From 93a986bc80abdef75923054b9df9adb6e1ccff52 Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期二, 08 十月 2024 16:44:08 +0800 Subject: [PATCH] - --- src/pages/order/detail.vue | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 54 insertions(+), 5 deletions(-) diff --git a/src/pages/order/detail.vue b/src/pages/order/detail.vue index 709a1c2..68d3e6b 100644 --- a/src/pages/order/detail.vue +++ b/src/pages/order/detail.vue @@ -80,14 +80,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 +170,7 @@ let selectVal = ref(false) let orderIdVal = ref('') let isLoading = ref(false) + let showEdit = ref(false) onLoad((option) => { let { orderid @@ -169,6 +184,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.showEdit = false + } else { + $util.showToast({ + title: res.error + }) + } + }) + } let modalShow = ref(false) let content = ref('') const toView = (item) => { @@ -177,7 +223,7 @@ }) } const toWorkerDetail = (item) => { - $db.set('toudiItem', JSON.stringify(item)) + $db.set('toudiItem',item) uni.navigateTo({ url: `/pages/worker/worker?workerid=${item.workerUserId}` }) @@ -244,6 +290,9 @@ const getOrder = (orderid) => { $api.getOrder(orderid).then(res => { if (res.code == 1) { + res.data.orderBidding.forEach(item => { + item.showEdit = false + }) detailItem.value = res.data } }) -- Gitblit v1.9.1