Commit bc8802cb authored by Facius's avatar Facius

feat: 订单列表接口调试

parent d9778aff
<template>
<view class="eusing-view">
<view class="fixed-button">
<ApplyButton
:type.sync="buttonType"
icon="dingdan-button.png"
text="最近查看"
clickedType="hidden"
:show.sync="showApplyButton"
@click="visible = true"
/>
</view>
<FiveOrders
:visible.sync="visible"
@close="showApplyButton = true"
></FiveOrders>
</view>
</template>
<script>
import ApplyButton from '@/components/parts/applyButton.vue'
import FiveOrders from '@/components/order/fiveOrders.vue'
export default {
components: {
ApplyButton,
FiveOrders,
},
props: {
type: {
// 按钮宽'collapse': '80rpx', 'expand': '220rpx'
type: String,
default: 'expand',
},
},
data() {
return {
buttonType: this.type || 'expand', // 申请按钮宽 collapse': '80rpx', 'expand': '220rpx''
showApplyButton: true,
visible: false,
}
},
}
</script>
<style lang="scss" scoped>
.eusing-view {
.fixed-button {
position: fixed;
right: 10rpx;
bottom: 64rpx;
}
}
</style>
......@@ -84,15 +84,19 @@
>
</OrderCell>
</view>
<u-loadmore
<view
class="load-more-view"
v-show="
(search.pageNumber == 1 && loadedOrder) ||
search.pageNumber > 1
"
>
<u-loadmore
:status="currentLoadStatus"
bgColor="#F4F5F7"
></u-loadmore>
</view>
</view>
</template>
</view>
</view>
......@@ -102,20 +106,7 @@
<view class="bottom-line-view"></view>
</view>
</scroll-view>
<view class="fixed-button">
<ApplyButton
:type.sync="buttonType"
icon="dingdan-button.png"
text="最近查看"
clickedType="hidden"
:show.sync="showApplyButton"
@click="visible = true"
/>
</view>
<FiveOrders
:visible.sync="visible"
@close="showApplyButton = true"
></FiveOrders>
<EusingList />
</view>
</TabBarPage>
</template>
......@@ -125,16 +116,14 @@ import TabBarPage from '@/components/tabBarList/index.vue'
import NoOrder from '@/components/order/noOrder.vue'
const app = getApp()
import OrderCell from '@/components/order/index.vue'
import ApplyButton from '@/components/parts/applyButton.vue'
import FiveOrders from '@/components/order/fiveOrders.vue'
import EusingList from '@/components/order/eusingList.vue'
export default {
components: {
OrderCell,
TabBarPage,
NoOrder,
ApplyButton,
FiveOrders,
EusingList,
},
data() {
return {
......@@ -160,9 +149,6 @@ export default {
old: {
scrollTop: 0,
},
buttonType: 'expand', // 申请按钮宽 collapse': '80rpx', 'expand': '220rpx''
showApplyButton: true,
visible: false,
}
},
watch: {
......@@ -593,6 +579,9 @@ export default {
background-color: #f4f5f7;
border-radius: 12rpx;
margin-bottom: 20rpx;
.load-more-view {
padding-bottom: 44rpx;
}
}
}
}
......
......@@ -79,12 +79,11 @@
>
</OrderCell>
</view>
<view class="load-more-view">
<u-loadmore
<view
class="load-more-view"
v-show="(pageNumber == 1 && loaded) || pageNumber > 1"
:status="loadStatus"
bgColor="#F4F5F7"
></u-loadmore>
>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
</template>
<view class="loading-view" v-if="!loaded && !_freshing">
......@@ -92,6 +91,7 @@
</view>
</scroll-view>
</view>
<EusingList type="collapse" />
</TabBarPage>
</template>
......@@ -99,12 +99,14 @@
import TabBarPage from '@/components/tabBarList/index.vue'
import OrderCell from '@/components/order/index.vue'
import NoOrder from '@/components/order/noOrder.vue'
import EusingList from '@/components/order/eusingList.vue'
export default {
components: {
TabBarPage,
OrderCell,
NoOrder,
EusingList,
},
data() {
return {
......@@ -494,7 +496,7 @@ export default {
overflow: auto;
// padding-bottom: 20rpx;
.load-more-view {
margin-bottom: 20rpx;
padding-bottom: 44rpx;
}
.loading-view {
width: 100%;
......
......@@ -36,7 +36,11 @@
:key="index"
class="item-view"
>
<view class="left-view" @click="handleClick(item.type)" hover-class="u-hover-class">
<view
class="left-view"
@click="handleClick(index)"
hover-class="u-hover-class"
>
<view :class="['count-view', { active: item.type == 'finish' }]">{{
info[item.key] || 0
}}</view>
......@@ -44,6 +48,9 @@
</view>
</view>
</view>
<view>
<u-toast ref="uToast" />
</view>
</view>
</view>
</template>
......@@ -60,10 +67,10 @@ export default {
computed: {
timeTypeTexts() {
return [
{ name: '今日', key: 'today' },
{ name: '昨日', key: 'yesterday' },
{ name: '本周', key: 'week' },
{ name: '本月', key: 'month' },
{ name: '今日' },
{ name: '昨日' },
{ name: '本周' },
{ name: '本月' },
]
// return { today: '今日', yesterday: '昨日', week: '本周', month: '本月' }
},
......@@ -71,11 +78,35 @@ export default {
return [
{ label: '已接单', type: 'waitCheckIn', key: 'acceptedCount' },
{ label: '已签到', type: 'waitFinish', key: 'toFinishCount' },
{ label: '已完工', type: 'finish', key: 'finishedCount' },
{ label: '审核中', type: 'audit', key: 'reviewingCount' },
]
},
nextTitle() {
return (
this.timeTypeTexts[this.current].name +
'-' +
this.detailLabels[this.current].label
)
},
params() {
var date = new Date()
var timestamp = date.getTime()
var today = this.$u.timeFormat(timestamp, 'yyyy-mm-dd')
var yesterday = this.$u.timeFormat(date.setDate(date.getDate() - 1))
var weekDays = [6, 0, 1, 2, 3, 4, 5]
var week = this.$u.timeFormat(
date.setDate(date.getDate() - weekDays[date.getDay()])
)
var month = this.$u.timeFormat(date.setDate(1))
return [
{ start: today, end: today },
{ start: yesterday, end: yesterday },
{ start: week, end: today },
{ start: month, end: today },
]
},
currentKey() {
return this.timeTypeTexts[this.current].key
currentParam() {
return this.params[this.current]
},
},
onLoad() {
......@@ -84,7 +115,7 @@ export default {
methods: {
// 获取订单数量
getOrderCount() {
this.$u.api.listOrderCount().then((res) => {
this.$u.api.listOrderCount(this.currentParam).then((res) => {
if (res.code == 200) {
if (res.data) {
this.info = res.data || {}
......@@ -102,14 +133,23 @@ export default {
this.currentTime = key
this.getOrderCount()
},
handleClick(key) {
handleClick(index) {
var item = this.detailLabels[index]
if (this.info[item.key] > 0) {
this.$u.route({
url: 'pages/mine/order/list',
params: {
orderType: key,
timeType: this.currentTime,
orderType: item.type,
title: this.nextTitle,
...this.currentParam,
},
})
} else {
this.$refs.uToast.show({
title: '暂无数据',
type: 'warning',
})
}
},
},
}
......
......@@ -41,12 +41,11 @@
>
</OrderCell>
</view>
<view class="load-more-view">
<u-loadmore
<view
class="load-more-view"
v-show="(pageNumber == 1 && loaded) || pageNumber > 1"
:status="loadStatus"
bgColor="#F4F5F7"
></u-loadmore>
>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
</template>
</scroll-view>
......@@ -73,31 +72,14 @@ export default {
loaded: false,
triggered: true,
_freshing: false,
title: '',
orderType: '',
timeType: '',
timeParam: {},
}
},
computed: {
title() {
return (
this.timeTypeTexts[this.timeType] +
'-' +
this.orderTypeTexts[this.orderType]
)
},
orderTypeTexts() {
return {
waitAppointment: '已接单',
waitCheckIn: '已接单',
waitFinish: '已签到',
finish: '已完工',
}
},
timeTypeTexts() {
return { today: '今日', yesterday: '昨日', week: '本周', month: '本月' }
},
cellType() {
return this.orderType == 'waitLianxi' ? '' : this.orderType
return this.orderType == 'yijiedan' ? '' : this.orderType
},
noMore() {
return this.orderList.length == 0 && this.loaded
......@@ -109,11 +91,14 @@ export default {
onLoad(e) {
getApp().trackPage('订单首页')
this._freshing = false
if (e && e.title) {
this.title = decodeURIComponent(e.title)
}
if (e && e.orderType) {
this.orderType = e.orderType
}
if (e && e.timeType) {
this.timeType = e.timeType
if (e && e.start && e.end) {
this.timeParam = { start: e.start, end: e.end }
}
this.reloadOrderList()
},
......@@ -136,6 +121,7 @@ export default {
pageSize: this.pageSize,
keyword: '',
type: this.orderType,
...this.timeParam,
}
var self = this
self.$u.api.listOrder(param).then((res) => {
......@@ -235,7 +221,7 @@ export default {
overflow: auto;
padding: 20rpx 30rpx;
.load-more-view {
margin-bottom: 20rpx;
padding-bottom: 44rpx;
}
.loading-view {
width: 100%;
......
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