feat: 增加界面

This commit is contained in:
2021-11-25 21:13:38 +08:00
parent 52c1603176
commit 29da9c7746
33 changed files with 1896 additions and 870 deletions
+9 -16
View File
@@ -1,18 +1,4 @@
// export default {
// install(Vue){
// wx.config({
// debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
// appId: '', // 必填,公众号的唯一标识
// timestamp: 123, // 必填,生成签名的时间戳
// nonceStr: '', // 必填,生成签名的随机串
// signature: '',// 必填,签名
// jsApiList: [] // 必填,需要使用的JS接口列表
// });
// wx.ready(function(){
// Vue.prototype.$wx = wx;
// })
// }
// }
let wechatInstance;
function signToWechat(config){
@@ -25,6 +11,7 @@ function signToWechat(config){
return new Promise((resolve) => {
wx.config({
...defaultConfig,
debug: true,
...config,
})
wx.ready(function(){
@@ -57,9 +44,15 @@ function requestPayment(paymentConfig){
success: function (res) {
// 支付成功后的回调函数
resolve(res)
},
fail(res){
alert(JSON.stringify(res))
}
});
})
}
export { signToWechat, getLocation, requestPayment };
function openLocation(config){
return wechatInstance.openLocation(config)
}
export { signToWechat, getLocation, requestPayment, openLocation };