From 2d43a1df3f5ba42710e6d21c27d1e13bdb8dfd56 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期一, 24 三月 2025 09:23:08 +0800
Subject: [PATCH] -
---
src/pages/order/order.vue | 175 ++++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 140 insertions(+), 35 deletions(-)
diff --git a/src/pages/order/order.vue b/src/pages/order/order.vue
index 6a35a8e..22b8ba7 100644
--- a/src/pages/order/order.vue
+++ b/src/pages/order/order.vue
@@ -1,23 +1,22 @@
<template>
- <view>
+ <view class="full-page" scroll-y using-sticky>
<up-sticky bgColor="#fff">
<view class="coreshop-ff content c-p-10">
<!-- <up-search placeholder="璇风偣鍑婚�夋嫨鏃ユ湡" @clear='clear' @clickIcon='clickTime' @custom='search'
v-model="workTime" search-icon="calendar" @search='search'></up-search> -->
- <up-search placeholder="璇疯緭鍏ュ伐浣滃悕绉�" @clear='clear' @clickIcon='clickTime' @custom='search'
- v-model="state.orderName" @search='search'></up-search>
+ <up-search placeholder="璇疯緭鍏ュ伐浣滃悕绉�" @clear='clear' @custom='PostMyListPageCompany'
+ v-model="state.orderName" @search='PostMyListPageCompany'></up-search>
</view>
- <!-- <up-subsection :list="list" :current="current4" activeColor="#f9ae3d"
- @change="sectionChange"></up-subsection> -->
+ <up-subsection :list="list" current="1" activeColor="#f9ae3d" @change="sectionChange"></up-subsection>
</up-sticky>
- <view class="full-page">
+ <view class="full-page-content">
<view class="c-p-l-20 c-p-r-20" v-if="listO.orderList&&listO.orderList.length>0">
<view class="listrecord c-p-t-20" v-for="(item,index) in listO.orderList" :key="item.id"
@click="pageToDetail(item)">
- <view class="coreshop-ff chuany-bradius20">
- <view class="c-p-26">
+ <view class="coreshop-ff chuany-bradius20 ">
+ <view class="c-p-24">
<view class="chuany-flex chuany-justify-between">
- <text class="chuany-font34 chuany-text-bold">
+ <text class="chuany-font32">
{{item.orderName}}
</text>
<view class="chuany-flex chuany-justify-between">
@@ -25,27 +24,55 @@
<!-- <text class="c-p-r-20">
</text> -->
- <up-tag class='c-m-r-10' :text="item.orderStatusName" shape="circle" type="success"
- plain plainFill size='mini'></up-tag>
+ <!-- <up-tag class='c-m-r-10' :text="item.orderStatusName" shape="circle" type="success"
+ plain plainFill size='mini'></up-tag> -->
+ <up-text v-if="item.isEn" :type="item.orderStatus==0?'primary':'success'"
+ :text="item.orderStatusName" size='12'></up-text>
+ <up-text v-else type="error" text="宸蹭笅鏋�" size='12'></up-text>
+
+ <!-- <up-button class='c-m-r-10' :text="item.isEn?'涓嬫灦':'涓婃灦'" disabled shape="circle"
+ v-if="item.orderStatus==0" :type="item.isEn?'error':'primary'" size='mini'
+ @click.stop="manageOrder(item)"></up-button> -->
</view>
</view>
- <view class="c-p-t-14">
- 鏃ユ湡锛歿{$util.formatDate(item.wordStartTime)}} 鑷� {{$util.formatDate(item.wordEndTime)}}
- </view>
- <view class="c-p-t-14">
- 鏃堕棿锛歿{item.startTimeName}} 鑷� {{item.endTimeName}}
- </view>
- <view class="chuany-flex chuany-justify-between c-p-t-14">
- <view class="chuany-width50">
- <text>
- 鏂瑰紡锛歿{item.workerType==0?'璁℃椂':'璁′欢'}}
- </text>
+ <view class="text-69 chuany-font28">
+ <view class="">
+ 鏃ユ湡锛歿{$util.formatDate(item.wordStartTime)}} 鑷� {{$util.formatDate(item.wordEndTime)}}
</view>
- <view class="chuany-width50">
- 宸ヤ环锛歿{item.workPrice}}{{item.workerType==0?'鍏�/灏忔椂':'鍏�/浠�'}}
- <text></text>
+ <view class="chuany-flex chuany-justify-between chuany-flex-wrap">
+ <view class="chuany-width50" v-if="item.zixinganpai">
+ 鏃堕棿锛歿{item.zixinganpaiName}}
+ </view>
+ <view class="chuany-width50" v-else>
+ 鏃堕棿锛歿{item.startTimeName}} 鑷� {{item.endTimeName}}
+ </view>
+ <view class="chuany-width50">
+ <text>
+ 鏂瑰紡锛歿{item.workerType==0?'璁℃椂':'璁′欢'}}
+ </text>
+ </view>
+ <view class="chuany-width50">
+ 宸叉嫑浜烘暟锛歿{item.worderCounted}} 浜�
+ </view>
+ <view class="chuany-width50">
+ <text>
+ 寰呭鏍镐汉鏁帮細{{item.workerDaiCount}} 浜�
+ </text>
+ </view>
+ <view class="chuany-width50">
+ 宸ヤ环锛歿{item.workPrice}}<template
+ v-if="item.workPriceMax">~{{item.workPriceMax}}</template>
+ {{item.workerType==0?'鍏�/灏忔椂':'鍏�/浠�'}}
+ </view>
+ <view class="">
+ <up-button hoverStopPropagation :text="item.isEn?'涓嬫灦':'涓婃灦'" shape="circle"
+ :loading='item.isLoading' :loadingText="item.isEn?'涓嬫灦涓�':'涓婃灦涓�'"
+ v-if="item.orderStatus==0" :type="item.isEn?'error':'primary'" size='mini'
+ @tap.stop="manageOrder(item)"></up-button>
+ </view>
</view>
</view>
+
</view>
</view>
</view>
@@ -65,7 +92,8 @@
import {
onLoad,
onShow,
- onReachBottom
+ onReachBottom,
+ onPullDownRefresh
} from "@dcloudio/uni-app";
import {
reactive,
@@ -87,6 +115,7 @@
let datePickerShow = ref(false)
let loadStatus = ref('loadmore')
let totalPages = ref(0)
+ let isEn = ref(true)
let listO = reactive({
orderList: []
})
@@ -95,34 +124,38 @@
PostMyListPageCompany();
}
})
- onLoad(() => {
+ onShow(() => {
PostMyListPageCompany()
})
+ onPullDownRefresh(() => {
+ state.pageIndex = 1
+ state.pageSize = 20
+ loadStatus.value = 'loadmore'
+ PostMyListPageCompany()
+ uni.stopPullDownRefresh();
+ })
const current4 = ref(0);
- const list = ref(['鍏ㄩ儴', '鍙戝竷', '鎷涘伐瀹屾瘯', '缁撶畻瀹屾瘯']);
+ const list = ref(['鍏ㄩ儴', '鍙戝竷涓�', '宸蹭笅鏋�']);
const changePicker = (val) => {
console.log(val);
workTime.value = val.startDate.result + '鑷�' + val.endDate.result
state.wordStartTime = new Date(val.startDate.result) //宸ヤ綔寮�濮嬫椂闂�
state.wordEndTime = new Date(val.endDate.result)
}
-
- const search = (index) => {
- PostMyListPageCompany()
- }
const clear = () => {
state.orderName = ''
state.wordStartTime = ""
state.wordEndTime = ""
+ PostMyListPageCompany()
}
const clickTime = () => {
datePickerShow.value = !datePickerShow.value
}
- const PostMyListPageCompany = (orderStatus) => {
+ const PostMyListPageCompany = () => {
let data = {
pageIndex: state.pageIndex,
pageSize: state.pageSize,
- orderStatus
+ isEn: isEn.value
}
if (state.wordStartTime) {
data.wordStartTime = state.wordStartTime
@@ -140,8 +173,11 @@
if (state.pageIndex == 1) {
listO.orderList = res.data.items
} else {
- listO.orderList.concat(...res.data.items)
+ listO.orderList = listO.orderList.concat(...res.data.items)
}
+ listO.orderList.forEach(item => {
+ item.isLoading = false
+ })
console.log(listO.orderList, 'listO.orderList鈥�');
// totalPages.value = res.data.totalCount
// 鏍规嵁count鏁伴噺鍒ゆ柇鏄惁杩樻湁鏁版嵁
@@ -157,6 +193,75 @@
}
})
}
+ const sectionChange = (val) => {
+ switch (val) {
+ case 0:
+ isEn.value = null
+ break;
+ case 1:
+ isEn.value = true
+ break;
+ case 2:
+ isEn.value = false
+ break;
+ }
+ state.pageIndex = 1
+ state.pageSize = 20
+ loadStatus.value = 'loadmore'
+ PostMyListPageCompany()
+ }
+ const manageOrder = (item) => {
+ let obj = {
+ orderId: item.id
+ }
+ console.log(obj);
+ if (item.isEn) {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '纭涓嬫灦璇ュ伐浣滃悧锛熶笅鏋跺悗灏嗗垹闄ょ浉鍏虫暟鎹紒',
+ success: function(res) {
+ if (res.confirm) {
+ // 鎵ц纭鍚庣殑鎿嶄綔
+ item.isLoading = true
+ $api.deleteOrder(obj).then(req => {
+ if (req.code == 1) {
+ $util.showToast({
+ title: '涓嬫灦鎴愬姛锛�'
+ })
+ PostMyListPageCompany()
+ } else {
+ $util.showToast({
+ title: req.error
+ })
+ }
+ item.isLoading = false
+ })
+ }
+ else {
+ // 鎵ц鍙栨秷鍚庣殑鎿嶄綔
+ }
+ }
+ })
+
+ } else {
+ item.OldId = item.id
+ item.id = 0
+ $api.saveOrder(item).then(res => {
+ if (res.code == 1) {
+ $util.showToast({
+ title: "涓婃灦鎴愬姛锛�",
+ icon: "success"
+ })
+ PostMyListPageCompany()
+ } else {
+ $util.showToast({
+ title: res.msg
+ })
+ }
+ item.isLoading = false
+ })
+ }
+ }
const pageToDetail = (item) => {
uni.navigateTo({
url: `/pages/order/detail?orderid=${item.id}`
--
Gitblit v1.9.1