orderDetail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  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.headImg" mode="aspectFill"></image>
  63. <view class="message-info-box">
  64. <view class="message-name">{{item.name}}</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. buttonGroup: [],
  134. noPick: true // 没有自助采摘的商品
  135. }
  136. },
  137. onLoad(options) {
  138. this.userData = uni.getStorageSync("userData")
  139. NET.request(API.getOrderDetail, {
  140. flag: 2,
  141. orderId: options.orderId,
  142. orderStatus: options.orderStatus,
  143. }, 'GET').then(res => {
  144. this.orderData = res.data
  145. if (this.orderData.addOrderTime) {
  146. let tempTime = new Date(this.orderData.addOrderTime).getTime()
  147. let addTempTime = new Date(tempTime + 1000 * 60 * 60 * 24)
  148. let addYear = addTempTime.getFullYear()
  149. let addMonth = addTempTime.getMonth() + 1
  150. let addDay = addTempTime.getDate()
  151. let addHours = addTempTime.getHours()
  152. let addMin = addTempTime.getMinutes()
  153. let addSeconds = addTempTime.getSeconds()
  154. this.orderData.overTime = addYear + '年' + addMonth + '月' + addDay + '日' + addHours + ':' + addMin + ':' +
  155. addSeconds
  156. }
  157. if (this.orderData.merchantInfoResVO.products.length && this.orderData.merchantInfoResVO.products[0].productType !=
  158. 2 && this.orderData.merchantInfoResVO.products[0].productType != 4) {
  159. this.goodType = 1
  160. } else {
  161. this.goodType = 2
  162. }
  163. if (this.orderData.orderStatus == 2) {
  164. if (this.orderData.merchantInfoResVO.products.length) {
  165. if (this.orderData.merchantInfoResVO.products.some(v => {return v.productType == 3})) {
  166. this.noPick = false
  167. this.buttonGroup = [{
  168. text: '发货',
  169. backgroundColor: '#75BD60',
  170. color: '#fff'
  171. }, {
  172. text: '自助采摘',
  173. backgroundColor: '#52A63A',
  174. color: '#fff'
  175. }]
  176. } else {
  177. this.buttonGroup = [{
  178. text: '发货',
  179. backgroundColor: '#75BD60',
  180. color: '#fff'
  181. }]
  182. }
  183. }
  184. } else if (this.orderData.orderStatus == 3 || this.orderData.orderStatus == 4) {
  185. this.buttonGroup[0].text = '追踪物流'
  186. } else if (this.orderData.evaluateReplyStatus == 1) {
  187. this.buttonGroup[0].text = '回复'
  188. } else {
  189. this.buttonGroup = []
  190. }
  191. this.getOrderType()
  192. }).catch(error => {
  193. this.$refs.uTips.show({
  194. title: error.data.msg,
  195. type: 'warning',
  196. })
  197. })
  198. },
  199. onShow() {},
  200. methods: {
  201. // 获取订单类型
  202. getOrderType() {
  203. switch (this.orderData.orderStatus) {
  204. case 1:
  205. this.orderType = {
  206. title: '等待买家付款',
  207. text: '订单将于' + this.orderData.overTime + '关闭',
  208. }
  209. break;
  210. case 2:
  211. this.orderType = {
  212. title: '待发货',
  213. text: '买家已付款,请尽快发货',
  214. }
  215. break;
  216. case 3:
  217. this.orderType = {
  218. title: '已发货',
  219. text: '商品正在运输中',
  220. }
  221. break;
  222. case 4:
  223. this.orderType = {
  224. title: '已送达',
  225. text: '商品已送达',
  226. }
  227. break;
  228. case 5:
  229. this.orderType = {
  230. title: '交易已完成',
  231. text: '',
  232. }
  233. break;
  234. default:
  235. this.orderType = {
  236. title: '交易已取消',
  237. text: '',
  238. }
  239. }
  240. },
  241. // 操作
  242. orderHandle(e) {
  243. if (this.orderData.orderStatus == 2) {
  244. if (e.index == 0) {
  245. // 发货
  246. uni.navigateTo({
  247. url: '/pagesMain/bindOrder?orderId=' + this.orderData.orderId
  248. });
  249. } else if (e.index == 1) {
  250. // 去自助采摘
  251. uni.navigateTo({
  252. url: '/pagesGood/pickVideo?tenantCode=' + this.orderData.tenantCode + '&orderId=' + this.orderData.orderId
  253. });
  254. }
  255. } else if (this.orderData.orderStatus == 3 || this.orderData.orderStatus == 4) {
  256. // 追踪物流
  257. uni.navigateTo({
  258. url: '/pagesMain/logisticsDeatil?logisticCode=' + this.orderData.logisticCode
  259. });
  260. } else {
  261. // 回复
  262. uni.navigateTo({
  263. url: '/pagesMain/evaluateForm?orderId=' + this.orderData.orderId +'&mid='+this.orderData.mid
  264. });
  265. }
  266. },
  267. // 跳转留言列表
  268. goToMessage() {
  269. uni.navigateTo({
  270. url: '/pagesMain/messageList?orderId=' + this.orderData.orderId + '&tenantCode=' + this.orderData.tenantCode
  271. });
  272. }
  273. }
  274. }
  275. </script>
  276. <style>
  277. page {
  278. background-color: #f7f7f7;
  279. }
  280. </style>
  281. <style lang="less" scoped>
  282. page {
  283. width: 100%;
  284. height: 100%;
  285. }
  286. .container {
  287. width: 100%;
  288. height: 100%;
  289. float: left;
  290. background-color: #f7f7f7;
  291. box-sizing: border-box;
  292. overflow-y: auto;
  293. position: absolute;
  294. .order-type-info {
  295. width: 100%;
  296. height: 115px;
  297. float: left;
  298. box-sizing: border-box;
  299. padding: 22px 100px 0 15px;
  300. background: #52A63A;
  301. border-radius: 0px 0px 20px 20px;
  302. background-size: 62px;
  303. background-position: calc(100% - 48px) 12px;
  304. background-repeat: no-repeat;
  305. background-image: url(@/static/images/orderDetail.png);
  306. .order-type-title {
  307. width: 100%;
  308. float: left;
  309. height: 20px;
  310. line-height: 20px;
  311. font-size: 15px;
  312. font-family: PingFang SC;
  313. color: #FFFFFF;
  314. margin-bottom: 4px;
  315. }
  316. .order-type-text {
  317. width: 100%;
  318. float: left;
  319. height: 20px;
  320. line-height: 20px;
  321. font-size: 12px;
  322. font-family: PingFang SC;
  323. color: #FFFFFF;
  324. }
  325. }
  326. .address-info-box {
  327. width: calc(100% - 30px);
  328. float: left;
  329. box-sizing: border-box;
  330. padding: 16px 18px 16px 16px;
  331. margin: -34px 15px 10px 15px;
  332. background: #FFFFFF;
  333. border-radius: 10px;
  334. .address-icon {
  335. width: 36px;
  336. height: 40px;
  337. float: left;
  338. align-items: center;
  339. display: flex;
  340. .iconfont {
  341. color: #52A63A;
  342. font-size: 36px;
  343. }
  344. }
  345. .address-content {
  346. width: calc(100% - 56px);
  347. height: 40px;
  348. float: left;
  349. margin: 0 8px 0 12px;
  350. .address-info {
  351. height: 20px;
  352. font-family: PingFang SC;
  353. line-height: 20px;
  354. overflow: hidden;
  355. text-overflow: ellipsis;
  356. white-space: nowrap;
  357. .address-name {
  358. font-size: 16px;
  359. color: #333333;
  360. margin-right: 14px;
  361. }
  362. .address-phone {
  363. font-size: 12px;
  364. color: #666666;
  365. }
  366. }
  367. .address-detail {
  368. height: 20px;
  369. font-size: 16px;
  370. font-family: PingFang SC;
  371. color: #333333;
  372. line-height: 20px;
  373. overflow: hidden;
  374. text-overflow: ellipsis;
  375. white-space: nowrap;
  376. }
  377. }
  378. }
  379. .goods-info-box {
  380. width: calc(100% - 30px);
  381. float: left;
  382. margin: 0 15px 10px 15px;
  383. background: #FFFFFF;
  384. border-radius: 10px;
  385. .shop-info {
  386. width: 100%;
  387. height: 48px;
  388. float: left;
  389. box-sizing: border-box;
  390. padding: 13px 15px 12px 15px;
  391. border-bottom: 1px solid #EEEEEE;
  392. line-height: 22px;
  393. .iconwode {
  394. font-size: 22px;
  395. color: #333333;
  396. }
  397. .shop-name {
  398. font-size: 15px;
  399. font-family: PingFang SC;
  400. color: #333333;
  401. margin: 0 8px 0 10px;
  402. }
  403. .iconshangjia {
  404. font-size: 12px;
  405. color: #999999;
  406. }
  407. }
  408. .goods-list {
  409. width: 100%;
  410. float: left;
  411. box-sizing: border-box;
  412. padding: 10px 15px 0 15px;
  413. .goods-row {
  414. width: 100%;
  415. height: 90px;
  416. float: left;
  417. display: flex;
  418. margin-bottom: 10px;
  419. .goods-img {
  420. width: 90px;
  421. height: 90px;
  422. border-radius: 5px;
  423. object-fit: cover;
  424. }
  425. .goods-info {
  426. width: calc(100% - 106px);
  427. height: 90px;
  428. margin-left: 16px;
  429. .goods-name {
  430. width: 100%;
  431. height: 36px;
  432. float: left;
  433. font-size: 14px;
  434. font-family: PingFang SC;
  435. color: #333333;
  436. line-height: 18px;
  437. overflow: hidden;
  438. text-overflow: ellipsis;
  439. display: -webkit-box;
  440. -webkit-line-clamp: 2;
  441. -webkit-box-orient: vertical;
  442. word-wrap: break-word;
  443. }
  444. .goods-type {
  445. height: 20px;
  446. float: left;
  447. background: #F0F0F0;
  448. border-radius: 4px;
  449. padding: 0 8px;
  450. margin: 6px 0;
  451. font-size: 10px;
  452. font-family: PingFang SC;
  453. color: #666666;
  454. line-height: 20px;
  455. }
  456. .plant-area {
  457. height: 20px;
  458. float: right;
  459. margin: 6px 0;
  460. font-size: 12px;
  461. font-family: PingFang SC;
  462. color: #333333;
  463. }
  464. .goods-price-number {
  465. width: 100%;
  466. height: 20px;
  467. float: left;
  468. line-height: 20px;
  469. font-family: PingFang SC;
  470. color: #333333;
  471. .goods-unit {
  472. font-size: 12px;
  473. }
  474. .goods-price {
  475. font-size: 15px;
  476. margin-right: 6px;
  477. }
  478. .goods-number {
  479. font-size: 12px;
  480. }
  481. }
  482. .plant-text {
  483. float: right;
  484. font-size: 12px;
  485. font-family: PingFang SC;
  486. color: #333333;
  487. }
  488. }
  489. }
  490. }
  491. .order-info {
  492. width: 100%;
  493. float: left;
  494. /deep/.u-cell {
  495. padding: 6px 16px;
  496. }
  497. }
  498. .pay-info {
  499. width: 100%;
  500. height: 46px;
  501. float: left;
  502. box-sizing: border-box;
  503. border-top: 1px solid #EEEEEE;
  504. padding-right: 15px;
  505. line-height: 44px;
  506. font-family: PingFang SC;
  507. font-size: 14px;
  508. text-align: right;
  509. white-space: nowrap;
  510. .pay-text {
  511. float: left;
  512. color: #333333;
  513. margin-left: 15px;
  514. }
  515. .pay-price {
  516. color: #52A63A;
  517. }
  518. }
  519. }
  520. .order-info-box {
  521. width: calc(100% - 30px);
  522. float: left;
  523. margin: 0 15px 10px 15px;
  524. background: #FFFFFF;
  525. border-radius: 10px;
  526. .info-title-box {
  527. width: 100%;
  528. height: 48px;
  529. float: left;
  530. box-sizing: border-box;
  531. padding: 15px 15px 14px 15px;
  532. border-bottom: 1px solid #EEEEEE;
  533. line-height: 18px;
  534. white-space: nowrap;
  535. .info-title {
  536. height: 18px;
  537. float: left;
  538. font-size: 15px;
  539. font-family: PingFang SC;
  540. color: #333333;
  541. margin-right: 8px;
  542. padding-left: 10px;
  543. border-left: 2px solid #74BD60;
  544. }
  545. .iconfangxiang {
  546. float: right;
  547. font-size: 12px;
  548. color: #999999;
  549. }
  550. }
  551. .info-content-box {
  552. width: 100%;
  553. float: left;
  554. padding: 15px 0;
  555. .message-row {
  556. width: 100%;
  557. float: left;
  558. box-sizing: border-box;
  559. padding: 0 15px;
  560. margin-bottom: 15px;
  561. .message-head {
  562. width: 50px;
  563. height: 50px;
  564. object-fit: cover;
  565. float: left;
  566. border-radius: 50%;
  567. overflow: hidden;
  568. }
  569. .message-info-box {
  570. width: calc(100% - 75px);
  571. float: right;
  572. .message-name {
  573. width: 50%;
  574. height: 30px;
  575. float: left;
  576. font-size: 15px;
  577. font-family: PingFang SC;
  578. color: #333333;
  579. line-height: 30px;
  580. overflow: hidden;
  581. text-overflow: ellipsis;
  582. white-space: nowrap;
  583. }
  584. .message-date {
  585. width: 50%;
  586. height: 30px;
  587. float: left;
  588. font-size: 12px;
  589. font-family: PingFang SC;
  590. color: #666666;
  591. text-align: right;
  592. line-height: 30px;
  593. overflow: hidden;
  594. text-overflow: ellipsis;
  595. white-space: nowrap;
  596. }
  597. .message-text {
  598. width: 100%;
  599. height: 20px;
  600. float: left;
  601. font-size: 12px;
  602. font-family: PingFang SC;
  603. color: #666666;
  604. line-height: 20px;
  605. overflow: hidden;
  606. text-overflow: ellipsis;
  607. white-space: nowrap;
  608. }
  609. .message-img-box {
  610. width: 100%;
  611. float: left;
  612. .message-img {
  613. width: 76px;
  614. height: 76px;
  615. object-fit: cover;
  616. float: left;
  617. margin: 0 10px 10px 0;
  618. }
  619. }
  620. }
  621. }
  622. .message-row:last-child {
  623. margin-bottom: 0;
  624. }
  625. .order-info-row {
  626. width: 100%;
  627. float: left;
  628. box-sizing: border-box;
  629. padding: 0 15px;
  630. font-size: 12px;
  631. font-family: PingFang SC;
  632. color: #333333;
  633. line-height: 26px;
  634. word-break:break-all;
  635. }
  636. }
  637. }
  638. .order-handle {
  639. width: 100%;
  640. height: 50px;
  641. float: left;
  642. border-top: 1px solid #cccccc;
  643. }
  644. }
  645. </style>