|
@@ -14,16 +14,16 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<ul class="list-unstyled">
|
|
<ul class="list-unstyled">
|
|
|
- <li v-for="(item, index) in listInfo.content">
|
|
|
|
|
- <div class="wrapper-line">
|
|
|
|
|
|
|
+ <li v-for="(item, index) in addressList">
|
|
|
|
|
+ <div class="wrapper-line clearfix">
|
|
|
<div class="name pull-left">{{isSend ? '发货地址:' : '收货地址:'}}</div>
|
|
<div class="name pull-left">{{isSend ? '发货地址:' : '收货地址:'}}</div>
|
|
|
<div class="name-text">{{item.area}}{{item.detailAddress}}</div>
|
|
<div class="name-text">{{item.area}}{{item.detailAddress}}</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="wrapper-line">
|
|
|
|
|
|
|
+ <div class="wrapper-line clearfix">
|
|
|
<div class="name pull-left">{{isSend ? '发货人:' : '收货人:'}}</div>
|
|
<div class="name pull-left">{{isSend ? '发货人:' : '收货人:'}}</div>
|
|
|
<div class="name-text">{{item.name}}</div>
|
|
<div class="name-text">{{item.name}}</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="wrapper-line">
|
|
|
|
|
|
|
+ <div class="wrapper-line clearfix">
|
|
|
<div class="name pull-left">电话:</div>
|
|
<div class="name pull-left">电话:</div>
|
|
|
<div class="name-text">{{item.tel}}</div>
|
|
<div class="name-text">{{item.tel}}</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -42,11 +42,13 @@
|
|
|
</li>
|
|
</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
|
|
|
|
|
- <!--<pull-up :fixId="'logistics-content'"-->
|
|
|
|
|
- <!--:searchMore="isSearchSearchingMore"-->
|
|
|
|
|
- <!--:allPage="allPage"-->
|
|
|
|
|
- <!--:page="param.page"-->
|
|
|
|
|
- <!--@pullUpAction="getMoreSearch"></pull-up>-->
|
|
|
|
|
|
|
+ <pull-up
|
|
|
|
|
+ :searchMore="fetching"
|
|
|
|
|
+ :allPage="allPage"
|
|
|
|
|
+ :page="param.page"
|
|
|
|
|
+ :fixId="'logisticsContent'"
|
|
|
|
|
+ @pullUpAction="getPullAddress">
|
|
|
|
|
+ </pull-up>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -62,6 +64,7 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ addressList: [],
|
|
|
showLogout: false,
|
|
showLogout: false,
|
|
|
// 保存操作数据的序号
|
|
// 保存操作数据的序号
|
|
|
saveId: {
|
|
saveId: {
|
|
@@ -72,14 +75,29 @@
|
|
|
count: 10,
|
|
count: 10,
|
|
|
page: 1,
|
|
page: 1,
|
|
|
sorting: { 'num': 'asc' }
|
|
sorting: { 'num': 'asc' }
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ isChange: false
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ 'listInfo': {
|
|
|
|
|
+ handler: function (val) {
|
|
|
|
|
+ val.content = val.content.sort((a, b) => { return a.num - b.num })
|
|
|
|
|
+ if (this.isChange) {
|
|
|
|
|
+ this.addressList = val.content
|
|
|
|
|
+ this.isChange = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.addressList = [...this.addressList, ...val.content]
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ immediate: true
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 设置默认地址
|
|
// 设置默认地址
|
|
|
setActiveClick (type) {
|
|
setActiveClick (type) {
|
|
|
this.$http.put(`/trade/address/settop/${type}`).then(() => {
|
|
this.$http.put(`/trade/address/settop/${type}`).then(() => {
|
|
|
- this.$store.dispatch('mobileAddress/loadAddressData', {count: 10, page: 1, isSend: this.isSend, sorting: { 'num': 'ASC' }})
|
|
|
|
|
|
|
+ this.initList()
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
// 删除事件
|
|
// 删除事件
|
|
@@ -88,10 +106,13 @@
|
|
|
this.saveId.active = index
|
|
this.saveId.active = index
|
|
|
this.showLogout = true
|
|
this.showLogout = true
|
|
|
},
|
|
},
|
|
|
- goNext () {
|
|
|
|
|
|
|
+ goNext() {
|
|
|
|
|
+ if (this.saveId.active === 0) {
|
|
|
|
|
+ this.setActiveClick(this.addressList[1].id)
|
|
|
|
|
+ }
|
|
|
this.$http.put(`/trade/address/delete/${this.saveId.id}`)
|
|
this.$http.put(`/trade/address/delete/${this.saveId.id}`)
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
- this.$store.dispatch('mobileAddress/loadAddressData', {count: 10, page: 1, isSend: this.isSend, sorting: { 'num': 'ASC' }})
|
|
|
|
|
|
|
+ this.initList()
|
|
|
this.showLogout = false
|
|
this.showLogout = false
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -100,16 +121,30 @@
|
|
|
this.$emit('isEditEvent', type || {}, true)
|
|
this.$emit('isEditEvent', type || {}, true)
|
|
|
},
|
|
},
|
|
|
// 加载更多
|
|
// 加载更多
|
|
|
- getMoreSearch() {}
|
|
|
|
|
|
|
+ getPullAddress() {
|
|
|
|
|
+ this.param.page++
|
|
|
|
|
+ this.reloadList()
|
|
|
|
|
+ },
|
|
|
|
|
+ // 初始化数据页面
|
|
|
|
|
+ initList () {
|
|
|
|
|
+ this.isChange = true
|
|
|
|
|
+ this.param.page = 1
|
|
|
|
|
+ this.reloadList()
|
|
|
|
|
+ },
|
|
|
|
|
+ // 发送请求数据
|
|
|
|
|
+ reloadList () {
|
|
|
|
|
+ this.$store.dispatch('mobileAddress/loadAddressData', {count: this.param.count, page: this.param.page, isSend: this.isSend, sorting: this.param.sorting})
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
listInfo() {
|
|
listInfo() {
|
|
|
- let list = this.baseUtils.deepCopy(this.$store.state.mobileAddress.address.data)
|
|
|
|
|
- list.content = list.content.sort((a, b) => { return a.num - b.num })
|
|
|
|
|
- return list
|
|
|
|
|
|
|
+ return this.baseUtils.deepCopy(this.$store.state.mobileAddress.address.data)
|
|
|
|
|
+ },
|
|
|
|
|
+ fetching () {
|
|
|
|
|
+ return this.$store.state.mobileAddress.address.fetching
|
|
|
},
|
|
},
|
|
|
allPage() {
|
|
allPage() {
|
|
|
- return this.listInfo.totalElements
|
|
|
|
|
|
|
+ return this.listInfo.totalPages
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
components: {
|
|
components: {
|
|
@@ -227,10 +262,12 @@
|
|
|
.name{
|
|
.name{
|
|
|
display:inline-block;
|
|
display:inline-block;
|
|
|
text-align: right;
|
|
text-align: right;
|
|
|
- width:1.5rem;
|
|
|
|
|
|
|
+ width:1.4rem;
|
|
|
|
|
+ font-size: .28rem;
|
|
|
|
|
+ color: #4c8cf7;
|
|
|
}
|
|
}
|
|
|
.name-text {
|
|
.name-text {
|
|
|
- margin-left:1.5rem;
|
|
|
|
|
|
|
+ margin-left:1.4rem;
|
|
|
word-break: break-all;
|
|
word-break: break-all;
|
|
|
word-wrap: break-word;
|
|
word-wrap: break-word;
|
|
|
font-size: 0.28rem;
|
|
font-size: 0.28rem;
|