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.

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