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.

734 lines
14 KiB

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