Commit 16c5f708 authored by Facius's avatar Facius

feat: 前台-订单管理高保真;订单页面加载显示优化

parent c0cd6ca7
......@@ -56,11 +56,8 @@
@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"
v-if="noMore"
imageName="zwdd.png"
:customStyle="noOrderCustomStyle"
/>
......@@ -83,6 +80,9 @@
></u-loadmore>
</view>
</template>
<view class="loading-view" v-if="!loaded && !_freshing">
<u-loading mode="flower"></u-loading>
</view>
</scroll-view>
</view>
</TabBarPage>
......@@ -157,6 +157,7 @@ export default {
old: {
scrollTop: 0,
},
cellType: 'waitAppointment',
}
},
computed: {
......@@ -167,9 +168,6 @@ export default {
orderType() {
return this.indexStatus[this.curNow][this.current]
},
cellType() {
return this.orderType == 'waitLianxi' ? '' : this.orderType
},
offset() {
return [
[0, 0],
......@@ -247,7 +245,7 @@ export default {
// tab栏切换
change(index) {
this.current = index
this.orderList = []
// this.orderList = []
this.reloadOrderList()
},
......@@ -277,6 +275,7 @@ export default {
if (self.pageNumber == 1) {
self.orderList = []
}
this.cellType = this.orderType == 'waitLianxi' ? '' : this.orderType
if (res.data.list) {
self.orderList.push(...res.data.list)
if (
......@@ -350,6 +349,7 @@ export default {
})
},
handleClickCellButton(item, type) {
if (!this.loaded) return
if (type == 'exception') {
this.$u.api.workerDealWithError(item.orderId).then(() => {})
}
......@@ -377,6 +377,7 @@ export default {
})
},
handleClick(item, type, showCountTime) {
if (!this.loaded) return
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
......@@ -444,11 +445,12 @@ export default {
}
.loading-view {
width: 100%;
background-color: transparent;
display: flex;
align-items: center;
justify-content: center;
margin-top: 300rpx;
position: absolute;
top: 50%;
position: fixed;
}
}
......
......@@ -8,25 +8,41 @@
:border-bottom="false"
title-bold
></u-navbar>
<view class="header-view">
<view class="title-view">工作数据</view>
<view class="time-view">
<view class="body-view">
<view class="header-view">
<view class="title-view">工作数据</view>
<view class="time-view">
<u-tabs
height="56"
activeColor="#2272FF"
bg-color="none"
inactive-color="#999"
bar-height="4"
bar-width="44"
:offset="offset"
:list="timeTypeTexts"
:current="current"
@change="change"
:is-scroll="false"
font-size="26"
bold
></u-tabs>
</view>
</view>
<view class="line-view"></view>
<view class="content-view">
<view
v-for="(value, key) in timeTypeTexts"
:key="key"
@click="handleSelectTime(key)"
>{{ value }}</view
v-for="(item, index) in detailLabels"
:key="index"
class="item-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 class="left-view" @click="handleClick(item.type)">
<view :class="['count-view', { active: item.type == 'finish' }]">{{
info[item.key] || 0
}}</view>
<view>{{ item.label }}</view>
</view>
</view>
<view v-if="key == 'total'" class="line-view"></view>
</view>
</view>
</view>
......@@ -36,19 +52,30 @@ export default {
data() {
return {
info: {},
offset: [0, 0],
current: 0,
currentTime: 'today',
}
},
computed: {
timeTypeTexts() {
return { today: '今日', yesterday: '昨日', week: '本周', month: '本月' }
return [
{ name: '今日', key: 'today' },
{ name: '昨日', key: 'yesterday' },
{ name: '本周', key: 'week' },
{ name: '本月', key: 'month' },
]
// return { today: '今日', yesterday: '昨日', week: '本周', month: '本月' }
},
detailLabels() {
return {
acceptedCount: { label: '已接单', key: 'waitCheckIn' },
toFinishCount: { label: '已签到', key: 'waitFinish' },
finishedCount: { label: '已完工', key: 'finish' },
}
return [
{ label: '已接单', type: 'waitCheckIn', key: 'acceptedCount' },
{ label: '已签到', type: 'waitFinish', key: 'toFinishCount' },
{ label: '已完工', type: 'finish', key: 'finishedCount' },
]
},
currentKey() {
return this.timeTypeTexts[this.current].key
},
},
onLoad() {
......@@ -67,6 +94,10 @@ export default {
}
})
},
change(index) {
this.current = index
this.getOrderCount()
},
handleSelectTime(key) {
this.currentTime = key
this.getOrderCount()
......@@ -85,45 +116,57 @@ export default {
</script>
<style lang="scss" scoped>
.order-manage-view {
.header-view {
display: flex;
justify-content: space-between;
.body-view {
background-color: #ffffff;
margin: 20rpx 30rpx;
border-radius: 12rpx;
padding: 20rpx 30rpx;
.title-view {
}
.time-view {
.header-view {
display: flex;
justify-content: flex-end;
align-content: center;
justify-content: space-between;
.title-view {
font-size: 32rpx;
color: #333333;
font-weight: bold;
display: flex;
align-items: center;
}
.time-view {
width: 300rpx;
}
}
}
.content-view {
display: flex;
align-self: center;
justify-content: space-around;
padding-top: 56rpx;
padding-bottom: 66rpx;
.item-view {
.line-view {
width: 100%;
background-color: #f4f5f7;
height: 2rpx;
margin: 30rpx 0;
}
.content-view {
display: flex;
align-items: center;
justify-content: center;
.left-view {
text-align: center;
color: #333333;
font-size: 26rpx;
width: 240rpx;
align-self: center;
justify-content: space-around;
padding: 54rpx 0;
.item-view {
display: flex;
align-items: center;
justify-content: center;
.left-view {
text-align: center;
color: #666666;
font-size: 28rpx;
width: 240rpx;
.count-view {
font-weight: bold;
font-size: 48rpx;
margin-bottom: 6rpx;
.count-view {
font-weight: bold;
font-size: 52rpx;
margin-bottom: 20rpx;
color: #333333;
&.active {
color: #2272ff;
}
}
}
}
.line-view {
width: 2rpx;
background-color: #7993ff;
height: 70rpx;
}
}
}
}
......
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