mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-02-05 00:49:49 +08:00
【新增】用户地址添加地址,增加【从微信获取】功能,但因微信地址存储数据有限,同时省市县不统一,会有部分数据需要手动输入,无法全部一键识别入库。
This commit is contained in:
@@ -121,6 +121,9 @@
|
||||
}
|
||||
},
|
||||
"permission": {
|
||||
"scope.userFuzzyLocation": {
|
||||
"desc": "你的位置信息将用于小程序定位"
|
||||
},
|
||||
"scope.userLocation": {
|
||||
"desc": "你的位置信息将用于小程序定位"
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<view class="coreshop-bottomBox">
|
||||
<button class="coreshop-btn coreshop-btn-square coreshop-btn-w" @click="delShip" v-if="id && id != 0" :disabled='submitStatus' :loading='submitStatus'>删除</button>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button class="coreshop-btn coreshop-btn-square coreshop-btn-b" @click="wechatAddress" hover-class="btn-hover2">从微信获取</button>
|
||||
<button class="coreshop-btn coreshop-btn-square coreshop-btn-w" @click="wechatAddress" v-if="!id">从微信获取</button>
|
||||
<!-- #endif -->
|
||||
<button class="coreshop-btn coreshop-btn-square coreshop-btn-b" @click="saveShip" :disabled='submitStatus' :loading='submitStatus'>保存</button>
|
||||
</view>
|
||||
@@ -275,7 +275,7 @@
|
||||
//编辑获取收货地址信息
|
||||
getShipInfo() {
|
||||
let data = {
|
||||
'id': this.id
|
||||
id: this.id
|
||||
}
|
||||
this.$u.api.shipDetail(data).then(res => {
|
||||
if (res.status) {
|
||||
@@ -472,24 +472,36 @@
|
||||
// #endif
|
||||
},
|
||||
// #ifdef MP-WEIXIN
|
||||
wechatAddress: function () {
|
||||
wechatAddress() {
|
||||
let _that = this;
|
||||
wx.chooseAddress({
|
||||
success: res => {
|
||||
if (res.errMsg == "chooseAddress:ok") {
|
||||
//获取成功
|
||||
//存储这个收获地区信息到数据库
|
||||
_that.form.name = res.userName;
|
||||
_that.form.mobile = res.telNumber;
|
||||
_that.form.address = res.detailInfo;
|
||||
|
||||
_that.pickerValue = res.provinceName + " " + res.cityName + " " + res.countyName;
|
||||
let data = {
|
||||
provinceName: res.provinceName,
|
||||
cityName: res.cityName,
|
||||
countyName: res.countyName,
|
||||
postalCode: res.postalCode
|
||||
};
|
||||
this.$u.api.getAreaId(data).then(res => {
|
||||
if (res.status) {
|
||||
this.areaId = res.data;
|
||||
this.init();
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '地区选择出现问题,请重新选择地区',
|
||||
showCancel: false
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
console.log(res);
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
this.$refs.uToast.show({ title: '获取微信地址失败', type: 'error' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user