Commit 48280df8 authored by jyx's avatar jyx

代码优化

parent 113db493
......@@ -72,7 +72,9 @@
<script>
import common from '@/mixins/common';
import { message } from '@/utils/fun';
import {
message
} from '@/utils/fun';
export default {
name: 'coinPopup',
mixins: [common],
......@@ -188,21 +190,24 @@
// 虚拟支付
let wxParams = wxData.params;
let signDataParams = wxData.params.sigData;
// let signDataStr = wxData.params.signDataStr;
let that = this;
const SDKVersion = wx.getSystemInfoSync().SDKVersion;
if (this.compareVersion(SDKVersion, '2.19.2') >= 0 || wx.canIUse('requestVirtualPayment')) {
wx.requestVirtualPayment({
signData: JSON.stringify({
offerId: signDataParams.offerId,
buyQuantity: signDataParams.buyQuantity,
env: signDataParams.env,
currencyType: signDataParams.currencyType,
platform: signDataParams.platform,
productId: signDataParams.productId,
goodsPrice: signDataParams.goodsPrice,
outTradeNo: signDataParams.outTradeNo,
attach: signDataParams.attach,
}),
// signData :signDataStr,
signData: JSON.stringify(wxData.params.sigData),
// signData: JSON.stringify({
// offerId: signDataParams.offerId,
// buyQuantity: signDataParams.buyQuantity,
// env: signDataParams.env,
// currencyType: signDataParams.currencyType,
// platform: signDataParams.platform,
// productId: signDataParams.productId,
// goodsPrice: signDataParams.goodsPrice,
// outTradeNo: signDataParams.outTradeNo,
// attach: signDataParams.attach,
// }),
paySig: wxParams.paySig,
signature: wxParams.signature,
mode: wxParams.mode,
......@@ -214,7 +219,7 @@
errCode
}) {
message.notify(errMsg);
console.log('虚拟支付异常:errMsg='+errMsg+' errCode='+errCode);
console.log('虚拟支付异常:errMsg=' + errMsg + ' errCode=' + errCode);
},
})
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment