Przeglądaj źródła

Merge branch 'release' into dev4.6.3.2

luwenna 3 lat temu
rodzic
commit
1477d718e7

+ 29 - 12
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_introduce.html

@@ -29,6 +29,9 @@
             background: linear-gradient(173deg, #FFA573 0%, #F01212 100%);
             border-radius: 0.10rem;
         }
+        .pop-tip-group.active {
+            width: 2.4rem;
+        }
         .pop-tip-group.tip-box::after,
         .pop-tip-group.active::after {
             content: '';
@@ -52,7 +55,7 @@
             width: 0.72rem;
             height: 0.32rem;
             display: inline-block;
-            background: url('{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/public/image/icon-1212.png?v={{Msg "seo" "version"}}');
+            /*background: url('{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/public/image/icon-1212.png?v={{Msg "seo" "version"}}');*/
             background-size: cover;
             background-repeat: no-repeat;
         }
@@ -91,7 +94,7 @@
                 <div>每天一块钱,立刻拥有全网商机!</div>
         </div>
         <div class="pop-tip-group active" style="display: none">
-                <div>限时早鸟价,买1年送1年</div>
+                <div>买1年送1年</div>
         </div>
         <div class="pop-button" data-need-bind-phone data-url="/jyapp/vipsubscribe/vipsubscribe_new{{if .T.disWord}}?disWord={{.T.disWord}}{{end}}"  id="vip-introduce">
                 <img data-name="default" src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/image/info/btnBottom.png?v={{Msg "seo" "version"}}">
@@ -106,21 +109,35 @@
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/js/utils.js?v={{Msg "seo" "mod_version"}}'></script>
 <script>
     // 双12活动
