瀏覽代碼

fix: 缺陷修复

cuiyalong 4 年之前
父節點
當前提交
7432eec072

+ 44 - 40
src/jfw/modules/app/src/web/templates/commonPay/checkout.html

@@ -309,46 +309,9 @@
                                     iconHide: true,
                                     duration: 1500,
                                     callback: function () {
-                                      // 三级页引流过来的埋点
-                                      if (checkout.getUrlParam('mid')) {
-                                        try {
-                                          $.ajax({
-                                            type: "POST",
-                                            url: "/publicapply/drainage/bmt/" + checkout.getUrlParam('mid'),
-                                            data: {
-                                              p: 'Paid'
-                                            },
-                                            success: function(r) {
-                                              console.log(r)
-                                            }
-                                          })
-                                        } catch (error) {
-                                          console.log(error)
-                                        }
-                                      }
-                                      // 采购单位画像引流过来的埋点
-                                      if (checkout.getUrlParam('bid')) {
-                                        try {
-                                          var params = {
-                                            mold: 'isPaid'
-                                          }
-                                          $.ajax({
-                                            type: 'POST',
-                                            url: '/publicapply/drainage/buyerunit',
-                                            contentType: "application/json",
-                                            data: JSON.stringify(params),
-                                            success: function (res) {
-                                              console.log(res)
-                                            },
-                                            error: function (error) {
-                                              console.log(error)
-                                            }
-                                          })
-                                        } catch (error) {
-                                          console.log(error)
-                                        }
-                                      }
-                                       var  bigmemberBid=checkout.getUrlParam("b");
+                                        // 埋点请求
+                                        _this.buryingPoint()
+                                        var  bigmemberBid = checkout.getUrlParam("b");
                                         var href="/jyapp/{{.T.doType}}/paySuccess?orderCode=" + res.orderCode + "&email=" + res.email + "&payTime=" + res.payTime + "&pay_way=" + res.pay_way + "&price=" + res.price + "&t={{.T.t}}"
                                         if (bigmemberBid==="1"){
                                            href = "/jyapp/aiForecastPack/paySuccess?orderCode=" + res.orderCode + "&email=" + res.email + "&payTime=" + res.payTime + "&pay_way=" + res.pay_way + "&price=" + res.price + "&t={{.T.t}}"
@@ -373,6 +336,47 @@
                 if (r != null)
                     return unescape(r[2]);
                 return null;
+            },
+            buryingPoint: function () {
+                // 三级页引流过来的埋点
+                if (checkout.getUrlParam('mid')) {
+                    try {
+                        $.ajax({
+                        type: "POST",
+                        url: "/publicapply/drainage/bmt/" + checkout.getUrlParam('mid'),
+                        data: {
+                            p: 'Paid'
+                        },
+                        success: function(r) {
+                            console.log(r)
+                        }
+                        })
+                    } catch (error) {
+                        console.log(error)
+                    }
+                }
+                // 采购单位画像引流过来的埋点
+                if (checkout.getUrlParam('bid')) {
+                    try {
+                        var params = {
+                            mold: 'isPaid'
+                        }
+                        $.ajax({
+                        type: 'POST',
+                        url: '/publicapply/drainage/buyerunit',
+                        contentType: "application/json",
+                        data: JSON.stringify(params),
+                        success: function (res) {
+                            console.log(res)
+                        },
+                        error: function (error) {
+                            console.log(error)
+                        }
+                        })
+                    } catch (error) {
+                        console.log(error)
+                    }
+                }
             }
         }
         checkout.init()

+ 3 - 3
src/jfw/modules/app/src/web/templates/dataPack/recharge.html

@@ -33,8 +33,8 @@
                   :key="index">
                   <div class="spec-i-label">${ item.label }</div>                    
                   <div class="spec-i-sub">
-                    <div class="spec-i-text del">${ item.price * charge.discount }元/条</div>
-                    <div class="spec-i-text">${ item.price }元/条</div>
+                    <div class="spec-i-text del">${ item.price }元/条</div>
+                    <div class="spec-i-text">${ item.price  * charge.discount }元/条</div>
                   </div>                    
                 </div>
               </div>
@@ -108,10 +108,10 @@
   <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
   <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
   <script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
