123
This commit is contained in:
+4
-2
@@ -26,7 +26,8 @@ import {
|
||||
RadioGroup,
|
||||
Switch,
|
||||
Cascader,
|
||||
ActionSheet
|
||||
ActionSheet,
|
||||
Dialog
|
||||
} from "vant";
|
||||
|
||||
Vue.use(Button);
|
||||
@@ -57,4 +58,5 @@ Vue.use(Radio)
|
||||
Vue.use(RadioGroup)
|
||||
Vue.use(Switch)
|
||||
Vue.use(ActionSheet)
|
||||
Vue.use(Cascader)
|
||||
Vue.use(Cascader)
|
||||
Vue.use(Dialog)
|
||||
@@ -46,4 +46,20 @@ function getLocation(){
|
||||
})
|
||||
}
|
||||
|
||||
export { signToWechat, getLocation };
|
||||
function requestPayment(paymentConfig){
|
||||
return new Promise(resolve => {
|
||||
wechatInstance.chooseWXPay({
|
||||
timestamp: paymentConfig.timestamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
|
||||
nonceStr: paymentConfig.nonceStr, // 支付签名随机串,不长于 32 位
|
||||
package: paymentConfig.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
|
||||
signType: paymentConfig.signType, // 微信支付V3的传入RSA,微信支付V2的传入格式与V2统一下单的签名格式保持一致
|
||||
paySign: paymentConfig.paySign, // 支付签名
|
||||
success: function (res) {
|
||||
// 支付成功后的回调函数
|
||||
resolve(res)
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export { signToWechat, getLocation, requestPayment };
|
||||
Reference in New Issue
Block a user