index.vue
3.87 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
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
<template>
<view class="order-icon-btn">
<view class="order-icon-btn-box" @click="queryMyOrderList()">
<view class="order-icon-btn-box-img">
<image :src="orderUrl"></image>
<view class="order-icon-btn-box-img-badge">
<!-- <up-badge max="99" bgColor="#f3a200" :value="messageCount"></up-badge> -->
</view>
</view>
<view class="order-icon-btn-box-label">
我的订单
</view>
</view>
<view class="order-icon-btn-box" @click="queryNoCleanOrderList">
<view class="order-icon-btn-box-img">
<image :src="cleanWaitUrl"></image>
<view class="order-icon-btn-box-img-badge">
<up-badge max="99" bgColor="#f3a200" :value="newBadgeCount"></up-badge>
</view>
</view>
<view class="order-icon-btn-box-label">
待清运
</view>
</view>
<view class="order-icon-btn-box" @click="queryCleanOrderList">
<view class="order-icon-btn-box-img">
<image :src="cleanActiveUrl"></image>
<view class="order-icon-btn-box-img-badge">
<up-badge max="99" bgColor="#f3a200" :value="cleanBadgeCount"></up-badge>
</view>
</view>
<view class="order-icon-btn-box-label">
清运中
</view>
</view>
<view class="order-icon-btn-box" @click="querySuccessOrderList">
<view class="order-icon-btn-box-img">
<image :src="evaluateUrl"></image>
<view class="order-icon-btn-box-img-badge">
</view>
</view>
<view class="order-icon-btn-box-label">
已完成
</view>
</view>
</view>
</template>
<script setup>
import { queryBadgeByType } from "@/apis/order";
import cleanActiveUrl from '@/static/image/clean-active.png';
import cleanWaitUrl from '@/static/image/clean-wait.png';
import evaluateUrl from '@/static/image/evaluate.png';
import orderUrl from '@/static/image/order.png';
import { onShow } from "@dcloudio/uni-app";
import { ref } from 'vue';
const cleanBadgeCount = ref(0);
const newBadgeCount = ref(0);
const queryMyOrderList = () => {
// TODO 查询我的订单
uni.$u.route({
url: `pages/wode-info/wode-info-driver-order/index`,
params: {
type: 2
}
})
}
const queryNoCleanOrderList = () => {
// TODO 查询待清运订单
uni.$u.route({
url: `pages/wode-info/wode-info-driver-order/index`,
params: {
type: 0
}
})
}
const queryCleanOrderList = () => {
// TODO 查询清运中订单
uni.$u.route({
url: `pages/wode-info/wode-info-driver-order/index`,
params: {
type: 1
}
})
}
const querySuccessOrderList = () => {
console.log("querySuccessOrderList");
uni.$u.route({
url: `pages/wode-info/wode-info-driver-order/index`,
params: {
type: 3
}
})
}
const initBadge = () => {
let newType = 0;
let cleanType = 1;
queryBadgeByType(newType).then((res) => {
newBadgeCount.value = res.data.data.badge;
})
queryBadgeByType(cleanType).then((res) => {
cleanBadgeCount.value = res.data.data.badge;
})
}
onShow(() => {
initBadge();
})
</script>
<style lang="scss" scoped>
.order-icon-btn {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 150rpx;
box-sizing: border-box;
padding: 0 30rpx;
background-color: white;
border-radius: 15rpx;
margin-top: 20rpx;
.order-icon-btn-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: $u-main-color;
@include handleClick;
.order-icon-btn-box-img {
margin-bottom: 20rpx;
display: flex;
font-weight: small;
image {
width: 45rpx;
height: 45rpx;
background-size: 100% 100%;
transform: translate(9rpx, 8rpx);
}
.order-icon-btn-box-img-badge {
z-index: 9999;
}
}
.order-icon-btn-box-label {}
}
}
</style>