dingdong-master/pages/demand-center/demand-detail.vue

130 lines
5.2 KiB
Vue
Raw Normal View History

<template>
<view>
<!-- 顶部操作条 -->
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">任务详情</block>
</cu-custom>
<view class="padding bg-white margin-top-sm margin-lr-sm">
<view class="flex justify-between">
<view class="text-lg text-bold text-cut" style="width: 70%;">{{order.title}}</view>
<view class="text-right">
<view class="text-lg text-price text-red text-bold">{{order.price}}</view>
<view v-if="order.expeditedPrice">
<text>加急</text><text class="text-price text-red text-bold">{{order.expeditedPrice}}</text>
</view>
</view>
</view>
<view class="flex justify-start">
<view v-for="(tagContent, index1) in order.tag" class='cu-tag margin-right-xs'>{{tagContent}}</view>
</view>
<view class="margin-top-sm">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-locationfill"></text></text>
<text>{{order.address}}</text>
</view>
<view class="margin-top-sm">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-timefill"></text></text>
<text>{{order.doorTime}}</text>
</view>
<view class="margin-top-sm">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-phone"></text></text>
<text class="margin-right-xs">{{order.contactPerson}}</text>
<text>{{order.phoneNum}}</text>
</view>
</view>
<view class="margin-top-sm bg-white margin-lr-sm margin-bottom-with-bar">
<view class="cu-bar solid-bottom">
<view class="action bar-first-action">
<text class="cuIcon-titles text-main-color"></text> 商品信息
</view>
</view>
<view class="padding">
<view class="cu-avatar margin-bottom-sm" :style="'background-image:url(' + order.picUrl + '); width: 180rpx; height: 180rpx'"></view>
<view class="margin-bottom-sm"><text class="text-bold">商品规格</text>{{order.spec}}</view>
<view class="margin-bottom-sm"><text class="text-bold">服务类别</text>{{order.servType}}</view>
<view class="margin-bottom-sm"><text class="text-bold">订单编码</text>{{order.serialId}}</view>
<view class="margin-bottom-sm"><text class="text-bold">订单时间</text>{{order.createTime}}</view>
<view class="margin-bottom-sm"><text class="text-bold">备注</text>{{order.comments}}</view>
</view>
</view>
<view class="cu-bar tabbar border shop fixed-bottom-bar">
<button class="bg-main-color long-btn margin-lr-sm" data-take-modal="showTakeSuccessModal" data-certify-modal="showTakeCertifiedModal" @click="takeTask">立即接单</button>
</view>
<!-- 接单认证模态框 -->
<view class="cu-modal" :class="showTakeCertifiedModal?'show':''">
<view class="cu-dialog">
<view class="padding-xl">
<view class="cuIcon-profile big-icon padding-tb text-main-color"></view>
<view>您还未进行认证</view>
</view>
<view class="cu-bar bg-white solid-top">
<view class="action margin-0 flex-sub text-black" data-modal="showTakeCertifiedModal" @tap="hideModal">以后认证</view>
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="showTakeCertifiedModal" @tap="hideModal"
@click="goToCertify">立即认证</view>
</view>
</view>
</view>
<!-- 接单成功模态框 -->
<view class="cu-modal" :class="showTakeSuccessModal?'show':''">
<view class="cu-dialog">
<view class="padding-xl">
<view class="cuIcon-roundcheck big-icon padding-tb text-main-color"></view>
<view class="text-bold text-lg margin-bottom-sm">接单成功</view>
<view>请在30分钟内联系客户预约好上门时间并在订单中操作排单时间超时6倍将受平台处罚管理该订单佣金在完成任务24小时内计入您的账户</view>
</view>
<view class="cu-bar bg-white solid-top">
<view class="action margin-0 flex-sub text-black" data-modal="showTakeSuccessModal" @click="contactCustomer">联系客户</view>
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="showTakeSuccessModal" @tap="hideModal" @click="continueAcceptDemand">继续接单</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
order: {},
takeCertify: false,
showTakeCertifiedModal: false,
showTakeSuccessModal: false
}
},
onLoad(options) {
let paramObj = JSON.parse(decodeURIComponent(options.paramObj));
this.loadData(paramObj.orderId);
},
methods: {
async loadData(orderId) {
this.order = await this.$api.data('order');
this.takeCertify = await this.$api.data('takeCertify');
},
takeTask(e) {
if (this.takeCertify) {
// 已认证可直接接单
e.currentTarget.dataset.modal = e.currentTarget.dataset.takeModal;
} else {
// 未认证需提示前往认证
e.currentTarget.dataset.modal = e.currentTarget.dataset.certifyModal;
}
this.showModal(e);
},
showModal(e) {
this[e.currentTarget.dataset.modal] = true;
},
hideModal(e) {
this[e.currentTarget.dataset.modal] = false;
},
continueAcceptDemand() {
uni.navigateBack({
delta: -1
})
}
}
}
</script>
<style>
</style>