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.

720 lines
15 KiB

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