This commit is contained in:
2021-11-11 15:10:51 +08:00
parent ec0724c873
commit b4af257c70
63 changed files with 3189 additions and 832 deletions
+4 -2
View File
@@ -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)
+17 -1
View File
@@ -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 };