Ver código fonte

代码优化

喻文俊 3 anos atrás
pai
commit
fea9929758

+ 9 - 10
src/main/resources/static/js/user-center/member/memberPage.js

@@ -105,7 +105,6 @@ var memberPage = new Vue({
                     _self.vipInfo = res.data.vip;
                     window.localStorage.setItem('vipInfo', JSON.stringify(_self.vipInfo));
                     _self.couponList = _self.initCouponInfo(res.data.coupon.splice(0, 4));
-                    console.log(_self.couponList);
                 } else {
                     CAIMEI.Alert(response.msg, '确定', false);
                     _self.isRequset = false;
@@ -174,7 +173,6 @@ var memberPage = new Vue({
         fetchSuperPackage: function () {
             var _self = this;
             UserApi.FetchSuperPackage({}, function (response) {
-                console.log(response);
                 if (response.code === 0) {
                     _self.comboInfo = response.data;
                 }
@@ -196,33 +194,34 @@ var memberPage = new Vue({
         },
         // 点击去使用跳转路由处理
         toUseCoupon: function (coupon) {
-            console.log(coupon);
+            var resultUrl = '';
             switch (coupon.couponType) {
                 case 0:// 活动券跳转到商城首页 / 或者活动页(看是否指定了商品)
                     if (coupon.productType === 1) {
-                        window.location.href = '/index.html';
+                        resultUrl = '/index.html';
                     } else {
-                        window.location.href = '/product/product-coupon.html?couponId=' + coupon.couponId;
+                        resultUrl = '/product/product-coupon.html?couponId=' + coupon.couponId;
                     }
                     break;
                 case 1:// 品类券:跳转到产品 / 仪器页
                     if (coupon.categoryType === 1) {
-                        window.location.href = '/product/type-287.html';
+                        resultUrl = '/product/type-287.html';
                     } else {
-                        window.location.href = '/product/type-286.html';
+                        resultUrl = '/product/type-286.html';
                     }
                     break;
                 case 2:// 专享券:跳转到商城首页
-                    window.location.href = '/index.html';
+                    resultUrl = '/index.html';
                     break;
                 case 3:// 店铺券:跳转到店铺首页
-                    window.location.href = '/supplier-' + coupon.shopId + '.html';
+                    resultUrl = '/supplier-' + coupon.shopId + '.html';
                 debugger
                     break;
                 case 4:// 新用户券:跳转到商城首页
-                    window.location.href = '/index.html';
+                    resultUrl = '/index.html';
                     break;
             }
+            window.open(resultUrl, '_blank');
         },
 
         // 领取专属优惠券