+  {{include "/big-member/commonjs.html"}}
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/coupon/js/pay-order-template.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/data-pack/js/recharge.js?v={{Msg "seo" "version"}}'></script>
   <!--E-当前页面的资源-->
-  {{include "/big-member/commonjs.html"}}
   {{include "/common/baiducc.html"}}
 </body>
 

+ 6 - 2
src/web/staticres/common-module/coupon/js/pay-order-template.js

@@ -129,7 +129,7 @@ var couponTem = {
   },
   computed: {
     realPrice: function () {
-      if (this.config.type === 'dataExport') {
+      if (this.config.type === 'dataExport' || this.config.type === 'dataPack') {
         return this.config.disPrice - this.coupon.value
       } else {
         return this.config.initPrice - this.coupon.value
@@ -153,7 +153,8 @@ var couponTem = {
     selectCoupon: function () {
       var isWeiXinBrowser = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
       var pId = this.getProductId();
-      var price = this.config.type === 'dataExport' ? this.config.disPrice : this.config.initPrice;
+      var useDisPrice = this.config.type === 'dataExport' || this.config.type === 'dataPack'
+      var price = useDisPrice ? this.config.disPrice : this.config.initPrice;
       var checkedId = this.coupon.checkedId;
       if (isWeiXinBrowser) {
         location.href = '/weixin/frontPage/coupon/free/selectCoupon?pId=' + pId + '&price=' + price + '&checkedId=' + checkedId;
@@ -211,6 +212,9 @@ var couponTem = {
         case 'big':
           id = 104
           break;
+        case 'dataPack':
+          id = ''
+          break;
         case 'big-7day':
           id = 1001
           break;

+ 8 - 8
src/web/staticres/common-module/data-pack/js/recharge.js

@@ -1,8 +1,3 @@
-// 部分页面没有全局工具函数
-if (typeof utils !== 'object') {
-  utils = {}
-}
-utils.isWeiXinBrowser = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
 var vm = new Vue({
   delimiters: ['${', '}'],
   el: '#app',
@@ -14,7 +9,7 @@ var vm = new Vue({
         before: 0, // 优惠前价格
         after: 0 // 优惠后价格
       },
-      specActive: 0,
+      specActive: 1,
       charge: {
         discount: 1,
         count: 1000,
@@ -60,7 +55,7 @@ var vm = new Vue({
         question: false
       },
       bottomConf: {
-        type: 'dataExport',
+        type: 'dataPack',
         initPrice: 0,
         realPrice: 0,
         disPrice: 0,
@@ -94,7 +89,8 @@ var vm = new Vue({
     }
   },
   mounted: function () {
-    $('#previewButton').hide()
+    this.checkConfirmButtonDisabled()
+    utils.iosBackRefresh()
   },
   methods: {
     showLoading: function () {
@@ -226,6 +222,10 @@ var vm = new Vue({
       this.bottomConf.checkboxStatus = checkStatus
       return checkStatus
     },
+    // 保证mounted之后执行
+    checkConfirmButtonDisabled: function () {
+      this.$refs.couponRef.submitStatus = !this.bottomConf.checkboxStatus
+    },
     readEvent: function () {
       this.savePageState()
       if (utils.isWeiXinBrowser) {

+ 3 - 3
src/web/templates/weixin/dataPack/recharge.html

@@ -45,8 +45,8 @@
                   :key="index">
                   <div class="spec-i-label">${ item.label }</div>                    
                   <div class="spec-i-sub">
-                    <div class="spec-i-text del">${ item.price * charge.discount }元/条</div>
-                    <div class="spec-i-text">${ item.price }元/条</div>
+                    <div class="spec-i-text del">${ item.price }元/条</div>
+                    <div class="spec-i-text">${ item.price * charge.discount }元/条</div>
                   </div>                    
                 </div>
               </div>
@@ -122,7 +122,7 @@
   <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
   <script src=//cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js></script>
   <!--E-当前页面的资源-->
-  {{include "/big-member/commonjs.html"}}
+  <script src='{{Msg "seo" "cdn"}}/big-member/js/utils.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Msg "seo" "cdn"}}/common-module/coupon/js/pay-order-template.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Msg "seo" "cdn"}}/common-module/data-pack/js/recharge.js?v={{Msg "seo" "version"}}'></script>
   {{include "/common/baiducc.html"}}