first commit
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
<!--#
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.van-cell-group--inset {
|
||||
margin: 0 16px;
|
||||
overflow: hidden;
|
||||
border-radius: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-sticky>
|
||||
<van-nav-bar title="地址管理" left-arrow placeholder fixed
|
||||
@click-left="history.back()"></van-nav-bar>
|
||||
</van-sticky>
|
||||
|
||||
<div v-if="vLoading && !vLoading.value">
|
||||
<van-address-edit
|
||||
ref="address"
|
||||
:area-list="areaList"
|
||||
:show-delete="addressId"
|
||||
:address-info="addressInfo"
|
||||
show-set-default
|
||||
show-search-result
|
||||
tel-maxlength="11"
|
||||
:area-columns-placeholder="['请选择', '请选择', '请选择']"
|
||||
@save="onSave"
|
||||
@delete="onDelete"
|
||||
></van-address-edit>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("/mobile/welfare/include/areaList.js"){};include("/mobile/welfare/include/mixins.js"){}#-->
|
||||
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [mobileMixins, welfareMixins],
|
||||
data() {
|
||||
return {
|
||||
areaList: areaList,
|
||||
addressInfo: {},
|
||||
addressId: null
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async onSave(content) {
|
||||
const loading = this.$toast.loading({
|
||||
message: '保存中...',
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
content.userName = content.name
|
||||
const resp = await $.post('/mobile/welfare/mine/doSaveUserAddress', content)
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$toast.success(resp.msg)
|
||||
setTimeout(() => {
|
||||
let welfareProjectId = window.sessionStorage.getItem("welfareProjectId");
|
||||
if (welfareProjectId) {
|
||||
location.replace('/mobile/welfare/list/receive?projectId=' + welfareProjectId)
|
||||
window.sessionStorage.removeItem("welfareProjectId");
|
||||
} else {
|
||||
location.replace('/mobile/welfare/mine/address')
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
},
|
||||
async onDelete(content) {
|
||||
const loading = this.$toast.loading({
|
||||
message: '删除中...',
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
const resp = await $.post('/mobile/welfare/mine/deleteAddress', {id: content.id})
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$toast.success(resp.msg)
|
||||
setTimeout(() => {
|
||||
window.location.replace('/mobile/welfare/mine/address')
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.startLoading()
|
||||
this.addressId = GetQueryString("id") === '' ? null : GetQueryString("id")
|
||||
if (this.addressId) {
|
||||
const resp = await $.get('/mobile/welfare/mine/findOneUserAddress', {id: this.addressId})
|
||||
if (resp.code === 0) {
|
||||
this.addressInfo = resp.data
|
||||
}
|
||||
this.closeLoading()
|
||||
} else {
|
||||
this.addressInfo.name = "${@shiro.getPrincipalProperty('username')}";
|
||||
this.closeLoading()
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user