From c4cfb8888eaddb2d197c28402beffd2f5b2db08b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Mon, 12 Aug 2024 14:43:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=BA=E5=AD=90=E8=BF=85=E8=BF=9E=E5=81=9C?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Host/Views.Mobile/Product/Index.cshtml | 59 +++++++++++++- Host/Views.Mobile/Product/ReBuyIndex.cshtml | 61 ++++++++++++++- Host/Views.Mobile/User/MyAccounts.cshtml | 2 +- Host/Views/Product/Index.cshtml | 76 ++++++++++++++++++- Host/Views/Product/ReBuyIndex.cshtml | 62 ++++++++++++++- Host/Views/User/MyAccounts.cshtml | 4 +- .../Service/ProductOrderService.cs | 11 +++ 7 files changed, 265 insertions(+), 10 deletions(-) diff --git a/Host/Views.Mobile/Product/Index.cshtml b/Host/Views.Mobile/Product/Index.cshtml index 6683445..f7d55a3 100644 --- a/Host/Views.Mobile/Product/Index.cshtml +++ b/Host/Views.Mobile/Product/Index.cshtml @@ -745,6 +745,42 @@ +
+ @@ -1103,8 +1139,14 @@ localStorage.setItem('buyrecommend', new Date().getTime()); } } + function buyrecommendfunc_2() { + var isChecked = $('#recommendchechk_2').is(':checked'); + if (isChecked) { + localStorage.setItem('buyrecommend_2', new Date().getTime()); + } + } function onrecommend(id) { - if (id != 29 && id != 28 && id != 25 && id != 22 && id != 21 && id != 20 && id != 18 ) { + if (id != 29 && id != 28 && id != 22 && id != 21 && id != 20 && id != 18 && id != 1 ) { var lastClosedTime = localStorage.getItem('buyrecommend'); if (!lastClosedTime) { // 如果之前没有关闭时间记录,则显示提示框 @@ -1119,6 +1161,21 @@ } } } + if (id == 1) { + var lastClosedTime = localStorage.getItem('buyrecommend_2'); + if (!lastClosedTime) { + // 如果之前没有关闭时间记录,则显示提示框 + $('#product_recommend_2').modal('show') + } else { + // 如果有关闭时间记录,则检查是否超过7天 + var sevenDaysInMillis = 7 * 24 * 60 * 60 * 1000; // 7天的毫秒数 + var currentTime = new Date().getTime(); + if (currentTime - lastClosedTime > sevenDaysInMillis) { + // 超过7天,显示提示框 + $('#product_recommend_2').modal('show') + } + } + } } $(function(){ setTimeout(function(){ diff --git a/Host/Views.Mobile/Product/ReBuyIndex.cshtml b/Host/Views.Mobile/Product/ReBuyIndex.cshtml index 53c7a75..e72752d 100644 --- a/Host/Views.Mobile/Product/ReBuyIndex.cshtml +++ b/Host/Views.Mobile/Product/ReBuyIndex.cshtml @@ -157,6 +157,42 @@ + +