From 0b33a3dcc3a7592c476d992e1b79a3bc837afb25 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 21 八月 2025 13:42:56 +0800
Subject: [PATCH] 优化
---
small-program/pages/order-details/order-details.vue | 291 ++++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 240 insertions(+), 51 deletions(-)
diff --git a/small-program/pages/order-details/order-details.vue b/small-program/pages/order-details/order-details.vue
index c27529e..ee98882 100644
--- a/small-program/pages/order-details/order-details.vue
+++ b/small-program/pages/order-details/order-details.vue
@@ -10,16 +10,20 @@
<view class="order-quxiao">
<view class="order-quxiao-btn" @click="show = true" v-if="userInfo.id === info.acceptMemberId && info.status ===2">鍙栨秷璁㈠崟</view>
<view class="order-quxiao-btn" @click="show = true" v-if="userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)">鍙栨秷璁㈠崟</view>
+ <view class="order-quxiao-btn1" v-if="userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)" @click="jumpEdit()">淇敼璁㈠崟</view>
</view>
<view class="order-user" v-if="userInfo.id === info.releaseMemberId">
<view class="order-user-info">
<view class="user-info-l">
<view class="user-info-l-image">
<image v-if="info.acceptCoverImage" :src="info.acceptCoverImage" mode="widthFix"></image>
- <image v-else src="/static/logo.png" mode="widthFix"></image>
+ <image v-else src="/static/icon/img@2x.png" mode="widthFix"></image>
</view>
<view class="user-info-l-i">
- <view class="user-info-l-i-top">{{info.acceptName || '鍖垮悕'}}</view>
+ <view class="user-info-l-i-top">
+ <text>{{info.acceptName || '鍖垮悕'}}</text>
+ <view class="user-info-l-i-top-jdf">鎺ュ崟鏂�</view>
+ </view>
<view class="user-info-l-i-bottom">
<view class="user-info-l-i-bottom-item">
<text>璇勫垎锛�</text>
@@ -58,12 +62,12 @@
<view class="order-info-address">
<image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image>
<view class="order-info-address-info">
- <text>{{info.startDate || ''}}-{{info.endDate || ''}}({{info.totalDays||0}}澶�)</text>
+ <text>{{info.startDate || ''}}{{' 鑷� '}}{{info.endDate || ''}}({{info.totalDays||0}}澶�)</text>
</view>
</view>
<view class="address" v-if="info.type===1 && wayList && wayList.length>0">
<view class="address-xian"></view>
- <view class="address-row" v-for="(item,index) in wayList" style="display: block;margin: 10px" :key="'bbb'+index">
+ <view class="address-row" v-for="(item,index) in wayList" style="display: block;margin: 10px" :key="index">
<image v-if="index === 0" src="/static/icon/ic_qidian@2x.png" mode="widthFix"></image>
<image v-if="index >0 && index < wayList.length-1" src="/static/icon/ic_jingguo@2x.png" mode="widthFix"></image>
<image v-if="index === wayList.length-1" src="/static/icon/ic_zhongdian@2x.png" mode="widthFix"></image>
@@ -113,10 +117,10 @@
<view class="order-ren-left">
<view class="order-ren-left-img">
<image v-if="info.releaseCoverImage" :src="info.releaseCoverImage" mode="widthFix"></image>
- <image v-else src="/static/logo.png" mode="widthFix"></image>
+ <image v-else src="/static/icon/img@2x.png" mode="widthFix"></image>
</view>
<text>{{info.releaseName || '鍖垮悕'}}</text>
- <view class="order-ren-left-tip">鍙戝崟鏂�</view>
+ <view class="order-ren-left-tip">涓氫富</view>
</view>
<view class="order-ren-x"></view>
<view class="order-ren-lx" @click="contactPhone(info.releasePhone)">
@@ -129,50 +133,54 @@
<text>璁㈠崟淇℃伅</text>
</view>
<view class="order-info-list">
- <view class="order-info-list-item">
+ <view class="order-info-list-item" v-if="info.code">
<text>璁㈠崟缂栧彿锛�</text>
<text>{{info.code || ''}}</text>
</view>
- <view class="order-info-list-item">
+ <view class="order-info-list-item" v-if="info.createTime">
<text>涓嬪崟鏃堕棿锛�</text>
<text>{{info.createTime||'-'}}</text>
</view>
- <view class="order-info-list-item">
+ <view class="order-info-list-item" v-if="info.acceptTime">
<text>鎺ュ崟鏃堕棿锛�</text>
<text>{{info.acceptTime||'-'}}</text>
</view>
- <view class="order-info-list-item">
+ <view class="order-info-list-item" v-if="info.workStartTime">
<text>寮�濮嬫椂闂达細</text>
<text>{{info.workStartTime||'-'}}</text>
</view>
- <view class="order-info-list-item">
+ <view class="order-info-list-item" v-if="info.finishTime">
<text>瀹屾垚鏃堕棿锛�</text>
<text>{{info.finishTime||'-'}}</text>
</view>
- <view class="order-info-list-item">
+ <view class="order-info-list-item" v-if="info.payTime">
<text>鏀粯鏃堕棿锛�</text>
<text>{{info.payTime||'-'}}</text>
</view>
- <view class="order-info-list-item">
+ <view class="order-info-list-item" v-if="info.payMethod && info.payMethod >= 0">
<text>鏀粯鏂瑰紡锛�</text>
<text>{{info.payMethod==0?'寰俊鏀粯':'-'}}</text>
</view>
- <view class="order-info-list-item">
+ <view class="order-info-list-item" v-if="info.wxExternalNo">
<text>浜ゆ槗鍗曞彿锛�</text>
<text>{{info.wxExternalNo || '-'}}</text>
</view>
</view>
</view>
- <view style="width: 100%; height: calc(108rpx + env(safe-area-inset-bottom));"></view>
- <view class="order-footer">
- <view class="order-footer-btn">
+ <view style="width: 100%; height: calc(108rpx + env(safe-area-inset-bottom));" v-if="![99].includes(info.status)"></view>
+ <view class="order-footer" v-if="![99].includes(info.status)">
+ <template v-if="(userInfo.id === info.releaseMemberId) && info.status ===2">
+ <sunui-mverify hint="寮�濮嬩綔涓�" @change="getaccept($event)"></sunui-mverify>
+ </template>
+ <view class="order-footer-btn" v-else>
<view class="order-footer-btn-a" @click="show = true" v-if="userInfo.id === info.acceptMemberId && info.status ===2">鍙栨秷璁㈠崟</view>
<view class="order-footer-btn-a" @click="show = true" v-if="userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)">鍙栨秷璁㈠崟</view>
- <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId && (info.status ===4 && info.commentStatus!=1)">鍘昏瘎浠�</view>
- <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId &&((info.status ===3 && info.type !==2)|| (info.status ===0 && info.type===2))">鍘绘敮浠�</view>
- <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)">淇敼璁㈠崟</view>
- <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId && (info.isUpdate==1 && info.status ===2)">淇敼纭</view>
- <view class="order-footer-btn-b" v-if="userInfo.id !== info.releaseMemberId && (info.status ===1)">鎶㈠崟</view>
+ <view class="order-footer-btn-b" @click="show2=true" v-if="userInfo.id === info.releaseMemberId && (info.status ===4 && info.commentStatus!=1)">鍘昏瘎浠�</view>
+ <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId &&((info.status ===3 && info.type !==2)|| (info.status ===0 && info.type===2))" @click="show1 = true">瀹屾垚骞舵敮浠�</view>
+ <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)" @click="jumpEdit()">淇敼璁㈠崟</view>
+ <view class="order-footer-btn-b" @click="show5 =true" v-if="userInfo.id === info.acceptMemberId && (info.isUpdate==1 && info.status ===2)">淇敼纭</view>
+ <view class="order-footer-btn-b" @click="startJobs()" v-if="userInfo.id === info.releaseMemberId && (info.status ===2)">寮�濮嬩綔涓�</view>
+ <view class="order-footer-btn-b" @click="show6 =true" v-if="userInfo.id !== info.releaseMemberId && (info.status ===1)">鎶㈠崟</view>
</view>
<view style="width: 100%; height: env(safe-area-inset-bottom);"></view>
</view>
@@ -191,7 +199,51 @@
<view class="btn2" @click="cancelDo">纭鍙栨秷</view>
</view>
</u-modal>
-
+ <u-modal
+ title="娓╅Θ鎻愮ず"
+ :show="show4"
+ closeOnClickOverlay
+ showCancelButton
+ >
+ <view class="slot-content">
+ 纭鍙栨秷璁㈠崟鍚楋紵
+ </view>
+ <view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
+ <view class="btn1" @click="show = false">鎴戝啀鎯虫兂</view>
+ <view class="btn2" @click="cancelDo">纭鍙栨秷</view>
+ </view>
+ </u-modal>
+ <u-modal
+ title="娓╅Θ鎻愮ず"
+ :show="show6"
+ closeOnClickOverlay
+ showCancelButton
+ >
+ <view class="slot-content">
+ 纭鎶㈠崟鍚楋紵
+ </view>
+ <view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
+ <view class="btn1" @click="show6 = false">鎴戝啀鎯虫兂</view>
+ <view class="btn2" @click="acceptDo">纭鎺ュ崟</view>
+ </view>
+ </u-modal>
+ <u-modal
+ title="娓╅Θ鎻愮ず"
+ :show="show5"
+ closeOnClickOverlay
+ showCancelButton
+ >
+ <view class="slot-content">
+ 鏄惁鍚屾剰璁㈠崟淇敼鍐呭锛�
+ </view>
+ <view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
+ <view class="btn1" @click="show5=false">鎴戝啀鎯虫兂</view>
+ <view style="width: 20rpx; height: 100%;"></view>
+ <view class="btn2" style="background-color: #f56c6c; color: #ffffff;" @click="confirmUpdDo(1)">涓嶅悓鎰�</view>
+ <view style="width: 20rpx; height: 100%;"></view>
+ <view class="btn2" @click="confirmUpdDo(0)">鍚屾剰</view>
+ </view>
+ </u-modal>
<!-- 鏀粯寮圭獥 -->
<u-popup :show="show1" round="15" mode="bottom">
<view class="zhifu">
@@ -201,16 +253,16 @@
<image @click="show1 = false" src="/static/icon/ic_close@2x.png" mode="widthFix"></image>
</view>
<view class="zhifu-c">
- <view class="zhifu-c-info">
- 璇风‘璁ら噾棰濆苟鏀粯璐圭敤缁� <text>鑾茶姳鍔冲姟鍏徃</text>
+ <view class="zhifu-c-info" v-if="info.type !== 2">
+ 璇风‘璁ら噾棰濆苟鏀粯璐圭敤缁� <text>{{info.acceptName}}</text>
</view>
<view class="zhifu-c-info1">鏀粯閲戦锛�</view>
<view class="zhifu-c-input">
<image src="/static/icon/楼@2x.png" mode="widthFix"></image>
- <input type="number" placeholder="璇疯緭鍏�" />
+ <input type="number" v-model="amount" :disabled="info.type === 2" placeholder="璇疯緭鍏�" />
</view>
</view>
- <view class="zhifu-botton">纭鏀粯</view>
+ <view class="zhifu-botton" @click="payment">纭鏀粯</view>
</view>
</u-popup>
@@ -225,7 +277,7 @@
<view class="zhifu-pj">
<view class="zhifu-pj-label">鏈嶅姟璇勪环</view>
<view class="zhifu-pj-val">
- <u-rate :count="count" activeColor="#FFC331" size="26" v-model="value"></u-rate>
+ <u-rate :count="count" activeColor="#FFC331" size="26" v-model="value" @click=""></u-rate>
</view>
</view>
<view class="zhifu-textarea">
@@ -240,6 +292,7 @@
<script>
import { mapState } from 'vuex'
+ import sunuiMverify from '@/components/sunui-mverify/sunui-mverify.vue';
export default {
computed: {
...mapState( ['userInfo'])
@@ -250,12 +303,18 @@
show1: false,
show2: false,
count: 5,
+ show3:false,
+ show4:false,
+ show5:false,
+ show6:false,
+ value:0,
wayList:[],
bgImg: require('@/static/image/bg_green@2x.png'),
id: null,
loading:false,
commentInfo:'',
- info: {},
+ info: {},
+ amount: ''
};
},
onLoad(options) {
@@ -265,12 +324,104 @@
this.getOrderData()
},
methods:{
+ getaccept(e) {
+ if (!e.msg) return;
+ this.$u.api.begin({ orderId: this.info.id })
+ .then(res => {
+ if (res.code === 200) {
+ this.getOrderData()
+ }
+ })
+ },
+ // 寮�濮嬩綔涓�
+ startJobs() {
+ this.$u.api.begin({ orderId: this.info.id })
+ .then(res => {
+ if (res.code === 200) {
+ this.getOrderData()
+ }
+ })
+ },
+ // 淇敼
+ jumpEdit() {
+ if (this.info.type === 0 && this.info.workType === 0) {
+ uni.navigateTo({
+ url: `/pages/using-workers/using-workers?id=${this.info.id}`
+ })
+ } else if (this.info.type === 0 && this.info.workType === 1) {
+ uni.navigateTo({
+ url: `/pages/sorting/sorting?id=${this.info.id}`
+ })
+ } else if (this.info.type === 0 && this.info.workType === 2) {
+ uni.navigateTo({
+ url: `/pages/packaging-worker/packaging-worker?id=${this.info.id}`
+ })
+ } else if (this.info.type === 1) {
+ uni.navigateTo({
+ url: `/pages/freight/freight?id=${this.info.id}`
+ })
+ }
+ },
+ payment() {
+ var that = this
+ // 璁㈤
+ if (this.info.type === 2) {
+ this.$u.api.reusePay({
+ orderId: this.info.id
+ }).then(res => {
+ if (res.code === 200) {
+ wx.requestPayment({
+ timeStamp: res.data.object.timeStamp,
+ nonceStr: res.data.object.nonceStr,
+ package: res.data.object.packageVal,
+ signType: res.data.object.signType,
+ paySign: res.data.object.paySign,
+ success (res1) {
+ if (res1.errMsg = 'requestPayment:ok') {
+ that.show1 = false
+ uni.showToast({ title: '鏀粯鎴愬姛', icon: 'success', duration: 2000 });
+ that.getOrderData()
+ }
+ },
+ fail(err) {
+ console.log(err)
+ }
+ })
+ }
+ })
+ } else {
+ this.$u.api.doneOrder({
+ orderId: this.info.id,
+ amount: Number(this.amount) * 100
+ }).then(res => {
+ if (res.code === 200) {
+ wx.requestPayment({
+ timeStamp: res.data.object.timeStamp,
+ nonceStr: res.data.object.nonceStr,
+ package: res.data.object.packageVal,
+ signType: res.data.object.signType,
+ paySign: res.data.object.paySign,
+ success (res1) {
+ if (res1.errMsg = 'requestPayment:ok') {
+ that.show1 = false
+ uni.showToast({ title: '鏀粯鎴愬姛', icon: 'success', duration: 2000 });
+ that.getOrderData()
+ }
+ },
+ fail(err) {
+ console.log(err)
+ }
+ })
+ }
+ })
+ }
+ },
commentDo(){
var that = this
- var param = { info: that.commentInfo,level:that.value,orderId: this.id}
+ var param = { info: that.commentInfo,level:that.value||0,orderId: this.id}
this.$u.api.comment(param).then(res =>{
if(res.code ===200){
- that.show=false
+ that.show2=false
uni.showToast({ title: '璇勪环鎴愬姛', icon: 'error', duration: 2000 });
that.getOrderData()
}
@@ -278,32 +429,36 @@
},
beginDo(){
var that = this
- var param = { info: that.commentInfo,level:that.value,orderId: this.id}
+ var param = {orderId: this.id}
this.$u.api.begin(param).then(res =>{
if(res.code ===200){
- that.show=false
+ that.show3=false
uni.showToast({ title: '鎿嶄綔鎴愬姛', icon: 'error', duration: 2000 });
that.getOrderData()
}
})
},
- confirmUpdDo(){
+ confirmUpdDo(status){
var that = this
- var param = { info: that.commentInfo,level:that.value,orderId: this.id}
- this.$u.api.confirmUpdDo(param).then(res =>{
+ var param = {orderId: this.id,status:status}
+ this.$u.api.confirmUpd(param).then(res =>{
if(res.code ===200){
- that.show=false
- uni.showToast({ title: '鎿嶄綔鎴愬姛', icon: 'error', duration: 2000 });
- that.getOrderData()
+ that.show5=false
+ uni.showToast({ title: '纭鎴愬姛', icon: 'error', duration: 2000 });
+ if(status==1){
+ uni.navigateBack({ delta: 1 })
+ }else{
+ that.getOrderData()
+ }
}
})
},
acceptDo(){
var that = this
- var param = { info: that.commentInfo,level:that.value,orderId: this.id}
+ var param = {orderId: this.id}
this.$u.api.accept(param).then(res =>{
if(res.code ===200){
- that.show=false
+ that.show6=false
uni.showToast({ title: '鎶㈠崟鎴愬姛', icon: 'error', duration: 2000 });
that.getOrderData()
}
@@ -316,15 +471,19 @@
if(res.code ===200){
that.show=false
uni.showToast({ title: '璁㈠崟鍙栨秷鎴愬姛', icon: 'error', duration: 2000 });
- that.getOrderData()
+ if(that.userInfo.id !== that.info.releaseMemberId){
+ uni.navigateBack({ delta: 1 })
+ }else{
+ that.getOrderData()
+ }
}
})
},
previemImg(src){
uni.previewImage({
- current: src, // 褰撳墠鏄剧ず鍥剧墖鐨刪ttp閾炬帴
- urls: [src] // 闇�瑕侀瑙堢殑鍥剧墖http閾炬帴鍒楄〃
- });
+ current: src,
+ urls: [src]
+ });
},
contactPhone(phone){
if(phone !=null && phone!=''){
@@ -374,6 +533,7 @@
if(res.code ===200){
if(that.userInfo.id === res.data.releaseMemberId || that.userInfo.id === res.data.acceptMemberId ){
that.info = res.data
+ that.amount = ((that.info.estimatedAccount || 0) / 100).toFixed(2)
if(that.info.wayInfo){
that.wayList = JSON.parse(that.info.wayInfo)
}
@@ -564,9 +724,9 @@
box-sizing: border-box;
display: flex;
align-items: center;
- justify-content: space-between;
+ justify-content: space-between;
.order-footer-btn-a {
- width: 334rpx;
+ flex: 1;
height: 88rpx;
line-height: 88rpx;
text-align: center;
@@ -577,7 +737,7 @@
border: 1rpx solid #B2B2B2;
}
.order-footer-btn-b {
- width: 334rpx;
+ flex: 1;
height: 88rpx;
line-height: 88rpx;
text-align: center;
@@ -882,9 +1042,26 @@
flex-direction: column;
justify-content: space-between;
.user-info-l-i-top {
- font-weight: 400;
- font-size: 30rpx;
- color: #222222;
+ width: 100%;
+ display: flex;
+ align-items: center;
+ text {
+ font-weight: 400;
+ font-size: 30rpx;
+ color: #222222;
+ }
+ .user-info-l-i-top-jdf {
+ width: 96rpx;
+ height: 42rpx;
+ line-height: 42rpx;
+ text-align: center;
+ font-weight: 400;
+ font-size: 24rpx;
+ color: #FF7200;
+ border-radius: 8rpx;
+ border: 2rpx solid #FD9E24;
+ margin-left: 10rpx;
+ }
}
.user-info-l-i-bottom {
display: flex;
@@ -949,6 +1126,18 @@
border-radius: 34rpx;
border: 1rpx solid #B2B2B2;
}
+ .order-quxiao-btn1 {
+ width: 160rpx;
+ height: 64rpx;
+ line-height: 64rpx;
+ text-align: center;
+ border-radius: 34rpx;
+ font-weight: 400;
+ font-size: 28rpx;
+ color: #00BC12;
+ margin-left: 20rpx;
+ border: 1rpx solid #00BC12;
+ }
}
}
.address {
--
Gitblit v1.9.3