1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<template>
<div class="address2">
<div class="item" v-if="deliverDetail && isShowCurrent">
<div class="head next">
<i style="background:#60ADF0"></i>
本期收货地址
<!-- <span class="fl-r" @click="goEdit" v-if="deliverDetail.flag">
<span class="iconfont icon-icon_edit"></span> 修改
</span>
<span class="fl-r Invalid" v-if="!deliverDetail.flag">
<span class="iconfont icon-icon_edit"></span> 修改
</span>-->
</div>
<div class="content" v-if="deliverDetail">
<div class="top">
<span>{{deliverDetail.receive_name}}</span>
<span>{{deliverDetail.receive_mobile}}</span>
</div>
<div
class="bottom"
>{{deliverDetail.province_name}} {{deliverDetail.city_name}}{{deliverDetail.area_name}}{{deliverDetail.address}}</div>
<div class="line"></div>
<div class="timeInfo">
<div class="text">
<!-- <p>地址修改时间:{{deliverDetail.updated_at}}</p> -->
<p v-if="!!deliverDetail.express_no">发货时间:{{deliverDetail.deliver_at}}</p>
<p
v-if="!!!deliverDetail.express_no"
>预计发货时间:{{deliverDetail.deliver_start_at}}-{{deliverDetail.deliver_end_at}}</p>
<div v-if="!!deliverDetail.express_no && deliverDetail.status == 1" class="express-no">
<span>物流信息:</span>
<span style="flex: 1;">{{deliverDetail.express_name}} {{deliverDetail.express_no}}</span>
<van-button round size="small" @click="search(1)" type="info">查看物流</van-button>
</div>
<div v-if="!!!deliverDetail.express_no && deliverDetail.status == 0" class="express-no">
<span>物流信息:</span>
<span style="flex: 1;">待发货</span>
</div>
<!-- <div v-if="!deliverDetail.express_no">物流信息:- -</div> -->
</div>
</div>
</div>
</div>
<div class="item" v-if="noDeliverDetail && isShowNext">
<div class="head next">
<i style="background:#FFD454"></i>
下期收货地址
<span class="fl-r" @click="goEdit">
<span class="iconfont icon-icon_edit"></span> 修改
</span>
<!-- <span class="fl-r Invalid" v-if="noDeliverDetail.flag == 0">
<span class="iconfont icon-icon_edit"></span> 修改
</span>-->
<!-- <span class="fl-r" @click="goEdit">
<span class="iconfont icon-icon_edit"></span> 修改
</span>-->
</div>
<div class="content">
<div class="top">
<span>{{noDeliverDetail.receive_name}}</span>
<span>{{noDeliverDetail.receive_mobile}}</span>
</div>
<div
class="bottom"
>{{noDeliverDetail.province_name}} {{noDeliverDetail.city_name}}{{noDeliverDetail.area_name}}{{noDeliverDetail.address}}</div>
<div class="line"></div>
<div class="timeInfo">
<div class="text">
<!-- <p>地址修改时间:{{noDeliverDetail.updated_at}}</p> -->
<p
v-if="!!!noDeliverDetail.express_no"
>预计发货时间:{{noDeliverDetail.deliver_start_at}}-{{noDeliverDetail.deliver_end_at}}</p>
<div
v-if="!!noDeliverDetail.express_no && noDeliverDetail.status == 1"
style="justify-content:space-between;"
>
物流信息:{{noDeliverDetail.express_name}} {{noDeliverDetail.express_no}}
<van-button round size="small" @click="search(2)" type="info">查看物流</van-button>
</div>
<div
v-if="!!!noDeliverDetail.express_no && noDeliverDetail.status == 0"
style="justify-content:space-between;"
>物流信息:待发货</div>
<!-- <div v-if="!noDeliverDetail.express_no">物流信息:- -</div> -->
</div>
</div>
</div>
</div>
<div class="tip" v-if="(deliverDetail && isShowCurrent)|| (noDeliverDetail && isShowNext )">
<div class="tip-title">*</div>
<div style="white-space: wrap;flex:1;">预计发货时间内不可修改地址,若有需要请联系您的专属班主任老师</div>
</div>
</div>
<!-- <div class="address2">
<div class="content">
<div class="top">
<span>{{addressInfo.receive_name}}</span>
<span>{{addressInfo.receive_mobile}}</span>
</div>
<div class="bottom">{{addressInfo.province_name}} {{addressInfo.city}}{{addressInfo.area}}{{addressInfo.address}}</div>
</div>
<div class="linebox">
<img class="line" :src="line" alt>
</div>
<div class="tip">
<p>(最新地址修改时间:{{addressInfo.updated_at}})</p>
<p>*若要修改收货地址,请联系您的专属班主任老师</p>
</div>
</div>-->
</template>
<script>
import line from "../../assets/activity/img_line@2x.png";
import { shopSuccess } from "../../util/imgUrl";
import { getNewestAddressListAPi } from "../../service/api";
import { Toast } from "vant";
export default {
name: "Address",
components: {},
data() {
return {
line: line,
isShowCurrent: false,
isShowNext: false,
addressInfo: null,
noDeliverDetail: null, //下期收货地址
deliverDetail: null //本期收货地址
};
},
mounted() {
this.initPage();
},
methods: {
initPage() {
getNewestAddressListAPi()
.then(res => {
// this.starNum = res.last_value
// res = {
// code: 505,
// msg: "该用户没有物流信息"
// };
if (res) {
if (res.deliver_detail) {
if (typeof res.deliver_detail == "object") {
if (res.deliver_detail instanceof Array) {
if (res.deliver_detail.length > 0) {
this.deliverDetail = res.deliver_detail[0];
}
} else {
this.deliverDetail = res.deliver_detail;
}
}
}
if (res.no_deliver_detail) {
if (typeof res.no_deliver_detail == "object") {
if (res.no_deliver_detail instanceof Array) {
if (res.no_deliver_detail.length > 0) {
this.noDeliverDetail = res.no_deliver_detail[0];
}
} else {
this.noDeliverDetail = res.no_deliver_detail;
}
}
}
if (this.deliverDetail) {
if (
!this.deliverDetail.receive_name ||
this.deliverDetail.receive_name.length === 0 ||
!this.deliverDetail.receive_mobile ||
this.deliverDetail.receive_mobile.length === 0 ||
!this.deliverDetail.address ||
this.deliverDetail.address.length === 0
) {
this.isShowCurrent = false;
} else {
this.isShowCurrent = true;
}
} else {
this.isShowCurrent = false;
}
if (this.noDeliverDetail) {
if (
!this.noDeliverDetail.receive_name ||
this.noDeliverDetail.receive_name.length === 0 ||
!this.noDeliverDetail.receive_mobile ||
this.noDeliverDetail.receive_mobile.length === 0 ||
!this.noDeliverDetail.address ||
this.noDeliverDetail.address.length === 0
) {
this.isShowNext = false;
} else {
this.isShowNext = true;
}
} else {
this.isShowNext = false;
}
}
})
.catch(error => {
console.log(error);
});
},
goEdit() {
this.$router.push({
name: "addressModify",
params: { data: JSON.stringify(this.noDeliverDetail) }
});
},
search(index) {
let express_no =
index == 1
? this.deliverDetail.express_no
: this.noDeliverDetail.express_no;
window.location = `https://m.baidu.com/from=1013755s/s?word=${express_no}&sa=tb&ts=2790568&t_kt=0&ie=utf-8&rsv_t=cbe2F%252FT5T3MIzkRl%252Fg8ZUw%252FEPHZmn2wHIrB8cLvgNlEKyyDqUNPrTyDEEDjkAb8&rsv_pq=11793168499026332712&ss=110000000001&tj=1&rqlang=zh&rsv_sug4=4111&inputT=3178&oq=快递单号查询`;
}
}
};
</script>
<style scoped lang="less">
@import "../../util/public";
@import "../../util/public";
.address2 {
background: #f5f5f9;
.van-button {
margin-left: 20 * @toVw;
margin-right: 20 * @toVw;
}
.van-button__text {
padding: 10 * @toVw;
}
.head {
i {
display: inline-block;
border-radius: 50%;
width: 11 * @toVw;
height: 11 * @toVw;
}
padding: 13 * @toVw;
background: white;
border-bottom: 1px solid #e2e2e2;
color: #666666;
font-size: 14 * @toVw;
}
.Invalid {
color: #cccccc;
}
.now {
i {
background: #60adf0;
}
}
.item {
margin-top: 10px;
}
.next {
i {
background: #ffd454;
}
}
.content {
background: white;
padding: 13 * @toVw 0 13 * @toVw 26 * @toVw;
.top {
line-height: 28 * @toVw;
color: #333333;
font-weight: bold;
font-size: 17 * @toVw;
}
.bottom {
color: #666666;
font-size: 14 * @toVw;
line-height: 20 * @toVw;
}
.timeInfo {
display: flex;
.text {
color: #999999;
font-size: 12 * @toVw;
margin-left: 0;
line-height: 26 * @toVw;
width: 100%;
.express-no {
display: flex;
justify-content: space-between;
}
}
.right {
margin-top: 43 * @toVw;
}
.van-button--info {
background: white;
// width: 74 * @toVw;
color: #60adf0;
border-color: #60adf0;
}
}
}
.linebox {
background: white;
}
.line {
width: 100%;
display: block;
border-bottom: 1px solid #e2e2e2;
margin: 12 * @toVw 0;
-webkit-transform: scale(1, 0.5);
}
.tip {
width: 90%;
margin: 10 * @toVw auto;
letter-spacing: 0;
color: #999999;
font-size: 12 * @toVw;
// line-height: 23 * @toVw;
display: flex;
.tip-title {
margin-top: 2 * @toVw;
margin-right: 4 * @toVw;
}
}
}
@media screen and (orientation: landscape) {
}
</style>