Browse Source

美博会活动优惠券

zhengjinyi 3 years ago
parent
commit
c5e42349e7

+ 2 - 2
src/main/resources/config/dev/application-dev.yml

@@ -54,8 +54,8 @@ logging:
 caimei:
   siteEnv: 0 #网站环境,(2:正式环境,1:测试环境,0:开发环境)
   #spiServer: http://192.168.2.68:8008
-  coreServer: https://core-b.caimei365.com
-#  coreServer: http://192.168.2.67:18002
+#  coreServer: https://core-b.caimei365.com
+  coreServer: http://192.168.2.67:18002
   #coreServer: http://192.168.2.75:18002
   imageDomain: https://img-b.caimei365.com
   wwwDomain: http:localhost:8009

+ 24 - 0
src/main/resources/static/js/common/serviceapi/pay.service.js

@@ -189,6 +189,30 @@ var PayApi = {
                 callback(res);
             });
         },
+        PayCouponMiniWxPay: function(params, callback){ // 微信购买优惠券
+            Http.AjaxService({
+                url:'/order/pay/coupon/wechat',
+                type:'POST',
+                data:params,
+                json:false,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res);
+            });
+        },
+        PayCouponMiniAliPay: function(params, callback){ // 支付宝购买优惠券
+            Http.AjaxService({
+                url:'/order/pay/coupon/alipay',
+                type:'POST',
+                data:params,
+                json:false,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res);
+            });
+        },
         PayGetBankCode: function(params, callback){ // 网银银行列表
             Http.AjaxService({
                 url:'/order/pay/bankcode',

+ 16 - 0
src/main/resources/static/js/common/serviceapi/product.service.js

@@ -345,6 +345,22 @@ var ProductApi = {
                 callback(res);
             });
         },
+        /**
+         * @优惠券-根据优惠券查询优惠券详细信息
+         * @param:couponId 优惠券Id
+         */
+        QueryCouponDetail:function (params, callback) {
+            Http.AjaxService({
+                url:'/commodity/coupon/coupon/detail',
+                type:'get',
+                data:params,
+                json:true,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res);
+            });
+        },
         /**
          * @商品收藏-操作商品收藏
          * @param:userId 用户userId

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

@@ -15,11 +15,7 @@ var payContainer = new Vue({
             payUserType:'ENTERPRISE',
             payType:'',
         },
-        couponInfo:{
-            price:10000,
-            touchPrice:20000,
-            couponAmount:10000
-        },
+        couponInfo:{},
         bankListData:[],
         methodTab:['线上支付','转账支付'],
         mobileData:[
@@ -57,7 +53,8 @@ var payContainer = new Vue({
         is_Wechat_bowcr:false,
         comboInfo: null, //选中的svip套餐信息
         vipRecordId: undefined,
-        couponId:undefined
+        couponId:undefined,
+        userId:0
     },
     filters: {
         NumFormat:function(value) {
@@ -79,6 +76,19 @@ var payContainer = new Vue({
         }
     },
     methods: {
+        initCouponDetail:function (couponId) {//初始化优惠券数据
+            var _self = this;
+            ProductApi.QueryCouponDetail({ couponId: couponId },function (response) {
+                if(response.code == 0){
+                    _self.couponInfo = response.data
+                    if(globalUserData){
+                        _self.userId = globalUserData.userId;
+                    }
+                }else{
+                    CAIMEI.Alert(response.msg, '确定', false);
+                }
+            })
+        },
         infoPayOrderCheckoutCounter:function(){//初始化订单数据
             var _self = this;
             PayApi.PayOrderCheckoutCounter({orderId:_self.payInfo.payOrderId},function(response){
@@ -145,116 +155,120 @@ var payContainer = new Vue({
                 CAIMEI.dialog('支付系统遇到点小问题,请稍后重试', false);
                 return;
             }
-            if(_self.onlinePay == 2){
-                _self.layerConfirm();
+            if(_self.pageType === '3'){// 移动支付优惠券
+                _self.PayCouponMiniPayFn();
             }else{
-                if(_self.payInfo.payBankNum == ''){
-                    CAIMEI.dialog('请选择支付方式');
-                    return;
-                }
-                if(_self.payAmount == ''){
-                    CAIMEI.dialog('请输入本次支付金额');
-                    return;
-                }
-                if(_self.payAmount == 0){
-                    CAIMEI.dialog('本次支付金额不能为0');
-                    return;
-                }
-                if(_self.payAmount*100 < 2){
-                    CAIMEI.dialog('本次支付金额必须大于¥0.02');
-                    return;
-                }
-                if(_self.payAmount > _self.paymentIimit){
-                    switch (_self.payInfo.payBankNum) {
-                        case 'WEIXIN':
-                            _self.paymentIimitText = '本次支付金额已超出微信支付限额,请输入小于5千的金额进行支付';
-                            break;
-                        case 'ALIPAY':
-                            _self.paymentIimitText = '本次支付金额已超出支付宝限额,请输入小于5千的金额进行支付';
-                            break;
+                if(_self.onlinePay == 2){
+                    _self.layerConfirm();
+                }else{
+                    if(_self.payInfo.payBankNum == ''){
+                        CAIMEI.dialog('请选择支付方式');
+                        return;
                     }
-                    CAIMEI.Alert(_self.paymentIimitText,'知道了');
-                    return;
-                }
-                if(_self.payInfo.payBankNum == "WEIXIN"){
-                    if(_self.pageType === '1'){
-                        if(!isPC){
-                            var orderInfo = {//二手微信二维码参数
+                    if(_self.payAmount == ''){
+                        CAIMEI.dialog('请输入本次支付金额');
+                        return;
+                    }
+                    if(_self.payAmount == 0){
+                        CAIMEI.dialog('本次支付金额不能为0');
+                        return;
+                    }
+                    if(_self.payAmount*100 < 2){
+                        CAIMEI.dialog('本次支付金额必须大于¥0.02');
+                        return;
+                    }
+                    if(_self.payAmount > _self.paymentIimit){
+                        switch (_self.payInfo.payBankNum) {
+                            case 'WEIXIN':
+                                _self.paymentIimitText = '本次支付金额已超出微信支付限额,请输入小于5千的金额进行支付';
+                                break;
+                            case 'ALIPAY':
+                                _self.paymentIimitText = '本次支付金额已超出支付宝限额,请输入小于5千的金额进行支付';
+                                break;
+                        }
+                        CAIMEI.Alert(_self.paymentIimitText,'知道了');
+                        return;
+                    }
+                    if(_self.payInfo.payBankNum == "WEIXIN"){
+                        if(_self.pageType === '1'){
+                            if(!isPC){
+                                var orderInfo = {//二手微信二维码参数
                                     pageType:1,
                                     productId:_self.productID,
                                     payAmount:_self.payAmount
-                            };
-                            _self.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state="+JSON.stringify(orderInfo)+"#wechat_redirect";
-                            location.href = _self.payInfo.payMobileUrl;
+                                };
+                                _self.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state="+JSON.stringify(orderInfo)+"#wechat_redirect";
+                                location.href = _self.payInfo.payMobileUrl;
+                            }else{
+                                _self.payInfo.payData = {//二手
+                                    type:_self.payInfo.payBankNum,
+                                    productId:_self.productID,
+                                    amount:_self.payAmount,
+                                    url:_self.payInfo.payMobileUrl
+                                };
+                                CAIMEI.Storage.setItem('payData',JSON.stringify(_self.payInfo.payData));
+                                window.open("/pay/caimei-paymobile.html?pageType=1");
+                                _self.isPayAlert = true;
+                            }
+                        }else if(_self.pageType === '2'){ // 微信支付会员
+                            _self.payVipMiniWxPay();
                         }else{
-                            _self.payInfo.payData = {//二手
-                                type:_self.payInfo.payBankNum,
-                                productId:_self.productID,
-                                amount:_self.payAmount,
-                                url:_self.payInfo.payMobileUrl
-                            };
-                            CAIMEI.Storage.setItem('payData',JSON.stringify(_self.payInfo.payData));
-                            window.open("/pay/caimei-paymobile.html?pageType=1");
-                            _self.isPayAlert = true;
-                        }
-                    }else if(_self.pageType === '2'){ // 微信支付会员
-                        _self.payVipMiniWxPay();
-                    }else{
-                        if(!isPC){
-                            var orderInfo = {//普通订单微信二维码参数
+                            if(!isPC){
+                                var orderInfo = {//普通订单微信二维码参数
                                     pageType:0,
                                     orderID:_self.payInfo.payOrderId,
                                     payAmount:_self.payAmount
+                                };
+                                _self.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state="+JSON.stringify(orderInfo)+"#wechat_redirect";
+                                location.href = _self.payInfo.payMobileUrl;
+                            }else{
+                                _self.payInfo.payData = {//正常订单
+                                    type:_self.payInfo.payBankNum,
+                                    orderid:_self.payInfo.payOrderId,
+                                    amount:_self.payAmount,
+                                    url:_self.payInfo.payMobileUrl
+                                };
+                                CAIMEI.Storage.setItem('payData',JSON.stringify(_self.payInfo.payData));
+                                window.open("/pay/caimei-paymobile.html?pageType=0");
+                                _self.isPayAlert = true;
+                            }
+                        }
+                    }else if(_self.payInfo.payBankNum == "ALIPAY"){//支付宝支付
+                        if(_self.pageType === '1'){// 二手
+                            var params = {//二手
+                                returnUrl:'https://www.caimei365.com/',
+                                productId:_self.productID,
                             };
-                            _self.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state="+JSON.stringify(orderInfo)+"#wechat_redirect";
-                            location.href = _self.payInfo.payMobileUrl;
+                            _self.PayOrdersecondAliPay(params);
+                        }else if(_self.pageType === '2'){ // 支付宝支付会员
+                            _self.payVipAliPay();
                         }else{
-                            _self.payInfo.payData = {//正常订单
-                                type:_self.payInfo.payBankNum,
-                                orderid:_self.payInfo.payOrderId,
-                                amount:_self.payAmount,
-                                url:_self.payInfo.payMobileUrl
+                            var params = {//正常订单
+                                payAmount:Math.round(_self.payAmount*100),
+                                returnUrl:'https://www.caimei365.com/',
+                                orderId:_self.payInfo.payOrderId
                             };
-                            CAIMEI.Storage.setItem('payData',JSON.stringify(_self.payInfo.payData));
-                            window.open("/pay/caimei-paymobile.html?pageType=0");
-                            _self.isPayAlert = true;
+                            _self.PayOrderPcMallAlipay(params);
                         }
-                    }
-                }else if(_self.payInfo.payBankNum == "ALIPAY"){//支付宝支付
-                    if(_self.pageType === '1'){// 二手
-                        var params = {//二手
+                    }else{// 网银支付
+                        if(_self.pageType === '1'){
+                            var params = {//二手
+                                payWay:_self.payInfo.payBankNum,
                                 returnUrl:'https://www.caimei365.com/',
                                 productId:_self.productID,
                             };
-                        _self.PayOrdersecondAliPay(params);
-                    }else if(_self.pageType === '2'){ // 支付宝支付会员
-                        _self.payVipAliPay();
-                    }else{
-                        var params = {//正常订单
+                            _self.PayOrdersecondUnion(params,_self.payInfo.payBankNum);
+                        }else if(_self.pageType === '2'){ // 网银支付会员
+                            console.log('网银支付会员');
+                        }else{
+                            var params = {//正常订单
+                                payWay:_self.payInfo.payBankNum,
                                 payAmount:Math.round(_self.payAmount*100),
                                 returnUrl:'https://www.caimei365.com/',
                                 orderId:_self.payInfo.payOrderId
                             };
-                        _self.PayOrderPcMallAlipay(params);
-                    }
-                }else{// 网银支付
-                    if(_self.pageType === '1'){
-                        var params = {//二手
-                            payWay:_self.payInfo.payBankNum,
-                            returnUrl:'https://www.caimei365.com/',
-                            productId:_self.productID,
-                        };
-                        _self.PayOrdersecondUnion(params,_self.payInfo.payBankNum);
-                    }else if(_self.pageType === '2'){ // 网银支付会员
-                        console.log('网银支付会员');
-                    }else{
-                        var params = {//正常订单
-                            payWay:_self.payInfo.payBankNum,
-                            payAmount:Math.round(_self.payAmount*100),
-                            returnUrl:'https://www.caimei365.com/',
-                            orderId:_self.payInfo.payOrderId
-                        };
-                        _self.PayOrderPcMallPay(params,_self.payInfo.payBankNum);
+                            _self.PayOrderPcMallPay(params,_self.payInfo.payBankNum);
+                        }
                     }
                 }
             }
@@ -634,7 +648,7 @@ var payContainer = new Vue({
         payVipMiniWxPay: function(){
             if (!isPC) {
                 var orderInfo = {//普通订单微信二维码参数
-                    pageType: 2,
+                    couponId: 2,
                     vipId: this.comboInfo.id,
                     vipRecordId: this.vipRecordId,
                     payAmount: this.payAmount
@@ -654,6 +668,75 @@ var payContainer = new Vue({
                 this.isPayAlert = true;
             }
         },
+        // 移动支付购买优惠券
+        PayCouponMiniPayFn:function () {
+            var _self = this;
+            if(_self.payInfo.payBankNum == "WEIXIN"){
+                _self.payCouponMiniWxPay();
+            }else if(_self.payInfo.payBankNum == "ALIPAY"){//支付宝支付
+                _self.payCouponAliPay();
+            }
+        },
+        // 微信支付优惠券
+        payCouponMiniWxPay: function(){
+            console.log('微信支付优惠券');
+            if (!isPC) {
+                var orderInfo = {//普通订单微信二维码参数
+                    pageType: 3,
+                    vipId: this.comboInfo.id,
+                    vipRecordId: this.vipRecordId,
+                    payAmount: this.payAmount
+                };
+                this.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state=" + JSON.stringify(orderInfo) + "#wechat_redirect";
+                location.href = this.payInfo.payMobileUrl;
+            } else {
+                this.payInfo.payData = {
+                    type: this.payInfo.payBankNum,
+                    amount: this.couponInfo.moneyCouponPrice,
+                    url: this.payInfo.payMobileUrl,
+                    couponId:this.couponId,
+                    userId:this.userId
+                };
+                CAIMEI.Storage.setItem('payData', JSON.stringify(this.payInfo.payData));
+                window.open("/pay/caimei-paymobile.html?pageType=3");
+                this.isPayAlert = true;
+            }
+        },
+        // 支付宝支付优惠券
+        payCouponAliPay: function(){
+            console.log('支付宝支付优惠券');
+            var params = {
+                returnUrl: 'https://www.caimei365.com/',
+                couponId: _self.couponInfo.couponId,
+                userId:_self.userId
+            };
+            PayApi.PayCouponMiniAliPay(params, function(response){
+                console.log(response);
+                if (response.code === 0) {
+                    _self.isPayAlert = true;
+                    _self.mbOrderId = response.data.data.mbOrderId;
+                    _self.payInfo.payMobileUrl = response.data.data.payUrl;
+                    _self.payInfo.payData = {
+                        type: _self.payInfo.payBankNum,
+                        mbOrderId: _self.mbOrderId,
+                        amount: _self.couponInfo.moneyCouponPrice,
+                        url: _self.payInfo.payMobileUrl,
+                        couponId:_self.couponId,
+                        userId:_self.userId
+                    };
+                    CAIMEI.Storage.setItem('payData', JSON.stringify(_self.payInfo.payData));
+                    if (!isPC) {
+                        location.href = _self.payInfo.payMobileUrl;
+                    } else {
+                        console.log('支付宝支付优惠券跳转')
+                        window.open("/pay/caimei-paymobile.html?pageType=3");
+                    }
+                } else {
+                    CAIMEI.Alert(response.msg, '确定', false);
+                    _self.isSubMitStatus = false;
+                }
+            });
+        },
     },
     mounted: function () {
         var _self = this;
@@ -676,6 +759,7 @@ var payContainer = new Vue({
             this.getBankList();
         } else if(this.pageType === '3') {// 支付优惠券
             this.couponId = parseInt(CAIMEI.getUrlParam('couponId'));
+            this.initCouponDetail(this.couponId);
             this.PayOrderOnLineSwitch();
             this.getBankList();
         }else{

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

@@ -29,7 +29,9 @@ var payContainer = new Vue({
         productID:'',//商品ID
         duration: 0, // 购买的会员期限
         vipId: null, // vip套餐id
-        vipRecordId: undefined
+        vipRecordId: undefined,
+        couponId:0,
+        userId:0
     },
     filters: {
         NumFormat:function(value) {
@@ -53,7 +55,7 @@ var payContainer = new Vue({
     methods: {
         infoPayOrderCheckoutCounter:function(){//初始化订单数据
             var _self = this;
-            if( _self.pageType === '1' || _self.pageType === '2'){
+            if( _self.pageType === '1' || _self.pageType === '2' || _self.pageType === '3'){
                 setTimeout(function(){
                     switch (_self.payInfo.payType) {
                         case 'WEIXIN':
@@ -126,6 +128,14 @@ var payContainer = new Vue({
                     vipId: _self.vipId,
                     vipRecordId: _self.vipRecordId
                 };
+            } else if (_self.pageType === '3') { // 微信支付优惠券
+                console.log('微信支付优惠券');
+                orderInfo = {
+                    pageType: 3,
+                    payAmount: _self.payAmount,
+                    couponId: _self.couponId,
+                    userId : _self.userId
+                };
             } else {
                 orderInfo = {//普通订单微信二维码参数
                     pageType:0,
@@ -221,6 +231,12 @@ var payContainer = new Vue({
             if(!_self.duration) { // 微信支付获取会员开通月份
                 _self.duration = payData.duration;
             }
+        }else if(_self.pageType === '3'){
+            _self.payInfo.payType = payData.type;
+            _self.payAmount = _self.payableAmount = payData.amount;
+            _self.payInfo.payMobileUrl = payData.url;
+            _self.couponId = payData.couponId;
+            _self.userId = payData.userId;
         }else{
             console.log('订单支付');
             _self.payInfo.payType = payData.type;

+ 39 - 1
src/main/resources/static/js/pay/caimei-wechatpay.js

@@ -12,7 +12,9 @@ var payContainer = new Vue({
         isRequest:false,
         productId:'',//二手商品ID
         vipId: null, // vip套餐id
-        vipRecordId: undefined
+        vipRecordId: undefined,
+        couponId: undefined,//优惠券Id
+        userId : undefined //购买优惠券的用户Id
     },
     computed: {
 
@@ -30,6 +32,9 @@ var payContainer = new Vue({
             }else if(_this.pageType == 2){
                 _this.vipId = _this.state.vipId;
                 _this.vipRecordId = _this.state.vipRecordId;
+            }else if(_this.pageType == 3){
+                _this.couponId = _this.state.couponId;
+                _this.userId = _this.state.userId;
             }else{
                 _this.orderID = _this.state.orderID;
             }
@@ -39,6 +44,8 @@ var payContainer = new Vue({
                 this.WxRequestsecondHandPay();
             } else if (this.pageType == 2) {
                 this.WxRequestPaymentVipFn();
+            } if (this.pageType == 2) {
+                this.WxRequestPaymentCouponFn();
             } else {
                 this.WxRequestPaymentFn();
             }
@@ -74,6 +81,37 @@ var payContainer = new Vue({
                 }
             });
         },
+        // 优惠券支付
+        WxRequestPaymentCouponFn: function(){
+            var _this = this;
+            var params = {
+                code: _this.wechatcode,
+                state: _this.rand(1000, 9999),
+                userId: _this.userId,
+                couponId: _this.couponId,
+                returnUrl: 'https://www.caimei365.com/',
+            };
+            PayApi.PayCouponMiniWxPay(params,function(response){
+                if(response.code == 0){
+                    var PayInfo = JSON.parse(response.data.data.payInfo);
+                    if (typeof WeixinJSBridge == "undefined"){
+                        if( document.addEventListener ){
+                            document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
+                        }else if (document.attachEvent){
+                            document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
+                            document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
+                        }
+                    }else{
+                        _this.onBridgeReady(PayInfo);
+                    }
+                }else{
+                    CAIMEI.dialog("支付链接已失效,请重新扫码支付");
+                    setTimeout(function(){
+                        WeixinJSBridge.call('closeWindow');
+                    },3000);
+                }
+            });
+        },
         WxRequestsecondHandPay:function(){ // 二手商品支付
             var _this = this;
             var params = {

+ 3 - 0
src/main/resources/static/js/product/detail.js

@@ -680,6 +680,9 @@ var productDetail = new Vue({
             CAIMEI.Storage.setItem('KEY_SUPPORE', JSON.stringify(checkedList));
             window.location.href = '/shopping/confirm.html?type=3';
         },
+        toBuyCoupon:function (coupon) {// 点击购买按钮事件处理
+            window.location.href = '/pay/caimei-paycash.html?pageType=3&couponId='+coupon.couponId;
+        },
         showSupportingMore:function () {
             var _self = this;
             _self.isShowMoreButton = false;

+ 3 - 0
src/main/resources/static/js/shopping/cart.js

@@ -532,6 +532,9 @@ var shoppingCart = new Vue({
                 }
             })
         },
+        toBuyCoupon:function (coupon) {// 点击购买按钮事件处理
+            window.location.href = '/pay/caimei-paycash.html?pageType=3&couponId='+coupon.couponId;
+        },
         queryCouponTabs:function (value){
             var _self = this;
             _self.currentTab = _self.couponParam.status = value;

+ 3 - 2
src/main/resources/templates/pay/caimei-paycash.html

@@ -48,8 +48,8 @@
             <template v-else-if="pageType === '3'">
                 <div class="pay-coupontitle">收银台</div>
                 <div class="pay-coupon">
-                    <div class="pay-coupon-title">购买优惠券 <span>(满¥100000减10000)</span></div>
-                    <div class="pay-coupon-content">待付金额:<span>¥{{ couponInfo.price | NumFormat }}</span></div>
+                    <div class="pay-coupon-title">购买优惠券 <span>(满¥{{ couponInfo.touchPrice }}减{{ couponInfo.couponAmount }})</span></div>
+                    <div class="pay-coupon-content">待付金额:<span>¥{{ couponInfo.moneyCouponPrice | NumFormat }}</span></div>
                 </div>
             </template>
             <!--普通订单-->
@@ -183,6 +183,7 @@
 <!-- 引入底部 -->
 <template th:replace="components/footer"></template>
 <template th:replace="components/foot-link"></template>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/product.service.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/pay.service.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/pay/caimei-bank.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/pay/caimei-paycash.js(v=${version})}"></script>

+ 2 - 2
src/main/resources/templates/pay/caimei-paymobile.html

@@ -27,7 +27,7 @@
                         <p v-if="pageType == '2'">超级会员套餐:{{ duration }}个月 </p>
                         <p>交易金额: <span>¥{{payAmount | NumFormat}}</span> </p>
                         <p>收款方: <span>深圳市采美信息技术有限公司</span> </p>
-                        <p v-if="pageType!='1' && pageType!='2'">订单号: <span>{{orderNo}}</span> </p>
+                        <p v-if="pageType!='1' && pageType!='2' && pageType!='3'">订单号: <span>{{orderNo}}</span> </p>
                     </div>
                     <div class="pay-amount-icon"><img src="/img/pay/icon-pay@2x.png" alt=""></div>
                 </div>
@@ -55,7 +55,7 @@
                         <p v-if="pageType == '2'">超级会员套餐:{{ duration }}个月 </p>
                         <p>交易金额: <span>¥{{payAmount | NumFormat}}</span> </p>
                         <p>收款方: <span>深圳市采美信息技术有限公司</span> </p>
-                        <p v-if="pageType!='1' && pageType!='2'">订单号: <span>{{orderNo}}</span> </p>
+                        <p v-if="pageType!='1' && pageType!='2' && pageType!='3'">订单号: <span>{{orderNo}}</span> </p>
                     </div>
                     <div class="pay-amount-icon"><img src="/img/pay/icon-pay@2x.png" alt=""></div>
                 </div>

+ 22 - 7
src/main/resources/templates/product/detail.html

@@ -659,14 +659,29 @@
                                     <div class="coupon-list-time"> {{ coupon.startDate }} - {{ coupon.endDate }}</div>
                                 </div>
                                 <div class="coupon-list-ri">
-                                    <div class="buy" v-if="coupon.couponBtnType == 2" @click="toBuyCoupon(coupon)">
-                                        <p>¥10000</p>
-                                        <p>购买</p>
-                                    </div>
-                                    <span class="none" v-if="coupon.couponBtnType == 0" @click="receiveCoupon(coupon)">领取</span>
-                                    <span v-if="coupon.couponBtnType == 1">已领取</span>
+                                    <template v-if="coupon.moneyCouponFlag == 1">
+                                        <div class="buy" v-if="coupon.couponBtnType == 2" @click="toBuyCoupon(coupon)"
+                                             id="coupon-buy-coupon"
+                                             onclick="_czc.push(['_trackEvent','商品详情','优惠券购买按钮点击','优惠券购买按钮点击',1,'coupon-buy-coupon'])">
+                                            <p>¥{{ coupon.moneyCouponPrice }}</p>
+                                            <p>购买</p>
+                                        </div>
+                                    </template>
+                                    <template v-else>
+                                        <span class="none" v-if="coupon.couponBtnType == 0"
+                                              @click="receiveCoupon(coupon)"
+                                              id="coupon-receive"
+                                              onclick="_czc.push(['_trackEvent','商品详情','优惠券领取按钮点击','优惠券领取按钮点击',1,'coupon-receive'])">领取</span>
+                                        <span v-if="coupon.couponBtnType == 1">已领取</span>
+                                    </template>
                                 </div>
-                                <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>
+                                <template v-if="coupon.moneyCouponFlag == 1">
+                                    <div class="coupon-tags" v-if="coupon.moneyCouponType == 1">意向{{ coupon.couponType | TypeFormat }}</div>
+                                    <div class="coupon-tags"  v-else>定向{{ coupon.couponType | TypeFormat }}</div>
+                                </template>
+                                <template v-else>
+                                    <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>
+                                </template>
                             </div>
                         </div>
                     </div>

+ 24 - 8
src/main/resources/templates/shopping/cart.html

@@ -78,7 +78,10 @@
                                 </div>
                             </div>
                         </div>
-                        <div class="couponTag" v-if="supplier.couponsLogo" @click="showPopup(supplier)">领券</div>
+                        <div class="couponTag" v-if="supplier.couponsLogo" @click="showPopup(supplier)"
+                             id="coupon-receive-button"
+                             onclick="_czc.push(['_trackEvent','机构购物车','优惠券领券按钮点击','优惠券领券按钮点击',1,'coupon-receive-button'])">领券
+                        </div>
                     </div>
                 </div>
                 <div class="cartItem clear"  v-for="cart in supplier.cartList" >
@@ -256,14 +259,27 @@
                                 <div class="coupon-list-time"> {{ coupon.startDate }} - {{ coupon.endDate }} </div>
                             </div>
                             <div class="coupon-list-ri">
-                                <div class="buy" v-if="coupon.couponBtnType == 2" @click="toBuyCoupon(coupon)">
-                                    <p>¥10000</p>
-                                    <p>购买</p>
-                                </div>
-                                <span class="none" v-if="coupon.couponBtnType == 0" @click="receiveCoupon(coupon)">领取</span>
-                                <span v-if="coupon.couponBtnType == 1">已领取</span>
+                                <template v-if="coupon.moneyCouponFlag == 1">
+                                    <div class="buy" @click="toBuyCoupon(coupon)" id="coupon-buy-coupon"
+                                         onclick="_czc.push(['_trackEvent','机构购物车','优惠券购买按钮点击','优惠券购买按钮点击',1,'coupon-buy-coupon'])">
+                                        <p>¥{{ coupon.moneyCouponPrice }}</p>
+                                        <p>购买</p>
+                                    </div>
+                                </template>
+                                <template>
+                                    <span class="none" v-if="coupon.couponBtnType == 0" @click="receiveCoupon(coupon)"
+                                          id="coupon-receive"
+                                          onclick="_czc.push(['_trackEvent','机构购物车','优惠券领取按钮点击','优惠券领取按钮点击',1,'coupon-receive'])">领取</span>
+                                    <span v-if="coupon.couponBtnType == 1">已领取</span>
+                                </template>
                             </div>
-                            <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>
+                            <template v-if="coupon.moneyCouponFlag == 1">
+                                <div class="coupon-tags" v-if="coupon.moneyCouponType == 1">意向{{ coupon.couponType | TypeFormat }}</div>
+                                <div class="coupon-tags"  v-else>定向{{ coupon.couponType | TypeFormat }}</div>
+                            </template>
+                            <template v-else>
+                                <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>
+                            </template>
                         </div>
                     </div>
                 </div>

+ 7 - 1
src/main/resources/templates/shopping/confirm.html

@@ -326,7 +326,13 @@
                     <span class="coupon-list-checked" :class="[coupon.ischecked ?'checked':'']"></span>
                 </div>
                 <div class="coupon-list-ri"><span>已领取</span></div>
-                <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>
+                <template v-if="coupon.moneyCouponFlag == 1">
+                    <div class="coupon-tags" v-if="coupon.moneyCouponType == 1">意向{{ coupon.couponType | TypeFormat }}</div>
+                    <div class="coupon-tags"  v-else>定向{{ coupon.couponType | TypeFormat }}</div>
+                </template>
+                <template v-else>
+                    <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>
+                </template>
             </div>
         </div>
         <div class="totalPriceWrap">

+ 25 - 7
src/main/resources/templates/user-center/account/coupon-collection.html

@@ -43,14 +43,32 @@
                 <div class="coupon-list-time"> {{ coupon.startDate }} - {{ coupon.endDate }}</div>
               </div>
               <div class="coupon-list-ri">
-                <div class="buy" v-if="coupon.couponBtnType == 2" @click="toBuyCoupon(coupon)">
-                  <p>¥10000</p>
-                  <p>购买</p>
-                </div>
-                <span class="none" v-if="coupon.couponBtnType == 0" @click="receiveCoupon(coupon)">领取</span>
-                <span v-if="coupon.couponBtnType == 1" @click="toUseCoupon(coupon)">去使用</span>
+                <template v-if="coupon.moneyCouponFlag == 1">
+                  <div class="buy" @click="toBuyCoupon(coupon)"
+                       id="coupon-buy-coupon"
+                       onclick="_czc.push(['_trackEvent','领券中心','优惠券购买按钮点击','优惠券购买按钮点击',1,'coupon-buy-coupon'])">
+                    <p>¥{{ coupon.moneyCouponPrice }}</p>
+                    <p>购买</p>
+                  </div>
+                </template>
+                <template v-else>
+                  <span class="none" v-if="coupon.couponBtnType == 0"
+                        @click="receiveCoupon(coupon)"
+                        id="coupon-receive"
+                        onclick="_czc.push(['_trackEvent','领券中心','优惠券领取按钮点击','优惠券领取按钮点击',1,'coupon-receive'])">领取</span>
+                  <span v-if="coupon.couponBtnType == 1"
+                        @click="toUseCoupon(coupon)"
+                        id="coupon-use-coupon"
+                        onclick="_czc.push(['_trackEvent','领券中心','优惠券去使用按钮点击','优惠券去使用按钮点击',1,'coupon-use-coupon'])">去使用</span>
+                </template>
               </div>
-              <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>
+              <template v-if="coupon.moneyCouponFlag == 1">
+                <div class="coupon-tags" v-if="coupon.moneyCouponType == 1">意向{{ coupon.couponType | TypeFormat }}</div>
+                <div class="coupon-tags"  v-else>定向{{ coupon.couponType | TypeFormat }}</div>
+              </template>
+              <template v-else>
+                <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>
+              </template>
             </div>
           </div>
           <div v-else class="empty">

+ 21 - 2
src/main/resources/templates/user-center/account/coupon.html

@@ -68,8 +68,27 @@
                     {{ coupon.startDate }} - {{ coupon.endDate }}
                   </div>
                 </div>
-                <div class="coupon-list-ri" :class="coupon.useStatus == 2 || coupon.useStatus == 3 ? 'none' : 'used'" @click="toUseCoupon(coupon)">{{ coupon.useStatus | TypeBtnFormat }}</div>
-                <div class="coupon-tags" :class="coupon.useStatus == 2 || coupon.useStatus == 3 ? 'none' : 'used'">{{ coupon.couponType | TypeFormat }}</div>
+                <div class="coupon-list-ri" :class="coupon.useStatus == 2 || coupon.useStatus == 3 ? 'none' : 'used'"
+                     id="coupon-use-coupon"
+                     @click="toUseCoupon(coupon)"
+                     onclick="_czc.push(['_trackEvent','机构优惠券列表','优惠券去使用按钮点击','优惠券去使用按钮点击',1,'coupon-use-coupon'])">{{
+                  coupon.useStatus | TypeBtnFormat }}
+                </div>
+                <template v-if="coupon.moneyCouponFlag == 1">
+                  <div v-if="coupon.moneyCouponType == 1" class="coupon-tags"
+                       :class="coupon.useStatus == 2 || coupon.useStatus == 3 ? 'none' : 'used'">意向{{ coupon.couponType
+                    | TypeFormat }}
+                  </div>
+                  <div v-else class="coupon-tags"
+                       :class="coupon.useStatus == 2 || coupon.useStatus == 3 ? 'none' : 'used'">定向{{ coupon.couponType
+                    | TypeFormat }}
+                  </div>
+                </template>
+                <template v-else>
+                  <div class="coupon-tags" :class="coupon.useStatus == 2 || coupon.useStatus == 3 ? 'none' : 'used'">{{
+                    coupon.couponType | TypeFormat }}
+                  </div>
+                </template>
               </div>
           </div>
           <div v-else class="empty">