orderDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. <template>
  2. <view class="container" :style="{paddingBottom: ((orderData.orderStatus >= 2 && orderData.orderStatus <= 4) || (orderData.orderStatus == 5 && orderData.evaluateReplyStatus == 1)) ? '' :'10px'}">
  3. <view class="order-type-info">
  4. <view class="order-type-title">{{orderType.title}}</view>
  5. <view class="order-type-text">{{orderType.text}}</view>
  6. </view>
  7. <view class="address-info-box">
  8. <view class="address-icon">
  9. <text class="iconfont icondizhi"></text>
  10. </view>
  11. <view class="address-content">
  12. <text class="address-info">
  13. <text class="address-name">{{orderData.recName}}</text>
  14. <text class="address-phone">{{orderData.recMobile}}</text>
  15. </text>
  16. <view class="address-detail">{{orderData.address}}</view>
  17. </view>
  18. </view>
  19. <view class="goods-info-box">
  20. <view class="shop-info">
  21. <text class="iconfont iconwode"></text>
  22. <text class="shop-name">{{orderData.nickname}}</text>
  23. </view>
  24. <view class="goods-list">
  25. <view class="goods-row" v-for="(item, index) in orderData.merchantInfoResVO.products" :key="index">
  26. <image class="goods-img" :src="item.imgUrl" mode="aspectFill"></image>
  27. <view class="goods-info">
  28. <view class="goods-name">{{item.productName}}</view>
  29. <view class="goods-type">
  30. 类型:{{item.productType == 1 ? '普通商品' : (item.productType == 2 ? '拍卖商品' : (item.productType == 3 ? '自助采摘' : '共享种植'))}}
  31. </view>
  32. <view class="plant-area" v-if="item.productType == 4">面积:{{item.areaSize}}㎡</view>
  33. <view class="goods-price-number">
  34. <text class="goods-unit">¥</text>
  35. <text class="goods-price">{{item.bizPrice}}</text>
  36. <text class="goods-number">x{{item.buyNum}}</text>
  37. <text class="plant-text" v-if="item.productType == 4">有效期:{{item.term}}天</text>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="order-info">
  43. <u-cell-group :border="false">
  44. <u-cell-item title="商品金额" :value="'¥' + orderData.orderSum" :arrow="false" :border-bottom="false"></u-cell-item>
  45. <u-cell-item title="积分抵扣" :value="'-¥' + orderData.integralAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1"></u-cell-item>
  46. <u-cell-item title="优惠券" :value="'-¥' + orderData.couponDiscountAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1"></u-cell-item>
  47. <u-cell-item title="备注" :value="orderData.notes" :arrow="false" :border-bottom="false"></u-cell-item>
  48. </u-cell-group>
  49. </view>
  50. <view class="pay-info">
  51. <text class="pay-text">实付款</text>
  52. <text class="pay-price">¥{{orderData.paySum}}</text>
  53. </view>
  54. </view>
  55. <view class="order-info-box" @click="goToMessage()">
  56. <view class="info-title-box">
  57. <view class="info-title">留言板</view>
  58. <text class="iconfont iconfangxiang"></text>
  59. </view>
  60. <view class="info-content-box">
  61. <view class="message-row" v-for="(item, index1) in orderData.leas" :key="index1">
  62. <image class="message-head" :src="item.imgUrl" mode="aspectFill"></image>
  63. <view class="message-info-box">
  64. <view class="message-name">{{item.leaMsgType}}</view>
  65. <view class="message-date">{{item.leaMsgTime}}</view>
  66. <view class="message-text">{{item.leaMsgContent}}</view>
  67. <view class="message-img-box" v-for="(site, index2) in item.orderLeaImgResVOs" :key="index2">
  68. <image class="message-img" :src="site.imgUrl" mode="aspectFill"></image>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="order-info-box">
  75. <view class="info-title-box">
  76. <view class="info-title">订单信息</view>
  77. </view>
  78. <view class="info-content-box">
  79. <view class="order-info-row">订单编号:{{orderData.orderCode}}</view>
  80. <view class="order-info-row">创建时间:{{orderData.addOrderTime}}</view>
  81. <view class="order-info-row" v-if="orderData.orderStatus > 1 && orderData.orderStatus != 6">支付时间:{{orderData.payTime}}</view>
  82. <view class="order-info-row" v-if="orderData.orderStatus > 2 && orderData.orderStatus != 6">发货时间:{{orderData.sendTime}}</view>
  83. <view class="order-info-row" v-if="orderData.orderStatus > 3 && orderData.orderStatus != 6">收货时间:{{orderData.confirmTime}}</view>
  84. <view class="order-info-row" v-if="orderData.orderStatus == 6">取消时间:{{orderData.cancelTime}}</view>
  85. </view>
  86. </view>
  87. <uni-goods-nav :fill="true" :options="[]" @click="" @buttonClick="orderHandle" class="order-handle" :buttonGroup="buttonGroup"
  88. v-if="(orderData.orderStatus >= 2 && orderData.orderStatus <= 4) || (orderData.orderStatus == 5 && orderData.evaluateReplyStatus == 1)" />
  89. <u-top-tips ref="uTips"></u-top-tips>
  90. </view>
  91. </template>
  92. <script>
  93. const NET = require('@/utils/request')
  94. const API = require('@/config/api')
  95. export default {
  96. data() {
  97. return {
  98. orderType: {
  99. title: '',
  100. text: '',
  101. },
  102. orderData: {
  103. orderId: '',
  104. orderStatus: 1,
  105. addOrderTime: '',
  106. recName: '',
  107. recMobile: '',
  108. address: '',
  109. merchantInfoResVO: {
  110. supplierName: '',
  111. products: [],
  112. },
  113. orderSum: 0,
  114. integralAmount: 0,
  115. couponDiscountAmount: 0,
  116. notes: 'xxxxx',
  117. paySum: 0,
  118. leas: [],
  119. orderCode: '',
  120. payTime: '',
  121. sendTime: '',
  122. confirmTime: '',
  123. cancelTime: '',
  124. tenantCode: '',
  125. evaluateReplyStatus: 1,
  126. },
  127. goodType: 1,
  128. buttonGroup: [{
  129. text: '',
  130. backgroundColor: '#52A63A',
  131. color: '#fff'
  132. }],
  133. }
  134. },
  135. onLoad(options) {
  136. this.userData = uni.getStorageSync("userData")
  137. NET.request(API.getOrderDetail, {
  138. flag: 2,
  139. orderId: options.orderId,
  140. orderStatus: options.orderStatus,
  141. }, 'GET').then(res => {
  142. this.orderData = res.data
  143. if (this.orderData.merchantInfoResVO.products.length && this.orderData.merchantInfoResVO.products[0].productType !=
  144. 2 && this.orderData.merchantInfoResVO.products[0].productType != 4) {
  145. this.goodType = 1
  146. } else {
  147. this.goodType = 2
  148. }
  149. if (this.orderData.orderStatus == 2) {
  150. this.buttonGroup[0].text = '发货'
  151. } else if (this.orderData.orderStatus == 3 || this.orderData.orderStatus == 4) {
  152. this.buttonGroup[0].text = '追踪物流'
  153. } else if (this.orderData.evaluateReplyStatus == 1) {
  154. this.buttonGroup[0].text = '回复'
  155. } else {
  156. this.buttonGroup = []
  157. }
  158. this.getOrderType()
  159. }).catch(error => {
  160. this.$refs.uTips.show({
  161. title: error.data.msg,
  162. type: 'warning',
  163. })
  164. })
  165. },
  166. onShow() {},
  167. methods: {
  168. // 获取订单类型
  169. getOrderType() {
  170. switch (this.orderData.orderStatus) {
  171. case 1:
  172. this.orderType = {
  173. title: '等待买家付款',
  174. text: '订单将于' + this.orderData.addOrderTime + '关闭',
  175. }
  176. break;
  177. case 2:
  178. this.orderType = {
  179. title: '等待卖家发货',
  180. text: '您的商品正在打包等待发货',
  181. }
  182. break;
  183. case 3:
  184. this.orderType = {
  185. title: '等待商品送达',
  186. text: '您的商品正在路上',
  187. }
  188. break;
  189. case 4:
  190. this.orderType = {
  191. title: '商品已送达',
  192. text: '',
  193. }
  194. break;
  195. case 5:
  196. this.orderType = {
  197. title: '交易已完成',
  198. text: '',
  199. }
  200. break;
  201. default:
  202. this.orderType = {
  203. title: '交易已取消',
  204. text: '',
  205. }
  206. }
  207. },
  208. // 操作
  209. orderHandle() {
  210. if (this.orderData.orderStatus == 2) {
  211. // 发货
  212. uni.navigateTo({
  213. url: '/pagesMain/bindOrder?orderId=' + this.orderData.orderId
  214. });
  215. } else if (this.orderData.orderStatus == 3 || this.orderData.orderStatus == 4) {
  216. // 追踪物流
  217. uni.navigateTo({
  218. url: '/pagesMain/logisticsDeatil?logisticCode=' + this.orderData.logisticCode
  219. });
  220. } else {
  221. // 回复
  222. uni.navigateTo({
  223. url: '/pagesMain/evaluateForm?orderId=' + this.orderData.orderId +'&mid='+this.orderData.mid
  224. });
  225. }
  226. },
  227. // 跳转留言列表
  228. goToMessage() {
  229. uni.navigateTo({
  230. url: '/pagesMain/messageList?orderId=' + this.orderData.orderId + '&tenantCode=' + this.orderData.tenantCode
  231. });
  232. }
  233. }
  234. }
  235. </script>
  236. <style>
  237. page {
  238. background-color: #f7f7f7;
  239. }
  240. </style>
  241. <style lang="less" scoped>
  242. page {
  243. width: 100%;
  244. height: 100%;
  245. }
  246. .container {
  247. width: 100%;
  248. height: 100%;
  249. float: left;
  250. background-color: #f7f7f7;
  251. box-sizing: border-box;
  252. overflow-y: auto;
  253. position: absolute;
  254. .order-type-info {
  255. width: 100%;
  256. height: 115px;
  257. float: left;
  258. box-sizing: border-box;
  259. padding: 22px 100px 0 15px;
  260. background: #52A63A;
  261. border-radius: 0px 0px 20px 20px;
  262. background-size: 62px;
  263. background-position: calc(100% - 48px) 12px;
  264. background-repeat: no-repeat;
  265. background-image: url(@/static/images/orderDetail.png);
  266. .order-type-title {
  267. width: 100%;
  268. float: left;
  269. height: 20px;
  270. line-height: 20px;
  271. font-size: 15px;
  272. font-family: PingFang SC;
  273. color: #FFFFFF;
  274. margin-bottom: 4px;
  275. }
  276. .order-type-text {
  277. width: 100%;
  278. float: left;
  279. height: 20px;
  280. line-height: 20px;
  281. font-size: 12px;
  282. font-family: PingFang SC;
  283. color: #FFFFFF;
  284. }
  285. }
  286. .address-info-box {
  287. width: calc(100% - 30px);
  288. float: left;
  289. box-sizing: border-box;
  290. padding: 16px 18px 16px 16px;
  291. margin: -34px 15px 10px 15px;
  292. background: #FFFFFF;
  293. border-radius: 10px;
  294. .address-icon {
  295. width: 36px;
  296. height: 40px;
  297. float: left;
  298. align-items: center;
  299. display: flex;
  300. .iconfont {
  301. color: #52A63A;
  302. font-size: 36px;
  303. }
  304. }
  305. .address-content {
  306. width: calc(100% - 56px);
  307. height: 40px;
  308. float: left;
  309. margin: 0 8px 0 12px;
  310. .address-info {
  311. height: 20px;
  312. font-family: PingFang SC;
  313. line-height: 20px;
  314. overflow: hidden;
  315. text-overflow: ellipsis;
  316. white-space: nowrap;
  317. .address-name {
  318. font-size: 16px;
  319. color: #333333;
  320. margin-right: 14px;
  321. }
  322. .address-phone {
  323. font-size: 12px;
  324. color: #666666;
  325. }
  326. }
  327. .address-detail {
  328. height: 20px;
  329. font-size: 16px;
  330. font-family: PingFang SC;
  331. color: #333333;
  332. line-height: 20px;
  333. overflow: hidden;
  334. text-overflow: ellipsis;
  335. white-space: nowrap;
  336. }
  337. }
  338. }
  339. .goods-info-box {
  340. width: calc(100% - 30px);
  341. float: left;
  342. margin: 0 15px 10px 15px;
  343. background: #FFFFFF;
  344. border-radius: 10px;
  345. .shop-info {
  346. width: 100%;
  347. height: 48px;
  348. float: left;
  349. box-sizing: border-box;
  350. padding: 13px 15px 12px 15px;
  351. border-bottom: 1px solid #EEEEEE;
  352. line-height: 22px;
  353. .iconwode {
  354. font-size: 22px;
  355. color: #333333;
  356. }
  357. .shop-name {
  358. font-size: 15px;
  359. font-family: PingFang SC;
  360. color: #333333;
  361. margin: 0 8px 0 10px;
  362. }
  363. .iconshangjia {
  364. font-size: 12px;
  365. color: #999999;
  366. }
  367. }
  368. .goods-list {
  369. width: 100%;
  370. float: left;
  371. box-sizing: border-box;
  372. padding: 10px 15px 0 15px;
  373. .goods-row {
  374. width: 100%;
  375. height: 90px;
  376. float: left;
  377. display: flex;
  378. margin-bottom: 10px;
  379. .goods-img {
  380. width: 90px;
  381. height: 90px;
  382. border-radius: 5px;
  383. object-fit: cover;
  384. }
  385. .goods-info {
  386. width: calc(100% - 106px);
  387. height: 90px;
  388. margin-left: 16px;
  389. .goods-name {
  390. width: 100%;
  391. height: 36px;
  392. float: left;
  393. font-size: 14px;
  394. font-family: PingFang SC;
  395. color: #333333;
  396. line-height: 18px;
  397. overflow: hidden;
  398. text-overflow: ellipsis;
  399. display: -webkit-box;
  400. -webkit-line-clamp: 2;
  401. -webkit-box-orient: vertical;
  402. word-wrap: break-word;
  403. }
  404. .goods-type {
  405. height: 20px;
  406. float: left;
  407. background: #F0F0F0;
  408. border-radius: 4px;
  409. padding: 0 8px;
  410. margin: 6px 0;
  411. font-size: 10px;
  412. font-family: PingFang SC;
  413. color: #666666;
  414. line-height: 20px;
  415. }
  416. .plant-area {
  417. height: 20px;
  418. float: right;
  419. margin: 6px 0;
  420. font-size: 12px;
  421. font-family: PingFang SC;
  422. color: #333333;
  423. }
  424. .goods-price-number {
  425. width: 100%;
  426. height: 20px;
  427. float: left;
  428. line-height: 20px;
  429. font-family: PingFang SC;
  430. color: #333333;
  431. .goods-unit {
  432. font-size: 12px;
  433. }
  434. .goods-price {
  435. font-size: 15px;
  436. margin-right: 6px;
  437. }
  438. .goods-number {
  439. font-size: 12px;
  440. }
  441. }
  442. .plant-text {
  443. float: right;
  444. font-size: 12px;
  445. font-family: PingFang SC;
  446. color: #333333;
  447. }
  448. }
  449. }
  450. }
  451. .order-info {
  452. width: 100%;
  453. float: left;
  454. /deep/.u-cell {
  455. padding: 6px 16px;
  456. }
  457. }
  458. .pay-info {
  459. width: 100%;
  460. height: 46px;
  461. float: left;
  462. box-sizing: border-box;
  463. border-top: 1px solid #EEEEEE;
  464. padding-right: 15px;
  465. line-height: 44px;
  466. font-family: PingFang SC;
  467. font-size: 14px;
  468. text-align: right;
  469. white-space: nowrap;
  470. .pay-text {
  471. float: left;
  472. color: #333333;
  473. margin-left: 15px;
  474. }
  475. .pay-price {
  476. color: #52A63A;
  477. }
  478. }
  479. }
  480. .order-info-box {
  481. width: calc(100% - 30px);
  482. float: left;
  483. margin: 0 15px 10px 15px;
  484. background: #FFFFFF;
  485. border-radius: 10px;
  486. .info-title-box {
  487. width: 100%;
  488. height: 48px;
  489. float: left;
  490. box-sizing: border-box;
  491. padding: 15px 15px 14px 15px;
  492. border-bottom: 1px solid #EEEEEE;
  493. line-height: 18px;
  494. white-space: nowrap;
  495. .info-title {
  496. height: 18px;
  497. float: left;
  498. font-size: 15px;
  499. font-family: PingFang SC;
  500. color: #333333;
  501. margin-right: 8px;
  502. padding-left: 10px;
  503. border-left: 2px solid #74BD60;
  504. }
  505. .iconfangxiang {
  506. float: right;
  507. font-size: 12px;
  508. color: #999999;
  509. }
  510. }
  511. .info-content-box {
  512. width: 100%;
  513. float: left;
  514. padding: 15px 0;
  515. .message-row {
  516. width: 100%;
  517. float: left;
  518. box-sizing: border-box;
  519. padding: 0 15px;
  520. margin-bottom: 15px;
  521. .message-head {
  522. width: 50px;
  523. height: 50px;
  524. object-fit: cover;
  525. float: left;
  526. border-radius: 50%;
  527. overflow: hidden;
  528. }
  529. .message-info-box {
  530. width: calc(100% - 75px);
  531. float: right;
  532. .message-name {
  533. width: 50%;
  534. height: 30px;
  535. float: left;
  536. font-size: 15px;
  537. font-family: PingFang SC;
  538. color: #333333;
  539. line-height: 30px;
  540. overflow: hidden;
  541. text-overflow: ellipsis;
  542. white-space: nowrap;
  543. }
  544. .message-date {
  545. width: 50%;
  546. height: 30px;
  547. float: left;
  548. font-size: 12px;
  549. font-family: PingFang SC;
  550. color: #666666;
  551. text-align: right;
  552. line-height: 30px;
  553. overflow: hidden;
  554. text-overflow: ellipsis;
  555. white-space: nowrap;
  556. }
  557. .message-text {
  558. width: 100%;
  559. height: 20px;
  560. float: left;
  561. font-size: 12px;
  562. font-family: PingFang SC;
  563. color: #666666;
  564. line-height: 20px;
  565. overflow: hidden;
  566. text-overflow: ellipsis;
  567. white-space: nowrap;
  568. }
  569. .message-img-box {
  570. width: 100%;
  571. float: left;
  572. .message-img {
  573. width: 76px;
  574. height: 76px;
  575. object-fit: cover;
  576. float: left;
  577. margin: 0 10px 10px 0;
  578. }
  579. }
  580. }
  581. }
  582. .message-row:last-child {
  583. margin-bottom: 0;
  584. }
  585. .order-info-row {
  586. width: 100%;
  587. float: left;
  588. box-sizing: border-box;
  589. padding: 0 15px;
  590. font-size: 12px;
  591. font-family: PingFang SC;
  592. color: #333333;
  593. line-height: 26px;
  594. word-break:break-all;
  595. }
  596. }
  597. }
  598. .order-handle {
  599. width: 100%;
  600. height: 50px;
  601. float: left;
  602. border-top: 1px solid #cccccc;
  603. }
  604. }
  605. </style>