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.

744 lines
15 KiB

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