Commit b05cb379 authored by Damon's avatar Damon

Merge branch 'dev-1.5.0' into test

parents 267bcc6a 952a9d6e
......@@ -278,7 +278,7 @@ export default {
provinceName: this.region[0],
cityName: this.region[1],
districtName: this.region[2],
address: this.region.join("") + this.address
address: this.address
};
let res = await this.$u.api.updateAddress(params);
if (res && res.code == 200) {
......@@ -300,7 +300,7 @@ export default {
provinceName: this.region[0],
cityName: this.region[1],
districtName: this.region[2],
address: this.region.join("") + this.address
address: this.address
};
if (this.id) params.id = this.id
let res = await this.$u.api.saveMyAddress(params);
......
......@@ -61,16 +61,14 @@ export default {
getMineSite() {
this.$u.api.getMyAddress().then((res) => {
const data = res.data
if (data.length > 0) {
this.lists = data.map(v => {
let region = []
if(v.provinceName && v.cityName && v.districtName) {
region = [v.provinceName, v.cityName, v.districtName]
}
v.region = region
return v
})
}
this.lists = data.length > 0 ? data.map(v => {
let region = []
if(v.provinceName && v.cityName && v.districtName) {
region = [v.provinceName, v.cityName, v.districtName]
}
v.region = region
return v
}) : []
})
},
toAddSite() {
......
......@@ -40,14 +40,17 @@
<view class="more" @click="toAddress">更多地址></view>
</view>
<view class="body">
<w-address :info="addressInfo" @editSite="editSite" @selectSite="editSite" siteType="view" />
<w-address v-if="addressInfo.id" :info="addressInfo" @editSite="editSite" @selectSite="editSite" siteType="view" />
<view class="u-flex-col u-col-center list" v-if="!addressInfo.id">
<button class="add-button" plain="true" @click="$u.throttle(toAddSite, 500)">填写地址</button>
</view>
</view>
</view>
</view>
<view class="bottom">
<u-button shape="circle" :disabled="isEmptyParts && $u.test.isEmpty(remark)"
:hair-line="false" :custom-style="customStyle"
hover-class="none" @click="submitParts">提交</u-button>
hover-class="none" @click="$u.throttle(submitParts, 500)">提交</u-button>
</view>
</view>
</template>
......@@ -98,6 +101,11 @@ export default {
this.applyType = e && Number(e.applyType) || 0
this.initData()
},
onShow() {
if (!this.addressInfo.id) {
this.loadAddress()
}
},
methods: {
initData() {
this.loadAddress()
......@@ -145,6 +153,14 @@ export default {
}
})
},
toAddSite() {
this.$u.route({
url: 'pages/mine/address/addSite',
params: {
type: 'select'
}
})
},
toAddress() {
this.$u.route({
url: "pages/parts/address"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment