'use strict'; var hlbPayMixin = function () {// 合利宝支付渠道 return { methods: { hlb_PayOrderPcMallPay(){// 正常订单网银支付通道 const _this = this; const params = {//正常订单 payType: 'YL', payAmount: _this.payAmount, bankCode: _this.payInfo.payBankNum, returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount=' + _this.payAmount, shopOrderId: _this.payInfo.shopOrderId, userType: _this.payInfo.payUserType }; _this.isSubMitStatus=true; console.log('正常订单合利宝网银支付通道',params) PayApi.PayOrderPcMallPay(params,function(response){ if(response.code === 0){ _this.iframe = response.data _this.isIframe = true _this.$nextTick(() => { const onlineForm = document.getElementById('onlineForm'); onlineForm.setAttribute('target', '_blank') _this.mbOrderId = onlineForm.P2_orderId.value console.log('mbOrderId',_this.mbOrderId) _this.isSubMitStatus=false; $('input[type="submit"]').on('click', function(e) { _this.isPayAlert = true; _this.isIframe = false onlineForm.submit(); document.getElementById('onlineForm').remove(); }) }) }else{ _this.isSubMitStatus=false; CAIMEI.Alert(response.msg,'确定',false); } }) }, hlb_PayOrderPcScanAliPay (){// 正常订单支付宝通道 var _this = this; var params = {//正常订单 payType:'ZFBEWM', payAmount:_this.payAmount, returnUrl:'https://www.caimei365.com/', shopOrderId:_this.payInfo.shopOrderId }; _this.isSubMitStatus=true; console.log('正常订单支付宝通道',params) PayApi.PayOrderPcScanAliPay(params,function(response){ if(response.code == 0){ console.log('data',response.data) _this.isPayAlert = true; _this.isSubMitStatus=false; _this.mbOrderId = response.data.rt5_orderId; _this.payInfo.payMobileUrl = response.data.rt8_qrcode; _this.payInfo.payData = { mbOrderId:_this.mbOrderId, type:_this.payInfo.payBankNum, shopOrderId:_this.payInfo.shopOrderId, amount:_this.payAmount, url:_this.payInfo.payMobileUrl }; CAIMEI.Storage.setItem('payData',JSON.stringify(_this.payInfo.payData)); if(!isPC){ location.href = _this.payInfo.payMobileUrl; }else{ window.open("/pay/caimei-paymobile.html?pageType=0"); } }else{ CAIMEI.Alert(response.msg,'确定',false); _this.isSubMitStatus=false; } }) }, hlb_PayOrderMiniWxPay (){// 正常订单微信支付通道 console.log('正常订单微信支付通道') var _this = this; if(!isPC){ var orderInfo = {//正常订单微信二维码参数 pageType:0, shopOrderId:_this.payInfo.shopOrderId, 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, shopOrderId:_this.payInfo.shopOrderId, amount:_this.payAmount, url:_this.payInfo.payMobileUrl }; CAIMEI.Storage.setItem('payData',JSON.stringify(_this.payInfo.payData)); window.open("/pay/caimei-paymobile.html?pageType=0"); _this.isPayAlert = true; } }, hlb_PayCouponUnionPayFn () { // 网银支付购买优惠券 console.log('网银支付购买优惠券'); var _this = this; var params = { source:2, //支付来源 1 小程序 2 WWW payType:'YL', userId:_this.userId, couponId: _this.couponId, couponRecordId:_this.couponRecordId, bankCode: this.payInfo.payBankNum, returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_this.couponInfo.moneyCouponPrice, userType: _this.payInfo.payUserType, }; PayApi.PayCouponUnionPay(params, function (response) { if (response.code == 0) { _this.isPayAlert = true; _this.iframe = response.data _this.$nextTick(() => { var onlineForm = document.getElementById('onlineForm'); onlineForm.setAttribute('target', '_blank') _this.mbOrderId = onlineForm.P2_orderId.value console.log('mbOrderId',_this.mbOrderId) _this.isSubMitStatus=false; onlineForm.submit(); }) } else { _this.isSubMitStatus = false; CAIMEI.Alert(response.msg, '确定', false); } }); }, hlb_PayCouponMiniWxPay(){ // 微信支付优惠券 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; } }, hlb_PayCouponAliPay(){ // 支付宝支付优惠券 var _this = this; console.log('支付宝支付优惠券'); var params = { source:2, //支付来源 1 小程序 2 WWW payType:'ZFBEWM', userId:_this.userId, couponId: _this.couponInfo.couponId, couponRecordId:_this.couponRecordId, returnUrl: 'https://www.caimei365.com/', }; PayApi.PayCouponMiniScanAliPay(params, function(response){ console.log(response); if (response.code === 0) { _this.isPayAlert = true; _this.mbOrderId = response.data.rt5_orderId; _this.payInfo.payMobileUrl = response.data.rt8_qrcode; _this.payInfo.payData = { type: _this.payInfo.payBankNum, mbOrderId: _this.mbOrderId, amount: _this.couponInfo.moneyCouponPrice, url: _this.payInfo.payMobileUrl, couponId:_this.couponId, userId:_this.userId }; CAIMEI.Storage.setItem('payData', JSON.stringify(_this.payInfo.payData)); if (!isPC) { location.href = _this.payInfo.payMobileUrl; } else { window.open("/pay/caimei-paymobile.html?pageType=3"); } } else { CAIMEI.Alert(response.msg, '确定', false); _this.isSubMitStatus = false; } }); }, hlb_PayVipPcMallPay(){// 超级会员网银支付通道 var _this = this; var params = { payType:'YL', bankCode: this.payInfo.payBankNum, returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=vip&type=success&payAmount='+_this.payAmount, userType: _this.payInfo.payUserType, vipRecordId: _this.vipRecordId }; _this.isSubMitStatus=true; PayApi.PayVipPcMallPay(params, function (response) { if (response.code == 0) { _this.isPayAlert = true; _this.iframe = response.data; _this.$nextTick(() => { var onlineForm = document.getElementById('onlineForm'); onlineForm.setAttribute('target', '_blank') _this.mbOrderId = onlineForm.P2_orderId.value console.log('mbOrderId',_this.mbOrderId) _this.isSubMitStatus=false; onlineForm.submit(); }) } else { _this.isSubMitStatus = false; CAIMEI.Alert(response.msg, '确定', false); } }); }, hlb_PayVipScanAliPay(){ // 超级会员支付宝通道 var _this = this; var params = { payType:'ZFBEWM', vipRecordId: _this.vipRecordId, bankCode: _this.payInfo.payBankNum, userType: _this.payInfo.payUserType, returnUrl: 'https://www.caimei365.com/', }; _this.isSubMitStatus = true; PayApi.PayVipScanAliPay(params, function(response){ console.log(response); if (response.code === 0) { _this.isPayAlert = true; _this.isSubMitStatus = false; _this.mbOrderId = response.data.rt5_orderId; _this.payInfo.payMobileUrl = response.data.rt8_qrcode; _this.payInfo.payData = { mbOrderId: _this.mbOrderId, type: _this.payInfo.payBankNum, amount: _this.payAmount, url: _this.payInfo.payMobileUrl, }; CAIMEI.Storage.setItem('payData', JSON.stringify(_this.payInfo.payData)); if (!isPC) { location.href = _this.payInfo.payMobileUrl; } else { window.open("/pay/caimei-paymobile.html?pageType=2&duration=" + _this.comboInfo.duration); } } else { CAIMEI.Alert(response.msg, '确定', false); _this.isSubMitStatus = false; } }); }, hlb_PayVipMiniWxPay(){ // 超级会员微信支付通道 var _this = this; if (!isPC) { var orderInfo = {//普通订单微信二维码参数 pageType: 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; } }, hlb_PayOrdersecondUnion (){// 二手发布网银支付通道 var _this = this; var params = {//二手 payType:'YL', bankCode:_this.payInfo.payBankNum, returnUrl:'https://www.caimei365.com/pay/success.html?pageType=second&type=success&payAmount='+_this.payAmount, productId:_this.productID, userType:_this.payInfo.payUserType, }; _this.isSubMitStatus=true; PayApi.PayOrdersecondUnion(params,function(response){ if(response.code == 0){ _this.isPayAlert = true; _this.iframe = response.data _this.$nextTick(() => { var onlineForm = document.getElementById('onlineForm'); onlineForm.setAttribute('target', '_blank') _this.mbOrderId = onlineForm.P2_orderId.value console.log('mbOrderId',_this.mbOrderId) _this.isSubMitStatus=false; onlineForm.submit(); }) }else{ CAIMEI.Alert(response.msg,'确定',false); _this.isSubMitStatus=false; } }) }, hlb_PayOrdersecondScanAliPay (){// 二手发布支付宝通道 var _this = this; var params = {//二手 payType:'ZFBEWM', returnUrl:'https://www.caimei365.com/', productId:_this.productID, }; _this.isSubMitStatus=true; PayApi.PayOrdersecondScanAliPay(params,function(response){ if(response.code == 0){ _this.isPayAlert = true; _this.isSubMitStatus=false; _this.mbOrderId = response.data.rt5_orderId; _this.payInfo.payMobileUrl = response.data.rt8_qrcode; _this.payInfo.payData = { mbOrderId:_this.mbOrderId, type:_this.payInfo.payBankNum, productId:_this.productID, amount:_this.payAmount, url:_this.payInfo.payMobileUrl }; CAIMEI.Storage.setItem('payData',JSON.stringify(_this.payInfo.payData)); window.open("/pay/caimei-paymobile.html?pageType=1"); }else{ CAIMEI.Alert(response.msg,'确定',false); _this.isSubMitStatus=false; } }) }, hlb_PaySecondMiniWxPay (){// 二手发布微信支付通道 var _this = this; if(!isPC){// h5跳 H5支付页 var orderInfo = {//二手微信二维码参数 pageType:1, productId:_this.productID, 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{// PC 跳扫码支付页 _this.payInfo.payData = {//二手 type:_this.payInfo.payBankNum, productId:_this.productID, amount:_this.payAmount, url:_this.payInfo.payMobileUrl }; CAIMEI.Storage.setItem('payData',JSON.stringify(_this.payInfo.payData)); window.open("/pay/caimei-paymobile.html?pageType=1"); _this.isPayAlert = true; } }, hlb_CopyLinkPaySubmitFn (params) { var _this = this; console.log('合利宝支付链接'); PayApi.PayOrderPayLink(params,function(response){ _this.bankPayLink_url = response.data; var oInput = document.createElement("textarea"); oInput.value = _this.bankPayLink_url; document.body.appendChild(oInput); oInput.select(); // 选择对象 document.execCommand("Copy"); // 执行浏览器复制命令 document.body.removeChild(oInput); CAIMEI.dialog('复制成功'); } ) }, } }; }();