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.

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