小程序导入系统地址权限校验优化

master
gongfuxiang 2021-12-20 22:01:01 +08:00
parent 58ba42321e
commit 103fc59982
1 changed files with 47 additions and 41 deletions

View File

@ -310,50 +310,56 @@
},
//
choose_system_address_event(e) {
if(e == 1) {
uni.chooseAddress({
success(res) {
var data = {
"name": res.userName || '',
"tel": res.telNumber || '',
"province": res.provinceName || '',
"city": res.cityName || '',
"county": res.countyName || '',
"address": res.detailInfo || ''
};
//
uni.showLoading({
title: "处理中..."
});
uni.request({
url: app.globalData.get_request_url("outsystemadd", "useraddress"),
method: "POST",
data: data,
dataType: "json",
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
this.get_data_list();
choose_system_address_event(e) {
//
// #ifdef MP-BAIDU || MP-TOUTIAO
//
if(e != 1) {
app.globalData.auth_check(this, 'choose_system_address_event', 'scope.address');
return false;
}
// #endif
//
uni.chooseAddress({
success(res) {
var data = {
"name": res.userName || '',
"tel": res.telNumber || '',
"province": res.provinceName || '',
"city": res.cityName || '',
"county": res.countyName || '',
"address": res.detailInfo || ''
};
//
uni.showLoading({
title: "处理中..."
});
uni.request({
url: app.globalData.get_request_url("outsystemadd", "useraddress"),
method: "POST",
data: data,
dataType: "json",
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
this.get_data_list();
} else {
if (app.globalData.is_login_check(res.data)) {
app.globalData.showToast(res.data.msg);
} else {
if (app.globalData.is_login_check(res.data)) {
app.globalData.showToast(res.data.msg);
} else {
app.globalData.showToast('提交失败,请重试!');
}
app.globalData.showToast('提交失败,请重试!');
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast("服务器请求出错");
}
});
}
});
} else {
app.globalData.auth_check(this, 'choose_system_address_event', 'scope.address');
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast("服务器请求出错");
}
});
}
});
},
//