You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

759 lines
16 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. <template>
  2. <view class="order">
  3. <mNavbar title="订单详情" :leftClick="toLeft" style="background: linear-gradient(#4899a6, rgb(78 160 167));" />
  4. <view class="box">
  5. <view class="title">
  6. <view class="icon">
  7. <uni-icons type="wallet-filled" color="#4899a6" size="15"></uni-icons>
  8. </view>
  9. <view class="text">
  10. <!-- 订单已完成 -->
  11. {{ getOrderState(msgOrder.tenState) }}
  12. </view>
  13. </view>
  14. <!-- <view class="tips">
  15. 请确认订单
  16. </view> -->
  17. <van-steps style="background: transparent;padding-bottom: 30px;" active-color="#fff" inactive-color="#ddd"
  18. :active="stepsActive">
  19. <van-step v-for="(item, index) in steps">
  20. <template #active-icon>
  21. <view class="active-icon"></view>
  22. </template>
  23. <view :class="{color : index <
  24. stepsActive,stepText : true,
  25. tip : index == 2 || index == 4}">
  26. {{ item }}
  27. <view :class="{act : index == stepsActive}"></view>
  28. </view>
  29. <template #inactive-icon>
  30. <view :class="{'inactive-icon' : true,
  31. tip : index == 2 || index == 4}"></view>
  32. </template>
  33. </van-step>
  34. </van-steps>
  35. <view v-if="msgOrder.state !=4" class="btns">
  36. <view class="btn" v-if="msgOrder.tenState == 0 && msgOrder.state != 4"
  37. @click.stop="confirmVipOrder(msgOrder, getOrderDetail)">
  38. 确认订单
  39. </view>
  40. <view class="btn" v-if="msgOrder.tenState == 1" @click.stop="startVipOrder(msgOrder, getOrderDetail)">
  41. 技师出发
  42. </view>
  43. <view class="btn" v-if="msgOrder.tenState == 2" @click.stop="arriveVipOrder(msgOrder, getOrderDetail)">
  44. 到达打卡
  45. </view>
  46. <view class="btn" v-if="msgOrder.tenState == 3" @click.stop="startVipService(msgOrder, getOrderDetail)">
  47. 开始服务
  48. </view>
  49. <view class="btn" v-if="msgOrder.tenState == 4"
  50. @click.stop="endVipService(msgOrder, toEvaluate, msgOrder.id, msgShop.id)">
  51. 结束服务
  52. </view>
  53. <view class="btn" v-if="msgOrder.tenState == 4 && !isTimeout"
  54. @click.stop="toCountdown(msgOrder)">
  55. 服务时间
  56. </view>
  57. <!-- <view class="btn" @click.stop="toEvaluate()" v-if="msgOrder.tenState == 5">
  58. 投诉举报
  59. </view> -->
  60. <view class="btn" @click.stop="toEvaluate(msgOrder.id,msgOrder.projectId)"
  61. v-if="msgOrder.tenState == 5 && msgOrder.evaluated == 0">
  62. 立即评价
  63. </view>
  64. </view>
  65. <view v-else class="bottom">
  66. <view @click.stop="()=>{}" class="cancel-btn">
  67. 用户取消
  68. </view>
  69. </view>
  70. </view>
  71. <view class="info">
  72. <view class="flex">
  73. <view style="width: 8rpx;height: 30rpx;
  74. background: #6fc6ad;border-radius: 6rpx;" />
  75. <view class="head-title">服务项目</view>
  76. </view>
  77. <view class="flex">
  78. <view class="server-item">
  79. <view class="img-box">
  80. <image :src="msgShop.image" mode="aspectFill"></image>
  81. </view>
  82. <view class="server-info">
  83. <view class="server-title">
  84. {{msgOrder.projectName}}
  85. <!-- <view class="coupon">领券立减</view> -->
  86. </view>
  87. <view class="current-price">
  88. <text class="unit"></text>{{msgOrder.money}}
  89. </view>
  90. <view class="time-coupon">
  91. <view class="flex">
  92. <image src="@/static/home/time-icon.png"></image>
  93. <view class="time">{{msgOrder.useTime}}分钟</view>
  94. </view>
  95. <view class="sales-volume">
  96. <image src="@/static/icons/icon1.png"></image>
  97. <view class="desc">已售出{{msgShop.payNum}}+</view>
  98. </view>
  99. </view>
  100. <view class="sales-volume" style="margin-top: 5px;">
  101. <view class="desc">服务时间{{msgOrder.startServiceTime}}</view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <view class="line min_tips">
  107. <view class="head-div flex">
  108. <view style="width: 118rpx;height: 118rpx;border-radius: 50%;overflow: hidden;">
  109. <image style="width: 118rpx;" :src="msgTechnician.image" mode="widthFix"></image>
  110. </view>
  111. <view
  112. style="padding: 10rpx 34rpx;display: flex;flex-direction: column;justify-content: space-around;">
  113. <view class="nickname">
  114. {{msgTechnician.title}}
  115. <view v-if="msgTechnician.isVip" class="tag">
  116. <image src="@/static/order/s.png" mode="aspectFit"></image>
  117. <view class="auth">官方认证</view>
  118. </view>
  119. </view>
  120. <view class="days">
  121. <van-rate v-model="msgTechnician.score" :size="10" readonly color="#ffb54c" void-icon="star"
  122. void-color="#eee" />
  123. <view class="">
  124. 好评{{msgTechnician.pinNum}}
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. <view class="btn-x">
  130. 服务技师
  131. </view>
  132. </view>
  133. <view class="line address">
  134. <view class="address-top">
  135. <view class="">
  136. 服务地址
  137. </view>
  138. <view class="copy">
  139. <image @click="copy(msgOrder.name + ' ' + msgOrder.phone + ' ' + msgOrder.address)"
  140. src="/static/order/copy.png"></image>
  141. </view>
  142. </view>
  143. <view class="addressDetail">
  144. <view class="">{{msgOrder.name}} {{msgOrder.phone}}</view>
  145. <view class="">{{msgOrder.address}}</view>
  146. </view>
  147. </view>
  148. <view class="line">
  149. <view class="t min_tips">
  150. <view class="">
  151. 实付款含路费
  152. </view>
  153. <view class="current-price">
  154. {{ msgOrder.money }}
  155. </view>
  156. </view>
  157. <view class="min_tips">
  158. <view class="">
  159. 订单金额
  160. </view>
  161. <view class="">
  162. {{ msgShop.price }}
  163. </view>
  164. </view>
  165. <view class="min_tips">
  166. <view class="">
  167. 车费
  168. </view>
  169. <view class="">
  170. {{ msgOrder.temp}}
  171. </view>
  172. </view>
  173. <view class="min_tips">
  174. <view class="">
  175. 优惠券
  176. </view>
  177. <view class="">
  178. -{{ coupon ? coupon.money : 0 }}
  179. </view>
  180. </view>
  181. </view>
  182. <!-- 订单信息 -->
  183. <view class="line">
  184. <view class="t min_tips">
  185. <view class="">
  186. 订单信息
  187. </view>
  188. </view>
  189. <view class="min_tips">
  190. <view class="">
  191. 订单编号
  192. </view>
  193. <view class="">
  194. {{msgOrder.id}}
  195. </view>
  196. </view>
  197. <view class="min_tips">
  198. <view class="">
  199. 下单时间
  200. </view>
  201. <view class="">
  202. {{msgOrder.createTime}}
  203. </view>
  204. </view>
  205. <view class="min_tips">
  206. <view class="">
  207. 平台金额
  208. </view>
  209. <view class="">
  210. {{msgOrder.shopMoney}}
  211. </view>
  212. </view>
  213. <view class="min_tips">
  214. <view class="">
  215. 技师金额
  216. </view>
  217. <view class="">
  218. {{msgOrder.tenPrice}}
  219. </view>
  220. </view>
  221. </view>
  222. <!-- 下单须知 -->
  223. <view class="line">
  224. <view class="t min_tips">
  225. <view class="">
  226. 下单须知
  227. </view>
  228. </view>
  229. <view class="min_tips" style="line-height: 40rpx;">
  230. <!-- 1.服务属于舒缓保健不是治疗如需治疗请到医院就诊2.平台只提供专业正规的服务对于不正当的行为和要求理疗师有权
  231. 拒绝并保留诉讼法律的权利<br />
  232. 3.因客户原因提前终止服务的服务费不予退还<br />
  233. 4.客户因看见理疗师不够漂亮等与专业无关系列因素要求退单者该客户所付项回费退一半交通费不予退还<br />
  234. 5.如客户选择理疗师下单后理疗师与客户联系确定核实情况后理疗师按了确认出发客户如要取消订单的扣该订单的项目三分之一费用和理疗师的交通费用<br />
  235. 6.理疗师到达服务地址后若联系不上客户理疗师会等待20分钟;如20分钟后仍无法联系上点按开始服务后理疗师则会自行离开该订单将扣除订单三分之一费用和金部交通费用剩余费用请联系客服退款感谢你的理解和支持<br />
  236. 联系客服 -->
  237. {{msgShop.projectExplain}}
  238. </view>
  239. <view class="btns">
  240. <view @click="clickService" class="btn">
  241. 联系客服
  242. </view>
  243. </view>
  244. </view>
  245. </view>
  246. </view>
  247. </template>
  248. <script>
  249. import mNavbar from '@/components/base/m-navbar.vue'
  250. import orderMixins from '@/mixins/order.js'
  251. export default {
  252. mixins: [orderMixins],
  253. components: {
  254. mNavbar,
  255. },
  256. data() {
  257. return {
  258. rate: 5,
  259. stepsActive: 0,
  260. steps: ['待支付', '已接单', '技师出发', '技师到达', '开始服务', '服务完成'],
  261. msgOrder: [],
  262. msgShop: [],
  263. msgTechnician: [],
  264. phone : '',
  265. coupon : {},
  266. isTimeout : null, //(开始服务)倒计时是否已经结束
  267. }
  268. },
  269. onShow() {
  270. this.getOrderDetail()
  271. this.getConfig()
  272. },
  273. methods: {
  274. //获取订单详情
  275. getOrderDetail() {
  276. this.$api('getOrderVipDetail', {
  277. id: this.$route.query.id
  278. }, res => {
  279. if (res.code == 200) {
  280. this.msgOrder = res.result.order;
  281. this.msgShop = res.result.shop;
  282. this.msgTechnician = res.result.technician;
  283. this.coupon = res.result.coupon
  284. let { useTime , startServiceTime } = res.result.order
  285. this.isTimeout = !(Date.now() < new Date(res.result.order.startServiceTime).valueOf() + useTime * 1000 * 60)
  286. this.changeSetup()
  287. }
  288. })
  289. },
  290. toLeft() {
  291. uni.switchTab({
  292. url: '/pages/index/order'
  293. })
  294. },
  295. copy(e) {
  296. uni.setClipboardData({
  297. data: e,
  298. success: () => {
  299. uni.showToast({
  300. title: '复制成功',
  301. icon: 'none'
  302. })
  303. }
  304. })
  305. },
  306. toPayOrder() {
  307. uni.navigateTo({
  308. url: '/pages/order/payOrder'
  309. })
  310. },
  311. toEvaluate(id, projectId) {
  312. uni.navigateTo({
  313. url: '/pages/order/evaluate?id=' + id + '&projectId=' + projectId
  314. })
  315. },
  316. //修改进度条状态
  317. changeSetup() {
  318. let state = this.msgOrder.state;
  319. let tenState = this.msgOrder.tenState
  320. if (state == 1) {
  321. this.stepsActive = 0
  322. }
  323. if (tenState == 2 && state == 2) {
  324. return this.stepsActive = 2
  325. }
  326. if (state == 2) {
  327. this.stepsActive = 1
  328. }
  329. if (tenState == 3) {
  330. this.stepsActive = 3
  331. }
  332. if (tenState == 4) {
  333. this.stepsActive = 4
  334. }
  335. if (tenState == 5 && state == 3) {
  336. this.stepsActive = 5
  337. }
  338. },
  339. getOrderState(state) { //获取订单状态
  340. let stateArr = ['未确认', '已确认', '已出发', '已到达', '开始服务', '结束服务']
  341. return stateArr[state]
  342. },
  343. //点击联系客服按钮(联系客服)
  344. clickService() {
  345. uni.makePhoneCall({
  346. phoneNumber: this.phone,
  347. success: () => {},
  348. fail: () => {}
  349. });
  350. },
  351. //获取配置信息
  352. getConfig() {
  353. this.$api('getConfig', {}, res => {
  354. if (res.code == 200) {
  355. res.result.forEach(item => {
  356. if (item.keyValue == 'phone') {
  357. this.phone = this.deleteTag(item.content);
  358. }
  359. })
  360. }
  361. })
  362. },
  363. //删除html标签
  364. deleteTag(html) { //删除html标签
  365. return html.replace(/<[^>]*>/g, '');
  366. },
  367. //跳转倒计时
  368. toCountdown(order){
  369. let { useTime , startServiceTime } = order
  370. let isTimeout = new Date(startServiceTime).valueOf() + useTime * 1000 * 60
  371. if(Date.now() >= isTimeout){
  372. return uni.showToast({
  373. title : '服务时间已过',
  374. icon : 'none'
  375. })
  376. }
  377. uni.navigateTo({
  378. url: `/pages/mine/countdown?time=${useTime}&startTime=${startServiceTime}`
  379. })
  380. },
  381. }
  382. }
  383. </script>
  384. <style scoped lang="scss">
  385. .order {
  386. background: linear-gradient(#4899a6, #6fc6ad, #6fc6ad);
  387. padding-bottom: 10px;
  388. }
  389. .box {
  390. padding: 20px;
  391. .active-icon {
  392. width: 12px;
  393. height: 12px;
  394. background-color: #fff;
  395. border-radius: 6px;
  396. transform: translate(-25%, 0);
  397. }
  398. .inactive-icon {
  399. width: 8px;
  400. height: 8px;
  401. background-color: #fff;
  402. border-radius: 4px;
  403. }
  404. .stepText {
  405. font-size: 20rpx !important;
  406. }
  407. .stepText.color {
  408. color: #eee;
  409. }
  410. .inactive-icon.tip {
  411. width: 6px;
  412. height: 6px;
  413. background-color: #fff;
  414. border-radius: 3px;
  415. }
  416. .stepText.tip {
  417. background-color: #b5d7d3;
  418. padding: 3px 5px;
  419. position: relative;
  420. top: 50px;
  421. border-radius: 5px;
  422. color: #4899a6;
  423. display: flex;
  424. font-size: 10px;
  425. }
  426. .stepText.tip>view {
  427. position: absolute;
  428. top: -13px;
  429. left: 50%;
  430. transform: translate(-50%, 0);
  431. border-top: 7px solid transparent;
  432. border-bottom: 7px solid #b5d7d3;
  433. border-left: 7px solid transparent;
  434. border-right: 7px solid transparent;
  435. }
  436. .stepText.tip>view.act {
  437. left: 50%;
  438. }
  439. .title {
  440. display: flex;
  441. justify-content: center;
  442. align-items: center;
  443. .icon {
  444. width: 25px;
  445. height: 25px;
  446. background-color: #fff;
  447. border-radius: 15px;
  448. display: flex;
  449. justify-content: center;
  450. align-items: center;
  451. }
  452. .text {
  453. color: #fff;
  454. padding-left: 5px;
  455. }
  456. }
  457. .tips {
  458. display: flex;
  459. justify-content: center;
  460. align-items: center;
  461. color: #eee;
  462. padding: 10px;
  463. font-size: 22rpx;
  464. padding-bottom: 20px;
  465. }
  466. .btns,
  467. .bottom {
  468. display: flex;
  469. justify-content: center;
  470. align-items: center;
  471. margin-top: 10px;
  472. .btn,
  473. .cancel-btn {
  474. color: #fff;
  475. padding: 10rpx 50rpx;
  476. background-color: #ffb300;
  477. border-radius: 30rpx;
  478. font-size: 25rpx;
  479. margin: 0 10rpx;
  480. }
  481. .cancel-btn {
  482. background: transparent;
  483. background: #ccc;
  484. }
  485. }
  486. }
  487. .info {
  488. margin: 10px;
  489. padding: 20rpx;
  490. background-color: #fff;
  491. width: calc(100% - 40px);
  492. border-radius: 10px;
  493. .head-title {
  494. font-family: PingFang SC, PingFang SC-Bold;
  495. color: #2f2e2e;
  496. line-height: 30rpx;
  497. margin-left: 10rpx;
  498. }
  499. .server-item {
  500. display: flex;
  501. flex-wrap: wrap;
  502. justify-content: space-between;
  503. background: white;
  504. border-radius: 15rpx;
  505. box-sizing: border-box;
  506. margin: 20rpx 0rpx;
  507. width: 100%;
  508. .img-box {
  509. width: 150rpx;
  510. height: 150rpx;
  511. border-radius: 10rpx;
  512. overflow: hidden;
  513. image {
  514. width: 150rpx;
  515. height: 150rpx;
  516. }
  517. }
  518. .server-info {
  519. width: calc(100% - 180rpx);
  520. box-sizing: border-box;
  521. padding: 0 15rpx;
  522. .server-title {
  523. display: flex;
  524. }
  525. .coupon {
  526. display: flex;
  527. justify-content: center;
  528. align-items: center;
  529. background: #F29E45;
  530. color: white;
  531. width: 120rpx;
  532. height: 40rpx;
  533. border-radius: 10rpx;
  534. margin-left: 10rpx;
  535. font-size: 22rpx;
  536. }
  537. .time-coupon,
  538. .price {
  539. display: flex;
  540. flex-wrap: wrap;
  541. align-items: center;
  542. }
  543. .time-coupon {
  544. margin: 10rpx 0rpx;
  545. font-size: 26rpx;
  546. justify-content: space-between;
  547. width: 100%;
  548. .flex {
  549. justify-content: center;
  550. align-items: center;
  551. }
  552. image {
  553. width: 25rpx;
  554. height: 25rpx;
  555. }
  556. .time {
  557. color: #B8B8B8;
  558. margin-left: 6rpx;
  559. }
  560. }
  561. .sales-volume {
  562. display: flex;
  563. align-items: center;
  564. color: #B8B8B8;
  565. font-size: 24rpx;
  566. image {
  567. width: 25rpx;
  568. height: 25rpx;
  569. }
  570. }
  571. }
  572. }
  573. .address {
  574. .address-top {
  575. display: flex;
  576. justify-content: space-between;
  577. align-items: center;
  578. image {
  579. width: 30rpx;
  580. height: 30rpx;
  581. }
  582. }
  583. .addressDetail {
  584. color: #777;
  585. font-size: 22rpx;
  586. padding: 5px 0;
  587. }
  588. text {
  589. background-color: #F29E45;
  590. padding: 8rpx 10rpx;
  591. color: #fff;
  592. font-size: 20rpx;
  593. margin-left: 10px;
  594. border-radius: 5px;
  595. }
  596. }
  597. .address {
  598. .addressDetail {}
  599. text {
  600. background-color: #F29E45;
  601. padding: 8rpx 10rpx;
  602. color: #fff;
  603. font-size: 20rpx;
  604. margin-left: 10px;
  605. border-radius: 5px;
  606. }
  607. }
  608. .min_tips {
  609. font-size: 22rpx;
  610. color: #777;
  611. display: flex;
  612. justify-content: space-between;
  613. padding: 5px 0;
  614. align-items: center;
  615. }
  616. .current-price {
  617. font-size: 30rpx;
  618. color: #F29E45;
  619. }
  620. .line {
  621. border-top: 2px dotted #00000011;
  622. padding: 20rpx 0;
  623. .t {
  624. padding: 5px 0;
  625. color: #000;
  626. font-size: 26rpx;
  627. }
  628. }
  629. .head-div {
  630. .nickname {
  631. font-size: 30rpx;
  632. font-weight: 600;
  633. text-align: left;
  634. line-height: 42rpx;
  635. display: flex;
  636. align-items: center;
  637. .tag {
  638. position: relative;
  639. display: flex;
  640. align-items: center;
  641. image {
  642. height: 45rpx;
  643. width: 90rpx;
  644. vertical-align: middle;
  645. }
  646. .auth {
  647. position: absolute;
  648. white-space: nowrap;
  649. color: #FF6200;
  650. left: 23rpx;
  651. font-size: 17rpx;
  652. }
  653. }
  654. }
  655. .days {
  656. font-size: 20rpx;
  657. font-weight: 400;
  658. text-align: left;
  659. line-height: 56rpx;
  660. display: flex;
  661. align-items: center;
  662. view {
  663. padding-left: 5px;
  664. }
  665. }
  666. }
  667. .btn-x {
  668. color: #6fc6ad;
  669. border: 1px solid #6fc6ad;
  670. padding: 10rpx 20rpx;
  671. border-radius: 30rpx;
  672. }
  673. .btns {
  674. display: flex;
  675. justify-content: center;
  676. .btn {
  677. color: #6fc6ad;
  678. border: 1px solid #6fc6ad;
  679. padding: 10rpx 20rpx;
  680. border-radius: 30rpx;
  681. }
  682. }
  683. }
  684. </style>