宜轩到家/服务到家第三版,换个颜色
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.

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