Commit 16c5f708 authored by Facius's avatar Facius

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

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