orderCard.vue
2.29 KB
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
<template>
<view>
<view class="orderCardCss usuallyCard">
<view class="flex justify-between">
<view class="text-lg">
我的订单
</view>
<view class="flex align-center text-gray" @click="goToOrderPage('全部')">
<view class="">查看全部订单</view>
<u-icon name="arrow-right" color="#666666"></u-icon>
</view>
</view>
<view class="margin-top-lg">
<u-line></u-line>
</view>
<view class="flex justify-around margin-top-lg">
<view class="flex flex-direction align-center justify-center" v-for="(item,index) of orderCardList"
:key="`${$assignKeys(item.name)}`">
<view class="" @click="goToOrderPage(item.name)">
<u-image width="30px" height="25px" :src="item.imgIcon" mode="heightFix"></u-image>
</view>
<view class="text-sm margin-top-sm">
{{ item.name }}
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
components: {},
props: {
},
data() {
return {
orderCardList: [{
name: '待付款',
imgIcon: "/static/images/mine/orderCard-01.png",
path: "/pages/mine/emptyPage"
}, {
name: '待配送',
imgIcon: "/static/images/mine/orderCard-02.png",
path: "/pages/mine/appList/gasInformation/gasInformation"
}, {
name: '配送中',
imgIcon: "/static/images/mine/orderCard-03.png",
path: ""
}, {
name: '待评价',
imgIcon: "/static/images/mine/orderCard-04.png",
path: "/pages/mine/emptyPage"
}, ],
checkOrderList: ['待配送', '配送中', '全部']
}
},
computed: {
},
onLoad() {
},
methods: {
goToOrderPage(val) {
console.log('打印orderIndex', val);
let orderIndex = this.checkOrderList.findIndex(el => val == el);
if (orderIndex > -1) {
uni.setStorageSync('orderCardType', val);
uni.switchTab({
url: `/pages/order/order`
})
} else {
let url = this.orderCardList.filter((item) => item.name == val)[0].path;
console.log('打印orderIndex', url);
uni.navigateTo({
url: `${url}?pageName=${val}`
})
// uni.switchTab({
// url:`/pages/order/order`
// })
// this.$modal.msg('待开发')
}
}
}
}
</script>
<style lang="scss" scoped>
.orderCardCss {
margin: 10px;
padding: 20px 10px 20px 10px;
}
</style>