对接数据库,模拟第三方接入信息
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="header">
|
||||
<text class="title">我的快递</text>
|
||||
<text class="count">共 {{ orders.length }} 个包裹</text>
|
||||
<text class="back-link" @click="goBack">⬅ 返回</text>
|
||||
<view class="header-main">
|
||||
<text class="title">我的快递</text>
|
||||
<text class="count">共 {{ orders.length }} 个包裹</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="tabs">
|
||||
@@ -21,7 +24,7 @@
|
||||
<view class="card-body">
|
||||
<view class="pkg-icon">📦</view>
|
||||
<view class="pkg-info">
|
||||
<text class="latest-msg">{{ getLatestMsg(order.order_no) }}</text>
|
||||
<text class="latest-msg">{{ order.current_status_text || '包裹准备中' }}</text>
|
||||
<text class="order-meta">订单号: {{ order.order_no }}</text>
|
||||
</view>
|
||||
<text class="arrow">></text>
|
||||
@@ -66,8 +69,12 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadData() {
|
||||
this.orders = [...mockService.getMockOrders()]
|
||||
goBack() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
async loadData() {
|
||||
const data = await mockService.getMockOrders()
|
||||
this.orders = [...data]
|
||||
},
|
||||
getStatusText(status: string): string {
|
||||
const maps = {
|
||||
@@ -80,17 +87,6 @@
|
||||
}
|
||||
return (maps[status] != null) ? maps[status] : '处理中'
|
||||
},
|
||||
getLatestMsg(orderNo: string): string {
|
||||
const history = mockService.getMockTracking(orderNo)
|
||||
if (history.length > 0) {
|
||||
const text = history[0].event_text
|
||||
// 消费者端列表页:脱敏处理手机号
|
||||
return text.replace(/(1[3-9]\d{9})/g, (m : string) : string => {
|
||||
return m.substring(0, 3) + '****' + m.substring(7)
|
||||
})
|
||||
}
|
||||
return '包裹准备中'
|
||||
},
|
||||
goDetail(orderNo: string) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/mall/delivery/test/consumer-logistics-detail?order_no=${orderNo}`
|
||||
@@ -109,6 +105,20 @@
|
||||
.header {
|
||||
margin-bottom: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.back-link {
|
||||
font-size: 28rpx;
|
||||
color: #007AFF;
|
||||
cursor: pointer;
|
||||
}
|
||||
.header-main {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user