feat: 优化
This commit is contained in:
parent
b9b20e49da
commit
d983bff677
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
<view class="list" v-if="data.list.length > 0">
|
||||
<view class="order-item" v-for="(item, index) in data.list" :key="index">
|
||||
<view class="top flex-sb">
|
||||
<view class="type flex-l" @click="toDetail(item.id)">{{item.order_info.item_title}}</view>
|
||||
<view class="top flex-sb" @click="toDetail(item.id)">
|
||||
<view class="type flex-l">{{item.order_info.item_title}}</view>
|
||||
<view class="price flex-r important-color" v-if="item.order_info.receive_type === 1">上门报价</view>
|
||||
<view class="price flex-r" v-else>平台已收款</view>
|
||||
</view>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
<view class="distance flex-c" v-else>{{formatDistance(item.order_info.lat, item.order_info.lng)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="discount flex-l" v-if="item.order_info.receive_type === 1">已支付订金:{{item.order_info.online_amount}}元抵扣{{item.order_info.discount_amount}}元</view>
|
||||
<view class="discount flex-l" @click="toDetail(item.id)" v-if="item.order_info.receive_type === 1">已支付订金:{{item.order_info.online_amount}}元抵扣{{item.order_info.discount_amount}}元</view>
|
||||
<view class="btn-ctr flex-sb">
|
||||
<me-button @click="acceptOrder(index, item.id)" text="确认接单" width="460rpx" icon-type="icon-flashlight"></me-button>
|
||||
<me-button @click="rejectOrder(index, item.id)" active-color="var(--contentBgColor)" text="拒 接" width="166rpx" text-color="var(--titleColor)"></me-button>
|
||||
|
|
@ -133,6 +133,12 @@ const data = reactive({
|
|||
list: []
|
||||
})
|
||||
const getList = () => {
|
||||
if (data.page > 1) {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
}
|
||||
|
||||
api.orderDispatchList({page: data.page, page_size: data.page_size}).then(res => {
|
||||
data.last_page = res.last_page
|
||||
if (data.page === 1) {
|
||||
|
|
@ -141,6 +147,7 @@ const getList = () => {
|
|||
data.list = data.list.concat(helpers.deepObj(res.data))
|
||||
}
|
||||
data.is_show_skeleton = false
|
||||
uni.hideLoading();
|
||||
}).catch(() => {}).finally(() => {
|
||||
refreshComplete()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@
|
|||
|
||||
<view class="list" v-if="data.list.length > 0">
|
||||
<view class="order-item" v-for="(item, index) in data.list" :key="index">
|
||||
<view class="top flex-sb">
|
||||
<view class="type flex-l" @click="toDetail(item.id)">{{item.order_info.item_title}}</view>
|
||||
<view class="top flex-sb" @click="toDetail(item.id)">
|
||||
<view class="type flex-l">{{item.order_info.item_title}}</view>
|
||||
<view class="price flex-r important-color" v-if="item.order_info.receive_type === 1">上门报价</view>
|
||||
<view class="price flex-r" v-else>平台已收款</view>
|
||||
</view>
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="user flex-sb">
|
||||
<view class="left">
|
||||
<view class="left" @click="toDetail(item.id)">
|
||||
<view class="user-name flex-l">
|
||||
<me-icon type="icon-user" color="var(--descriptionColor)" size="36rpx"></me-icon>
|
||||
<view class="name">{{ item.order_info.customer }}</view>
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="operate-ctr flex-sb">
|
||||
<view class="status-ctr flex-l">
|
||||
<view class="status-ctr flex-l" @click="toDetail(item.id)">
|
||||
<me-icon type="icon-progress-2-line" color="#E18F00" size="40rpx"></me-icon>
|
||||
<text class="text">{{getOrderStatusText(item.status)}}</text>
|
||||
</view>
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {onLoad, onShow} from '@dcloudio/uni-app'
|
||||
import {onLoad, onShow, onReachBottom} from '@dcloudio/uni-app'
|
||||
import {ref, reactive, computed, watch, inject} from 'vue'
|
||||
import MeIcon from "../../components/me-icon/me-icon";
|
||||
import MeEmptySpace from "../../components/me-empty-space/me-empty-space";
|
||||
|
|
@ -86,6 +86,13 @@ import helpers from "../../utils/helpers";
|
|||
import enums from "../../utils/enums";
|
||||
import WorkbenchSkeleton from "./workbench-skeleton";
|
||||
|
||||
onReachBottom(() => {
|
||||
if (data.page < data.last_page) {
|
||||
data.page = data.page + 1
|
||||
getList()
|
||||
}
|
||||
})
|
||||
|
||||
//订单详情
|
||||
const toDetail = (id) => {
|
||||
helpers.jumpToPage('order-info', `id=${id}`)
|
||||
|
|
@ -175,6 +182,12 @@ const data = reactive({
|
|||
list: null
|
||||
})
|
||||
const getList = () => {
|
||||
if (data.page > 1) {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
}
|
||||
|
||||
let params = {
|
||||
page: data.page,
|
||||
page_size: data.page_size,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user