【类 型】:feat
【主 题】:主页显示 已付款订单信息 实时显示 【描 述】: [原因]: [过程]: [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
1efa9308f2
commit
1cbfd0ae03
@ -20,6 +20,14 @@
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
<!-- 新订单 提示框 -->
|
||||
<!-- 新订单提示框 -->
|
||||
<view v-for="(item, index) in orderList" :key="index">
|
||||
订单:{{ item.order_sn }}
|
||||
<text v-if="item.status === 'pending'">状态:已付款</text>
|
||||
<text v-else-if="item.status === 'processing'">状态:备货中</text>
|
||||
<text v-else-if="item.status === 'shipped'">状态:已发货</text>
|
||||
</view>
|
||||
<!-- 主按钮 -->
|
||||
<view class="flex mse" style="height: 222rpx;margin-top: 30rpx;">
|
||||
<navigator url="/pages/shop/list">
|
||||
@ -57,6 +65,11 @@
|
||||
computed: {
|
||||
userInfo() {
|
||||
return this.$store.state.userInfo
|
||||
},
|
||||
//订单列表 过滤出 已付款的状态订单 (包括 已付款 备货中 已发货)
|
||||
orderList() {
|
||||
const validStatuses = ['pending', 'processing', 'shipped'];
|
||||
return this.$store.state.orderList.filter(item => validStatuses.includes(item.status));
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
@ -67,9 +80,9 @@
|
||||
this.checkUserInfo()
|
||||
// 当页面显示时,设置tabber的激活项
|
||||
this.$store.commit('setTabbarCurrent', 0)
|
||||
console.log(this.orderList)
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 检查用户信息
|
||||
checkUserInfo() {
|
||||
return checkUserInfo(this.$store)
|
||||
|
Loading…
Reference in New Issue
Block a user