From 82735e4d46ac7b9969facef2acc8f8e793b68f71 Mon Sep 17 00:00:00 2001 From: doum <doum> Date: 星期一, 15 九月 2025 16:11:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- small-program/pages/demand-hall/demand-hall.vue | 139 +++++++++++++++++++++++++++++++++------------- 1 files changed, 100 insertions(+), 39 deletions(-) diff --git a/small-program/pages/demand-hall/demand-hall.vue b/small-program/pages/demand-hall/demand-hall.vue index ced6e03..20f8714 100644 --- a/small-program/pages/demand-hall/demand-hall.vue +++ b/small-program/pages/demand-hall/demand-hall.vue @@ -18,18 +18,18 @@ <!-- 鍙戝崟鏂� --> <view class="index-labs" v-if="typeViewId === 0" :style="{ top: statusbarHeight + navHeight + 'px' }"> <scroll-view scroll-x class="scroll-view_H" :scroll-into-view="'view'+status"> - <view :class="item.id === status ? 'index-labs-row active' : 'index-labs-row'" v-for="(item, index) in list1" :id="'view'+item.id" :key="item.id" @click="clickOrderType(item.id)"> + <view :class=" item.id === status ? 'index-labs-row active' : 'index-labs-row'" v-for="(item, index) in list1" :id="'view'+item.id" :key="item.id" @click="clickOrderType(item.id)"> {{item.name}} - <view class="index-labs-row-x" v-if="item.id === status"></view> + <view class="index-labs-row-x" v-if=" item.id === status"></view> </view> </scroll-view> </view> <!-- 鎺ュ崟鏂� --> <view class="index-labs" v-if="typeViewId === 1" :style="{ top: statusbarHeight + navHeight + 'px' }"> <scroll-view scroll-x class="scroll-view_H" :scroll-into-view="'view'+status"> - <view :class="item.id === status ? 'index-labs-row active' : 'index-labs-row'" v-for="(item, index) in list" :id="'view'+item.id" :key="item.id" @click="clickOrderType(item.id)"> + <view :class=" item.id === status ? 'index-labs-row active' : 'index-labs-row'" v-for="(item, index) in list" :id="'view'+item.id" :key="item.id" @click="clickOrderType(item.id)"> {{item.name}} - <view class="index-labs-row-x" v-if="item.id === status"></view> + <view class="index-labs-row-x" v-if=" item.id === status "></view> </view> </scroll-view> </view> @@ -63,13 +63,13 @@ {{item.categoryName}}锝渰{item.priceNum2}}浜� </view> <view class="index-list-item-info" v-if="item.type === 0 && item.workType === 2&& item.carType === 0"> - {{item.categoryName}}锝渰{item.priceNum1}}澶� 锝渰{item.priceNum2}}浜� + {{item.categoryName}}锝渰{item.priceNum1}}澶� | {{item.priceNum2}}浜� </view> <view class="index-list-item-info" v-if="item.type === 0 && item.workType === 2&& item.carType === 1"> - {{item.categoryName}}锝渰{item.priceNum1}}灏忔椂 锝渰{item.priceNum2}}浜� + {{item.categoryName}}锝渰{item.priceNum1}}灏忔椂 | {{item.priceNum2}}浜� </view> <view class="index-list-item-info" v-if="item.type === 0 && item.workType === 2&& item.carType === 2"> - {{item.categoryName}}锝渰{item.priceNum1}}鏂� + {{item.categoryName}}锝渰{item.priceNum1}}鏂� | {{item.priceNum2}}浜� </view> <view class="index-list-item-info" v-if="item.type === 1"> {{item.carUnit}} | {{item.transportTypeName}} | {{item.transportNum}}{{item.transportUnit}}锝滅敤杞{item.priceNum1}}{{item.carType === 0?"澶�":"娆�"}} @@ -232,9 +232,9 @@ }, async onShow(options) { var flag = getApp().globalData.orderStatus - console.log(getApp().globalData,"=====================================") - this.status = '' - this.commentStatus='' + console.log(getApp().globalData,"=====================================") + // this.status = '' + // this.commentStatus='' // status: this.status === 5 ? 4 : this.status, // commentStatus: this.status === 5 ? 0 : '', if(flag =='1'){//鍙戝崟鏂瑰緟鎺ュ崟 @@ -242,47 +242,69 @@ }else if(flag =='2'){//鍙戝崟鏂硅繘琛屼腑 this.status = 3 }else if(flag =='3'){//鍙戝崟鏂瑰緟璇勪环 - this.status = 5 + this.status = 6 }else if(flag =='4'){//鎺ュ崟鏂瑰凡鎺ュ崟 this.status =2 }else if(flag =='5'){//鎺ュ崟鏂硅繘琛屼腑 this.status =3 }else if(flag =='6'){//鎺ュ崟鏂瑰凡瀹屾垚 this.status =4 + }else if(flag =='0'){ + this.status = -1 } + console.log(getApp().globalData,this.status ,"=====================================") this.typeViewId = 0 if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}'){ console.log('宸茬櫥闄�') this.isLogin = true - if (this.userInfo && this.userInfo.useIdentity == 1) { - this.typeViewId = 1 - } + /* this.getOrderList() if (!this.isOnce) { this.commentStatus = '' this.orderList = [] this.next = true this.page = 1 this.getOrderList() - } + } */ } else { this.isLogin = false console.log('鏈櫥闄�') } + if(this.isLogin){ + if(this.typeViewId !== this.userInfo.useIdentity || flag !=null){ + this.typeViewId = this.userInfo.useIdentity || 0 + //濡傛灉鍙戠敓 + this.initOrderList() + }else{ + //濡傛灉鏈彂鐢熷彉鍖栦笉鍒锋柊 + this.typeViewId = this.userInfo.useIdentity || 0 + if(!this.orderList || !this.orderList.length){ + this.initOrderList() + }else{ + if( this.tempOrderId){ + this.getOrderData() + } + } + console.log('this.tempOrderId',this.tempOrderId) + } + } + getApp().globalData.orderStatus =null }, data() { return { show: false, isLogin: false, - typeViewId: 0, + typeViewId: -1, + tempOrderId:null, list: [ - { name: '鍏ㄩ儴', id: '' }, + { name: '鍏ㄩ儴', id: -1 }, { name: '宸叉帴鍗�', id: 2 }, { name: '杩涜涓�', id: 3 }, + { name: '寰呮敮浠�', id: 5 }, { name: '宸插畬鎴�', id: 4 }, // { name: '宸插彇娑�', id: 99 }, ], list1: [ - { name: '鍏ㄩ儴', id: '' }, + { name: '鍏ㄩ儴', id: -1 }, { name: '寰呮敮浠�', id: 0 }, { name: '寰呮帴鍗�', id: 1 }, { name: '宸叉帴鍗�', id: 2 }, @@ -292,9 +314,8 @@ { name: '寰呰瘎浠�', id: 6 } ], orderId: null, - status: '', - commentStatus: '', - + status: -1, + commentStatus: '', next: true, page: 1, orderList: [], @@ -303,7 +324,7 @@ }, async onLoad() { await this.$onLaunched; - uni.$on('refresh', (data) => { + /* uni.$on('refresh', (data) => { console.log('鎴戠殑璁㈠崟椤靛埛鏂�'); this.status = '' this.commentStatus = '' @@ -311,17 +332,26 @@ this.next = true this.page = 1 this.getOrderList() - }) - this.getOrderList() + }) */ + }, onReachBottom() { - this.getOrderList() + if(this.isLogin){ + this.getOrderList() + } }, methods: { toLogin() { uni.navigateTo({ url: '/pages/login/login' }) + }, + initOrderList() { + this.commentStatus = '' + this.orderList = [] + this.next = true + this.page = 1 + this.getOrderList() }, startJobs(orderId) { this.$u.api.begin({ orderId }) @@ -341,9 +371,11 @@ uni.navigateTo({ url: `/pages/order-details/order-details?id=${item.id}&flag=${flag}` }) + this.tempOrderId = item.id }, // 淇敼 jumpEdit(item) { + this.tempOrderId =item.id if (item.type === 0 && item.workType === 0) { uni.navigateTo({ url: `/pages/using-workers/using-workers?id=${item.id}` @@ -372,14 +404,49 @@ this.next = true this.page = 1 this.getOrderList() - } - + } }) }, phoneCall(phoneNumber) { uni.makePhoneCall({ phoneNumber }); + }, + getOrderData(){ + var that = this + var param ={ orderId:that.tempOrderId} + this.$u.api.getDetail(param).then(res =>{ + if(res.code ===200 && res.data){ + var isDel = false + var tempIndex = -1 + that.orderList.forEach((item,index) =>{ + if(item.id == res.data.id){ + item.status = res.data.status + item.isUpdate = res.data.isUpdate + item.commentStatus = res.data.commentStatus + tempIndex = index + } + + }) + if(tempIndex > -1 ){ + console.log(tempIndex,that.status,res.data.status,"===================") + if(that.status >=0 ){ + //濡傛灉鏈夋爣绛鹃〉 + if(that.status ===6 && res.data.commentStatus == 1){ + isDel =true + console.log(tempIndex,that.status,res.data.status,"==================1") + }else if(that.status !=6 && that.status !== res.data.status){ + isDel =true + console.log(tempIndex,that.status,res.data.status,"===================2") + } + } + if(isDel){ + console.log(tempIndex,that.status,res.data.status,"===================3") + that.orderList.splice(tempIndex,1) + } + } + } + }) }, // 璁㈠崟鍒嗛〉 getOrderList() { @@ -389,7 +456,7 @@ page: this.page, model: { queryMyOrderType: this.userInfo.useIdentity, - status: this.status === 6 ? 4 : this.status, + status: this.status === 6 ? 4 : (this.status ==-1?"":this.status), commentStatus: this.status === 6 ? 0 : '', queryLat: this.latitude, queryLgt: this.longitude @@ -408,23 +475,17 @@ item.wayInfo = JSON.parse(item.wayInfo) } }) - this.orderList = [...this.orderList, ...res.data.records] - - if (this.orderList.length === res.data.total) { + this.orderList = [...this.orderList, ...res.data.records] + if (this.orderList.length >= res.data.total) { this.next = false } else { this.page += 1 } }) }, - clickOrderType(id) { - // if (typeof id === 5) { - // this.status = 5 - // // this.commentStatus = 0 - // } else { - this.commentStatus = '' - this.status = id - // } + clickOrderType(id) { + this.commentStatus = '' + this.status = id this.orderList = [] this.next = true this.page = 1 -- Gitblit v1.9.3