+    var initPageTime = new Date().getTime()
+    function activeReloadPage (nowTime, endTime) {
+        if (initPageTime >= endTime) { return }
+        var reloadTime = endTime - nowTime
+        if (reloadTime <= (4 * 60 * 60 * 1000) ) {
+            setTimeout(function (){
+                location.reload()
+            }, reloadTime)
+        }
+    }
     $.ajax({
         url: '/doubletwelve/activing',
         dataType: 'json',
         success: function(res) {
             if (res && res.nowtime) {
-                if (res.nowtime <= res.endtime && res.nowtime >= res.starttime) {
-                    $(".pop-tip-group").hide()
-                    $(".pop-tip-group.active").show()
-                    $('.pop-button img[data-name]').hide()
-                    $('.pop-button img[data-name="active"]').show()
-                } else {
-                    if (res.nowtime <= res.endtime) {
-                        setTimeout(function (){
-                            location.reload()
-                        }, (res.endtime - res.nowtime) * 1000)
+
+                var canTimeEnd = res.nowtime <= res.endtime
+                var canTimeStart = res.nowtime >= res.starttime
+
+                if (canTimeEnd) {
+                    if (canTimeStart) {
+                        // 活动中
+                        $(".pop-tip-group").hide()
+                        $(".pop-tip-group.active").show()
+                        $('.pop-button img[data-name]').hide()
+                        $('.pop-button img[data-name="active"]').show()
+                        activeReloadPage(res.nowtime * 1000, res.endtime * 1000)
+                    } else {
+                        activeReloadPage(res.nowtime * 1000, res.starttime * 1000)
                     }
                 }
             }

+ 30 - 13
src/web/templates/pc/subscribe_new.html

@@ -413,6 +413,17 @@
         document.documentElement.scrollTop = 0;  //ie下
         document.body.scrollTop = 0;  //非ie
     }
+    // 双12活动
+    var initPageTime = new Date().getTime()
+    function activeReloadPage (nowTime, endTime) {
+        if (initPageTime >= endTime) { return }
+        var reloadTime = endTime - nowTime
+        if (reloadTime <= (4 * 60 * 60 * 1000) ) {
+            setTimeout(function (){
+                location.reload()
+            }, reloadTime)
+        }
+    }
     function toggleShowBuy (type) {
         if (type) {
             //已购买扫码使用
@@ -421,29 +432,35 @@
             $(".footer-banner").hide()
         } else {
             // 双12活动
+
             $.ajax({
                 url: '/doubletwelve/activing',
                 dataType: 'json',
                 success: function(res) {
                     if (res && res.nowtime) {
-                        if (res.nowtime <= res.endtime && res.nowtime >= res.starttime) {
-                            $('.double12').addClass('active')
-                            $('.footer-banner').addClass('active')
-                            $('.footer-banner img').attr('src', '{{Msg "seo" "cdn"}}/vipsubscribe/image/double_12.png?v={{Msg "seo" "version"}}').css({
-                                width: '1200px',
-                                'margin-top': '-30px'
-                            })
-                            $('.footer-banner area').attr('coords', '1058.5, 46.5, 1194.5, 87')
-                        } else {
-                            if (res.nowtime <= res.endtime) {
-                                setTimeout(function (){
-                                    location.reload()
-                                }, (res.endtime - res.nowtime) * 1000)
+
+                        var canTimeEnd = res.nowtime <= res.endtime
+                        var canTimeStart = res.nowtime >= res.starttime
+
+                        if (canTimeEnd) {
+                            if (canTimeStart) {
+                                // 活动中
+                                $('.double12').addClass('active')
+                                // $('.footer-banner').addClass('active')
+                                // $('.footer-banner img').attr('src', '{{Msg "seo" "cdn"}}/vipsubscribe/image/double_12.png?v={{Msg "seo" "version"}}').css({
+                                //     width: '1200px',
+                                //     'margin-top': '-30px'
+                                // })
+                                // $('.footer-banner area').attr('coords', '1058.5, 46.5, 1194.5, 87')
+                                activeReloadPage(res.nowtime * 1000, res.endtime * 1000)
+                            } else {
+                                activeReloadPage(res.nowtime * 1000, res.starttime * 1000)
                             }
                         }
                     }
                 }
             })
+
             //为购买点击跳转购买链接
             $("div*[data-go-buy-subscribe]").siblings().show()
             $("div*[data-go-buy-subscribe]").text('立即购买').on("click",function (){

+ 29 - 12
src/web/templates/weixin/vipsubscribe/vip_introduce.html

@@ -29,6 +29,9 @@
             background: linear-gradient(173deg, #FFA573 0%, #F01212 100%);
             border-radius: 0.10rem;
         }
+        .pop-tip-group.active {
+            width: 2.4rem;
+        }
         .pop-tip-group.tip-box::after,
         .pop-tip-group.active::after {
             content: '';
@@ -52,7 +55,7 @@
             width: 0.72rem;
             height: 0.32rem;
             display: inline-block;
-            background: url('{{Msg "seo" "cdn"}}/common-module/public/image/icon-1212.png?v={{Msg "seo" "version"}}');
+            /*background: url('{{Msg "seo" "cdn"}}/common-module/public/image/icon-1212.png?v={{Msg "seo" "version"}}');*/
             background-size: cover;
             background-repeat: no-repeat;
         }
@@ -87,7 +90,7 @@
                 <div>每天一块钱,立刻拥有全网商机!</div>
             </div>
             <div class="pop-tip-group active" style="display: none">
-                <div>限时早鸟价,买1年送1年</div>
+                <div>买1年送1年</div>
             </div>
             <div class="pop-button" data-need-bind-phone data-url="/front/vipsubscribe/vipsubscribe_new{{if .T.disWord}}?disWord={{.T.disWord}}{{end}}"   id="vip-introduce">
                 <img data-name="default" src="{{Msg "seo" "cdn"}}/common-module/vipsubscribe/image/info/btnBottom.png?v={{Msg "seo" "version"}}">
@@ -102,21 +105,35 @@
     <script src='{{Msg "seo" "cdn"}}/big-member/js/utils.js?v={{Msg "seo" "version"}}'></script>
     <script>
         // 双12活动
+        var initPageTime = new Date().getTime()
+        function activeReloadPage (nowTime, endTime) {
+            if (initPageTime >= endTime) { return }
+            var reloadTime = endTime - nowTime
+            if (reloadTime <= (4 * 60 * 60 * 1000) ) {
+                setTimeout(function (){
+                    location.reload()
+                }, reloadTime)
+            }
+        }
         $.ajax({
             url: '/doubletwelve/activing',
             dataType: 'json',
             success: function(res) {
                 if (res && res.nowtime) {
-                    if (res.nowtime <= res.endtime && res.nowtime >= res.starttime) {
-                        $(".pop-tip-group").hide()
-                        $(".pop-tip-group.active").show()
-                        $('.pop-button img[data-name]').hide()
-                        $('.pop-button img[data-name="active"]').show()
-                    } else {
-                        if (res.nowtime <= res.endtime) {
-                            setTimeout(function (){
-                                location.reload()
-                            }, (res.endtime - res.nowtime) * 1000)
+
+                    var canTimeEnd = res.nowtime <= res.endtime
+                    var canTimeStart = res.nowtime >= res.starttime
+
+                    if (canTimeEnd) {
+                        if (canTimeStart) {
+                            // 活动中
+                            $(".pop-tip-group").hide()
+                            $(".pop-tip-group.active").show()
+                            $('.pop-button img[data-name]').hide()
+                            $('.pop-button img[data-name="active"]').show()
+                            activeReloadPage(res.nowtime * 1000, res.endtime * 1000)
+                        } else {
+                            activeReloadPage(res.nowtime * 1000, res.starttime * 1000)
                         }
                     }
                 }