取消订单详情滑动

This commit is contained in:
TOP糯米 2023-03-24 00:33:20 +08:00
parent 7809968a1e
commit f8145e492e
1 changed files with 84 additions and 121 deletions

View File

@ -15,124 +15,103 @@
</view>
</view>
<view class="order-detail-body">
<swiper
class="list-tab-list"
:current="tabIndex"
:duration="300"
@change="switchTab($event.detail.current)"
:style="{ minHeight: '75vh', height: tabHeight + 'px' }"
>
<swiper-item>
<view class="detail-tab tab0">
<!-- 不存在具体师傅时判断服务师傅展示方式 -->
<block v-if="utils.isType(order.worker, 'object') && !utils.isType(order.worker.id, 'number')">
<!-- 报价订单如果列表不为空则展示师傅列表 -->
<block v-if="order.listType == 't2' && order.orderType == 2">
<view
v-if="utils.isType(order.workerList, 'array') && order.workerList.length > 0"
class="worker-group"
>
<view class="worker-item" v-for="(item, index) in order.workerList" :key="index">
<view class="datetime">{{ item.createTime }}</view>
<view class="price">
<text class="title">报价金额</text>
<text class="number">¥ {{ utils.formatNumber(item.price, 2) }}</text>
</view>
<view class="detail" @click="workerDetail(item.id)">
<worker-item :data="item" :showPrice="false" />
</view>
<view class="action">
<view class="btn" @click="chooseWorker(item.uid)">选择师傅</view>
</view>
</view>
<view v-show="tabIndex == 0" class="detail-tab">
<!-- 不存在具体师傅时判断服务师傅展示方式 -->
<block v-if="utils.isType(order.worker, 'object') && !utils.isType(order.worker.id, 'number')">
<!-- 报价订单如果列表不为空则展示师傅列表 -->
<block v-if="order.listType == 't2' && order.orderType == 2">
<view v-if="utils.isType(order.workerList, 'array') && order.workerList.length > 0" class="worker-group">
<view class="worker-item" v-for="(item, index) in order.workerList" :key="index">
<view class="datetime">{{ item.createTime }}</view>
<view class="price">
<text class="title">报价金额</text>
<text class="number">¥ {{ utils.formatNumber(item.price, 2) }}</text>
</view>
<view
v-if="utils.isType(order.workerList, 'array') && order.workerList.length == 0"
class="desc-text"
>
当前暂无师傅报价
<view class="detail" @click="workerDetail(item.id)">
<worker-item :data="item" :showPrice="false" />
</view>
<view class="action">
<view class="btn" @click="chooseWorker(item.uid)">选择师傅</view>
</view>
</block>
<!-- 购买订单一口价订单展示暂无师傅 -->
<view
v-if="(order.listType == 't1' || order.listType == 't2') && order.orderType == 1"
class="desc-text"
>
当前暂无师傅接单
</view>
</block>
<!-- 存在师傅信息展示师傅详情 -->
<block v-if="utils.isType(order.worker, 'object') && utils.isType(order.worker.id, 'number')">
<view class="desc-text">{{ order.worker.id }}-{{ order.worker.name }}</view>
</block>
</view>
<view v-if="utils.isType(order.workerList, 'array') && order.workerList.length == 0" class="desc-text">
当前暂无师傅报价
</view>
</block>
<!-- 购买订单一口价订单展示暂无师傅 -->
<view v-if="(order.listType == 't1' || order.listType == 't2') && order.orderType == 1" class="desc-text">
当前暂无师傅接单
</view>
</swiper-item>
<swiper-item>
<view class="detail-tab tab1">
<view class="order-detail">
<view class="section info">
<view class="section-title">订单信息</view>
<view class="info-row">
<text class="title">订单编号</text>
<text class="text">{{ order.orderId }}</text>
<text class="copy" @click.stop="copyOrderId(order.orderId)">复制</text>
</block>
<!-- 存在师傅信息展示师傅详情 -->
<block v-if="utils.isType(order.worker, 'object') && utils.isType(order.worker.id, 'number')">
<view class="desc-text">{{ order.worker.id }}-{{ order.worker.name }}</view>
</block>
</view>
<view v-show="tabIndex == 1" class="detail-tab tab1">
<view class="order-detail">
<view class="section info">
<view class="section-title">订单信息</view>
<view class="info-row">
<text class="title">订单编号</text>
<text class="text">{{ order.orderId }}</text>
<text class="copy" @click.stop="copyOrderId(order.orderId)">复制</text>
</view>
<view class="info-row">
<text class="title">服务分类</text>
<text class="text">{{ order.cate }}</text>
</view>
<view class="info-row limit-line clamp-1">
<text class="title">需求内容</text>
<text class="text">{{ order.content }}</text>
</view>
<view class="info-row">
<text class="title">下单时间</text>
<text class="text">{{ order.createTime }}</text>
</view>
<view class="info-row">
<text class="title">服务时间</text>
<text class="text">{{ order.serviceTime }}</text>
</view>
</view>
<view class="section insurance">
<service-insurance :showSwitch="false" />
</view>
<view class="section address">
<view class="section-title">服务信息</view>
<view class="address-box">
<text class="iconfont icon-dingwei"></text>
<view>
<view class="contact limit-line clamp-1">
<text class="name">
{{ order.address.name }}({{ order.address.gender == 1 ? "先生" : "女士" }})
</text>
<text class="mobile">{{ order.address.mobile }}</text>
</view>
<view class="info-row">
<text class="title">服务分类</text>
<text class="text">{{ order.cate }}</text>
</view>
<view class="info-row limit-line clamp-1">
<text class="title">需求内容</text>
<text class="text">{{ order.content }}</text>
</view>
<view class="info-row">
<text class="title">下单时间</text>
<text class="text">{{ order.createTime }}</text>
</view>
<view class="info-row">
<text class="title">服务时间</text>
<text class="text">{{ order.serviceTime }}</text>
<view class="detail">
<text>{{ order.address.address }}{{ order.address.detail }}</text>
</view>
</view>
<view class="section insurance">
<service-insurance :showSwitch="false" />
</view>
</view>
<view class="section demand">
<view class="section-title">需求信息</view>
<view class="demand-box">
<view class="textarea-box">
<text class="textarea">{{ order.content }}</text>
</view>
<view class="section address">
<view class="section-title">服务信息</view>
<view class="address-box">
<text class="iconfont icon-dingwei"></text>
<view>
<view class="contact limit-line clamp-1">
<text class="name">
{{ order.address.name }}({{ order.address.gender == 1 ? "先生" : "女士" }})
</text>
<text class="mobile">{{ order.address.mobile }}</text>
</view>
<view class="detail">
<text>{{ order.address.address }}{{ order.address.detail }}</text>
</view>
</view>
</view>
</view>
<view class="section demand">
<view class="section-title">需求信息</view>
<view class="demand-box">
<view class="textarea-box">
<text class="textarea">{{ order.content }}</text>
</view>
<view class="common-form-container">
<view class="upload-item">
<view class="image-box" v-for="(item, index) in order.images" :key="index">
<image class="image" :src="item" mode="aspectFill" />
</view>
</view>
<view class="common-form-container">
<view class="upload-item">
<view class="image-box" v-for="(item, index) in order.images" :key="index">
<image class="image" :src="item" mode="aspectFill" />
</view>
</view>
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
</view>
</view>
<view class="common-bottom-components" :style="{ bottom: pageConfig.safeAreaInsets.bottom + 'px' }">
<view class="service" @click="showService = true">
@ -212,19 +191,6 @@ export default {
*/
switchTab(index) {
this.tabIndex = index;
this.$nextTick(() => {
this.setTabHeight();
});
},
setTabHeight() {
let element = ".tab" + this.tabIndex;
let query = uni.createSelectorQuery().in(this);
query.select(element).boundingClientRect();
query.exec((res) => {
if (res && res[0]) {
this.tabHeight = res[0].height;
}
});
},
//
copyOrderId(orderId) {
@ -295,9 +261,6 @@ export default {
...detail,
listType: this.listType,
};
this.$nextTick(() => {
this.setTabHeight();
});
})
.catch((e) => {
this.$utils.toast(e).then(() => {