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

656 lines
17 KiB

9 months ago
1 week ago
9 months ago
1 week ago
1 week ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 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. }
  307. }
  308. .tips {
  309. font-size: 26rpx;
  310. color: #FD5100;
  311. margin-top: 10rpx;
  312. }
  313. .steps {
  314. height: 60rpx;
  315. }
  316. .btns {
  317. // margin-top: 50rpx;
  318. display: flex;
  319. view {
  320. font-size: 26rpx;
  321. margin: 0 20rpx;
  322. display: flex;
  323. justify-content: center;
  324. align-items: center;
  325. color: #fff;
  326. background-color: $uni-color;
  327. padding: 15rpx 40rpx;
  328. border-radius: 40rpx;
  329. }
  330. .btn1 {
  331. background-color: rgba($color: $uni-color, $alpha: 0.2);
  332. border: 1px solid $uni-color;
  333. color: $uni-color;
  334. }
  335. }
  336. .delivery-title {
  337. width: 100%;
  338. margin-bottom: 20rpx;
  339. .head-title {
  340. font-family: PingFang SC, PingFang SC-Bold;
  341. color: #2f2e2e;
  342. line-height: 30rpx;
  343. margin-left: 10rpx;
  344. }
  345. }
  346. .delivery-images {
  347. display: flex;
  348. flex-wrap: wrap;
  349. gap: 20rpx;
  350. .image-item {
  351. width: 200rpx;
  352. height: 200rpx;
  353. border-radius: 10rpx;
  354. overflow: hidden;
  355. image {
  356. width: 100%;
  357. height: 100%;
  358. }
  359. }
  360. }
  361. }
  362. .steps {
  363. margin: 20rpx;
  364. background-color: #fff;
  365. display: flex;
  366. flex-direction: column;
  367. width: 710rpx;
  368. border-radius: 20rpx;
  369. padding: 70rpx 0;
  370. /deep/ .uv-text__value {
  371. font-size: 22rpx !important;
  372. }
  373. }
  374. .box {
  375. padding: 20px;
  376. .btns {
  377. display: flex;
  378. justify-content: center;
  379. align-items: center;
  380. margin-top: 10px;
  381. .btn {
  382. color: #fff;
  383. padding: 10rpx 50rpx;
  384. background-color: #ffb300;
  385. border-radius: 30rpx;
  386. font-size: 25rpx;
  387. margin-right: 10rpx;
  388. }
  389. .btc {
  390. background: #ccc;
  391. }
  392. }
  393. }
  394. .info {
  395. margin: 10px;
  396. padding: 20rpx;
  397. background-color: #fff;
  398. width: calc(100% - 40px);
  399. border-radius: 10px;
  400. .head-title {
  401. font-family: PingFang SC, PingFang SC-Bold;
  402. color: #2f2e2e;
  403. line-height: 30rpx;
  404. margin-left: 10rpx;
  405. }
  406. .server-item {
  407. display: flex;
  408. flex-wrap: wrap;
  409. align-items: center;
  410. justify-content: space-between;
  411. background: white;
  412. border-radius: 15rpx;
  413. box-sizing: border-box;
  414. margin: 20rpx 0rpx;
  415. width: 100%;
  416. .img-box {
  417. width: 150rpx;
  418. height: 150rpx;
  419. border-radius: 10rpx;
  420. overflow: hidden;
  421. image {
  422. width: 100%;
  423. height: 100%;
  424. }
  425. }
  426. .server-info {
  427. display: flex;
  428. flex-direction: column;
  429. justify-content: space-around;
  430. width: calc(100% - 180rpx);
  431. box-sizing: border-box;
  432. padding: 10rpx 15rpx;
  433. .server-title {
  434. display: flex;
  435. margin-bottom: 10rpx;
  436. }
  437. .coupon {
  438. display: flex;
  439. justify-content: center;
  440. align-items: center;
  441. background: #F29E45;
  442. color: white;
  443. width: 120rpx;
  444. height: 40rpx;
  445. border-radius: 10rpx;
  446. margin-left: 10rpx;
  447. font-size: 22rpx;
  448. }
  449. .time-coupon,
  450. .price {
  451. display: flex;
  452. flex-wrap: wrap;
  453. align-items: center;
  454. }
  455. .time-coupon {
  456. margin: 10rpx 0rpx;
  457. font-size: 26rpx;
  458. justify-content: space-between;
  459. width: 100%;
  460. .flex {
  461. justify-content: center;
  462. align-items: center;
  463. }
  464. image {
  465. width: 25rpx;
  466. height: 25rpx;
  467. }
  468. .time {
  469. color: #B8B8B8;
  470. margin-left: 6rpx;
  471. }
  472. }
  473. .sales-volume {
  474. display: flex;
  475. align-items: center;
  476. color: #B8B8B8;
  477. font-size: 24rpx;
  478. image {
  479. width: 25rpx;
  480. height: 25rpx;
  481. }
  482. }
  483. }
  484. }
  485. .address {
  486. .address-top {
  487. display: flex;
  488. justify-content: space-between;
  489. align-items: center;
  490. image {
  491. width: 30rpx;
  492. height: 30rpx;
  493. }
  494. }
  495. .addressDetail {
  496. color: #777;
  497. font-size: 28rpx;
  498. padding: 5px 0;
  499. }
  500. text {
  501. background-color: #F29E45;
  502. padding: 8rpx 10rpx;
  503. color: #fff;
  504. font-size: 20rpx;
  505. margin-left: 10px;
  506. border-radius: 5px;
  507. }
  508. }
  509. .min_tips {
  510. font-size: 22rpx;
  511. color: #777;
  512. display: flex;
  513. justify-content: space-between;
  514. padding: 5px 0;
  515. align-items: center;
  516. }
  517. .current-price {
  518. font-size: 27rpx;
  519. color: #FD5100;
  520. }
  521. .line {
  522. border-top: 2px dotted #00000011;
  523. padding: 20rpx 0;
  524. .t {
  525. padding: 5px 0;
  526. color: #000;
  527. font-size: 26rpx;
  528. }
  529. }
  530. .head-div {
  531. .nickname {
  532. font-size: 30rpx;
  533. font-weight: 600;
  534. text-align: left;
  535. line-height: 42rpx;
  536. display: flex;
  537. align-items: center;
  538. .tag {
  539. position: relative;
  540. display: flex;
  541. align-items: center;
  542. image {
  543. height: 45rpx;
  544. width: 90rpx;
  545. vertical-align: middle;
  546. }
  547. .auth {
  548. position: absolute;
  549. white-space: nowrap;
  550. color: #FF6200;
  551. left: 23rpx;
  552. font-size: 17rpx;
  553. }
  554. }
  555. }
  556. .days {
  557. font-size: 20rpx;
  558. font-weight: 400;
  559. text-align: left;
  560. line-height: 56rpx;
  561. display: flex;
  562. align-items: center;
  563. view {
  564. padding-left: 5px;
  565. }
  566. }
  567. }
  568. .btns {
  569. display: flex;
  570. justify-content: center;
  571. .btn {
  572. color: $uni-color;
  573. border: 1px solid $uni-color;
  574. padding: 10rpx 20rpx;
  575. border-radius: 30rpx;
  576. }
  577. }
  578. }
  579. </style>