|
|
- <template>
- <view class="order">
- <mNavbar title="订单详情" :leftClick="toLeft" style="background: linear-gradient(#4899a6, rgb(78 160 167));" />
- <view class="box">
-
- <view class="title">
- <view class="icon">
- <uni-icons type="wallet-filled" color="#4899a6" size="15"></uni-icons>
- </view>
- <view class="text">
- <!-- 订单已完成 -->
- {{ getOrderState(msgOrder.tenState) }}
- </view>
- </view>
-
- <!-- <view class="tips">
- 请确认订单
- </view> -->
-
- <van-steps style="background: transparent;padding-bottom: 30px;" active-color="#fff" inactive-color="#ddd"
- :active="stepsActive">
- <van-step v-for="(item, index) in steps">
-
- <template #active-icon>
- <view class="active-icon"></view>
- </template>
-
- <view :class="{color : index <
- stepsActive,stepText : true,
- tip : index == 2 || index == 4}">
- {{ item }}
- <view :class="{act : index == stepsActive}"></view>
- </view>
-
- <template #inactive-icon>
- <view :class="{'inactive-icon' : true,
- tip : index == 2 || index == 4}"></view>
- </template>
- </van-step>
- </van-steps>
-
- <view v-if="msgOrder.state !=4" class="btns">
- <view class="btn" v-if="msgOrder.tenState == 0 && msgOrder.state != 4"
- @click.stop="confirmVipOrder(msgOrder, getOrderDetail)">
- 确认订单
- </view>
- <view class="btn" v-if="msgOrder.tenState == 1" @click.stop="startVipOrder(msgOrder, getOrderDetail)">
- 技师出发
- </view>
- <view class="btn" v-if="msgOrder.tenState == 2" @click.stop="arriveVipOrder(msgOrder, getOrderDetail)">
- 到达打卡
- </view>
- <view class="btn" v-if="msgOrder.tenState == 3" @click.stop="startVipService(msgOrder, getOrderDetail)">
- 开始服务
- </view>
- <view class="btn" v-if="msgOrder.tenState == 4"
- @click.stop="endVipService(msgOrder, toEvaluate, msgOrder.id, msgShop.id)">
- 结束服务
- </view>
- <view class="btn" v-if="msgOrder.tenState == 4 && !isTimeout"
- @click.stop="toCountdown(msgOrder)">
- 服务时间
- </view>
- <!-- <view class="btn" @click.stop="toEvaluate()" v-if="msgOrder.tenState == 5">
- 投诉举报
- </view> -->
- <view class="btn" @click.stop="toEvaluate(msgOrder.id,msgOrder.projectId)"
- v-if="msgOrder.tenState == 5 && msgOrder.evaluated == 0">
- 立即评价
- </view>
- </view>
-
- <view v-else class="bottom">
- <view @click.stop="()=>{}" class="cancel-btn">
- 用户取消
- </view>
- </view>
-
- </view>
- <view class="info">
- <view class="flex">
- <view style="width: 8rpx;height: 30rpx;
- background: #6fc6ad;border-radius: 6rpx;" />
- <view class="head-title">服务项目</view>
- </view>
-
- <view class="flex">
- <view class="server-item">
- <view class="img-box">
- <image :src="msgShop.image" mode="aspectFill"></image>
- </view>
- <view class="server-info">
- <view class="server-title">
- {{msgOrder.projectName}}
- <!-- <view class="coupon">领券立减</view> -->
- </view>
- <view class="current-price">
- <text class="unit">¥</text>{{msgOrder.money}}
- </view>
- <view class="time-coupon">
- <view class="flex">
- <image src="@/static/home/time-icon.png"></image>
- <view class="time">{{msgOrder.useTime}}分钟</view>
- </view>
- <view class="sales-volume">
- <image src="@/static/icons/icon1.png"></image>
- <view class="desc">已售出{{msgShop.payNum}}+单</view>
- </view>
- </view>
- <view class="sales-volume" style="margin-top: 5px;">
- <view class="desc">服务时间:{{msgOrder.startServiceTime}}</view>
- </view>
- </view>
- </view>
- </view>
-
- <view class="line min_tips">
- <view class="head-div flex">
- <view style="width: 118rpx;height: 118rpx;border-radius: 50%;overflow: hidden;">
- <image style="width: 118rpx;" :src="msgTechnician.image" mode="widthFix"></image>
- </view>
- <view
- style="padding: 10rpx 34rpx;display: flex;flex-direction: column;justify-content: space-around;">
- <view class="nickname">
- {{msgTechnician.title}}
- <view v-if="msgTechnician.isVip" class="tag">
- <image src="@/static/order/s.png" mode="aspectFit"></image>
- <view class="auth">官方认证</view>
- </view>
- </view>
- <view class="days">
- <van-rate v-model="msgTechnician.score" :size="10" readonly color="#ffb54c" void-icon="star"
- void-color="#eee" />
- <view class="">
- 好评{{msgTechnician.pinNum}}
- </view>
- </view>
- </view>
- </view>
- <view class="btn-x">
- 服务技师
- </view>
- </view>
-
- <view class="line address">
- <view class="address-top">
- <view class="">
- 服务地址
- </view>
- <view class="copy">
- <image @click="copy(msgOrder.name + ' ' + msgOrder.phone + ' ' + msgOrder.address)"
- src="/static/order/copy.png"></image>
- </view>
- </view>
- <view class="addressDetail">
- <view class="">{{msgOrder.name}} {{msgOrder.phone}}</view>
- <view class="">{{msgOrder.address}}</view>
- </view>
- </view>
-
-
- <view class="line">
- <view class="t min_tips">
- <view class="">
- 实付款(含路费)
- </view>
- <view class="current-price">
- ¥{{ msgOrder.money }}
- </view>
- </view>
- <view class="min_tips">
- <view class="">
- 订单金额
- </view>
- <view class="">
- ¥{{ msgShop.price }}
- </view>
- </view>
- <view class="min_tips">
- <view class="">
- 车费
- </view>
- <view class="">
- ¥{{ msgOrder.temp}}
- </view>
- </view>
- <view class="min_tips">
- <view class="">
- 优惠券
- </view>
- <view class="">
- -¥{{ coupon ? coupon.money : 0 }}
- </view>
- </view>
- </view>
-
- <!-- 订单信息 -->
- <view class="line">
- <view class="t min_tips">
- <view class="">
- 订单信息
- </view>
- </view>
- <view class="min_tips">
- <view class="">
- 订单编号
- </view>
- <view class="">
- {{msgOrder.id}}
- </view>
- </view>
- <view class="min_tips">
- <view class="">
- 下单时间
- </view>
- <view class="">
- {{msgOrder.createTime}}
- </view>
- </view>
- <view class="min_tips">
- <view class="">
- 平台金额
- </view>
- <view class="">
- ¥{{msgOrder.shopMoney}}
- </view>
- </view>
- <view class="min_tips">
- <view class="">
- 技师金额
- </view>
- <view class="">
- ¥{{msgOrder.tenPrice}}
- </view>
- </view>
- </view>
-
-
- <!-- 下单须知 -->
- <view class="line">
- <view class="t min_tips">
- <view class="">
- 下单须知
- </view>
- </view>
- <view class="min_tips" style="line-height: 40rpx;">
- <!-- 1.服务属于舒缓保健,不是治疗,如需治疗请到医院就诊。2.平台只提供专业、正规的服务,对于不正当的行为和要求,理疗师有权
- 拒绝并保留诉讼法律的权利。<br />
- 3.因客户原因提前终止服务的,服务费不予退还。<br />
- 4.客户因看见理疗师不够漂亮等与专业无关系列因素要求退单者,该客户所付项回费退一半,交通费不予退还。<br />
- 5.如客户选择理疗师下单后,理疗师与客户联系确定核实情况后,理疗师按了确认出发,客户如要取消订单的,扣该订单的项目三分之一费用和理疗师的交通费用。<br />
- 6.理疗师到达服务地址后,若联系不上客户,理疗师会等待20分钟;如20分钟后仍无法联系上,点按开始服务后理疗师则会自行离开,该订单将扣除订单三分之一费用和金部交通费用,剩余费用请联系客服退款,感谢你的理解和支持。<br />
- 联系客服 -->
-
- {{msgShop.projectExplain}}
- </view>
- <view class="btns">
- <view @click="clickService" class="btn">
- 联系客服
- </view>
- </view>
- </view>
-
- </view>
-
- </view>
- </template>
-
- <script>
- import mNavbar from '@/components/base/m-navbar.vue'
- import orderMixins from '@/mixins/order.js'
- export default {
- mixins: [orderMixins],
- components: {
- mNavbar,
- },
- data() {
- return {
- rate: 5,
- stepsActive: 0,
- steps: ['待支付', '已接单', '技师出发', '技师到达', '开始服务', '服务完成'],
- msgOrder: [],
- msgShop: [],
- msgTechnician: [],
- phone : '',
- coupon : {},
- isTimeout : null, //(开始服务)倒计时是否已经结束
- }
- },
- onShow() {
- this.getOrderDetail()
- this.getConfig()
- },
- methods: {
- //获取订单详情
- getOrderDetail() {
- this.$api('getOrderVipDetail', {
- id: this.$route.query.id
- }, res => {
- if (res.code == 200) {
- this.msgOrder = res.result.order;
- this.msgShop = res.result.shop;
- this.msgTechnician = res.result.technician;
- this.coupon = res.result.coupon
-
- let { useTime , startServiceTime } = res.result.order
- this.isTimeout = !(Date.now() < new Date(res.result.order.startServiceTime).valueOf() + useTime * 1000 * 60)
- this.changeSetup()
- }
- })
- },
- toLeft() {
- uni.switchTab({
- url: '/pages/index/order'
- })
- },
- copy(e) {
- uni.setClipboardData({
- data: e,
- success: () => {
- uni.showToast({
- title: '复制成功',
- icon: 'none'
- })
- }
- })
- },
- toPayOrder() {
- uni.navigateTo({
- url: '/pages/order/payOrder'
- })
- },
- toEvaluate(id, projectId) {
- uni.navigateTo({
- url: '/pages/order/evaluate?id=' + id + '&projectId=' + projectId
- })
- },
- //修改进度条状态
- changeSetup() {
- let state = this.msgOrder.state;
- let tenState = this.msgOrder.tenState
- if (state == 1) {
- this.stepsActive = 0
- }
- if (tenState == 2 && state == 2) {
- return this.stepsActive = 2
- }
- if (state == 2) {
- this.stepsActive = 1
- }
- if (tenState == 3) {
- this.stepsActive = 3
- }
- if (tenState == 4) {
- this.stepsActive = 4
- }
- if (tenState == 5 && state == 3) {
- this.stepsActive = 5
- }
- },
- getOrderState(state) { //获取订单状态
- let stateArr = ['未确认', '已确认', '已出发', '已到达', '开始服务', '结束服务']
- return stateArr[state]
- },
- //点击联系客服按钮(联系客服)
- clickService() {
- uni.makePhoneCall({
- phoneNumber: this.phone,
- success: () => {},
- fail: () => {}
- });
- },
- //获取配置信息
- getConfig() {
- this.$api('getConfig', {}, res => {
- if (res.code == 200) {
- res.result.forEach(item => {
- if (item.keyValue == 'phone') {
- this.phone = this.deleteTag(item.content);
- }
- })
- }
- })
- },
- //删除html标签
- deleteTag(html) { //删除html标签
- return html.replace(/<[^>]*>/g, '');
- },
-
- //跳转倒计时
- toCountdown(order){
- let { useTime , startServiceTime } = order
- let isTimeout = new Date(startServiceTime).valueOf() + useTime * 1000 * 60
- if(Date.now() >= isTimeout){
- return uni.showToast({
- title : '服务时间已过',
- icon : 'none'
- })
- }
- uni.navigateTo({
- url: `/pages/mine/countdown?time=${useTime}&startTime=${startServiceTime}`
- })
- },
- }
- }
- </script>
-
- <style scoped lang="scss">
- .order {
- background: linear-gradient(#4899a6, #6fc6ad, #6fc6ad);
- padding-bottom: 10px;
- }
-
- .box {
- padding: 20px;
-
- .active-icon {
- width: 12px;
- height: 12px;
- background-color: #fff;
- border-radius: 6px;
- transform: translate(-25%, 0);
- }
-
- .inactive-icon {
- width: 8px;
- height: 8px;
- background-color: #fff;
- border-radius: 4px;
- }
-
- .stepText {
- font-size: 20rpx !important;
- }
-
- .stepText.color {
- color: #eee;
- }
-
- .inactive-icon.tip {
- width: 6px;
- height: 6px;
- background-color: #fff;
- border-radius: 3px;
- }
-
- .stepText.tip {
- background-color: #b5d7d3;
- padding: 3px 5px;
- position: relative;
- top: 50px;
- border-radius: 5px;
- color: #4899a6;
- display: flex;
- font-size: 10px;
- }
-
- .stepText.tip>view {
- position: absolute;
- top: -13px;
- left: 50%;
- transform: translate(-50%, 0);
- border-top: 7px solid transparent;
- border-bottom: 7px solid #b5d7d3;
- border-left: 7px solid transparent;
- border-right: 7px solid transparent;
- }
-
- .stepText.tip>view.act {
- left: 50%;
- }
-
- .title {
- display: flex;
- justify-content: center;
- align-items: center;
-
- .icon {
- width: 25px;
- height: 25px;
- background-color: #fff;
- border-radius: 15px;
- display: flex;
- justify-content: center;
- align-items: center;
- }
-
- .text {
- color: #fff;
- padding-left: 5px;
- }
- }
-
- .tips {
- display: flex;
- justify-content: center;
- align-items: center;
- color: #eee;
- padding: 10px;
- font-size: 22rpx;
- padding-bottom: 20px;
- }
-
- .btns,
- .bottom {
- display: flex;
- justify-content: center;
- align-items: center;
- margin-top: 10px;
-
- .btn,
- .cancel-btn {
- color: #fff;
- padding: 10rpx 50rpx;
- background-color: #ffb300;
- border-radius: 30rpx;
- font-size: 25rpx;
- margin: 0 10rpx;
- }
-
- .cancel-btn {
- background: transparent;
- background: #ccc;
- }
-
- }
- }
-
- .info {
- margin: 10px;
- padding: 20rpx;
- background-color: #fff;
- width: calc(100% - 40px);
- border-radius: 10px;
-
- .head-title {
- font-family: PingFang SC, PingFang SC-Bold;
- color: #2f2e2e;
- line-height: 30rpx;
- margin-left: 10rpx;
- }
-
- .server-item {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- background: white;
- border-radius: 15rpx;
- box-sizing: border-box;
- margin: 20rpx 0rpx;
- width: 100%;
-
- .img-box {
- width: 150rpx;
- height: 150rpx;
- border-radius: 10rpx;
- overflow: hidden;
-
- image {
- width: 150rpx;
- height: 150rpx;
- }
- }
-
- .server-info {
- width: calc(100% - 180rpx);
- box-sizing: border-box;
- padding: 0 15rpx;
-
- .server-title {
- display: flex;
- }
-
- .coupon {
- display: flex;
- justify-content: center;
- align-items: center;
- background: #F29E45;
- color: white;
- width: 120rpx;
- height: 40rpx;
- border-radius: 10rpx;
- margin-left: 10rpx;
- font-size: 22rpx;
- }
-
- .time-coupon,
- .price {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- }
-
- .time-coupon {
- margin: 10rpx 0rpx;
- font-size: 26rpx;
- justify-content: space-between;
- width: 100%;
-
- .flex {
- justify-content: center;
- align-items: center;
- }
-
- image {
- width: 25rpx;
- height: 25rpx;
- }
-
- .time {
- color: #B8B8B8;
- margin-left: 6rpx;
- }
- }
-
- .sales-volume {
- display: flex;
- align-items: center;
- color: #B8B8B8;
- font-size: 24rpx;
-
- image {
- width: 25rpx;
- height: 25rpx;
- }
- }
- }
- }
-
- .address {
-
- .address-top {
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- image {
- width: 30rpx;
- height: 30rpx;
- }
- }
-
- .addressDetail {
- color: #777;
- font-size: 22rpx;
- padding: 5px 0;
- }
-
- text {
- background-color: #F29E45;
- padding: 8rpx 10rpx;
- color: #fff;
- font-size: 20rpx;
- margin-left: 10px;
- border-radius: 5px;
- }
- }
-
- .address {
- .addressDetail {}
-
- text {
- background-color: #F29E45;
- padding: 8rpx 10rpx;
- color: #fff;
- font-size: 20rpx;
- margin-left: 10px;
- border-radius: 5px;
- }
- }
-
- .min_tips {
- font-size: 22rpx;
- color: #777;
- display: flex;
- justify-content: space-between;
- padding: 5px 0;
- align-items: center;
- }
-
- .current-price {
- font-size: 30rpx;
- color: #F29E45;
- }
-
- .line {
- border-top: 2px dotted #00000011;
- padding: 20rpx 0;
-
- .t {
- padding: 5px 0;
- color: #000;
- font-size: 26rpx;
- }
- }
-
- .head-div {
- .nickname {
- font-size: 30rpx;
- font-weight: 600;
- text-align: left;
- line-height: 42rpx;
- display: flex;
- align-items: center;
-
- .tag {
- position: relative;
- display: flex;
- align-items: center;
-
- image {
- height: 45rpx;
- width: 90rpx;
- vertical-align: middle;
- }
-
- .auth {
- position: absolute;
- white-space: nowrap;
- color: #FF6200;
- left: 23rpx;
- font-size: 17rpx;
- }
- }
- }
-
- .days {
- font-size: 20rpx;
- font-weight: 400;
- text-align: left;
- line-height: 56rpx;
- display: flex;
- align-items: center;
-
- view {
- padding-left: 5px;
- }
- }
- }
-
- .btn-x {
- color: #6fc6ad;
- border: 1px solid #6fc6ad;
- padding: 10rpx 20rpx;
- border-radius: 30rpx;
- }
-
- .btns {
- display: flex;
- justify-content: center;
-
- .btn {
- color: #6fc6ad;
- border: 1px solid #6fc6ad;
- padding: 10rpx 20rpx;
- border-radius: 30rpx;
- }
- }
- }
- </style>
|