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.

736 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
  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. -{{ coupon ? coupon.money : 0 }}
  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. coupon : {}
  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.coupon = res.result.coupon
  239. this.changeSetup()
  240. }
  241. })
  242. },
  243. //返回订单列表
  244. toLeft() {
  245. uni.switchTab({
  246. url: '/pages/index/order'
  247. })
  248. },
  249. //复制内容
  250. copy(content) {
  251. uni.setClipboardData({
  252. data: content,
  253. success: () => {
  254. uni.showToast({
  255. title: '复制成功',
  256. icon: 'none'
  257. })
  258. }
  259. })
  260. },
  261. //跳转确认订单页面
  262. //立即支付
  263. toPayOrder(item) {
  264. this.$api('immediatelyPay', {
  265. addressId: item.addressId,
  266. couponId: item.couponId,
  267. orderId: item.id,
  268. payType: item.payType,
  269. remark: item.remark,
  270. serviceTime: item.serviceTime
  271. }, res => {
  272. if (res.code == 200) {
  273. this.$wxPay(res,this.getOrderDetail,this.getOrderDetail)
  274. }
  275. })
  276. },
  277. //点击联系客服按钮(联系客服)
  278. clickService() {
  279. uni.makePhoneCall({
  280. phoneNumber: this.phone,
  281. success: () => {},
  282. fail: () => {}
  283. });
  284. },
  285. //获取配置信息
  286. getConfig() {
  287. this.$api('getConfig', {}, res => {
  288. if (res.code == 200) {
  289. res.result.forEach(item => {
  290. if (item.keyValue == 'phone') {
  291. this.phone = this.deleteTag(item.content);
  292. }
  293. })
  294. }
  295. })
  296. },
  297. //删除html标签
  298. deleteTag(html) { //删除html标签
  299. return html.replace(/<[^>]*>/g, '');
  300. },
  301. //跳转技师详情
  302. gototechnicianDetail(item) {
  303. uni.navigateTo({
  304. url: '/pages/technician/technicianDetail?id=' + item.id
  305. })
  306. },
  307. //修改进度条状态
  308. changeSetup() {
  309. let state = this.msgOrder.state;
  310. let tenState = this.msgOrder.tenState
  311. if (state == 1) {
  312. this.stepsActive = 0
  313. }
  314. if (tenState == 2 && state == 2) {
  315. this.stepsActive = 2
  316. }
  317. if (state == 2) {
  318. this.stepsActive = 1
  319. }
  320. if (tenState == 3) {
  321. this.stepsActive = 3
  322. }
  323. if (tenState == 4) {
  324. this.stepsActive = 4
  325. }
  326. if (tenState == 5 && state == 3) {
  327. this.stepsActive = 5
  328. }
  329. },
  330. //获取订单状态
  331. getStatus(state){
  332. let stateArr = ['待付款','已付款','已确认','已完成','已取消']
  333. return stateArr[state]
  334. },
  335. //取消成功
  336. cancelSuccess() {
  337. uni.showToast({
  338. title: '取消成功',
  339. icon: 'none'
  340. })
  341. this.getOrderDetail()
  342. },
  343. //跳转再来一单
  344. toPlaceorder(res, projectId) {
  345. uni.navigateTo({
  346. url: `/pages/technician/selectTechnician?serviceId=${projectId}`
  347. })
  348. sessionStorage.setItem('technicianList', JSON.stringify(res.result.tenPageList))
  349. },
  350. }
  351. }
  352. </script>
  353. <style scoped lang="scss">
  354. .order {
  355. background: linear-gradient(#4899a6, #6fc6ad, #6fc6ad);
  356. padding-bottom: 10px;
  357. }
  358. .box {
  359. padding: 20px;
  360. .active-icon {
  361. width: 12px;
  362. height: 12px;
  363. background-color: #fff;
  364. border-radius: 6px;
  365. transform: translate(-25%, 0);
  366. }
  367. .inactive-icon {
  368. width: 8px;
  369. height: 8px;
  370. background-color: #fff;
  371. border-radius: 4px;
  372. }
  373. .stepText {
  374. font-size: 20rpx !important;
  375. }
  376. .stepText.color {
  377. color: #eee;
  378. }
  379. .inactive-icon.tip {
  380. width: 6px;
  381. height: 6px;
  382. background-color: #fff;
  383. border-radius: 3px;
  384. }
  385. .stepText.tip {
  386. background-color: #b5d7d3;
  387. padding: 3px 5px;
  388. position: relative;
  389. top: 50px;
  390. border-radius: 5px;
  391. color: #4899a6;
  392. display: flex;
  393. font-size: 10px;
  394. }
  395. .stepText.tip>view {
  396. position: absolute;
  397. top: -13px;
  398. left: 50%;
  399. transform: translate(-50%, 0);
  400. border-top: 7px solid transparent;
  401. border-bottom: 7px solid #b5d7d3;
  402. border-left: 7px solid transparent;
  403. border-right: 7px solid transparent;
  404. }
  405. .stepText.tip>view.act {
  406. left: 50%;
  407. }
  408. .title {
  409. display: flex;
  410. justify-content: center;
  411. align-items: center;
  412. .icon {
  413. width: 25px;
  414. height: 25px;
  415. background-color: #fff;
  416. border-radius: 15px;
  417. display: flex;
  418. justify-content: center;
  419. align-items: center;
  420. }
  421. .text {
  422. color: #fff;
  423. padding-left: 5px;
  424. }
  425. }
  426. .tips {
  427. display: flex;
  428. justify-content: center;
  429. align-items: center;
  430. color: #eee;
  431. padding: 10px;
  432. font-size: 22rpx;
  433. padding-bottom: 20px;
  434. }
  435. .btns {
  436. display: flex;
  437. justify-content: center;
  438. align-items: center;
  439. margin-top: 10px;
  440. .btn {
  441. color: #fff;
  442. padding: 10rpx 50rpx;
  443. background-color: #ffb300;
  444. border-radius: 30rpx;
  445. font-size: 25rpx;
  446. margin-right: 10rpx;
  447. }
  448. .btc{
  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. align-items: center;
  469. justify-content: space-between;
  470. background: white;
  471. border-radius: 15rpx;
  472. box-sizing: border-box;
  473. margin: 20rpx 0rpx;
  474. width: 100%;
  475. .img-box {
  476. width: 150rpx;
  477. height: 150rpx;
  478. border-radius: 10rpx;
  479. overflow: hidden;
  480. image {
  481. width: 100%;
  482. height: 100%;
  483. }
  484. }
  485. .server-info {
  486. display: flex;
  487. flex-direction: column;
  488. justify-content: space-around;
  489. width: calc(100% - 180rpx);
  490. box-sizing: border-box;
  491. padding: 10rpx 15rpx;
  492. .server-title {
  493. display: flex;
  494. }
  495. .coupon {
  496. display: flex;
  497. justify-content: center;
  498. align-items: center;
  499. background: #F29E45;
  500. color: white;
  501. width: 120rpx;
  502. height: 40rpx;
  503. border-radius: 10rpx;
  504. margin-left: 10rpx;
  505. font-size: 22rpx;
  506. }
  507. .time-coupon,
  508. .price {
  509. display: flex;
  510. flex-wrap: wrap;
  511. align-items: center;
  512. }
  513. .time-coupon {
  514. margin: 10rpx 0rpx;
  515. font-size: 26rpx;
  516. justify-content: space-between;
  517. width: 100%;
  518. .flex {
  519. justify-content: center;
  520. align-items: center;
  521. }
  522. image {
  523. width: 25rpx;
  524. height: 25rpx;
  525. }
  526. .time {
  527. color: #B8B8B8;
  528. margin-left: 6rpx;
  529. }
  530. }
  531. .sales-volume {
  532. display: flex;
  533. align-items: center;
  534. color: #B8B8B8;
  535. font-size: 24rpx;
  536. image {
  537. width: 25rpx;
  538. height: 25rpx;
  539. }
  540. }
  541. }
  542. }
  543. .address {
  544. .address-top{
  545. display: flex;
  546. justify-content: space-between;
  547. align-items: center;
  548. image{
  549. width: 30rpx;
  550. height: 30rpx;
  551. }
  552. }
  553. .addressDetail {
  554. color: #777;
  555. font-size: 22rpx;
  556. padding: 5px 0;
  557. }
  558. text {
  559. background-color: #F29E45;
  560. padding: 8rpx 10rpx;
  561. color: #fff;
  562. font-size: 20rpx;
  563. margin-left: 10px;
  564. border-radius: 5px;
  565. }
  566. }
  567. .min_tips {
  568. font-size: 22rpx;
  569. color: #777;
  570. display: flex;
  571. justify-content: space-between;
  572. padding: 5px 0;
  573. align-items: center;
  574. }
  575. .current-price {
  576. font-size: 30rpx;
  577. color: #F29E45;
  578. }
  579. .line {
  580. border-top: 2px dotted #00000011;
  581. padding: 20rpx 0;
  582. .t {
  583. padding: 5px 0;
  584. color: #000;
  585. font-size: 26rpx;
  586. }
  587. }
  588. .head-div {
  589. .nickname {
  590. font-size: 30rpx;
  591. font-weight: 600;
  592. text-align: left;
  593. line-height: 42rpx;
  594. display: flex;
  595. align-items: center;
  596. .tag {
  597. position: relative;
  598. display: flex;
  599. align-items: center;
  600. image {
  601. height: 45rpx;
  602. width: 90rpx;
  603. vertical-align: middle;
  604. }
  605. .auth {
  606. position: absolute;
  607. white-space: nowrap;
  608. color: #FF6200;
  609. left: 23rpx;
  610. font-size: 17rpx;
  611. }
  612. }
  613. }
  614. .days {
  615. font-size: 20rpx;
  616. font-weight: 400;
  617. text-align: left;
  618. line-height: 56rpx;
  619. display: flex;
  620. align-items: center;
  621. view {
  622. padding-left: 5px;
  623. }
  624. }
  625. }
  626. .btn-x {
  627. color: #6fc6ad;
  628. border: 1px solid #6fc6ad;
  629. padding: 10rpx 20rpx;
  630. border-radius: 30rpx;
  631. }
  632. .btns {
  633. display: flex;
  634. justify-content: center;
  635. .btn {
  636. color: #6fc6ad;
  637. border: 1px solid #6fc6ad;
  638. padding: 10rpx 20rpx;
  639. border-radius: 30rpx;
  640. }
  641. }
  642. }
  643. </style>