From 376ac09a54e8c95190d06bf39f295c890829c103 Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期二, 03 九月 2024 15:43:25 +0800 Subject: [PATCH] 查看工人详情 --- src/pages/order/detail.vue | 142 ++++++++++++++++++++++++++++++++++------------ 1 files changed, 104 insertions(+), 38 deletions(-) diff --git a/src/pages/order/detail.vue b/src/pages/order/detail.vue index 2b30a1a..513c6d8 100644 --- a/src/pages/order/detail.vue +++ b/src/pages/order/detail.vue @@ -2,37 +2,39 @@ <view class=""> <scroll-view enable-flex="true"> <view class="list chuany-flex chuany-flex-direction chuany-align-center c-p-b-30"> - <view class="content " v-for="(item,index) in list2" @click='toDetail' :key='item.id'> - <view class="bgblue c-p-18 chuany-flex chuany-justify-between chuany-font34 chuany-text-bold"> - <text class=''> - {{item.time}} - </text> + <view class="content "> + <view class="bgblue c-p-18 chuany-flex chuany-justify-between chuany-font30"> + <view class="chuany-flex chuany-flex-direction"> + <text class=''> + {{$util.formatDate(detailItem.startTime)}} + </text> + </view> <text> - 鎷泏{item.zhaodao}}/{{item.peoplenum}}浜� + 鎷泏{detailItem.worderCounted}}/{{detailItem.worderCount}}浜� </text> </view> - <view class="c-p-18 chuany-font44 chuany-text-bold"> - {{item.name}} + <view class="c-p-l-18 c-p-b-14 c-p-t-14 c-p-r-18 chuany-font34"> + {{detailItem.orderName}} </view> - <view class="chuany-flex c-p-l-18"> + <!-- <view class="chuany-flex c-p-l-18"> <up-tag class='c-p-r-14' :text="item" plain v-for="(item,index) in item.tags" :key="index"> </up-tag> - </view> + </view> --> <view class="chuany-flex chuany-flex-direction"> - <text class='c-p-18'> - 瑕佹眰锛歿{item.yaoqiu}} + <text class='c-p-l-18 c-p-b-14 c-p-r-18 text-69'> + 瑕佹眰锛歿{detailItem.demand}} </text> - <text class='c-p-l-18 c-p-b-16'> - 鍦板潃锛歿{item.adress}} + <text class='c-p-l-18 c-p-b-14 c-p-r-18 text-69'> + 鍦板潃锛歿{detailItem.worderAddress}} </text> </view> <view class='chuany-flex chuany-justify-between c-p-l-18 c-p-r-18'> <view class="redcla"> <text class="chuany-font40 chuany-text-bold"> - {{item.price}} + {{detailItem.workPrice}} </text> <text class='chuany-font20'> - 鍏�/灏忔椂 + {{detailItem.workerType==0?'鍏�/灏忔椂':'鍏�/浠�'}} </text> </view> <!-- <up-tag text="鍘绘姠娲�" type="warning" shape="circle"></up-tag> --> @@ -40,20 +42,24 @@ </view> </view> </view> - <view class="coreshop-ff"> + <view class="coreshop-ff" v-if="detailItem.orderBidding&&detailItem.orderBidding.length>0"> <up-list> - <up-list-item> - <up-cell title="鍛ㄥ厛鐢�"> + <up-list-item v-for="(item,index) in detailItem.orderBidding" :key="item.id" @click.stop="toWorkDetail"> + <up-cell :title="item.workerName" :border='false'> <template #icon> - <up-avatar shape="square" size="35" src="https://uview-plus.jiangruyi.com/album/1.jpg" + <up-avatar shape="square" size="35" :src="item.workerAvatar" @click='toWorkerDetail(item)' customStyle="margin: -3px 5px -3px 0"></up-avatar> </template> - <template #right-icon> - <up-button class="button-layout__item" text="鏌ョ湅" size="mini" type="primary"></up-button> + <!-- <template #right-icon v-if="item.isSelected"> + <up-button class="button-layout__item" text="鏌ョ湅" size="mini" type="primary" @click="toView(item)"></up-button> + </template> --> + <template #right-icon v-if="!item.isSelected"> + <up-button class="button-layout__item" text="纭" size="mini" type="success" + @click="selectBtn(item)"></up-button> </template> </up-cell> </up-list-item> - <up-list-item> + <!-- <up-list-item> <up-cell title="鏉庡厛鐢�"> <template #icon> <up-avatar shape="square" size="35" src="https://uview-plus.jiangruyi.com/album/2.jpg" @@ -74,6 +80,21 @@ <up-button class="button-layout__item" text="纭" size="mini" type="success"></up-button> </template> </up-cell> + </up-list-item> --> + </up-list> + </view> + <view class="coreshop-ff" v-else> + <up-list> + <up-list-item> + <up-cell title="鏆傛棤鎶曢��" class="u-cell__title-text_wu" :border='false'> + <!-- <template #icon> + <up-avatar shape="square" size="35" src="https://uview-plus.jiangruyi.com/album/1.jpg" + customStyle="margin: -3px 5px -3px 0"></up-avatar> + </template> + <template #right-icon> + <up-button class="button-layout__item" text="鏌ョ湅" size="mini" type="primary"></up-button> + </template> --> + </up-cell> </up-list-item> </up-list> </view> @@ -84,33 +105,74 @@ <script setup> import { + onLoad, + onShow, + onReachBottom + } from "@dcloudio/uni-app"; + import { reactive, - ref + ref, + getCurrentInstance } from 'vue'; + const { + $upload, + $api, + $util, + $db + } = getCurrentInstance().appContext.config.globalProperties + const detailItem = ref({}) + let orderIdVal = ref('') + onLoad((option) => { + let { + orderid + } = option + getOrder(orderid) + orderIdVal = orderid + console.log(option,'========orderid',orderid); + // detailItem.value = JSON.parse($db.get('detailItem')) + }) let state = reactive({ currentIdex: 0 }) - const list2 = reactive([{ - id: 1, - time: '鏄庡ぉ 19:00-23:00', - name: '涓存椂宸�', - tags: ['4灏忔椂', '鍙棤缁忛獙', '鎵嬭剼楹诲埄'], - adress: '姝︿警鍖烘婧閬�4.0km', - yaoqiu: '涓嶉檺', - price: 50, - peoplenum: 3, - zhaodao: 1 - }]); const click = () => { } const change = (e) => { state.currentIdex = e.index } - const toDetail = (e) => { + const toView = (item) => { uni.navigateTo({ - url: '/pages/detail/detail' + url: `/pages/company/index?workerid=${item.WorkerUserId}&workname=${item.WorkerName}` + }) + } + const toWorkerDetail = (item)=>{ + $db.set('toudiItem',JSON.stringify(item)) + uni.navigateTo({ + url: `/pages/worker/worker?workerid=${item.workerUserId}` + }) + } + const toWorkDetail = (e) => { + uni.navigateTo({ + url: '/pages/order/worker' + }) + } + const selectBtn = (item) => { + $api.saveQueRen({orderBiddingId:item.id}).then(res => { + if(res.code==1){ + $util.showToast({ + title: "纭鎴愬姛锛�", + icon: "success" + }) + getOrder(orderIdVal) + } + }) + } + const getOrder=(orderid) =>{ + $api.getOrder(orderid).then(res => { + if (res.code == 1) { + detailItem.value = res.data + } }) } </script> @@ -122,7 +184,7 @@ } .content { - height: 430rpx; + min-height: 380rpx; width: 100%; background-color: #fff; border-radius: 20rpx; @@ -139,4 +201,8 @@ .redcla { color: #f05348; } + + .u-cell__title-text_wu { + text-align: center; + } </style> \ No newline at end of file -- Gitblit v1.9.1