Explorar o código

优惠券领取

喻文俊 %!s(int64=3) %!d(string=hai) anos
pai
achega
45eb894132

+ 2 - 2
src/main/resources/static/js/pay/caimei-pay.js

@@ -168,7 +168,7 @@ var payContainer = new Vue({
                     payWay: 'UNIONPAY',
                     payAmount: _self.payInfo.payUnpaidAmount * 100,
                     bankCode: _self.payInfo.payBankNum,
-                    returnUrl: 'https://www.caimei365.com/',
+                    returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.payAmount,
                     orderId: _self.payInfo.payOrderId,
                     userType: _self.payInfo.payUserType
                 };
@@ -178,7 +178,7 @@ var payContainer = new Vue({
                 console.log('支付超级会员');
                 var params = {
                     bankCode: this.payInfo.payBankNum,
-                    returnUrl: 'https://www.caimei365.com/',
+                    returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.payAmount,
                     userId: GLOBAL_USER_ID,
                     userType: _self.payInfo.payUserType,
                     vipId: _self.vipId

+ 2 - 2
src/main/resources/static/js/pay/caimei-paycash.js

@@ -257,7 +257,7 @@ var payContainer = new Vue({
                             userType:_self.payInfo.payUserType,
                     };
                     _self.PayOrdersecondUnion(params);
-                } else if (_self.pageType === '2') { // 支付宝支付会员
+                } else if (_self.pageType === '2') { // 网银付会员
                     _self.payVipPcMallPay();
                 } else {
                     var params = {//正常订单
@@ -548,7 +548,7 @@ var payContainer = new Vue({
             var _self = this;
             var params = {
                 bankCode: this.payInfo.payBankNum,
-                returnUrl: 'https://www.caimei365.com/',
+                returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.payAmount,
                 userId: GLOBAL_USER_ID,
                 userType: _self.payInfo.payUserType,
                 vipId: _self.comboInfo.id

+ 32 - 0
src/main/resources/static/js/user-center/member/memberPage.js

@@ -189,6 +189,38 @@ var memberPage = new Vue({
                 return item;
             })
         },
+        // 点击去使用跳转路由处理
+        toUseCoupon:function(coupon){
+            if(coupon.useStatus === 1){
+                switch (coupon.couponType) {
+                    case 0:// 活动券跳转到商城首页 / 或者活动页(看是否指定了商品)
+                        if(coupon.productType === 1){
+                            window.location.href='/index.html';
+                        }else{
+                            window.location.href='/product/product-coupon.html?couponId='+coupon.couponId;
+                        }
+                        break;
+                    case 1:// 品类券:跳转到产品 / 仪器页
+                        if(coupon.categoryType === 1){
+                            window.location.href='/product/type-287.html';
+                        }else{
+                            window.location.href='/product/type-286.html';
+                        }
+                        break;
+                    case 2:// 专享券:跳转到商城首页
+                        window.location.href='/index.html';
+                        break;
+                    case 3:// 店铺券:跳转到店铺首页
+                        window.location.href='/supplier-'+coupon.shopId+'.html';
+                        debugger
+                        break;
+                    case 4:// 新用户券:跳转到商城首页
+                        window.location.href='/index.html';
+                        break;
+                }
+            }
+        },
+
         // 领取专属优惠券
         receiveCoupon: function(id){
             var _self = this;

+ 5 - 3
src/main/resources/templates/user-center/member/member.html

@@ -80,17 +80,19 @@
                 <div class="section">
                     <div class="section-title">专属特权<span>每月可领4个</span></div>
                     <div class="content coupon-list">
-                        <template v-for="(item, index) in couponList">
-                            <div :key="index" :class="{'un-received': !item.getFlag}">
+                        <template v-if="couponList.length > 0">
+                            <div v-for="(item, index) in couponList" :key="index" :class="{'un-received': !item.getFlag}">
                                 <span class="type" v-html="item.typeText"></span>
                                 <div class="amount"><i>¥</i>{{ item.couponAmount }}</div>
                                 <div class="condition">满{{ item.touchPrice }}可用</div>
                                 <div class="condition" v-html="item.productType === 1 ? '全商城商品通用' : '指定商品可用'"></div>
                                 <div class="receive-btn" v-if="!item.getFlag" @click="receiveCoupon(item.couponId)">立即领取</div>
-                                <div class="receive-btn" v-else>已领取</div>
+                                <div class="receive-btn" v-else @click="toUseCoupon(item)">去使用</div>
                             </div>
                         </template>
+                        <span v-else>暂无可领取优惠券~</span>
                     </div>
+
                 </div>
                 <!--优惠商品-->
                 <div class="section">