bug修改
This commit is contained in:
parent
566b6f8929
commit
0c411882d9
|
|
@ -209,7 +209,7 @@
|
|||
secondTabs() {
|
||||
if (this.activeFirstId == 1 || this.activeFirstId == 2) {
|
||||
return [{
|
||||
title: `待服务(${this.numInfo.noservernum})`,
|
||||
title: `待开始(${this.numInfo.noservernum})`,
|
||||
id: 3
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,32 +13,40 @@
|
|||
<scroll-view scroll-y class="order-scroll" @scrolltolower="loadMore" refresher-enabled
|
||||
:refresher-triggered="isRefreshing" @refresherrefresh="onRefresh">
|
||||
<view class="order-item" v-for="(order, index) in orderList" :key="index">
|
||||
<!-- 订单编号和状态 -->
|
||||
<view class="order-header">
|
||||
<view class="order-tag">
|
||||
<text
|
||||
class="order-tag-text">{{order.order_kind == 1 ? '到家' : order.order_kind == 2 ? '到店' : ''}}</text>
|
||||
</view>
|
||||
<!-- 顶部:订单编号 + 状态 -->
|
||||
<view class="order-top">
|
||||
<text class="order-number">订单编号:{{order.number}}</text>
|
||||
<text class="order-status"
|
||||
: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>
|
||||
<view class="order-status-badge" :class="{
|
||||
'order-status-badge2': order.state > 4 && order.state !== 7,
|
||||
'order-status-badge3': order.state === 7
|
||||
}">
|
||||
{{ getStatusText(order.state) }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单内容 -->
|
||||
<view class="order-content" @click="goDetail(order)">
|
||||
<image v-if="order.order_photo" :src="order.order_photo[0]" mode="aspectFill"
|
||||
class="service-image"></image>
|
||||
<image v-if="order.order_photo && order.order_photo.length" :src="order.order_photo[0]"
|
||||
mode="aspectFill" class="service-image"></image>
|
||||
<view class="service-image" v-else></view>
|
||||
|
||||
<view class="service-info">
|
||||
<text class="service-name">{{order.server_title}}</text>
|
||||
<view class="service-time" v-if="order.order_kind == 1">
|
||||
<image src="/static/images/time_icon.png" class="time-icon"></image>
|
||||
<text>{{order.reservation_time}}</text>
|
||||
<view class="service-name">{{order.server_title}}</view>
|
||||
|
||||
<view class="service-time" v-if="getDisplayTime(order)">
|
||||
<text class="label-text">下单时间:</text>
|
||||
<text class="value-text">{{ getDisplayTime(order) }}</text>
|
||||
</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>
|
||||
<text>{{Object.assign({},order.reservation_address_arr).dependency}}{{Object.assign({},order.reservation_address_arr).address}}
|
||||
</text>
|
||||
<text class="address-text">{{ getFullAddress(order) }}</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>
|
||||
|
|
@ -50,26 +58,31 @@
|
|||
v-if="order.state == 5 || order.state == 6 || order.state == 7"></image>
|
||||
</view>
|
||||
<view class="action-right">
|
||||
<text class="action-btn contact" @click="cancelService(order)"
|
||||
v-if="order.state == 1">取消订单</text>
|
||||
<text class="action-btn contact" @click="refoundService(order)"
|
||||
v-if="order.state == 2 || order.state == 3">申请退款</text>
|
||||
<text class="action-btn contact" @click="contactService(order.order_shopphone)"
|
||||
v-if="order.state != 7 || order.state!=2">联系客服</text>
|
||||
<text class="action-btn primary" v-if="order.state == 1"
|
||||
@click="payOrder(order)">立即支付</text>
|
||||
<text class="action-btn review" v-if="order.state == 6"
|
||||
@click="reviewOrder(order)">评价</text>
|
||||
<text class="action-btn again"
|
||||
v-if="order.state == 5 || order.state == 6 || order.state == 7"
|
||||
@click="orderAgain(order)">再来一单</text>
|
||||
<!-- <text
|
||||
class="action-btn again"
|
||||
v-if="order.state == 5 && order.appeal == 1"
|
||||
@click="addComplaint(order)"
|
||||
>投诉</text> -->
|
||||
<text class="action-btn again" v-if="order.state == 5 && order.appeal == 2"
|
||||
@click="lookComplaint(order)">查看投诉</text>
|
||||
<text class="action-btn gray-btn" @click="cancelService(order)" v-if="order.state == 1">
|
||||
取消订单
|
||||
</text>
|
||||
<text class="action-btn gray-btn" @click="refoundService(order)"
|
||||
v-if="order.state == 2 || order.state == 3">
|
||||
申请退款
|
||||
</text>
|
||||
<!-- <text class="action-btn gray-btn" @click="contactService(order.order_shopphone)"
|
||||
v-if="order.state != 7 && order.state != 2">
|
||||
联系客服
|
||||
</text> -->
|
||||
<text class="action-btn red-btn" v-if="order.state == 1" @click="payOrder(order)">
|
||||
立即支付
|
||||
</text>
|
||||
<text class="action-btn red-btn" v-if="order.state == 6" @click="reviewOrder(order)">
|
||||
评价
|
||||
</text>
|
||||
<text class="action-btn gray-btn" v-if="order.state == 5 || order.state == 6 || order.state == 7"
|
||||
@click="orderAgain(order)">
|
||||
再来一单
|
||||
</text>
|
||||
<text class="action-btn gray-btn" v-if="order.state == 5 && order.appeal == 2"
|
||||
@click="lookComplaint(order)">
|
||||
查看投诉
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -86,14 +99,13 @@
|
|||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view class="nologin_part" v-else>
|
||||
<image src="/static/images/no_login.png" class="nologin_icon" mode="aspectFit"></image>
|
||||
<view class="btn-login">
|
||||
<text class="login-text" @click="goLogin">前去登录</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -104,6 +116,7 @@
|
|||
import {
|
||||
debounce
|
||||
} from '@/utils/debounce.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -131,7 +144,6 @@
|
|||
id: 7,
|
||||
title: '已取消'
|
||||
}],
|
||||
// ,{id: 6,title: '待评价'}
|
||||
currentTab: 0,
|
||||
isRefreshing: false,
|
||||
hasMore: true,
|
||||
|
|
@ -145,7 +157,6 @@
|
|||
},
|
||||
onLoad() {
|
||||
// this.loadOrders();
|
||||
|
||||
},
|
||||
async onShow() {
|
||||
this.isLogin = uni.getStorageSync('accessToken') ? true : false;
|
||||
|
|
@ -165,7 +176,6 @@
|
|||
this.currentTab = index;
|
||||
this.orderList = [];
|
||||
this.formData.page = 1;
|
||||
// TODO: 根据当前标签加载对应订单数据
|
||||
if (this.currentTab != 0) {
|
||||
this.formData.state = this.currentTab;
|
||||
} else {
|
||||
|
|
@ -193,13 +203,13 @@
|
|||
this.isRefreshing = true
|
||||
this.formData.page = 1;
|
||||
this.orderList = [];
|
||||
this.hasMore = true;
|
||||
this.loadOrders()
|
||||
},
|
||||
|
||||
// 加载更多
|
||||
loadMore() {
|
||||
if (!this.hasMore) return
|
||||
// TODO: 加载更多订单数据
|
||||
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) {
|
||||
uni.showModal({
|
||||
|
|
@ -218,7 +266,6 @@
|
|||
content: '确定要删除该订单吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// TODO: 删除订单
|
||||
request.post('/sj/deleteorder', {
|
||||
id: order.id,
|
||||
sjid: this.sjid
|
||||
|
|
@ -229,6 +276,7 @@
|
|||
})
|
||||
this.formData.page = 1;
|
||||
this.orderList = [];
|
||||
this.hasMore = true;
|
||||
this.loadOrders();
|
||||
})
|
||||
}
|
||||
|
|
@ -249,63 +297,14 @@
|
|||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 联系客服
|
||||
async contactService(phone) {
|
||||
// TODO: 实现联系客服功能
|
||||
uni.navigateTo({
|
||||
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) {
|
||||
console.log(order)
|
||||
|
|
@ -314,7 +313,6 @@
|
|||
content: '确定要取消该订单吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// TODO: 取消订单
|
||||
let data = {
|
||||
orderNo: order.number,
|
||||
amount: order.pay_money,
|
||||
|
|
@ -327,6 +325,7 @@
|
|||
})
|
||||
this.formData.page = 1;
|
||||
this.orderList = [];
|
||||
this.hasMore = true;
|
||||
this.loadOrders();
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
|
|
@ -335,6 +334,7 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 申请退款
|
||||
async refoundService(order) {
|
||||
uni.showModal({
|
||||
|
|
@ -342,7 +342,6 @@
|
|||
content: '确定申请退款?退款后则订单取消!',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// TODO: 申请退款
|
||||
let data = {
|
||||
orderNo: order.number,
|
||||
amount: order.pay_money,
|
||||
|
|
@ -365,6 +364,7 @@
|
|||
})
|
||||
this.formData.page = 1;
|
||||
this.orderList = [];
|
||||
this.hasMore = true;
|
||||
this.loadOrders();
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
|
|
@ -376,7 +376,6 @@
|
|||
|
||||
// 支付订单
|
||||
payOrder(order) {
|
||||
// TODO: 实现支付功能
|
||||
uni.navigateTo({
|
||||
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) {
|
||||
// TODO: 实现再次下单功能
|
||||
uni.navigateTo({
|
||||
url: '/pages/shop/service-detail?id=' + order.server_id
|
||||
})
|
||||
},
|
||||
|
||||
// 投诉
|
||||
addComplaint(order) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/complaint/add-complaint?number=' + order.number
|
||||
})
|
||||
},
|
||||
|
||||
// 查看投诉
|
||||
lookComplaint(order) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/complaint/detail?number=' + order.number
|
||||
})
|
||||
},
|
||||
|
||||
goLogin() {
|
||||
// uni.oprPresentLogin()
|
||||
uni.navigateTo({
|
||||
url: '/pages/blogPopup/blogPopup'
|
||||
});
|
||||
|
|
@ -471,113 +471,155 @@
|
|||
|
||||
.order-item {
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 24rpx;
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.order-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 34rpx;
|
||||
}
|
||||
|
||||
.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-top {
|
||||
position: relative;
|
||||
padding-right: 120rpx;
|
||||
min-height: 40rpx;
|
||||
}
|
||||
|
||||
.order-number {
|
||||
flex: 1;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.order-status {
|
||||
display: block;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
background-image: url('https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5349af61-d67a-4ecf-91ce-6e4f05ad5edb.png');
|
||||
color: #333333;
|
||||
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-size: 100%;
|
||||
height: 49rpx;
|
||||
width: 128rpx;
|
||||
padding-left: 30rpx;
|
||||
height: 49rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.status-pending {
|
||||
color: #E8101E;
|
||||
.order-status-badge2 {
|
||||
background-image: url("/static/images/icons/tabBj2.png");
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.status-cancelled {
|
||||
color: #E8101E;
|
||||
}
|
||||
|
||||
.status-completed {
|
||||
color: #E8101E;
|
||||
.order-status-badge3 {
|
||||
background-image: url("/static/images/icons/tabBj2.png");
|
||||
color: #999999 !important;
|
||||
}
|
||||
|
||||
.order-content {
|
||||
display: flex;
|
||||
margin-bottom: 24rpx;
|
||||
align-items: flex-start;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.service-image {
|
||||
width: 182rpx;
|
||||
height: 182rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-right: 24rpx;
|
||||
background-color: #000000;
|
||||
width: 162rpx;
|
||||
height: 162rpx;
|
||||
border-radius: 24rpx;
|
||||
margin-right: 20rpx;
|
||||
background-color: #F5F5F5;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.service-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.service-name {
|
||||
font-size: 24rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
line-height: 42rpx;
|
||||
margin-bottom: 12rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.service-time,
|
||||
.service-address {
|
||||
.service-time {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
line-height: 34rpx;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.label-text {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.value-text {
|
||||
color: #999999;
|
||||
font-weight: 500;
|
||||
margin-top: 8rpx;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
|
||||
.service-address {
|
||||
display: flex;
|
||||
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 {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-right: 4rpx;
|
||||
flex-shrink: 0;
|
||||
margin-right: 6rpx;
|
||||
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 {
|
||||
|
|
@ -586,6 +628,12 @@
|
|||
align-items: center;
|
||||
border-top: 1rpx solid #EEEEEE;
|
||||
padding-top: 24rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.action-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.delete-icon {
|
||||
|
|
@ -596,41 +644,33 @@
|
|||
.action-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
display: inline-block;
|
||||
width: 128rpx;
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 128rpx;
|
||||
height: 60rpx;
|
||||
padding: 0 28rpx;
|
||||
margin-left: 16rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
border-radius: 24rpx;
|
||||
border-radius: 30rpx;
|
||||
font-size: 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.action-btn.contact {
|
||||
.gray-btn {
|
||||
background-color: #FFFFFF;
|
||||
border: 1rpx solid #999999;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.action-btn.primary {
|
||||
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 {
|
||||
.red-btn {
|
||||
background-color: #FFFFFF;
|
||||
border: 1rpx solid #999999;
|
||||
color: #666666;
|
||||
border: 1rpx solid #E8101E;
|
||||
color: #E8101E;
|
||||
}
|
||||
|
||||
.nologin_part {
|
||||
|
|
@ -686,12 +726,12 @@
|
|||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
|
||||
/* 平台适配 */
|
||||
/* #ifdef H5 */
|
||||
/* .order-list {
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
} */
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
} */
|
||||
/* #endif */
|
||||
</style>
|
||||
|
|
@ -88,6 +88,30 @@
|
|||
<text class="label">下单时间</text>
|
||||
<text class="value">{{orderInfo.add_time}}</text>
|
||||
</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">
|
||||
<text class="label">开始服务时间</text>
|
||||
<text class="value">{{orderInfo.server_start_time}}</text>
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@
|
|||
<text class="value">{{orderInfo.team_buy_order_number}}</text>
|
||||
</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>
|
||||
<view class="coupon-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)">
|
||||
<text class="button-text">开始服务</text>
|
||||
</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>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -530,21 +530,19 @@
|
|||
};
|
||||
},
|
||||
getOrderDetail() {
|
||||
request.post(this.urls[this.serviceType].detail, {
|
||||
return request.post(this.urls[this.serviceType].detail, {
|
||||
id: this.id,
|
||||
sjid: this.userInfo.id
|
||||
}).then(res => {
|
||||
this.orderInfo = res.data;
|
||||
this.reservation_address_arr = res.data.reservation_address_arr;
|
||||
|
||||
// 添加店铺信息(如果有的话)
|
||||
if (res.data.user_sj) {
|
||||
this.user_sj = res.data.user_sj;
|
||||
this.calculateDistance(); // 计算距离
|
||||
const newOrderInfo = res.data;
|
||||
// 保留当前前端已经更新的状态
|
||||
if (this.orderInfo && this.orderInfo.state > newOrderInfo.state) {
|
||||
newOrderInfo.state = this.orderInfo.state;
|
||||
}
|
||||
|
||||
console.log(this.orderInfo)
|
||||
})
|
||||
this.orderInfo = newOrderInfo;
|
||||
this.orderInfo.coupon_info = this.orderInfo.coupon_info || {};
|
||||
this.reservation_address_arr = this.orderInfo.reservation_address_arr || {};
|
||||
});
|
||||
},
|
||||
|
||||
// 打开店铺地图
|
||||
|
|
@ -663,40 +661,41 @@
|
|||
},
|
||||
// 输入完成
|
||||
onConfirm(code) {
|
||||
this.showInput = false
|
||||
if (this.clickType) {
|
||||
return
|
||||
}
|
||||
this.clickType = true
|
||||
this.showInput = false;
|
||||
if (this.clickType) return;
|
||||
this.clickType = true;
|
||||
uni.showLoading({ title: '服务开始中...' });
|
||||
|
||||
request.post(this.urls[this.serviceType].startOrder, {
|
||||
id: this.orderInfo.id,
|
||||
server_code: code,
|
||||
sjid: this.userInfo.id
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.state == 1) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
this.getOrderDetail();
|
||||
// 修改上一页页面信息
|
||||
uni.showToast({ title: res.msg, icon: 'success' });
|
||||
// 直接修改状态为 4(待完成)
|
||||
this.orderInfo.state = 4;
|
||||
// 强制刷新视图,按钮立即变化
|
||||
this.$forceUpdate();
|
||||
// 后台静默获取真实数据,确保后续操作数据准确
|
||||
this.getOrderDetail().catch(e => console.warn('静默同步失败', e));
|
||||
// 刷新上一页订单列表
|
||||
const pages = getCurrentPages();
|
||||
const prevPage = pages[pages.length - 2];
|
||||
if (prevPage) {
|
||||
prevPage.$vm.getOrderNumber();
|
||||
prevPage.$vm.getOrderList();
|
||||
if (prevPage && prevPage.$vm) {
|
||||
prevPage.$vm.getOrderNumber?.();
|
||||
prevPage.$vm.getOrderList?.();
|
||||
}
|
||||
} else if (res.state == 2) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
uni.showToast({ title: res.msg, icon: 'none' });
|
||||
}
|
||||
this.handelOrder = {};
|
||||
}).catch(err => {
|
||||
console.error('开始服务失败', err);
|
||||
uni.showToast({ title: '操作失败', icon: 'none' });
|
||||
}).finally(() => {
|
||||
this.clickType = false
|
||||
})
|
||||
this.clickType = false;
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
// 完成服务
|
||||
endOrder(e, order) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue