/** *Created by ZHJY on 2020/7/14. */ var payContainer = new Vue({ el:"#payContainer", mixins: [mhWechatMixin,hlbWechatMixin], data: { paymentChannel:'HLB', orderID:'', pageType:0,//页面跳转类型 0:订单 1:二手 2:超级会员 3:优惠券 4:认证通会员 payAmount:0,//本次支付金额 wechatcode:'',//微信code state:0,//随机数 isRequest:false, productId:'',//二手商品ID vipId: null, // vip套餐id vipRecordId: undefined, couponId: undefined,//优惠券Id couponRecordId:undefined,//优惠券记录Id userId : undefined //购买优惠券的用户Id }, computed: { }, methods: { infoPayOrderCheckoutCounter:function(){//初始化订单数据 var _this = this; // _this.wechatcode = CAIMEI.getUrlParam('code'); // _this.state = JSON.parse(decodeURIComponent(CAIMEI.getUrlParam('state'))); // _this.payAmount = _this.state.payAmount; // _this.pageType = _this.state.pageType; _this.isRequest = true; if( _this.pageType == 1){ _this.productId = _this.state.productId; }else if(_this.pageType == 2 || _this.pageType == 4){ _this.vipId = _this.state.vipId; _this.vipRecordId = _this.state.vipRecordId; }else if(_this.pageType == 3){ _this.couponId = _this.state.couponId; _this.couponRecordId = _this.state.couponRecordId; _this.userId = _this.state.userId; }else{ _this.orderID = _this.state.orderID; } }, WxPaySubmit:function(){ if(this.paymentChannel == 'HLB'){ this.hlbWechatPayFn() }else{ this.mhWechatPayFn() } }, hlbWechatPayFn:function () {// 合利宝 console.log('=========>合利宝') if (this.pageType == 1) {// 二手 this.hlb_WxRequestsecondHandPay(); } else if (this.pageType == 2) { this.hlb_WxRequestPaymentVipFn(); } else if (this.pageType == 3) { this.hlb_WxRequestPaymentCouponFn(); } else if (this.pageType === 4){ this.hlb_WxRequestPaymentAuthVipFn(); } else { this.hlb_WxRequestPaymentFn(); } }, mhWechatPayFn:function () {// 米花 console.log('=========>米花') if (this.pageType == 1) { this.mh_WxRequestsecondHandPay(); } else if (this.pageType == 2) { this.mh_WxRequestPaymentVipFn(); } else if (this.pageType == 3) { this.mh_WxRequestPaymentCouponFn(); } else if (this.pageType === 4){ this.mh_WxRequestPaymentAuthVipFn(); } else { this.mh_WxRequestPaymentFn(); } }, rand:function (min,max) {//随机数 return Math.floor(Math.random()*(max-min))+min; }, toFixedFn:function(text){//处理小数点后两位数 return Number(text).toFixed(2); }, }, mounted: function () { var _this = this; _this.infoPayOrderCheckoutCounter(); } });