Commit 9fd10d3f authored by Facius's avatar Facius

feat: 前台-订单管理

parent 7a9d3862
...@@ -299,7 +299,7 @@ export default { ...@@ -299,7 +299,7 @@ export default {
待预约 orderStatus == 31 and appointmentDatetime == null 工单状态等于30并且预约时间为空 待预约 orderStatus == 31 and appointmentDatetime == null 工单状态等于30并且预约时间为空
待签到 orderStatus == 31 and appointmentDatetime is not null 工单状态等于30并且预约时间不为空 待签到 orderStatus == 31 and appointmentDatetime is not null 工单状态等于30并且预约时间不为空
待完工 orderStatus >31 and orderStatus < 80 工单状态大于31 小于80 待完工 orderStatus >31 and orderStatus < 80 工单状态大于31 小于80
审核中 orderStatus ==83 or orderStatus == 87 or orderStatus == 88 工单状态 等于85 或者 等于87 或者 等于88 审核中 orderStatus ==83 or orderStatus == 87 or orderStatus == 88 工单状态 等于83 或者 等于85 或者 等于87 或者 等于88
异常 orderStatus ==86 工单状态 等于86 异常 orderStatus ==86 工单状态 等于86
已完工 orderStatus in(80,81,89,110) 工单状态 等于80 or 81 or 89 or 110 已完工 orderStatus in(80,81,89,110) 工单状态 等于80 or 81 or 89 or 110
*/ */
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
:scroll-top="scrollTop" :scroll-top="scrollTop"
@scroll="scroll" @scroll="scroll"
scroll-anchoring scroll-anchoring
scroll-y="true"
refresher-enabled="true" refresher-enabled="true"
:refresher-triggered="triggered" :refresher-triggered="triggered"
:refresher-threshold="100" :refresher-threshold="100"
...@@ -108,7 +107,6 @@ ...@@ -108,7 +107,6 @@
</template> </template>
<script> <script>
import util from '@/utils/util.js'
import TabBarPage from '@/components/tabBarList/index.vue' import TabBarPage from '@/components/tabBarList/index.vue'
import NoOrder from '@/components/order/noOrder.vue' import NoOrder from '@/components/order/noOrder.vue'
const app = getApp() const app = getApp()
......
<template>
<view class="order-manage-view">
<u-navbar
back-icon-color="#333333"
background="#FFFFFF"
title="订单管理"
titleColor="#333333"
:border-bottom="false"
title-bold
></u-navbar>
<view class="header-view">
<view class="title-view">工作数据</view>
<view class="time-view">
<view
v-for="(value, key) in timeTypeTexts"
:key="key"
@click="handleSelectTime(key)"
>{{ value }}</view
>
</view>
</view>
<view class="content-view">
<view v-for="(value, key) in detailLabels" :key="key" class="item-view">
<view v-if="key == 'total'" class="line-view"></view>
<view class="left-view" @click="handleClick(value.key)">
<view class="count-view">{{ info[key] || 0 }}</view>
<view>{{ value.label }}</view>
</view>
<view v-if="key == 'total'" class="line-view"></view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
info: {},
currentTime: 'today',
}
},
computed: {
timeTypeTexts() {
return { today: '今日', yesterday: '昨日', week: '本周', month: '本月' }
},
detailLabels() {
return {
acceptedCount: { label: '已接单', key: 'waitCheckIn' },
toFinishCount: { label: '已签到', key: 'waitFinish' },
finishedCount: { label: '已完工', key: 'finish' },
}
},
},
onLoad() {
this.getOrderCount()
},
methods: {
// 获取订单数量
getOrderCount() {
this.$u.api.listOrderCount().then((res) => {
if (res.code == 200) {
if (res.data) {
this.info = res.data || {}
}
} else {
console.log(res.message, '获取订单数量失败!')
}
})
},
handleSelectTime(key) {
this.currentTime = key
this.getOrderCount()
},
handleClick(key) {
this.$u.route({
url: 'pages/mine/order/list',
params: {
orderType: key,
timeType: this.currentTime,
},
})
},
},
}
</script>
<style lang="scss" scoped>
.order-manage-view {
.header-view {
display: flex;
justify-content: space-between;
padding: 0rpx 30rpx;
.title-view {
}
.time-view {
display: flex;
justify-content: flex-end;
align-content: center;
}
}
.content-view {
display: flex;
align-self: center;
justify-content: space-around;
padding-top: 56rpx;
padding-bottom: 66rpx;
.item-view {
display: flex;
align-items: center;
justify-content: center;
.left-view {
text-align: center;
color: #333333;
font-size: 26rpx;
width: 240rpx;
.count-view {
font-weight: bold;
font-size: 48rpx;
margin-bottom: 6rpx;
}
}
.line-view {
width: 2rpx;
background-color: #7993ff;
height: 70rpx;
}
}
}
}
</style>
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
:border-bottom="false" :border-bottom="false"
title-bold title-bold
></u-navbar> ></u-navbar>
<view class="content-view">
<scroll-view <scroll-view
scroll-y scroll-y
style="height: 100%;width: 100%;"
@scrolltolower="reachBottom" @scrolltolower="reachBottom"
scroll-anchoring scroll-anchoring
refresher-enabled="true" refresher-enabled="true"
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
refresher-background="#F4F5F7" refresher-background="#F4F5F7"
@refresherrefresh="onRefresh" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" @refresherrestore="onRestore"
@scroll="scroll"
enable-back-to-top enable-back-to-top
> >
<view class="loading-view" v-if="!loaded && !_freshing"> <view class="loading-view" v-if="!loaded && !_freshing">
...@@ -52,11 +51,13 @@ ...@@ -52,11 +51,13 @@
</template> </template>
</scroll-view> </scroll-view>
</view> </view>
</view>
</template> </template>
<script> <script>
import OrderCell from '@/components/order/index.vue' import OrderCell from '@/components/order/index.vue'
import NoOrder from '@/components/order/noOrder.vue' import NoOrder from '@/components/order/noOrder.vue'
import Complete from '../../order/complete.vue'
export default { export default {
components: { components: {
...@@ -80,7 +81,7 @@ export default { ...@@ -80,7 +81,7 @@ export default {
computed: { computed: {
title() { title() {
return ( return (
this.orderTypeTexts[this.timeType] + this.timeTypeTexts[this.timeType] +
'-' + '-' +
this.orderTypeTexts[this.orderType] this.orderTypeTexts[this.orderType]
) )
...@@ -89,7 +90,7 @@ export default { ...@@ -89,7 +90,7 @@ export default {
return { return {
waitAppointment: '已接单', waitAppointment: '已接单',
waitCheckIn: '已接单', waitCheckIn: '已接单',
waitFinish: '已前到', waitFinish: '已签到',
finish: '已完工', finish: '已完工',
} }
}, },
...@@ -115,10 +116,9 @@ export default { ...@@ -115,10 +116,9 @@ export default {
if (e && e.timeType) { if (e && e.timeType) {
this.timeType = e.timeType this.timeType = e.timeType
} }
this.reloadOrderList()
}, },
onShow() {
this.reloadOrderInfo()
},
methods: { methods: {
reachBottom(e) { reachBottom(e) {
if (this.loadStatus != 'loadmore') return if (this.loadStatus != 'loadmore') return
...@@ -214,15 +214,11 @@ export default { ...@@ -214,15 +214,11 @@ export default {
onRefresh() { onRefresh() {
if (this._freshing) return if (this._freshing) return
this._freshing = true this._freshing = true
this.reloadOrderInfo() this.reloadOrderList()
}, },
onRestore() { onRestore() {
this.triggered = 'restore' // 需要重置 this.triggered = 'restore' // 需要重置
}, },
reloadOrderInfo() {
this.reloadOrderList()
this.getOrderCount()
},
reloadOrderList() { reloadOrderList() {
this.pageNumber = 0 this.pageNumber = 0
this.loadStatus = 'loading' this.loadStatus = 'loading'
...@@ -236,9 +232,12 @@ export default { ...@@ -236,9 +232,12 @@ export default {
.list-view { .list-view {
height: 100vh; height: 100vh;
overflow: auto; overflow: auto;
padding-bottom: 24rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.content-view {
height: 100%;
overflow: auto;
padding: 0rpx 30rpx 20rpx 30rpx;
.load-more-view { .load-more-view {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
...@@ -250,5 +249,6 @@ export default { ...@@ -250,5 +249,6 @@ export default {
margin-top: 300rpx; margin-top: 300rpx;
position: absolute; position: absolute;
} }
}
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment