Commit 9fd10d3f authored by Facius's avatar Facius

feat: 前台-订单管理

parent 7a9d3862
......@@ -295,13 +295,13 @@ export default {
orderType() {
/*
orderStatus:
待接单 orderStatus<31 工单状态小于31
待预约 orderStatus == 31 and appointmentDatetime == null 工单状态等于30并且预约时间为空
待签到 orderStatus == 31 and appointmentDatetime is not null 工单状态等于30并且预约时间不为空
待完工 orderStatus >31 and orderStatus < 80 工单状态大于31 小于80
审核中 orderStatus ==83 or orderStatus == 87 or orderStatus == 88 工单状态 等于85 或者 等于87 或者 等于88
异常 orderStatus ==86 工单状态 等于86
已完工 orderStatus in(80,81,89,110) 工单状态 等于80 or 81 or 89 or 110
待接单 orderStatus<31 工单状态小于31
待预约 orderStatus == 31 and appointmentDatetime == null 工单状态等于30并且预约时间为空
待签到 orderStatus == 31 and appointmentDatetime is not null 工单状态等于30并且预约时间不为空
待完工 orderStatus >31 and orderStatus < 80 工单状态大于31 小于80
审核中 orderStatus ==83 or orderStatus == 87 or orderStatus == 88 工单状态 等于83 或者 等于85 或者 等于87 或者 等于88
异常 orderStatus ==86 工单状态 等于86
已完工 orderStatus in(80,81,89,110) 工单状态 等于80 or 81 or 89 or 110
*/
if (!this.type) {
if (this.orderData.orderStatus < 31) {
......
......@@ -8,7 +8,6 @@
:scroll-top="scrollTop"
@scroll="scroll"
scroll-anchoring
scroll-y="true"
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
......@@ -108,7 +107,6 @@
</template>
<script>
import util from '@/utils/util.js'
import TabBarPage from '@/components/tabBarList/index.vue'
import NoOrder from '@/components/order/noOrder.vue'
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,55 +8,56 @@
:border-bottom="false"
title-bold
></u-navbar>
<scroll-view
scroll-y
style="height: 100%;width: 100%;"
@scrolltolower="reachBottom"
scroll-anchoring
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
:scroll-top="scrollTop"
refresher-background="#F4F5F7"
@refresherrefresh="onRefresh"
@refresherrestore="onRestore"
@scroll="scroll"
enable-back-to-top
>
<view class="loading-view" v-if="!loaded && !_freshing">
<u-loading mode="flower"></u-loading>
</view>
<NoOrder
v-else-if="noMore"
imageName="zwdd.png"
:customStyle="noOrderCustomStyle"
/>
<template v-else>
<view v-for="item in orderList" :key="item.orderId">
<OrderCell
:orderData="item"
:type="cellType"
:location="dataValue"
@click="handleClick"
@action="handleClickCellButton"
>
</OrderCell>
<view class="content-view">
<scroll-view
scroll-y
@scrolltolower="reachBottom"
scroll-anchoring
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
:scroll-top="scrollTop"
refresher-background="#F4F5F7"
@refresherrefresh="onRefresh"
@refresherrestore="onRestore"
enable-back-to-top
>
<view class="loading-view" v-if="!loaded && !_freshing">
<u-loading mode="flower"></u-loading>
</view>
<view class="load-more-view">
<u-loadmore
v-show="(pageNumber == 1 && loaded) || pageNumber > 1"
:status="loadStatus"
bgColor="#F4F5F7"
></u-loadmore>
</view>
</template>
</scroll-view>
<NoOrder
v-else-if="noMore"
imageName="zwdd.png"
:customStyle="noOrderCustomStyle"
/>
<template v-else>
<view v-for="item in orderList" :key="item.orderId">
<OrderCell
:orderData="item"
:type="cellType"
:location="dataValue"
@click="handleClick"
@action="handleClickCellButton"
>
</OrderCell>
</view>
<view class="load-more-view">
<u-loadmore
v-show="(pageNumber == 1 && loaded) || pageNumber > 1"
:status="loadStatus"
bgColor="#F4F5F7"
></u-loadmore>
</view>
</template>
</scroll-view>
</view>
</view>
</template>
<script>
import OrderCell from '@/components/order/index.vue'
import NoOrder from '@/components/order/noOrder.vue'
import Complete from '../../order/complete.vue'
export default {
components: {
......@@ -80,7 +81,7 @@ export default {
computed: {
title() {
return (
this.orderTypeTexts[this.timeType] +
this.timeTypeTexts[this.timeType] +
'-' +
this.orderTypeTexts[this.orderType]
)
......@@ -89,7 +90,7 @@ export default {
return {
waitAppointment: '已接单',
waitCheckIn: '已接单',
waitFinish: '已前到',
waitFinish: '已签到',
finish: '已完工',
}
},
......@@ -115,10 +116,9 @@ export default {
if (e && e.timeType) {
this.timeType = e.timeType
}
this.reloadOrderList()
},
onShow() {
this.reloadOrderInfo()
},
methods: {
reachBottom(e) {
if (this.loadStatus != 'loadmore') return
......@@ -214,15 +214,11 @@ export default {
onRefresh() {
if (this._freshing) return
this._freshing = true
this.reloadOrderInfo()
this.reloadOrderList()
},
onRestore() {
this.triggered = 'restore' // 需要重置
},
reloadOrderInfo() {
this.reloadOrderList()
this.getOrderCount()
},
reloadOrderList() {
this.pageNumber = 0
this.loadStatus = 'loading'
......@@ -236,19 +232,23 @@ export default {
.list-view {
height: 100vh;
overflow: auto;
padding-bottom: 24rpx;
display: flex;
flex-direction: column;
.load-more-view {
margin-bottom: 20rpx;
}
.loading-view {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-top: 300rpx;
position: absolute;
.content-view {
height: 100%;
overflow: auto;
padding: 0rpx 30rpx 20rpx 30rpx;
.load-more-view {
margin-bottom: 20rpx;
}
.loading-view {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-top: 300rpx;
position: absolute;
}
}
}
</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