|
@@ -2,6 +2,18 @@ import wx from 'weixin-js-sdk'
|
|
|
import * as API_WeiXin from '$project/apis/weixin'
|
|
|
import * as API_Common from '$project/apis/common'
|
|
|
|
|
|
+import Qs from 'qs';
|
|
|
+import request from '../utils/request'
|
|
|
+export function addSysLog(message) {
|
|
|
+
|
|
|
+ return request({
|
|
|
+ url: '/mobile/sysLogApi/submit',
|
|
|
+ data: Qs.stringify({
|
|
|
+ message:JSON.stringify(message)
|
|
|
+ }),
|
|
|
+ method: 'post',
|
|
|
+ })
|
|
|
+}
|
|
|
//获取微信配置
|
|
|
export function getWxConfig(jsApiList) {
|
|
|
var jsApiList = jsApiList || ['chooseImage', 'getLocalImgData', 'scanQRCode'];
|
|
@@ -90,6 +102,21 @@ export function getLocation() {
|
|
|
reject(res);
|
|
|
},
|
|
|
fail: function(res) {
|
|
|
+ if(res.errMsg=='getLocation:timeout'){
|
|
|
+ mui.alert("定位超时,请检查是否开启'定位'");
|
|
|
+ }else if(res.errMsg=='getLocation:ERROR_NETWORK'){
|
|
|
+ mui.alert("网络异常");
|
|
|
+ }else if(res.errMsg=='getLocation:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF'){
|
|
|
+ mui.alert("没开启系统定位");
|
|
|
+ }else if(res.errMsg=='getLocation:system permission denied'){
|
|
|
+ mui.alert("未给微信位置授权");
|
|
|
+ }else if(res.errMsg=='getLocation:location permission'){
|
|
|
+ mui.alert("未给微信位置授权");
|
|
|
+ }else if(res.errMsg=='getLocation:auth denied'){
|
|
|
+ mui.alert("用户在小程序中未授权");
|
|
|
+ }else if(res.errMsg=='getLocation:fail authorize no response'){
|
|
|
+ mui.alert("用户在小程序中未授权");
|
|
|
+ }
|
|
|
reject(res);
|
|
|
},
|
|
|
complete() {}
|
|
@@ -114,6 +141,8 @@ export function scanQRCode(needResult) {
|
|
|
reject(res);
|
|
|
},
|
|
|
fail: function(res) {
|
|
|
+
|
|
|
+
|
|
|
if(res.errMsg=='getLocation:timeout'){
|
|
|
mui.alert("定位超时,请检查是否开启'定位'");
|
|
|
}else if(res.errMsg=='getLocation:ERROR_NETWORK'){
|
|
@@ -128,12 +157,8 @@ export function scanQRCode(needResult) {
|
|
|
mui.alert("用户在小程序中未授权");
|
|
|
}else if(res.errMsg=='getLocation:fail authorize no response'){
|
|
|
mui.alert("用户在小程序中未授权");
|
|
|
- }else if(res.errMsg=='getLocation:background'){
|
|
|
- // mui.toast("正在");
|
|
|
- }else{
|
|
|
- mui.alert("未知异常:"+JSON.stringify(res));
|
|
|
}
|
|
|
- // reject(res);
|
|
|
+ reject(res);
|
|
|
},
|
|
|
complete() {}
|
|
|
})
|