123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- /**
- *Created by ZHJY on 2020/7/14.
- */
- var payContainer = new Vue({
- el:"#payContainer",
- mixins: [mhWechatMixin,hlbWechatMixin],
- data: {
- isSubMitStatus:false,
- paymentChannel:'HLB',
- shopOrderId:0,
- 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.shopOrderId = _this.state.shopOrderId;
- }
- },
- WxPaySubmit:function(){
- if(this.paymentChannel == 'HLB'){
- this.hlbWechatPayFn()
- }else{
- this.mhWechatPayFn()
- }
- },
- hlbWechatPayFn:function () {// 合利宝
- console.log('=========>合利宝')
- switch (this.pageType) {
- case 1:// 二手
- this.hlb_WxRequestsecondHandPay();
- break;
- case 2:// 超级会员
- this.hlb_WxRequestPaymentVipFn();
- break;
- case 3:// 优惠券
- this.hlb_WxRequestPaymentCouponFn();
- break;
- case 4:// 认证通会员
- this.hlb_WxRequestPaymentAuthVipFn();
- break;
- default:// 订单
- this.hlb_WxRequestPaymentFn();
- }
- },
- mhWechatPayFn:function () {// 米花
- console.log('=========>米花')
- switch (this.pageType) {
- case 1:// 二手
- this.mh_WxRequestsecondHandPay();
- break;
- case 2:// 超级会员
- this.mh_WxRequestPaymentVipFn();
- break;
- case 3:// 优惠券
- this.mh_WxRequestPaymentCouponFn();
- break;
- case 4:// 认证通会员
- this.mh_WxRequestPaymentAuthVipFn();
- break;
- default:// 订单
- 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();
- }
- });
|