建材商城系统20241014
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.

657 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
  1. <template>
  2. <view>
  3. <navbar title="订单详情" bgColor="#DC2828" color="#fff" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="">
  5. <view class="controls">
  6. <view class="title">
  7. <image src="@/static/image/order/icon.png" mode=""></image>
  8. 服务完成
  9. </view>
  10. <view class="tips">
  11. {{ tabs[order.status].name }}
  12. </view>
  13. <view class="steps" v-if="order.status != 3">
  14. <uv-steps activeColor="#FD5100" :current="stepsCurrent" dot>
  15. <uv-steps-item :title="item" :key="index" v-for="(item, index) in steps"></uv-steps-item>
  16. </uv-steps>
  17. </view>
  18. <view class="btns">
  19. <view class="btn2" v-if="order.status == 0"
  20. @click.stop="toPayOrder(order)"
  21. >
  22. 立即支付
  23. </view>
  24. <view class="btn2" v-if="order.status == 2"
  25. @click.stop="confirmOrder(order)"
  26. >
  27. 确认收货
  28. </view>
  29. <view class="btn1" v-if="order.status == 0"
  30. @click.stop="cancelOrder(order)"
  31. >
  32. 取消订单
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 送货图 -->
  38. <view class="" v-if="deliveryPictures.length > 0">
  39. <view class="controls">
  40. <view class="delivery-title">
  41. <view class="flex" style="display: flex; align-items: center;">
  42. <view style="width: 8rpx;height: 30rpx;
  43. background: #FD5100;border-radius: 6rpx;" />
  44. <view class="head-title">送货图</view>
  45. </view>
  46. </view>
  47. <view class="delivery-images">
  48. <view class="image-item"
  49. v-for="(image, index) in deliveryPictures"
  50. :key="index"
  51. @click="previewImage(image, deliveryPictures)">
  52. <image :src="image.trim()" mode="aspectFill"></image>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="info">
  58. <view class="flex" style="display: flex;">
  59. <view style="width: 8rpx;height: 30rpx;
  60. background: #FD5100;border-radius: 6rpx;" />
  61. <view class="head-title">产品</view>
  62. </view>
  63. <view class="flex">
  64. <view class="server-item"
  65. v-for="(shop, i) in order.children"
  66. :key="i">
  67. <view class="img-box">
  68. <image :src="shop.image && shop.image.split(',')[0]" mode="aspectFill"></image>
  69. </view>
  70. <view class="server-info">
  71. <view class="server-title">
  72. {{ shop.title }}
  73. <!-- <view class="coupon">领券立减</view> -->
  74. </view>
  75. <view class="current-price">
  76. 价格<text class="unit"></text>{{ shop.price }}
  77. </view>
  78. <view class="sales-volume" style="margin-top: 5px;">
  79. <view class="desc">产品材质{{ shop.material }}</view>
  80. </view>
  81. <view class="sales-volume" style="margin-top: 5px;">
  82. <view class="desc">产品数量{{ shop.num }}</view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="line address">
  88. <view class="address-top">
  89. <view class="">
  90. 地址信息
  91. </view>
  92. <view class="copy">
  93. <image @click="$utils.copyText('1')" src="../static/order/copy.png"></image>
  94. </view>
  95. </view>
  96. <view class="addressDetail">
  97. <view class="">{{ order.name }} {{ order.phone }}</view>
  98. <view class="">{{ order.address }}</view>
  99. </view>
  100. </view>
  101. <!-- <view class="line">
  102. <view class="t min_tips">
  103. <view class="">
  104. 实付款
  105. </view>
  106. <view class="current-price">
  107. {{ order.money }}
  108. </view>
  109. </view>
  110. <view class="min_tips">
  111. <view class="">
  112. 租赁费用
  113. </view>
  114. <view class="">
  115. {{ order.price }}
  116. </view>
  117. </view>
  118. <view class="min_tips">
  119. <view class="">
  120. 水洗费用
  121. </view>
  122. <view class="">
  123. {{ order.price}}
  124. </view>
  125. </view>
  126. <view class="min_tips">
  127. <view class="">
  128. 押金
  129. </view>
  130. <view class="">
  131. {{ order.price }}
  132. </view>
  133. </view>
  134. </view> -->
  135. <!-- 订单信息 -->
  136. <view class="line">
  137. <view class="t min_tips">
  138. <view class="">
  139. 订单信息
  140. </view>
  141. </view>
  142. <view class="min_tips">
  143. <view class="">
  144. 总金额
  145. </view>
  146. <view class="">
  147. {{ order.price }}
  148. </view>
  149. </view>
  150. <view class="min_tips">
  151. <view class="">
  152. 订单编号
  153. </view>
  154. <view class="">
  155. {{ order.id }}
  156. </view>
  157. </view>
  158. <view class="min_tips">
  159. <view class="">
  160. 下单时间
  161. </view>
  162. <view class="">
  163. {{ order.createTime }}
  164. </view>
  165. </view>
  166. </view>
  167. <!-- 下单须知 -->
  168. <view class="line">
  169. <!-- <view class="t min_tips">
  170. <view class="">
  171. 下单须知
  172. </view>
  173. </view>
  174. <view class="min_tips" style="line-height: 40rpx;">
  175. {{ order.projectExplain }}
  176. </view> -->
  177. <!-- <view class="btns">
  178. <view @click="clickService" class="btn">
  179. 联系客服
  180. </view>
  181. </view> -->
  182. </view>
  183. </view>
  184. <kefu></kefu>
  185. <quick-order-entry
  186. ref="quickOrderEntry"
  187. />
  188. <!-- 联系客服弹框 -->
  189. <customerServicePopup ref="customerServicePopup" />
  190. </view>
  191. </template>
  192. <script>
  193. import customerServicePopup from "@/components/config/customerServicePopup.vue";
  194. import { mapGetters } from 'vuex'
  195. import orderMixin from '@/mixins/order.js'
  196. export default {
  197. mixins: [orderMixin],
  198. computed: {
  199. ...mapGetters(['userShop']),
  200. },
  201. components: {
  202. customerServicePopup
  203. },
  204. data() {
  205. return {
  206. stepsCurrent: 0,
  207. steps: [
  208. '付款',
  209. '配送',
  210. '完成',
  211. ],
  212. tabs: [
  213. {
  214. name: '待付款'
  215. },
  216. {
  217. name: '已付款'
  218. },
  219. {
  220. name: '配送中'
  221. },
  222. {
  223. name: '已完成'
  224. },
  225. {
  226. name: '已取消'
  227. }
  228. ],
  229. order: {},
  230. id: '',
  231. deliveryPictures: [],
  232. }
  233. },
  234. onLoad(options) {
  235. this.id = options.id
  236. this.getData()
  237. },
  238. methods: {
  239. getData() {
  240. this.$api('getOrderInfoById', {
  241. orderId : this.id
  242. }, res => {
  243. this.order = res.result;
  244. this.stepsCurrent = this.order.status;
  245. this.deliveryPictures = this.getAllDeliveryPictures();
  246. })
  247. },
  248. // 联系客服
  249. clickService() {
  250. this.$refs.customerServicePopup.open();
  251. },
  252. // 预览送货图片
  253. previewImage(current, urls) {
  254. uni.previewImage({
  255. current: current.trim(),
  256. urls: urls.map(url => url.trim())
  257. });
  258. },
  259. // 提取所有送货图片(包括主订单和子订单)
  260. getAllDeliveryPictures() {
  261. let allPictures = [];
  262. // 提取主订单的送货图
  263. if (this.order.deliveryPicture) {
  264. const mainPictures = this.order.deliveryPicture.split(',').map(pic => pic.trim()).filter(pic => pic);
  265. allPictures = allPictures.concat(mainPictures);
  266. }
  267. // 提取所有子订单的送货图
  268. if (this.order.children && Array.isArray(this.order.children)) {
  269. this.order.children.forEach(child => {
  270. if (child.deliveryPicture) {
  271. const childPictures = child.deliveryPicture.split(',').map(pic => pic.trim()).filter(pic => pic);
  272. allPictures = allPictures.concat(childPictures);
  273. }
  274. });
  275. }
  276. // 去重(如果有重复的图片)
  277. return [...new Set(allPictures)];
  278. },
  279. }
  280. }
  281. </script>
  282. <style scoped lang="scss">
  283. .order {
  284. background: linear-gradient(#4899a6, #6fc6ad, #6fc6ad);
  285. padding-bottom: 10px;
  286. }
  287. .controls {
  288. margin: 20rpx;
  289. background-color: #fff;
  290. // height: 400rpx;
  291. display: flex;
  292. flex-direction: column;
  293. // width: 710rpx;
  294. border-radius: 20rpx;
  295. justify-content: center;
  296. align-items: center;
  297. padding: 20rpx;
  298. .title {
  299. display: flex;
  300. justify-content: center;
  301. align-items: center;
  302. font-size: 32rpx;
  303. image {
  304. width: 80rpx;
  305. height: 80rpx;
  306. margin-right: 20rpx;
  307. }
  308. }
  309. .tips {
  310. font-size: 26rpx;
  311. color: #FD5100;
  312. margin-top: 10rpx;
  313. }
  314. .steps {
  315. height: 60rpx;
  316. }
  317. .btns {
  318. // margin-top: 50rpx;
  319. display: flex;
  320. view {
  321. font-size: 26rpx;
  322. margin: 0 20rpx;
  323. display: flex;
  324. justify-content: center;
  325. align-items: center;
  326. color: #fff;
  327. background-color: $uni-color;
  328. padding: 15rpx 40rpx;
  329. border-radius: 40rpx;
  330. }
  331. .btn1 {
  332. background-color: rgba($color: $uni-color, $alpha: 0.2);
  333. border: 1px solid $uni-color;
  334. color: $uni-color;
  335. }
  336. }
  337. .delivery-title {
  338. width: 100%;
  339. margin-bottom: 20rpx;
  340. .head-title {
  341. font-family: PingFang SC, PingFang SC-Bold;
  342. color: #2f2e2e;
  343. line-height: 30rpx;
  344. margin-left: 10rpx;
  345. }
  346. }
  347. .delivery-images {
  348. display: flex;
  349. flex-wrap: wrap;
  350. gap: 20rpx;
  351. .image-item {
  352. width: 200rpx;
  353. height: 200rpx;
  354. border-radius: 10rpx;
  355. overflow: hidden;
  356. image {
  357. width: 100%;
  358. height: 100%;
  359. }
  360. }
  361. }
  362. }
  363. .steps {
  364. margin: 20rpx;
  365. background-color: #fff;
  366. display: flex;
  367. flex-direction: column;
  368. width: 710rpx;
  369. border-radius: 20rpx;
  370. padding: 70rpx 0;
  371. /deep/ .uv-text__value {
  372. font-size: 22rpx !important;
  373. }
  374. }
  375. .box {
  376. padding: 20px;
  377. .btns {
  378. display: flex;
  379. justify-content: center;
  380. align-items: center;
  381. margin-top: 10px;
  382. .btn {
  383. color: #fff;
  384. padding: 10rpx 50rpx;
  385. background-color: #ffb300;
  386. border-radius: 30rpx;
  387. font-size: 25rpx;
  388. margin-right: 10rpx;
  389. }
  390. .btc {
  391. background: #ccc;
  392. }
  393. }
  394. }
  395. .info {
  396. margin: 10px;
  397. padding: 20rpx;
  398. background-color: #fff;
  399. width: calc(100% - 40px);
  400. border-radius: 10px;
  401. .head-title {
  402. font-family: PingFang SC, PingFang SC-Bold;
  403. color: #2f2e2e;
  404. line-height: 30rpx;
  405. margin-left: 10rpx;
  406. }
  407. .server-item {
  408. display: flex;
  409. flex-wrap: wrap;
  410. align-items: center;
  411. justify-content: space-between;
  412. background: white;
  413. border-radius: 15rpx;
  414. box-sizing: border-box;
  415. margin: 20rpx 0rpx;
  416. width: 100%;
  417. .img-box {
  418. width: 150rpx;
  419. height: 150rpx;
  420. border-radius: 10rpx;
  421. overflow: hidden;
  422. image {
  423. width: 100%;
  424. height: 100%;
  425. }
  426. }
  427. .server-info {
  428. display: flex;
  429. flex-direction: column;
  430. justify-content: space-around;
  431. width: calc(100% - 180rpx);
  432. box-sizing: border-box;
  433. padding: 10rpx 15rpx;
  434. .server-title {
  435. display: flex;
  436. margin-bottom: 10rpx;
  437. }
  438. .coupon {
  439. display: flex;
  440. justify-content: center;
  441. align-items: center;
  442. background: #F29E45;
  443. color: white;
  444. width: 120rpx;
  445. height: 40rpx;
  446. border-radius: 10rpx;
  447. margin-left: 10rpx;
  448. font-size: 22rpx;
  449. }
  450. .time-coupon,
  451. .price {
  452. display: flex;
  453. flex-wrap: wrap;
  454. align-items: center;
  455. }
  456. .time-coupon {
  457. margin: 10rpx 0rpx;
  458. font-size: 26rpx;
  459. justify-content: space-between;
  460. width: 100%;
  461. .flex {
  462. justify-content: center;
  463. align-items: center;
  464. }
  465. image {
  466. width: 25rpx;
  467. height: 25rpx;
  468. }
  469. .time {
  470. color: #B8B8B8;
  471. margin-left: 6rpx;
  472. }
  473. }
  474. .sales-volume {
  475. display: flex;
  476. align-items: center;
  477. color: #B8B8B8;
  478. font-size: 24rpx;
  479. image {
  480. width: 25rpx;
  481. height: 25rpx;
  482. }
  483. }
  484. }
  485. }
  486. .address {
  487. .address-top {
  488. display: flex;
  489. justify-content: space-between;
  490. align-items: center;
  491. image {
  492. width: 30rpx;
  493. height: 30rpx;
  494. }
  495. }
  496. .addressDetail {
  497. color: #777;
  498. font-size: 28rpx;
  499. padding: 5px 0;
  500. }
  501. text {
  502. background-color: #F29E45;
  503. padding: 8rpx 10rpx;
  504. color: #fff;
  505. font-size: 20rpx;
  506. margin-left: 10px;
  507. border-radius: 5px;
  508. }
  509. }
  510. .min_tips {
  511. font-size: 22rpx;
  512. color: #777;
  513. display: flex;
  514. justify-content: space-between;
  515. padding: 5px 0;
  516. align-items: center;
  517. }
  518. .current-price {
  519. font-size: 27rpx;
  520. color: #FD5100;
  521. }
  522. .line {
  523. border-top: 2px dotted #00000011;
  524. padding: 20rpx 0;
  525. .t {
  526. padding: 5px 0;
  527. color: #000;
  528. font-size: 26rpx;
  529. }
  530. }
  531. .head-div {
  532. .nickname {
  533. font-size: 30rpx;
  534. font-weight: 600;
  535. text-align: left;
  536. line-height: 42rpx;
  537. display: flex;
  538. align-items: center;
  539. .tag {
  540. position: relative;
  541. display: flex;
  542. align-items: center;
  543. image {
  544. height: 45rpx;
  545. width: 90rpx;
  546. vertical-align: middle;
  547. }
  548. .auth {
  549. position: absolute;
  550. white-space: nowrap;
  551. color: #FF6200;
  552. left: 23rpx;
  553. font-size: 17rpx;
  554. }
  555. }
  556. }
  557. .days {
  558. font-size: 20rpx;
  559. font-weight: 400;
  560. text-align: left;
  561. line-height: 56rpx;
  562. display: flex;
  563. align-items: center;
  564. view {
  565. padding-left: 5px;
  566. }
  567. }
  568. }
  569. .btns {
  570. display: flex;
  571. justify-content: center;
  572. .btn {
  573. color: $uni-color;
  574. border: 1px solid $uni-color;
  575. padding: 10rpx 20rpx;
  576. border-radius: 30rpx;
  577. }
  578. }
  579. }
  580. </style>