|
@@ -944,7 +944,7 @@ export const weixinPay = function (data, successful, cancel, failure) {
|
|
|
}
|
|
|
|
|
|
// 微信授权验证配置
|
|
|
-export const wxConfig = function (configInfo, userInfo) {
|
|
|
+export const wxConfig = function (configInfo, userInfo, cb) {
|
|
|
let url = ''
|
|
|
const systemInfo = uni.getSystemInfoSync()
|
|
|
if (systemInfo.platform === 'android') {
|
|
@@ -982,7 +982,22 @@ export const wxConfig = function (configInfo, userInfo) {
|
|
|
'openLocation'
|
|
|
]
|
|
|
})
|
|
|
+
|
|
|
+ wx.checkJsApi({
|
|
|
+ jsApiList: ['getLocation'],
|
|
|
+ success: function (res) {
|
|
|
+ if (res.checkResult.getLocation == false) {
|
|
|
+ alert('你的微信版本太低,不支持微信JS接口,请升级到最新的微信版本!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: function (res) {
|
|
|
+ console.log('checkJsApi fail=' + JSON.stringify(res))
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
wx.ready(() => {
|
|
|
+ cb?.()
|
|
|
if (configInfo && userInfo) {
|
|
|
wxShare({
|
|
|
configInfo,
|
|
@@ -990,7 +1005,9 @@ export const wxConfig = function (configInfo, userInfo) {
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
wx.error(function (res) {
|
|
|
+ cb?.()
|
|
|
// alert('出错了:' + res.errMsg) //wx.config配置错误,会弹出窗口哪里错误,然后根据微信文档查询即可。
|
|
|
})
|
|
|
} else {
|