|
@@ -3,6 +3,7 @@
|
|
|
*/
|
|
|
var payContainer = new Vue({
|
|
|
el:"#payContainer",
|
|
|
+ mixins: [mhPayMixin],
|
|
|
data: {
|
|
|
isSubMitStatus:false,
|
|
|
payInfo:{
|
|
@@ -194,19 +195,19 @@ var payContainer = new Vue({
|
|
|
}
|
|
|
if(_self.payInfo.payBankNum == "WEIXIN"){// 微信
|
|
|
if(_self.pageType === '1'){ // 二手
|
|
|
- _self.PaySecondMiniWxPay();
|
|
|
+ _self.mh_PaySecondMiniWxPay();
|
|
|
}else if(_self.pageType === '2'){ // 会员
|
|
|
- _self.payVipMiniWxPay();
|
|
|
+ _self.mh_PayVipMiniWxPay();
|
|
|
}else{ // 正常订单
|
|
|
- _self.PayOrderMiniWxPay();
|
|
|
+ _self.mh_PayOrderMiniWxPay();
|
|
|
}
|
|
|
}else if(_self.payInfo.payBankNum == "ALIPAY"){// 支付宝
|
|
|
if(_self.pageType === '1'){// 二手
|
|
|
- _self.PayOrdersecondAliPay();
|
|
|
+ _self.mh_PayOrdersecondAliPay();
|
|
|
}else if(_self.pageType === '2'){ // 会员
|
|
|
- _self.PayVipAliPay();
|
|
|
+ _self.mh_PayVipAliPay();
|
|
|
}else{// 正常订单
|
|
|
- _self.PayOrderPcMallAlipay();
|
|
|
+ _self.mh_PayOrderPcMallAlipay();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -219,7 +220,7 @@ var payContainer = new Vue({
|
|
|
return;
|
|
|
}
|
|
|
if(_self.pageType === '3'){// 网银支付优惠券
|
|
|
- _self.PayCouponUnionPayFn();
|
|
|
+ _self.mh_PayCouponUnionPayFn();
|
|
|
}else{
|
|
|
if(_self.onlinePay == 2){
|
|
|
_self.layerConfirm();
|
|
@@ -233,379 +234,27 @@ var payContainer = new Vue({
|
|
|
return;
|
|
|
}
|
|
|
if(_self.pageType === '1'){
|
|
|
- _self.PayOrdersecondUnion()
|
|
|
+ _self.mh_PayOrdersecondUnion()
|
|
|
} else if (_self.pageType === '2') { // 网银付会员
|
|
|
- _self.payVipPcMallPay();
|
|
|
+ _self.mh_PayVipPcMallPay();
|
|
|
} else {
|
|
|
if(_self.mobileTabIndex === 4){
|
|
|
- var params = {
|
|
|
- payAmount:Math.round(_self.payAmount*100),
|
|
|
- orderId:_self.payInfo.payOrderId
|
|
|
- }
|
|
|
- _self.PayOrderTransferUnion(params);
|
|
|
+ _self.mh_PayOrderTransferUnion();
|
|
|
}else{
|
|
|
- _self.PayOrderPcMallPay();
|
|
|
+ _self.mh_PayOrderPcMallPay();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- PayOrderMiniWxPay:function () {// 正常订单微信支付
|
|
|
- var _self = this;
|
|
|
- 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;
|
|
|
- }
|
|
|
- },
|
|
|
- PaySecondMiniWxPay:function () {// 二手发布微信支付
|
|
|
- var _self = this;
|
|
|
- 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;
|
|
|
- }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;
|
|
|
- }
|
|
|
- },
|
|
|
- PayOrdersecondScanAliPay:function () {// 二手发布支付宝支付
|
|
|
- var _self = this;
|
|
|
- var params = {//二手
|
|
|
- bankCode:_self.payInfo.payBankNum,
|
|
|
- returnUrl:'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.payAmount,
|
|
|
- productId:_self.productID,
|
|
|
- userType:_self.payInfo.payUserType,
|
|
|
- };
|
|
|
- _self.isSubMitStatus=true;
|
|
|
- PayApi.PayOrdersecondUnion(params,function(response){
|
|
|
- if(response.code == 0){
|
|
|
- _self.isPayAlert = true;
|
|
|
- _self.isSubMitStatus=false;
|
|
|
- _self.mbOrderId = response.data.data.mbOrderId;
|
|
|
- window.open(response.data.data.payUrl);
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg,'确定',false);
|
|
|
- _self.isSubMitStatus=false;
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- PayOrderPcMallAlipay:function (){// 正常订单支付宝支付
|
|
|
- var _self = this;
|
|
|
- var params = {//正常订单
|
|
|
- payAmount:Math.round(_self.payAmount*100),
|
|
|
- returnUrl:'https://www.caimei365.com/',
|
|
|
- orderId:_self.payInfo.payOrderId
|
|
|
- };
|
|
|
- _self.isSubMitStatus=true;
|
|
|
- PayApi.PayOrderPcMallAlipay(params,function(response){
|
|
|
- if(response.code == 0){
|
|
|
- _self.isPayAlert = true;
|
|
|
- _self.isSubMitStatus=false;
|
|
|
- _self.mbOrderId = response.data.data.mbOrderId;
|
|
|
- _self.payInfo.payMobileUrl = response.data.data.payUrl;
|
|
|
- _self.payInfo.payData = {
|
|
|
- mbOrderId:_self.mbOrderId,
|
|
|
- type:_self.payInfo.payBankNum,
|
|
|
- orderid:_self.payInfo.payOrderId,
|
|
|
- amount:_self.payAmount,
|
|
|
- url:_self.payInfo.payMobileUrl
|
|
|
- };
|
|
|
- CAIMEI.Storage.setItem('payData',JSON.stringify(_self.payInfo.payData));
|
|
|
- if(!isPC){
|
|
|
- location.href = _self.payInfo.payMobileUrl;
|
|
|
- }else{
|
|
|
- window.open("/pay/caimei-paymobile.html?pageType=1");
|
|
|
- }
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg,'确定',false);
|
|
|
- _self.isSubMitStatus=false;
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- PayOrderPcMallPay:function(){// 正常订单网银支付
|
|
|
- var _self = this;
|
|
|
- var params = {//正常订单
|
|
|
- payAmount:Math.round(_self.payAmount*100),
|
|
|
- bankCode:_self.payInfo.payBankNum,
|
|
|
- returnUrl:'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.payAmount,
|
|
|
- orderId:_self.payInfo.payOrderId,
|
|
|
- userType:_self.payInfo.payUserType
|
|
|
- };
|
|
|
- _self.isSubMitStatus=true;
|
|
|
- PayApi.PayOrderPcMallPay(params,function(response){
|
|
|
- if(response.code == 0){
|
|
|
- _self.isPayAlert = true;
|
|
|
- _self.isSubMitStatus=false;
|
|
|
- _self.mbOrderId = response.data.data.mbOrderId;
|
|
|
- window.open(response.data.data.payUrl);
|
|
|
- }else{
|
|
|
- _self.isSubMitStatus=false;
|
|
|
- CAIMEI.Alert(response.msg,'确定',false);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- PayOrderTransferUnion:function (params) {// 大额网银转账
|
|
|
- var _self = this;
|
|
|
- _self.isSubMitStatus=true;
|
|
|
- PayApi.PayOrderTransferUnion(params,function(response){
|
|
|
- if(response.code == 0){
|
|
|
- _self.isPayBigAlert = true;
|
|
|
- _self.isSubMitStatus=false;
|
|
|
- _self.mbOrderId = response.data.data.mbOrderId;
|
|
|
- _self.bigPayInfo = JSON.parse(response.data.data.payInfo)
|
|
|
- console.log('bigPayInfo',_self.bigPayInfo)
|
|
|
- }else{
|
|
|
- _self.isSubMitStatus=false;
|
|
|
- CAIMEI.Alert(response.msg,'确定',false);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- PayOrdersecondAliPay:function (){// 二手支付宝支付
|
|
|
- var _self = this;
|
|
|
- var params = {//二手
|
|
|
- returnUrl:'https://www.caimei365.com/',
|
|
|
- productId:_self.productID,
|
|
|
- };
|
|
|
- _self.isSubMitStatus=true;
|
|
|
- PayApi.PayOrdersecondAliPay(params,function(response){
|
|
|
- if(response.code == 0){
|
|
|
- _self.isPayAlert = true;
|
|
|
- _self.isSubMitStatus=false;
|
|
|
- _self.mbOrderId = response.data.data.mbOrderId;
|
|
|
- _self.payInfo.payMobileUrl = response.data.data.payUrl;
|
|
|
- _self.payInfo.payData = {
|
|
|
- mbOrderId:_self.mbOrderId,
|
|
|
- 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");
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg,'确定',false);
|
|
|
- _self.isSubMitStatus=false;
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- PayOrdersecondUnion:function (){// 二手网银支付
|
|
|
- var _self = this;
|
|
|
- var params = {//二手
|
|
|
- payWay:_self.payInfo.payBankNum,
|
|
|
- returnUrl:'https://www.caimei365.com/',
|
|
|
- productId:_self.productID,
|
|
|
- };
|
|
|
- _self.isSubMitStatus=true;
|
|
|
- PayApi.PayOrdersecondUnion(params,function(response){
|
|
|
- if(response.code == 0){
|
|
|
- _self.isPayAlert = true;
|
|
|
- _self.isSubMitStatus=false;
|
|
|
- _self.mbOrderId = response.data.data.mbOrderId;
|
|
|
- window.open(response.data.data.payUrl);
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg,'确定',false);
|
|
|
- _self.isSubMitStatus=false;
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- payVipPcMallPay: function(){ // 网银支付会员
|
|
|
- console.log('网银支付会员');
|
|
|
- var _self = this;
|
|
|
- var params = {
|
|
|
- bankCode: this.payInfo.payBankNum,
|
|
|
- returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.payAmount,
|
|
|
- userType: _self.payInfo.payUserType,
|
|
|
- vipRecordId: _self.vipRecordId
|
|
|
- };
|
|
|
- PayApi.PayVipPcMallPay(params, function (response) {
|
|
|
- if (response.code == 0) {
|
|
|
- _self.isPayAlert = true;
|
|
|
- _self.isSubMitStatus = false;
|
|
|
- _self.mbOrderId = response.data.data.mbOrderId;
|
|
|
- window.open(response.data.data.payUrl);
|
|
|
- } else {
|
|
|
- _self.isSubMitStatus = false;
|
|
|
- CAIMEI.Alert(response.msg, '确定', false);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- PayVipAliPay: function(){ // 支付宝支付会员
|
|
|
- console.log('支付宝支付会员');
|
|
|
- var _self = this;
|
|
|
- var params = {
|
|
|
- bankCode: _self.payInfo.payBankNum,
|
|
|
- returnUrl: 'https://www.caimei365.com/',
|
|
|
- userType: _self.payInfo.payUserType,
|
|
|
- vipRecordId: _self.vipRecordId
|
|
|
- };
|
|
|
- console.log(params);
|
|
|
- PayApi.PayVipAliPay(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 = {
|
|
|
- mbOrderId: _self.mbOrderId,
|
|
|
- type: _self.payInfo.payBankNum,
|
|
|
- amount: _self.payAmount,
|
|
|
- url: _self.payInfo.payMobileUrl,
|
|
|
- };
|
|
|
- CAIMEI.Storage.setItem('payData', JSON.stringify(_self.payInfo.payData));
|
|
|
- if (!isPC) {
|
|
|
- location.href = _self.payInfo.payMobileUrl;
|
|
|
- } else {
|
|
|
- window.open("/pay/caimei-paymobile.html?pageType=2&duration=" + _self.comboInfo.duration);
|
|
|
- }
|
|
|
- } else {
|
|
|
- CAIMEI.Alert(response.msg, '确定', false);
|
|
|
- _self.isSubMitStatus = false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- payVipMiniWxPay: function(){ // 微信支付会员
|
|
|
- if (!isPC) {
|
|
|
- var orderInfo = {//普通订单微信二维码参数
|
|
|
- couponId: 2,
|
|
|
- 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,
|
|
|
- vipId: this.comboInfo.id,
|
|
|
- vipRecordId: this.vipRecordId,
|
|
|
- amount: this.payAmount,
|
|
|
- duration: this.comboInfo.duration,
|
|
|
- };
|
|
|
- CAIMEI.Storage.setItem('payData', JSON.stringify(this.payInfo.payData));
|
|
|
- window.open("/pay/caimei-paymobile.html?pageType=2");
|
|
|
- this.isPayAlert = true;
|
|
|
- }
|
|
|
- },
|
|
|
- PayCouponUnionPayFn:function () { // 网银支付购买优惠券
|
|
|
- console.log('网银支付购买优惠券');
|
|
|
- var _self = this;
|
|
|
- var params = {
|
|
|
- bankCode: this.payInfo.payBankNum,
|
|
|
- returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.couponInfo.moneyCouponPrice,
|
|
|
- userType: _self.payInfo.payUserType,
|
|
|
- couponId: _self.couponId,
|
|
|
- couponRecordId:_self.couponRecordId,
|
|
|
- userId:_self.userId,
|
|
|
- source:2 //支付来源 1 小程序 2 WWW
|
|
|
- };
|
|
|
- PayApi.PayCouponUnionPay(params, function (response) {
|
|
|
- if (response.code == 0) {
|
|
|
- _self.isPayAlert = true;
|
|
|
- _self.isSubMitStatus = false;
|
|
|
- _self.mbOrderId = response.data.data.mbOrderId;
|
|
|
- window.open(response.data.data.payUrl);
|
|
|
- } else {
|
|
|
- _self.isSubMitStatus = false;
|
|
|
- CAIMEI.Alert(response.msg, '确定', false);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
PayCouponMiniPayFn:function () { // 移动支付购买优惠券
|
|
|
var _self = this;
|
|
|
if(_self.payInfo.payBankNum == "WEIXIN"){
|
|
|
- _self.payCouponMiniWxPay();
|
|
|
+ _self.mh_PayCouponMiniWxPay();
|
|
|
}else if(_self.payInfo.payBankNum == "ALIPAY"){//支付宝支付
|
|
|
- _self.payCouponAliPay();
|
|
|
+ _self.mh_PayCouponAliPay();
|
|
|
}
|
|
|
},
|
|
|
- payCouponMiniWxPay: function(){// 微信支付优惠券
|
|
|
- console.log('微信支付优惠券');
|
|
|
- if (!isPC) {
|
|
|
- var orderInfo = {//普通订单微信二维码参数
|
|
|
- pageType: 3,
|
|
|
- payAmount: this.couponInfo.moneyCouponPrice,
|
|
|
- couponRecordId:this.couponRecordId,
|
|
|
- couponId: this.couponId,
|
|
|
- userId : this.userId
|
|
|
- };
|
|
|
- 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,
|
|
|
- couponRecordId:this.couponRecordId,
|
|
|
- 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(){// 支付宝支付优惠券
|
|
|
- var _self = this;
|
|
|
- console.log('支付宝支付优惠券');
|
|
|
- var params = {
|
|
|
- returnUrl: 'https://www.caimei365.com/',
|
|
|
- couponId: _self.couponInfo.couponId,
|
|
|
- userId:_self.userId,
|
|
|
- couponRecordId:_self.couponRecordId,
|
|
|
- source:2 //支付来源 1 小程序 2 WWW
|
|
|
- };
|
|
|
- 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 {
|
|
|
- window.open("/pay/caimei-paymobile.html?pageType=3");
|
|
|
- }
|
|
|
- } else {
|
|
|
- CAIMEI.Alert(response.msg, '确定', false);
|
|
|
- _self.isSubMitStatus = false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
changePayAmount:function(event){//输入支付金额控制
|
|
|
var _self = this;
|
|
|
var value = event.target.value;
|