|
@@ -30,7 +30,7 @@ var payContainer = new Vue({
|
|
|
_this.isRequest = true;
|
|
|
if( _this.pageType == 1){
|
|
|
_this.productId = _this.state.productId;
|
|
|
- }else if(_this.pageType == 2){
|
|
|
+ }else if(_this.pageType == 2 || _this.pageType == 4){
|
|
|
_this.vipId = _this.state.vipId;
|
|
|
_this.vipRecordId = _this.state.vipRecordId;
|
|
|
}else if(_this.pageType == 3){
|
|
@@ -46,8 +46,10 @@ var payContainer = new Vue({
|
|
|
this.WxRequestsecondHandPay();
|
|
|
} else if (this.pageType == 2) {
|
|
|
this.WxRequestPaymentVipFn();
|
|
|
- } if (this.pageType == 3) {
|
|
|
+ } else if (this.pageType == 3) {
|
|
|
this.WxRequestPaymentCouponFn();
|
|
|
+ } else if (this.pageType === 4){
|
|
|
+ this.WxRequestPaymentAuthVipFn();
|
|
|
} else {
|
|
|
this.WxRequestPaymentFn();
|
|
|
}
|
|
@@ -83,6 +85,36 @@ var payContainer = new Vue({
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ WxRequestPaymentAuthVipFn: function(){
|
|
|
+ var _this = this;
|
|
|
+ var params = {
|
|
|
+ code: _this.wechatcode,
|
|
|
+ state: _this.rand(1000, 9999),
|
|
|
+ vipId: _this.vipId,
|
|
|
+ vipRecordId: _this.vipRecordId,
|
|
|
+ returnUrl: 'https://www.caimei365.com/',
|
|
|
+ };
|
|
|
+ PayApi.PayAuthVipMiniWxPay(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);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
// 优惠券支付
|
|
|
WxRequestPaymentCouponFn: function(){
|
|
|
var _this = this;
|