Pārlūkot izejas kodu

Merge branch 'dev4.6.11' of http://192.168.3.207:8080/qmx/jy into dev4.6.11

zhangxinlei1996 3 gadi atpakaļ
vecāks
revīzija
ec7492f6b2

+ 14 - 0
src/web/staticres/frontRouter/pc/coupon/css/coupon-list.css

@@ -298,4 +298,18 @@
 }
 .coupon-item .coupon-yellow-color{
   color: #ff9f40;
+}
+.custom-toast .toast-container{
+  /* display: none; */
+  position: fixed;
+  top: 50%;
+  left: 50%;
+  width: auto;
+  padding: 16px 32px;
+  font-size: 16px;
+  background: rgba(0, 0, 0, 0.65);
+  border-radius: 8px;
+  color: #fff;
+  transform: translateX(-50%) translateY(-50%);
+  z-index: 99;
 }

+ 1 - 1
src/web/staticres/frontRouter/pc/coupon/js/coupon-item-template.js

@@ -63,7 +63,7 @@ var couponItemString = `
             <div class="product-list">
                 <div class="product-item" :class="productions.length - 1 == index ? 'last' : ''" v-for="(item,index) in productions" :key="index">
                     <span class="product-name ellipsis">{{ item.name }}</span>
-                    <a class="product-action" :href="item.url" target="_blank">去使用</a>
+                    <a class="product-action" @click="toUseFn(item.url)" href="javascript:;">去使用</a>
                 </div>
             </div>
         </el-popover>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
src/web/staticres/frontRouter/pc/coupon/js/coupon-item-template.min.js


+ 21 - 0
src/web/staticres/frontRouter/pc/coupon/js/coupon-list.js

@@ -114,6 +114,27 @@ Vue.component('coupon-item', {
                 trigger: 'hover'
             }
         }
+    },
+    methods: {
+      toUseFn: function (url) {
+        if (url) {
+          window.open(url)
+        } else {
+          this.toastFn('PC端暂无该产品,请前往移动端使用', 5000)
+        }
+      },
+      toastFn: function (text, duration) {
+        if (duration) {
+          duration = 3000
+        }
+        var _html = ""
+        _html+='<div class="custom-toast"><div class="mask" style="background-color: transparent;"></div><div class="toast-container">'
+        _html+='<span>' + text + '</span></div></div>'
+        $('body').append(_html)
+        setTimeout(function(){
+          $(".custom-toast").fadeOut().remove();
+        },duration)
+      }
     }
 })
 

+ 46 - 28
src/web/templates/pc/createOrderPage.html

@@ -1418,20 +1418,37 @@
                 return
             }
             canpay = false;
-            var param = {};
-            param.data_spec = pageDataMap.typeMap['个人支付'].type == 2 ? "senior" : "standard";
-            param.id ={{.T._id}}
+            var data_spec = pageDataMap.typeMap['个人支付'].type == 2 ? "senior" : "standard";
+            var _id = {{.T._id}}
+            var param = {
+              product: '历史数据',
+              productId: 1021,
+              data: {
+                id: _id,
+                data_spec: data_spec,
+                discountId: '',
+                order_phone: $(".phone_input").val().replace(/\s*/g, ""),
+                order_email: $(".email_input").val().replace(/\s*/g, "")
+              }
+            };
             // 优惠券
             var couponParam = getCouponParams.getValue()
             if (couponParam) {
-                param.lotteryId = couponParam.lotteryId
-                param.userLotteryId = couponParam.userLotteryId
+                param.data.lotteryId = couponParam.lotteryId
+                param.data.userLotteryId = couponParam.userLotteryId
             }
-
-            $.post("/jypay/dataExport/createOrder", param, function (data) {
-                var source = getParam("source");
-                if (data.status === "y") {
-                    if (source != null) {
+            console.log(param)
+          
+            $.ajax({
+              url: "/jypay/common/createorder",
+              dataType: "json",
+              contentType: "application/json;charset=utf-8",
+              data: JSON.stringify(param),
+              type: 'POST',
+              success: function (res) {
+                if (res.data && res.data.needPay) {
+                  var source = getParam("source");
+                  if (source != null) {
                         $.ajax({
                             type: 'GET',
                             url: '/front/order/source',
@@ -1439,30 +1456,31 @@
                                 source: source,
                                 type: "dataexport",
                                 terminal: "pc",
-                                ordercode: data.code
+                                ordercode: res.data.order_code
                             }
                         })
                     }
-                    sessionStorage.setItem("order_spec" +{{.T._id}}, pageDataMap.typeMap['个人支付'].type);
-                    sessionStorage.setItem("order_email" +{{.T._id}}, $(".email_input").val().replace(/\s*/g, ""));
-                    sessionStorage.setItem("order_phone" +{{.T._id}}, $(".phone_input").val().replace(/\s*/g, ""));
+                    sessionStorage.setItem("order_spec" + _id, pageDataMap.typeMap['个人支付'].type);
+                    sessionStorage.setItem("order_email" + _id, $(".email_input").val().replace(/\s*/g, ""));
+                    sessionStorage.setItem("order_phone" + _id, $(".phone_input").val().replace(/\s*/g, ""));
 
-                    history.replaceState({}, '', '/front/dataExport/toOrderDetail/' + data.code);
-                    window.location.href = "/front/dataexport/orderPay/" + data.code;
+                    history.replaceState({}, '', '/front/dataExport/toOrderDetail/' + res.data.order_code);
+                    window.location.href = "/front/dataexport/orderPay/" + res.data.order_code;
                 } else {
-                    canpay = true;
-                    $.confirm({
-                        title: '提示',
-                        content: '生成订单出错,请稍后尝试!',
-                        buttons: {
-                            ok: {
-                                text: '确认',
-                                btnClass: 'btn-primary-0',
-                            }
-                        }
-                    });
+                  canpay = true;
+                  $.confirm({
+                      title: '提示',
+                      content: res.error_msg || '生成订单出错,请稍后尝试!',
+                      buttons: {
+                          ok: {
+                              text: '确认',
+                              btnClass: 'btn-primary-0',
+                          }
+                      }
+                  });
                 }
-            }, "json");
+              }
+            })
         }
 
         //数据浏览

+ 19 - 14
src/web/templates/pc/dataPack/createOrderForDataPackage.html

@@ -378,33 +378,38 @@
             }
             canpay = false;
             var param = {
-                packId: (getNowSelect().level === 1 ? 'normal' : 'senior') + '_' +getNowSelect().total
-            };
-            param.id ={{.T._id}}
+                product: '数据流量包',
+                productId: pId,
+                data: {
+                  packId: (getNowSelect().level === 1 ? 'normal' : 'senior') + '_' +getNowSelect().total,
+                  id: {{.T._id}},
+                  order_phone: OrderPhoneCheck.phone
+                }
+            }
             // 优惠券
             var couponParam = getCouponParams.getValue()
             if (couponParam) {
-                param.lotteryId = couponParam.lotteryId
-                param.userLotteryId = couponParam.userLotteryId
+                param.data.lotteryId = couponParam.lotteryId
+                param.data.userLotteryId = couponParam.userLotteryId
             }
-
-            param.order_phone = OrderPhoneCheck.phone
-
+            // console.log(param)
             $.ajax({
-                url: "/subscribepay/dataExportPack/createOrder",
-                data: param,
+                url: "/jypay/common/createorder",
+                dataType: "json",
+                contentType: "application/json;charset=utf-8",
+                data: JSON.stringify(param),
                 type: 'POST',
                 success: function (res) {
-                    if (res.error_msg === "") {
-                        history.replaceState({}, '', '/front/dataPack/packDetail?order_code=' + res.data.orderCode);
+                    if (res.data && res.data.needPay) {
+                        history.replaceState({}, '', '/front/dataPack/packDetail?order_code=' + res.data.order_code);
                         var nowSelect = getNowSelect()
                         var allTotal = Number(nowSelect.total) + Number(nowSelect.level === 1 ? nowSelect.normal_num : nowSelect.senior_num)
-                        window.location.href = "/front/datapackage/orderPay/" + res.data.orderCode + "?total=" + allTotal;
+                        window.location.href = "/front/datapackage/orderPay/" + res.data.order_code + "?total=" + allTotal;
                     } else {
                         canpay = true;
                         $.confirm({
                             title: '提示',
-                            content: '生成订单出错,请稍后尝试!',
+                            content: res.error_msg || '生成订单出错',
                             buttons: {
                                 ok: {
                                     text: '确认',

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels