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

738 lines
15 KiB

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