bug修改

This commit is contained in:
BAKEYi 2026-04-17 18:45:30 +08:00
parent 566b6f8929
commit 0c411882d9
4 changed files with 309 additions and 246 deletions

View File

@ -209,7 +209,7 @@
secondTabs() { secondTabs() {
if (this.activeFirstId == 1 || this.activeFirstId == 2) { if (this.activeFirstId == 1 || this.activeFirstId == 2) {
return [{ return [{
title: `服务(${this.numInfo.noservernum})`, title: `开始(${this.numInfo.noservernum})`,
id: 3 id: 3
}, },
{ {

View File

@ -13,32 +13,40 @@
<scroll-view scroll-y class="order-scroll" @scrolltolower="loadMore" refresher-enabled <scroll-view scroll-y class="order-scroll" @scrolltolower="loadMore" refresher-enabled
:refresher-triggered="isRefreshing" @refresherrefresh="onRefresh"> :refresher-triggered="isRefreshing" @refresherrefresh="onRefresh">
<view class="order-item" v-for="(order, index) in orderList" :key="index"> <view class="order-item" v-for="(order, index) in orderList" :key="index">
<!-- 订单编号和状态 --> <!-- 顶部订单编号 + 状态 -->
<view class="order-header"> <view class="order-top">
<view class="order-tag">
<text
class="order-tag-text">{{order.order_kind == 1 ? '到家' : order.order_kind == 2 ? '到店' : ''}}</text>
</view>
<text class="order-number">订单编号{{order.number}}</text> <text class="order-number">订单编号{{order.number}}</text>
<text class="order-status" <view class="order-status-badge" :class="{
:class="order.statusClass">{{order.state == 1 ? '待支付' : order.state == 2 ? '待接单' : order.state == 3 ? '待服务' : order.state == 4 ? '待完成' : order.state == 5 ? '已完成' : order.state == 6 ? '待评价' : order.state == 7 ? '已取消' : ''}}</text> 'order-status-badge2': order.state > 4 && order.state !== 7,
'order-status-badge3': order.state === 7
}">
{{ getStatusText(order.state) }}
</view>
</view> </view>
<!-- 订单内容 --> <!-- 订单内容 -->
<view class="order-content" @click="goDetail(order)"> <view class="order-content" @click="goDetail(order)">
<image v-if="order.order_photo" :src="order.order_photo[0]" mode="aspectFill" <image v-if="order.order_photo && order.order_photo.length" :src="order.order_photo[0]"
class="service-image"></image> mode="aspectFill" class="service-image"></image>
<view class="service-image" v-else></view> <view class="service-image" v-else></view>
<view class="service-info"> <view class="service-info">
<text class="service-name">{{order.server_title}}</text> <view class="service-name">{{order.server_title}}</view>
<view class="service-time" v-if="order.order_kind == 1">
<image src="/static/images/time_icon.png" class="time-icon"></image> <view class="service-time" v-if="getDisplayTime(order)">
<text>{{order.reservation_time}}</text> <text class="label-text">下单时间:</text>
<text class="value-text">{{ getDisplayTime(order) }}</text>
</view> </view>
<view class="service-address" v-if="order.order_kind == 1">
<view class="service-address" v-if="order.order_kind == 1 && getFullAddress(order)">
<image src="/static/images/position_icon.png" class="location-icon"></image> <image src="/static/images/position_icon.png" class="location-icon"></image>
<text>{{Object.assign({},order.reservation_address_arr).dependency}}{{Object.assign({},order.reservation_address_arr).address}} <text class="address-text">{{ getFullAddress(order) }}</text>
</text> </view>
<view class="price-row">
<text class="price-symbol">¥</text>
<text class="price-now">{{ getDisplayPrice(order) }}</text>
<text class="price-old" v-if="getOriginalPrice(order)">{{ getOriginalPrice(order) }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -50,26 +58,31 @@
v-if="order.state == 5 || order.state == 6 || order.state == 7"></image> v-if="order.state == 5 || order.state == 6 || order.state == 7"></image>
</view> </view>
<view class="action-right"> <view class="action-right">
<text class="action-btn contact" @click="cancelService(order)" <text class="action-btn gray-btn" @click="cancelService(order)" v-if="order.state == 1">
v-if="order.state == 1">取消订单</text> 取消订单
<text class="action-btn contact" @click="refoundService(order)" </text>
v-if="order.state == 2 || order.state == 3">申请退款</text> <text class="action-btn gray-btn" @click="refoundService(order)"
<text class="action-btn contact" @click="contactService(order.order_shopphone)" v-if="order.state == 2 || order.state == 3">
v-if="order.state != 7 || order.state!=2">联系客服</text> 申请退款
<text class="action-btn primary" v-if="order.state == 1" </text>
@click="payOrder(order)">立即支付</text> <!-- <text class="action-btn gray-btn" @click="contactService(order.order_shopphone)"
<text class="action-btn review" v-if="order.state == 6" v-if="order.state != 7 && order.state != 2">
@click="reviewOrder(order)">评价</text> 联系客服
<text class="action-btn again" </text> -->
v-if="order.state == 5 || order.state == 6 || order.state == 7" <text class="action-btn red-btn" v-if="order.state == 1" @click="payOrder(order)">
@click="orderAgain(order)">再来一单</text> 立即支付
<!-- <text </text>
class="action-btn again" <text class="action-btn red-btn" v-if="order.state == 6" @click="reviewOrder(order)">
v-if="order.state == 5 && order.appeal == 1" 评价
@click="addComplaint(order)" </text>
>投诉</text> --> <text class="action-btn gray-btn" v-if="order.state == 5 || order.state == 6 || order.state == 7"
<text class="action-btn again" v-if="order.state == 5 && order.appeal == 2" @click="orderAgain(order)">
@click="lookComplaint(order)">查看投诉</text> 再来一单
</text>
<text class="action-btn gray-btn" v-if="order.state == 5 && order.appeal == 2"
@click="lookComplaint(order)">
查看投诉
</text>
</view> </view>
</view> </view>
</view> </view>
@ -86,14 +99,13 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="nologin_part" v-else> <view class="nologin_part" v-else>
<image src="/static/images/no_login.png" class="nologin_icon" mode="aspectFit"></image> <image src="/static/images/no_login.png" class="nologin_icon" mode="aspectFit"></image>
<view class="btn-login"> <view class="btn-login">
<text class="login-text" @click="goLogin">前去登录</text> <text class="login-text" @click="goLogin">前去登录</text>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
@ -104,6 +116,7 @@
import { import {
debounce debounce
} from '@/utils/debounce.js' } from '@/utils/debounce.js'
export default { export default {
data() { data() {
return { return {
@ -131,7 +144,6 @@
id: 7, id: 7,
title: '已取消' title: '已取消'
}], }],
// ,{id: 6,title: ''}
currentTab: 0, currentTab: 0,
isRefreshing: false, isRefreshing: false,
hasMore: true, hasMore: true,
@ -145,7 +157,6 @@
}, },
onLoad() { onLoad() {
// this.loadOrders(); // this.loadOrders();
}, },
async onShow() { async onShow() {
this.isLogin = uni.getStorageSync('accessToken') ? true : false; this.isLogin = uni.getStorageSync('accessToken') ? true : false;
@ -165,7 +176,6 @@
this.currentTab = index; this.currentTab = index;
this.orderList = []; this.orderList = [];
this.formData.page = 1; this.formData.page = 1;
// TODO:
if (this.currentTab != 0) { if (this.currentTab != 0) {
this.formData.state = this.currentTab; this.formData.state = this.currentTab;
} else { } else {
@ -193,13 +203,13 @@
this.isRefreshing = true this.isRefreshing = true
this.formData.page = 1; this.formData.page = 1;
this.orderList = []; this.orderList = [];
this.hasMore = true;
this.loadOrders() this.loadOrders()
}, },
// //
loadMore() { loadMore() {
if (!this.hasMore) return if (!this.hasMore) return
// TODO:
this.loadOrders(); this.loadOrders();
}, },
@ -211,6 +221,44 @@
}) })
}, },
getStatusText(state) {
const map = {
1: '待支付',
2: '待接单',
3: '待服务',
4: '服务中',
5: '已完成',
6: '待评价',
7: '已取消'
}
return map[state] || ''
},
getDisplayTime(order) {
return order.create_time || order.createtime || order.add_time || order.reservation_time || ''
},
getDisplayPrice(order) {
const price = order.pay_money || order.order_money || 0
return Number(price).toFixed(2)
},
getOriginalPrice(order) {
const orderMoney = Number(order.order_money || 0)
const payMoney = Number(order.pay_money || 0)
if (orderMoney > 0 && payMoney > 0 && orderMoney !== payMoney) {
return orderMoney.toFixed(2)
}
return ''
},
getFullAddress(order) {
const arr = order.reservation_address_arr || {}
const dependency = arr.dependency || ''
const address = arr.address || ''
return `${dependency}${address}`
},
// //
deleteOrder: debounce(async function(order) { deleteOrder: debounce(async function(order) {
uni.showModal({ uni.showModal({
@ -218,7 +266,6 @@
content: '确定要删除该订单吗?', content: '确定要删除该订单吗?',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
// TODO:
request.post('/sj/deleteorder', { request.post('/sj/deleteorder', {
id: order.id, id: order.id,
sjid: this.sjid sjid: this.sjid
@ -229,6 +276,7 @@
}) })
this.formData.page = 1; this.formData.page = 1;
this.orderList = []; this.orderList = [];
this.hasMore = true;
this.loadOrders(); this.loadOrders();
}) })
} }
@ -249,63 +297,14 @@
}); });
}); });
}, },
// //
async contactService(phone) { async contactService(phone) {
// TODO:
uni.navigateTo({ uni.navigateTo({
url: '/pages/contact/contact' url: '/pages/contact/contact'
}) })
// const systemInfo = uni.getSystemInfoSync()
// if(systemInfo.platform === 'ios') {
// uni.makePhoneCall({
// phoneNumber: phone //
// })
// }else {
// let permission = '';
// if(systemInfo.platform === 'ios') {
// permission = 'phone'
// }else {
// permission = 'android.permission.CALL_PHONE'
// }
// this.isShowPer = true;
// const firstRequest = !plus.storage.getItem(`perm_${permission}`)
// if(firstRequest) {
// this.isShowPer = true;
// }
// // 1.
// const { granted } = await permissionUtils.checkPermission('phone', '便');
// if (granted) {
// this.isShowPer = false;
// uni.makePhoneCall({
// phoneNumber: phone //
// })
// return;
// }
// this.isShowPer = false;
// // 2.
// const confirm = await this.showPermissionDialog(
// '',
// '便'
// );
// if (!confirm) return;
// // 3.
// const result = await permissionUtils.requestPermission('phone', '便');
// console.log('result',result)
// if (result) {
// uni.makePhoneCall({
// phoneNumber: phone //
// })
// return;
// } else {
// locationService.openAppSettings();
// return;
// // uni.showToast({ title: '', icon: 'none' });
// }
// }
}, },
// //
async cancelService(order) { async cancelService(order) {
console.log(order) console.log(order)
@ -314,7 +313,6 @@
content: '确定要取消该订单吗?', content: '确定要取消该订单吗?',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
// TODO:
let data = { let data = {
orderNo: order.number, orderNo: order.number,
amount: order.pay_money, amount: order.pay_money,
@ -327,6 +325,7 @@
}) })
this.formData.page = 1; this.formData.page = 1;
this.orderList = []; this.orderList = [];
this.hasMore = true;
this.loadOrders(); this.loadOrders();
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
@ -335,6 +334,7 @@
} }
}) })
}, },
// 退 // 退
async refoundService(order) { async refoundService(order) {
uni.showModal({ uni.showModal({
@ -342,7 +342,6 @@
content: '确定申请退款?退款后则订单取消!', content: '确定申请退款?退款后则订单取消!',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
// TODO: 退
let data = { let data = {
orderNo: order.number, orderNo: order.number,
amount: order.pay_money, amount: order.pay_money,
@ -365,6 +364,7 @@
}) })
this.formData.page = 1; this.formData.page = 1;
this.orderList = []; this.orderList = [];
this.hasMore = true;
this.loadOrders(); this.loadOrders();
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
@ -376,7 +376,6 @@
// //
payOrder(order) { payOrder(order) {
// TODO:
uni.navigateTo({ uni.navigateTo({
url: `/pages/shop/pay-order?id=${order.id}&money=${order.order_money}&title=${order.server_title}&number=${order.number}` url: `/pages/shop/pay-order?id=${order.id}&money=${order.order_money}&title=${order.server_title}&number=${order.number}`
}) })
@ -391,25 +390,26 @@
// //
orderAgain(order) { orderAgain(order) {
// TODO:
uni.navigateTo({ uni.navigateTo({
url: '/pages/shop/service-detail?id=' + order.server_id url: '/pages/shop/service-detail?id=' + order.server_id
}) })
}, },
// //
addComplaint(order) { addComplaint(order) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/complaint/add-complaint?number=' + order.number url: '/pages/complaint/add-complaint?number=' + order.number
}) })
}, },
// //
lookComplaint(order) { lookComplaint(order) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/complaint/detail?number=' + order.number url: '/pages/complaint/detail?number=' + order.number
}) })
}, },
goLogin() { goLogin() {
// uni.oprPresentLogin()
uni.navigateTo({ uni.navigateTo({
url: '/pages/blogPopup/blogPopup' url: '/pages/blogPopup/blogPopup'
}); });
@ -471,113 +471,155 @@
.order-item { .order-item {
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 16rpx; border-radius: 20rpx;
margin-bottom: 24rpx; margin-bottom: 24rpx;
padding: 24rpx; padding: 24rpx;
box-sizing: border-box; box-sizing: border-box;
position: relative;
} }
.order-header { .order-top {
display: flex; position: relative;
align-items: center; padding-right: 120rpx;
margin-bottom: 34rpx; min-height: 40rpx;
}
.order-tag {
width: 74rpx;
height: 38rpx;
display: flex;
flex-flow: row nowrap;
justify-content: center;
align-items: center;
border-radius: 19rpx;
margin-right: 8rpx;
background-color: rgba(232, 16, 30, 0.2);
}
.order-tag-text {
color: #E8101E;
font-size: 24rpx;
} }
.order-number { .order-number {
flex: 1; display: block;
font-size: 24rpx;
color: #666666;
}
.order-status {
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; color: #333333;
background-image: url('https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5349af61-d67a-4ecf-91ce-6e4f05ad5edb.png'); line-height: 40rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.order-status-badge {
font-weight: 400;
font-size: 26rpx;
color: #E8101E;
text-align: left;
font-style: normal;
position: absolute;
right: -24rpx;
top: -24rpx;
background-image: url("/static/images/icons/tabBj.png");
background-size: 100% auto;
background-position: center top;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100%;
height: 49rpx;
width: 128rpx; width: 128rpx;
padding-left: 30rpx; height: 49rpx;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
} }
.status-pending { .order-status-badge2 {
color: #E8101E; background-image: url("/static/images/icons/tabBj2.png");
color: #333333;
} }
.status-cancelled { .order-status-badge3 {
color: #E8101E; background-image: url("/static/images/icons/tabBj2.png");
} color: #999999 !important;
.status-completed {
color: #E8101E;
} }
.order-content { .order-content {
display: flex; display: flex;
margin-bottom: 24rpx; align-items: flex-start;
margin-top: 20rpx;
} }
.service-image { .service-image {
width: 182rpx; width: 162rpx;
height: 182rpx; height: 162rpx;
border-radius: 16rpx; border-radius: 24rpx;
margin-right: 24rpx; margin-right: 20rpx;
background-color: #000000; background-color: #F5F5F5;
flex-shrink: 0;
} }
.service-info { .service-info {
flex: 1; flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
justify-content: flex-start;
} }
.service-name { .service-name {
font-size: 24rpx; font-size: 30rpx;
color: #333333; color: #333333;
font-weight: 500; line-height: 42rpx;
margin-bottom: 12rpx;
word-break: break-all;
} }
.service-time, .service-time {
.service-address {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 24rpx; font-size: 24rpx;
line-height: 34rpx;
margin-bottom: 8rpx;
}
.label-text {
color: #666666;
}
.value-text {
color: #999999; color: #999999;
font-weight: 500; margin-left: 8rpx;
margin-top: 8rpx; }
.service-address {
display: flex;
align-items: flex-start; align-items: flex-start;
margin-bottom: 10rpx;
} }
.text-overflow-1 {
white-space: normal !important;
word-break: break-word !important;
overflow: visible !important;
text-overflow: clip !important;
flex: 1;
}
.time-icon,
.location-icon { .location-icon {
width: 24rpx; width: 24rpx;
height: 24rpx; height: 24rpx;
margin-right: 4rpx; margin-right: 6rpx;
flex-shrink: 0;
margin-top: 4rpx; margin-top: 4rpx;
flex-shrink: 0;
}
.address-text {
font-size: 24rpx;
color: #999999;
line-height: 34rpx;
word-break: break-all;
}
.price-row {
display: flex;
align-items: baseline;
margin-top: 6rpx;
}
.price-symbol {
font-size: 24rpx;
color: #FF0037;
line-height: 1;
}
.price-now {
font-size: 36rpx;
font-weight: 500;
color: #FF0037;
line-height: 1;
margin-left: 2rpx;
}
.price-old {
font-size: 22rpx;
color: #999999;
text-decoration: line-through;
margin-left: 10rpx;
line-height: 1;
} }
.order-actions { .order-actions {
@ -586,6 +628,12 @@
align-items: center; align-items: center;
border-top: 1rpx solid #EEEEEE; border-top: 1rpx solid #EEEEEE;
padding-top: 24rpx; padding-top: 24rpx;
margin-top: 24rpx;
}
.action-left {
display: flex;
align-items: center;
} }
.delete-icon { .delete-icon {
@ -596,41 +644,33 @@
.action-right { .action-right {
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: wrap;
justify-content: flex-end;
} }
.action-btn { .action-btn {
display: inline-block; display: inline-flex;
width: 128rpx; align-items: center;
height: 48rpx; justify-content: center;
line-height: 48rpx; min-width: 128rpx;
height: 60rpx;
padding: 0 28rpx;
margin-left: 16rpx; margin-left: 16rpx;
text-align: center; border-radius: 30rpx;
font-size: 28rpx;
border-radius: 24rpx;
font-size: 24rpx; font-size: 24rpx;
box-sizing: border-box;
} }
.action-btn.contact { .gray-btn {
background-color: #FFFFFF; background-color: #FFFFFF;
border: 1rpx solid #999999; border: 1rpx solid #999999;
color: #333333; color: #333333;
} }
.action-btn.primary { .red-btn {
background-color: #E8101E;
color: #FFFFFF;
}
.action-btn.review {
background-color: rgba(252, 67, 124, 0.40);
border: 1rpx solid #E8101E;
color: #FFFFFF;
}
.action-btn.again {
background-color: #FFFFFF; background-color: #FFFFFF;
border: 1rpx solid #999999; border: 1rpx solid #E8101E;
color: #666666; color: #E8101E;
} }
.nologin_part { .nologin_part {
@ -686,12 +726,12 @@
opacity: 1; opacity: 1;
visibility: visible; visibility: visible;
} }
/* #endif */ /* #endif */
/* 平台适配 */ /* 平台适配 */
/* #ifdef H5 */ /* #ifdef H5 */
/* .order-list { /* .order-list {
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
} */ } */
/* #endif */ /* #endif */
</style> </style>

View File

@ -88,6 +88,30 @@
<text class="label">下单时间</text> <text class="label">下单时间</text>
<text class="value">{{orderInfo.add_time}}</text> <text class="value">{{orderInfo.add_time}}</text>
</view> </view>
<view class="info-item">
<text class="label">服务时长</text>
<text class="value">{{ orderInfo.server_time }}分钟</text>
</view>
<view class="info-item" v-if="orderInfo.state != 1 && orderInfo.pay_kind">
<text class="label">支付方式</text>
<text class="value">{{
orderInfo.pay_kind == 1
? "账户余额"
: orderInfo.pay_kind == 2
? "微信支付"
: orderInfo.pay_kind == 3
? "支付宝支付"
: ""
}}</text>
</view>
<view class="info-item" v-if="orderInfo.state != 1 && orderInfo.pay_time">
<text class="label">支付时间</text>
<text class="value">{{ orderInfo.pay_time }}</text>
</view>
<view class="info-item" v-if="orderInfo.state >= 3 && orderInfo.get_time">
<text class="label">接单时间</text>
<text class="value">{{ orderInfo.get_time }}</text>
</view>
<view class="info-item" v-if="orderInfo.state != 1 && orderInfo.state != 2 && orderInfo.state != 3 && orderInfo.state != 7"> <view class="info-item" v-if="orderInfo.state != 1 && orderInfo.state != 2 && orderInfo.state != 3 && orderInfo.state != 7">
<text class="label">开始服务时间</text> <text class="label">开始服务时间</text>
<text class="value">{{orderInfo.server_start_time}}</text> <text class="value">{{orderInfo.server_start_time}}</text>

View File

@ -251,7 +251,7 @@
<text class="value">{{orderInfo.team_buy_order_number}}</text> <text class="value">{{orderInfo.team_buy_order_number}}</text>
</view> </view>
</view> </view>
<view class="order-card" v-if="Object.keys(orderInfo.coupon_info).length>0"> <view class="order-card" v-if="orderInfo.coupon_info && Object.keys(orderInfo.coupon_info).length > 0">
<text class="card-title">优惠券信息</text> <text class="card-title">优惠券信息</text>
<view class="coupon-item"> <view class="coupon-item">
<view class="info-item"> <view class="info-item">
@ -285,7 +285,7 @@
<view class="handel-button btn-bg" v-if="orderInfo.state == 3" @click.stop="startOrder($event, orderInfo)"> <view class="handel-button btn-bg" v-if="orderInfo.state == 3" @click.stop="startOrder($event, orderInfo)">
<text class="button-text">开始服务</text> <text class="button-text">开始服务</text>
</view> </view>
<view class="handel-button btn-bg" v-if="orderInfo.state != 4" @click.stop="endOrder($event, orderInfo)"> <view class="handel-button btn-bg" v-if="orderInfo.state == 4" @click.stop="endOrder($event, orderInfo)">
<text class="button-text">服务完成</text> <text class="button-text">服务完成</text>
</view> </view>
</view> </view>
@ -530,21 +530,19 @@
}; };
}, },
getOrderDetail() { getOrderDetail() {
request.post(this.urls[this.serviceType].detail, { return request.post(this.urls[this.serviceType].detail, {
id: this.id, id: this.id,
sjid: this.userInfo.id sjid: this.userInfo.id
}).then(res => { }).then(res => {
this.orderInfo = res.data; const newOrderInfo = res.data;
this.reservation_address_arr = res.data.reservation_address_arr; //
if (this.orderInfo && this.orderInfo.state > newOrderInfo.state) {
// newOrderInfo.state = this.orderInfo.state;
if (res.data.user_sj) {
this.user_sj = res.data.user_sj;
this.calculateDistance(); //
} }
this.orderInfo = newOrderInfo;
console.log(this.orderInfo) this.orderInfo.coupon_info = this.orderInfo.coupon_info || {};
}) this.reservation_address_arr = this.orderInfo.reservation_address_arr || {};
});
}, },
// //
@ -663,40 +661,41 @@
}, },
// //
onConfirm(code) { onConfirm(code) {
this.showInput = false this.showInput = false;
if (this.clickType) { if (this.clickType) return;
return this.clickType = true;
} uni.showLoading({ title: '服务开始中...' });
this.clickType = true
request.post(this.urls[this.serviceType].startOrder, { request.post(this.urls[this.serviceType].startOrder, {
id: this.orderInfo.id, id: this.orderInfo.id,
server_code: code, server_code: code,
sjid: this.userInfo.id sjid: this.userInfo.id
}).then(res => { }).then(res => {
console.log(res)
if (res.state == 1) { if (res.state == 1) {
uni.showToast({ uni.showToast({ title: res.msg, icon: 'success' });
title: res.msg, // 4
icon: 'none' this.orderInfo.state = 4;
}) //
this.getOrderDetail(); this.$forceUpdate();
// //
this.getOrderDetail().catch(e => console.warn('静默同步失败', e));
//
const pages = getCurrentPages(); const pages = getCurrentPages();
const prevPage = pages[pages.length - 2]; const prevPage = pages[pages.length - 2];
if (prevPage) { if (prevPage && prevPage.$vm) {
prevPage.$vm.getOrderNumber(); prevPage.$vm.getOrderNumber?.();
prevPage.$vm.getOrderList(); prevPage.$vm.getOrderList?.();
} }
} else if (res.state == 2) { } else if (res.state == 2) {
uni.showToast({ uni.showToast({ title: res.msg, icon: 'none' });
title: res.msg,
icon: 'none'
})
} }
this.handelOrder = {}; }).catch(err => {
console.error('开始服务失败', err);
uni.showToast({ title: '操作失败', icon: 'none' });
}).finally(() => { }).finally(() => {
this.clickType = false this.clickType = false;
}) uni.hideLoading();
});
}, },
// //
endOrder(e, order) { endOrder(e, order) {