From 91be10dcd43367aae04df6330e33d229c216a72e Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期三, 09 十月 2024 17:20:59 +0800 Subject: [PATCH] - --- src/pages/order/detail.vue | 73 +++++++++++++++++++++++++++++++++--- 1 files changed, 66 insertions(+), 7 deletions(-) diff --git a/src/pages/order/detail.vue b/src/pages/order/detail.vue index 709a1c2..ace65a2 100644 --- a/src/pages/order/detail.vue +++ b/src/pages/order/detail.vue @@ -43,11 +43,18 @@ <view class='chuany-flex chuany-justify-between c-p-l-18 c-p-r-18 c-p-t-6 chuany-align-center'> <view class="redcla"> <text class="chuany-font40"> - {{detailItem.workPrice}} + {{detailItem.workPrice}}<template + v-if="detailItem.workPriceMax">~{{detailItem.workPriceMax}}</template> </text> <text class='chuany-font20'> {{detailItem.workerType==0?'鍏�/灏忔椂':'鍏�/浠�'}} </text> + <!-- <text class="chuany-font40"> + {{detailItem.workPrice}} + </text> + <text class='chuany-font20'> + {{detailItem.workerType==0?'鍏�/灏忔椂':'鍏�/浠�'}} + </text> --> </view> <view class=""> <!-- <up-tag class='c-m-r-10' text="涓嬫灦" shape="circle" type="error" size='mini' @@ -80,14 +87,28 @@ <up-tag class="button-layout__item c-m-l-18" text="鎷掔粷" size="mini" type="error" @click="selectBtn(item,false)"></up-tag> </template> - <!-- <template #right-icon v-else class="chuany-flex"> - <up-text type="success" v-if="item.isSelected" text="宸插綍鐢�" size='14'></up-text> - <up-text type="error" v-else text="宸叉嫆缁�" size='14'></up-text> --> + <template #right-icon v-else class="chuany-flex"> + <template class="" v-if="item.workPrice&&!item.showEdit"> + <up-text type="error" + :text="item.workerType==0?`${item.workPrice}鍏�/灏忔椂`:`${item.workPrice}鍏�/浠禶 " + size='14'></up-text> + <up-icon name="edit-pen" @click='isShow(item)'></up-icon> + </template> + <up-input v-model="item.workPrice" border="none" v-else type="digit"> + <template #suffix> + <up-button @tap="saveWorkPrice(item)" text="淇濆瓨" type="success" + form-type="submit" size="mini"></up-button> + </template> + <!-- <template #suffix v-else> + <up-icon name="edit-pen" @click='isShow'></up-icon> + </template> --> + </up-input> + <!-- <up-text type="error" v-else text="宸叉嫆缁�" size='14'></up-text> --> <!-- <up-tag class="button-layout__item" text="褰曠敤" size="mini" type="success" @click="selectBtn(item,true)"></up-tag> <up-tag class="button-layout__item c-m-l-18" text="鎷掔粷" size="mini" type="error" @click="selectBtn(item,false)"></up-tag> --> - <!-- </template> --> + </template> </up-cell> </up-list-item> <!-- <up-list-item> @@ -156,6 +177,7 @@ let selectVal = ref(false) let orderIdVal = ref('') let isLoading = ref(false) + let showEdit = ref(false) onLoad((option) => { let { orderid @@ -169,6 +191,37 @@ const click = () => { } + const isShow = (item) => { + item.showEdit = true + } + const saveWorkPrice = (item) => { + let obj = { + orderBiddingId: item.id, + workPrice: item.workPrice + } + console.log(item, obj); + if (!item.workPrice) { + $util.showToast({ + title: "璇疯緭鍏ュ伐浠凤紒", + icon: "success" + }) + return + } + $api.saveWorkPrice(obj).then(res => { + if (res.code == 1) { + $util.showToast({ + title: "宸ヤ环淇濆瓨鎴愬姛锛�", + icon: "success" + }) + getOrder(orderIdVal, item.id) + item.showEdit = false + } else { + $util.showToast({ + title: res.error + }) + } + }) + } let modalShow = ref(false) let content = ref('') const toView = (item) => { @@ -177,7 +230,7 @@ }) } const toWorkerDetail = (item) => { - $db.set('toudiItem', JSON.stringify(item)) + $db.set('toudiItem', item) uni.navigateTo({ url: `/pages/worker/worker?workerid=${item.workerUserId}` }) @@ -241,9 +294,15 @@ modalShow.value = false workerItem.value = {} } - const getOrder = (orderid) => { + const getOrder = (orderid, id) => { $api.getOrder(orderid).then(res => { if (res.code == 1) { + res.data.orderBidding.forEach(item => { + item.showEdit = false + if (id == item.id) { + toWorkerDetail(item) + } + }) detailItem.value = res.data } }) -- Gitblit v1.9.1