orderDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  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 lang="less" scoped>
  237. page {
  238. width: 100%;
  239. height: 100%;
  240. }
  241. .container {
  242. width: 100%;
  243. height: 100%;
  244. float: left;
  245. background-color: #f7f7f7;
  246. box-sizing: border-box;
  247. overflow-y: auto;
  248. position: absolute;
  249. .order-type-info {
  250. width: 100%;
  251. height: 115px;
  252. float: left;
  253. box-sizing: border-box;
  254. padding: 22px 100px 0 15px;
  255. background: #52A63A;
  256. border-radius: 0px 0px 20px 20px;
  257. background-size: 62px;
  258. background-position: calc(100% - 48px) 12px;
  259. background-repeat: no-repeat;
  260. background-image: url(@/static/images/orderDetail.png);
  261. .order-type-title {
  262. width: 100%;
  263. float: left;
  264. height: 20px;
  265. line-height: 20px;
  266. font-size: 15px;
  267. font-family: PingFang SC;
  268. color: #FFFFFF;
  269. margin-bottom: 4px;
  270. }
  271. .order-type-text {
  272. width: 100%;
  273. float: left;
  274. height: 20px;
  275. line-height: 20px;
  276. font-size: 12px;
  277. font-family: PingFang SC;
  278. color: #FFFFFF;
  279. }
  280. }
  281. .address-info-box {
  282. width: calc(100% - 30px);
  283. float: left;
  284. box-sizing: border-box;
  285. padding: 16px 18px 16px 16px;
  286. margin: -34px 15px 10px 15px;
  287. background: #FFFFFF;
  288. border-radius: 10px;
  289. .address-icon {
  290. width: 36px;
  291. height: 40px;
  292. float: left;
  293. align-items: center;
  294. display: flex;
  295. .iconfont {
  296. color: #52A63A;
  297. font-size: 36px;
  298. }
  299. }
  300. .address-content {
  301. width: calc(100% - 56px);
  302. height: 40px;
  303. float: left;
  304. margin: 0 8px 0 12px;
  305. .address-info {
  306. height: 20px;
  307. font-family: PingFang SC;
  308. line-height: 20px;
  309. overflow: hidden;
  310. text-overflow: ellipsis;
  311. white-space: nowrap;
  312. .address-name {
  313. font-size: 16px;
  314. color: #333333;
  315. margin-right: 14px;
  316. }
  317. .address-phone {
  318. font-size: 12px;
  319. color: #666666;
  320. }
  321. }
  322. .address-detail {
  323. height: 20px;
  324. font-size: 16px;
  325. font-family: PingFang SC;
  326. color: #333333;
  327. line-height: 20px;
  328. overflow: hidden;
  329. text-overflow: ellipsis;
  330. white-space: nowrap;
  331. }
  332. }
  333. }
  334. .goods-info-box {
  335. width: calc(100% - 30px);
  336. float: left;
  337. margin: 0 15px 10px 15px;
  338. background: #FFFFFF;
  339. border-radius: 10px;
  340. .shop-info {
  341. width: 100%;
  342. height: 48px;
  343. float: left;
  344. box-sizing: border-box;
  345. padding: 13px 15px 12px 15px;
  346. border-bottom: 1px solid #EEEEEE;
  347. line-height: 22px;
  348. .iconwode {
  349. font-size: 22px;
  350. color: #333333;
  351. }
  352. .shop-name {
  353. font-size: 15px;
  354. font-family: PingFang SC;
  355. color: #333333;
  356. margin: 0 8px 0 10px;
  357. }
  358. .iconshangjia {
  359. font-size: 12px;
  360. color: #999999;
  361. }
  362. }
  363. .goods-list {
  364. width: 100%;
  365. float: left;
  366. box-sizing: border-box;
  367. padding: 10px 15px 0 15px;
  368. .goods-row {
  369. width: 100%;
  370. height: 90px;
  371. float: left;
  372. display: flex;
  373. margin-bottom: 10px;
  374. .goods-img {
  375. width: 90px;
  376. height: 90px;
  377. border-radius: 5px;
  378. object-fit: cover;
  379. }
  380. .goods-info {
  381. width: calc(100% - 106px);
  382. height: 90px;
  383. margin-left: 16px;
  384. .goods-name {
  385. width: 100%;
  386. height: 36px;
  387. float: left;
  388. font-size: 14px;
  389. font-family: PingFang SC;
  390. color: #333333;
  391. line-height: 18px;
  392. overflow: hidden;
  393. text-overflow: ellipsis;
  394. display: -webkit-box;
  395. -webkit-line-clamp: 2;
  396. -webkit-box-orient: vertical;
  397. word-wrap: break-word;
  398. }
  399. .goods-type {
  400. height: 20px;
  401. float: left;
  402. background: #F0F0F0;
  403. border-radius: 4px;
  404. padding: 0 8px;
  405. margin: 6px 0;
  406. font-size: 10px;
  407. font-family: PingFang SC;
  408. color: #666666;
  409. line-height: 20px;
  410. }
  411. .plant-area {
  412. height: 20px;
  413. float: right;
  414. margin: 6px 0;
  415. font-size: 12px;
  416. font-family: PingFang SC;
  417. color: #333333;
  418. }
  419. .goods-price-number {
  420. width: 100%;
  421. height: 20px;
  422. float: left;
  423. line-height: 20px;
  424. font-family: PingFang SC;
  425. color: #333333;
  426. .goods-unit {
  427. font-size: 12px;
  428. }
  429. .goods-price {
  430. font-size: 15px;
  431. margin-right: 6px;
  432. }
  433. .goods-number {
  434. font-size: 12px;
  435. }
  436. }
  437. .plant-text {
  438. float: right;
  439. font-size: 12px;
  440. font-family: PingFang SC;
  441. color: #333333;
  442. }
  443. }
  444. }
  445. }
  446. .order-info {
  447. width: 100%;
  448. float: left;
  449. /deep/.u-cell {
  450. padding: 6px 16px;
  451. }
  452. }
  453. .pay-info {
  454. width: 100%;
  455. height: 46px;
  456. float: left;
  457. box-sizing: border-box;
  458. border-top: 1px solid #EEEEEE;
  459. padding-right: 15px;
  460. line-height: 44px;
  461. font-family: PingFang SC;
  462. font-size: 14px;
  463. text-align: right;
  464. white-space: nowrap;
  465. .pay-text {
  466. float: left;
  467. color: #333333;
  468. margin-left: 15px;
  469. }
  470. .pay-price {
  471. color: #52A63A;
  472. }
  473. }
  474. }
  475. .order-info-box {
  476. width: calc(100% - 30px);
  477. float: left;
  478. margin: 0 15px 10px 15px;
  479. background: #FFFFFF;
  480. border-radius: 10px;
  481. .info-title-box {
  482. width: 100%;
  483. height: 48px;
  484. float: left;
  485. box-sizing: border-box;
  486. padding: 15px 15px 14px 15px;
  487. border-bottom: 1px solid #EEEEEE;
  488. line-height: 18px;
  489. white-space: nowrap;
  490. .info-title {
  491. height: 18px;
  492. float: left;
  493. font-size: 15px;
  494. font-family: PingFang SC;
  495. color: #333333;
  496. margin-right: 8px;
  497. padding-left: 10px;
  498. border-left: 2px solid #74BD60;
  499. }
  500. .iconfangxiang {
  501. float: right;
  502. font-size: 12px;
  503. color: #999999;
  504. }
  505. }
  506. .info-content-box {
  507. width: 100%;
  508. float: left;
  509. padding: 15px 0;
  510. .message-row {
  511. width: 100%;
  512. float: left;
  513. box-sizing: border-box;
  514. padding: 0 15px;
  515. margin-bottom: 15px;
  516. .message-head {
  517. width: 50px;
  518. height: 50px;
  519. object-fit: cover;
  520. float: left;
  521. border-radius: 50%;
  522. overflow: hidden;
  523. }
  524. .message-info-box {
  525. width: calc(100% - 75px);
  526. float: right;
  527. .message-name {
  528. width: 50%;
  529. height: 30px;
  530. float: left;
  531. font-size: 15px;
  532. font-family: PingFang SC;
  533. color: #333333;
  534. line-height: 30px;
  535. overflow: hidden;
  536. text-overflow: ellipsis;
  537. white-space: nowrap;
  538. }
  539. .message-date {
  540. width: 50%;
  541. height: 30px;
  542. float: left;
  543. font-size: 12px;
  544. font-family: PingFang SC;
  545. color: #666666;
  546. text-align: right;
  547. line-height: 30px;
  548. overflow: hidden;
  549. text-overflow: ellipsis;
  550. white-space: nowrap;
  551. }
  552. .message-text {
  553. width: 100%;
  554. height: 20px;
  555. float: left;
  556. font-size: 12px;
  557. font-family: PingFang SC;
  558. color: #666666;
  559. line-height: 20px;
  560. overflow: hidden;
  561. text-overflow: ellipsis;
  562. white-space: nowrap;
  563. }
  564. .message-img-box {
  565. width: 100%;
  566. float: left;
  567. .message-img {
  568. width: 76px;
  569. height: 76px;
  570. object-fit: cover;
  571. float: left;
  572. margin: 0 10px 10px 0;
  573. }
  574. }
  575. }
  576. }
  577. .message-row:last-child {
  578. margin-bottom: 0;
  579. }
  580. .order-info-row {
  581. width: 100%;
  582. float: left;
  583. box-sizing: border-box;
  584. padding: 0 15px;
  585. font-size: 12px;
  586. font-family: PingFang SC;
  587. color: #333333;
  588. line-height: 26px;
  589. word-break:break-all;
  590. }
  591. }
  592. }
  593. .order-handle {
  594. width: 100%;
  595. height: 50px;
  596. float: left;
  597. border-top: 1px solid #cccccc;
  598. }
  599. }
  600. </style>