order-details.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  1. <template>
  2. <view class="details clearfix">
  3. <view class="container-details" v-show="isRequest">
  4. <!-- 地址信息 -->
  5. <view class="address-section clearfix">
  6. <view class="address-content">
  7. <view class="info-item">
  8. <text class="label">买家名称:{{ orderInfo.userInfo.name }}</text>
  9. </view>
  10. <view class="info-item">
  11. <text class="label">收货人:{{ orderInfo.userInfo.receiver }}</text>
  12. <text class="label" :style="{ marginLeft: 40 + 'rpx' }"
  13. >联系方式:{{ orderInfo.userInfo.mobile }}</text
  14. >
  15. </view>
  16. <view class="info-item">
  17. <text class="label"
  18. >收货地址:<text style="color: #666666;">{{ orderInfo.userInfo.address }}</text></text
  19. >
  20. </view>
  21. </view>
  22. <image :src="StaticUrl + '/icon/line@3x.png'" mode=""></image>
  23. </view>
  24. <!-- 商品 -->
  25. <view class="goods-list">
  26. <view class="goods-item clearfix">
  27. <view class="productlist" v-for="(pros, idx) in orderInfo.orderProductList" :key="idx">
  28. <view class="goods-pros-t">
  29. <view class="pros-left">
  30. <view class="pros-img"><image :src="pros.image" alt="" mode="aspectFill"/></view>
  31. </view>
  32. <view class="pros-product">
  33. <view class="producttitle">{{ pros.aliasName ? pros.aliasName : '' }}</view>
  34. <view class="productspec">规格:{{ pros.productUnit ? pros.productUnit : '' }}</view>
  35. <view class="product-view">
  36. <view class="view-num price">¥{{ pros.price | NumFormat }}</view>
  37. <view class="view-num num">
  38. <text class="small">X</text> {{ pros.num + pros.presentNum }}</view
  39. >
  40. </view>
  41. <view class="product-view">
  42. <view class="view-num">已发货:{{ pros.shipmentsNum }}</view>
  43. <view class="view-num">已退货:{{ pros.returnedNum }}</view>
  44. <view class="view-num">已取消:{{ pros.actualCancelNum }}</view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="product-total">
  49. <view class="total">
  50. 合计: <text>¥{{ pros.totalAmount | NumFormat }}</text>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="goods-pros-m" v-if="orderInfo.note">
  55. <view class="m-text">留言:</view>
  56. <view class="m-input">
  57. <view class="text">{{ orderInfo.note ? orderInfo.note : '' }}</view>
  58. </view>
  59. </view>
  60. <view class="goods-pros-b">
  61. <view class="count">共{{ orderInfo.itemCount }}件商品</view>
  62. <view class="money"
  63. >商品总额:<text class="red">¥{{ orderInfo.productAmount | NumFormat }}</text>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <!-- 订单信息 -->
  69. <view class="information-content clearfix">
  70. <view class="order-title">
  71. <view class="order-title-t">
  72. <view class="order-title-num">订单编号:{{ orderInfo.shopOrderNo }}</view>
  73. <view class="order-title-tip"
  74. >结算状态:<text :style="{ color: setStatusText(orderInfo.payStatus) }">{{
  75. orderInfo.payStatus | payStatusType
  76. }}</text></view
  77. >
  78. </view>
  79. <view class="order-title-t">
  80. <view class="order-title-num">下单时间:{{ orderInfo.orderTime }}</view>
  81. <view class="order-title-tip"
  82. >发货状态:<text
  83. class="status"
  84. :style="{ color: setStatusText(orderInfo.receiptStatus) }"
  85. >{{ orderInfo.sendOutStatus | sendOutStatusType }}</text
  86. ></view
  87. >
  88. </view>
  89. <template v-if="isOpenInfoFlag">
  90. <view class="order-title-t">
  91. <view class="order-title-num"
  92. >结算商品金额:<text class="red"
  93. >¥{{ orderInfo.shopProductAmount | NumFormat }}</text
  94. ></view
  95. >
  96. <view class="order-title-tip"
  97. >结算税费:<text class="red">¥{{ orderInfo.shopTaxFee | NumFormat }}</text></view
  98. >
  99. </view>
  100. <view class="order-title-t">
  101. <view class="order-title-num"
  102. >结算运费:<text class="red">¥{{ orderInfo.shopPostFee | NumFormat }}</text></view
  103. >
  104. <view class="order-title-tip"
  105. >总结算金额:<text class="red"
  106. >¥{{ orderInfo.shouldPayShopAmount | NumFormat }}</text
  107. ></view
  108. >
  109. </view>
  110. <view class="order-title-t">
  111. <view class="order-title-num"
  112. >已结算金额:<text class="red">¥{{ orderInfo.payedShopAmount | NumFormat }}</text></view
  113. >
  114. <view class="order-title-tip"></view>
  115. </view>
  116. </template>
  117. </view>
  118. <view class="order-more" v-if="isOpenFlag">
  119. <view class="btnInfo" @click="OpenFlagShow"
  120. >查看更多<label class="iconfont icon-xiangxiajiantou"></label
  121. ></view>
  122. </view>
  123. </view>
  124. <!-- 结算记录 -->
  125. <view class="information-record clearfix">
  126. <view class="record-title"> <view class="record-title-l">结算记录</view> </view>
  127. <view class="record-list" v-if="payShopRecord.length > 0">
  128. <view class="record-item" v-for="(item, index) in payShopRecord" :key="index">
  129. <view class="item-time mm">¥{{ item.payAmount | NumFormat }}</view>
  130. <view class="item-time tt">{{ item.payTime ? item.payTime : '无' }}</view>
  131. </view>
  132. </view>
  133. <view class="record-empty" v-else> <text>暂无结算记录</text> </view>
  134. </view>
  135. <!-- 底部button -->
  136. <order-button
  137. ref="orderButton"
  138. v-if="isRequest"
  139. :status="btnStatus"
  140. :shareCode="shareCode"
  141. @buttonConfirm="handButtonConfirm"
  142. >
  143. </order-button>
  144. </view>
  145. <share-alert :shopOrderId="shopOrderId" v-if="isShareModal" @shareConfirm="onShareAppMessage"> </share-alert>
  146. </view>
  147. </template>
  148. <script>
  149. import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
  150. import orderAddress from './components/details/orderAddress' //地址信息
  151. import goodsList from './components/details/goodsList' //商品列表
  152. import orderButton from './components/supplierDetaileButton' //底部按钮
  153. import shareAlert from '../components/supplierShareAlert' //分享弹窗
  154. export default {
  155. components: {
  156. headerBack,
  157. orderAddress,
  158. goodsList,
  159. orderButton,
  160. shareAlert
  161. },
  162. data() {
  163. return {
  164. nvabarData: {
  165. //顶部自定义导航
  166. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  167. showSearch: 0,
  168. title: '订单详情', // 导航栏 中间的标题
  169. haveBack: false,
  170. textLeft: this.$store.state.isIphone
  171. },
  172. StaticUrl: this.$Static,
  173. windowHeight: '',
  174. isIphoneX: this.$store.state.isIphoneX,
  175. CustomBar: this.CustomBar, // 顶部导航栏高度
  176. state: 0,
  177. userID: '',
  178. shopOrderId: '',
  179. shareCode: '', //分享码
  180. payStatus: 0,
  181. btnStatus: 0, //按钮组件状态
  182. isRequest: false, //是否加载完成渲染子组件
  183. isOrderShare: false,
  184. isShareModal: false,
  185. orderInfo: {}, //订单信息
  186. payShopRecord: [], //结算记录
  187. isOpenInfoFlag: false,
  188. isOpenFlag: true
  189. }
  190. },
  191. onLoad(option) {
  192. console.log(option.shopOrderId)
  193. this.shopOrderId = option.shopOrderId
  194. this.initShopOrderDetails()
  195. },
  196. filters: {
  197. sendOutStatusType(value) {
  198. if (value === null) {
  199. return '未发货'
  200. } else if (value === 1) {
  201. return '待发货'
  202. } else if (value === 2) {
  203. return '部分发货'
  204. } else {
  205. return '已发货'
  206. }
  207. },
  208. payStatusType(value) {
  209. if (value === 1) {
  210. return '待结算'
  211. } else if (value === 2) {
  212. return '部分结算'
  213. } else {
  214. return '已结算'
  215. }
  216. },
  217. NumFormat(value) {
  218. //处理金额
  219. //处理金额
  220. if (!value) return '0.00'
  221. let number = parseFloat(Number(value))
  222. return number
  223. }
  224. },
  225. methods: {
  226. initShopOrderDetails() {
  227. //初始化页面数据@参数:订单ID
  228. this.ShopService.GetShopOrderDetails({ shopOrderId: this.shopOrderId })
  229. .then(response => {
  230. this.orderInfo = response.data.shopOrder
  231. this.btnStatus = this.orderInfo.sendOutStatus
  232. this.payShopRecord = response.data.payShopRecord
  233. this.isRequest = true
  234. })
  235. .catch(err => {
  236. this.$util.msg(err.msg, 2000)
  237. })
  238. },
  239. handButtonConfirm(data) {
  240. //监听点击时间的按钮类型并执行...
  241. this.handShowAlert(data)
  242. },
  243. handShowAlert(type) {
  244. //判断点击的按钮类型并执行...
  245. switch (type) {
  246. case 'record':
  247. this.$api.navigateTo('/pages/supplier/deliver/deliver-record?shopOrderId=' + this.shopOrderId)
  248. break
  249. case 'deliver':
  250. this.$api.navigateTo('/pages/supplier/deliver/deliver-goods?shopOrderId=' + this.shopOrderId)
  251. break
  252. }
  253. },
  254. setStatusText(status) {
  255. let textColor = ''
  256. switch (status) {
  257. case 1:
  258. textColor = '#FF2A2A'
  259. break
  260. case 2:
  261. textColor = '#FF5B00'
  262. break
  263. case 3:
  264. textColor = '#38CB3D'
  265. break
  266. }
  267. return textColor
  268. },
  269. OpenFlagShow() {
  270. //查看更多
  271. this.isOpenInfoFlag = true
  272. this.isOpenFlag = false
  273. },
  274. onShareCode() {
  275. this.isShareModal = true
  276. },
  277. onShareAppMessage(res) {
  278. //分享转发
  279. this.isShareModal = false
  280. if (res.from === 'button') {
  281. // 来自页面内转发按钮
  282. }
  283. return {
  284. title: '您有订单待处理,请点击查看~',
  285. path: `/pages/supplier/login/share-info?authority=3&shopOrderId=${this.shopOrderId}`,
  286. imageUrl: 'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  287. }
  288. }
  289. },
  290. onPullDownRefresh() {
  291. //下拉刷新
  292. this.initShopOrderDetails()
  293. uni.stopPullDownRefresh()
  294. },
  295. onShow() {}
  296. }
  297. </script>
  298. <style lang="scss">
  299. page {
  300. background: #f7f7f7;
  301. }
  302. .details {
  303. padding-bottom: 130rpx;
  304. width: 100%;
  305. height: auto;
  306. }
  307. .container-details {
  308. background: #f7f7f7;
  309. }
  310. .information-content {
  311. width: 702rpx;
  312. height: auto;
  313. padding: 10rpx 24rpx;
  314. background: #ffffff;
  315. margin: 24rpx 0;
  316. .order-more {
  317. width: 100%;
  318. height: auto;
  319. float: left;
  320. .btnInfo {
  321. width: 140rpx;
  322. height: 40rpx;
  323. border: 2rpx solid #e1e1e1;
  324. border-radius: 6rpx;
  325. padding: 5rpx;
  326. text-align: center;
  327. color: #b2b2b2;
  328. margin: 20rpx auto;
  329. font-size: $font-size-24;
  330. .iconfont {
  331. position: relative;
  332. top: 5rpx;
  333. right: -3rpx;
  334. }
  335. }
  336. }
  337. .order-title {
  338. width: 100%;
  339. height: auto;
  340. float: left;
  341. .order-title-t {
  342. width: 100%;
  343. height: 58rpx;
  344. float: left;
  345. font-size: $font-size-28;
  346. line-height: 58rpx;
  347. .order-title-num {
  348. float: left;
  349. text-align: left;
  350. color: #666666;
  351. .red {
  352. color: #f94b4b;
  353. font-weight: bold;
  354. }
  355. }
  356. .order-title-tip {
  357. float: right;
  358. text-align: right;
  359. font-size: $font-size-28;
  360. color: #666666;
  361. .red {
  362. color: #f94b4b;
  363. font-weight: bold;
  364. }
  365. .status {
  366. color: $color-system;
  367. }
  368. }
  369. }
  370. .order-title-b {
  371. width: 100%;
  372. height: 40rpx;
  373. float: left;
  374. margin-top: 8rpx;
  375. font-size: $font-size-28;
  376. line-height: 40rpx;
  377. color: #999999;
  378. text-align: left;
  379. }
  380. }
  381. .info-item {
  382. height: 58rpx;
  383. width: 100%;
  384. display: flex;
  385. .item-view {
  386. flex: 1;
  387. line-height: 58rpx;
  388. font-size: $font-size-28;
  389. color: #333333;
  390. }
  391. }
  392. }
  393. .address-section {
  394. width: 100%;
  395. margin-bottom: 24rpx;
  396. .address-content {
  397. width: 100%;
  398. height: auto;
  399. padding: 10rpx 24rpx;
  400. background: #ffffff;
  401. box-sizing: border-box;
  402. float: left;
  403. .info-item {
  404. width: 100%;
  405. display: flex;
  406. line-height: 50rpx;
  407. font-size: $font-size-28;
  408. color: #333333;
  409. }
  410. }
  411. image {
  412. float: left;
  413. width: 100%;
  414. height: 6rpx;
  415. }
  416. }
  417. .goods-list {
  418. width: 100%;
  419. height: auto;
  420. background: #f7f7f7;
  421. .goods-item {
  422. width: 702rpx;
  423. padding: 24rpx;
  424. height: auto;
  425. background: #ffffff;
  426. margin-bottom: 24rpx;
  427. &:last-child {
  428. margin-bottom: 0;
  429. }
  430. }
  431. .productlist {
  432. width: 100%;
  433. height: auto;
  434. }
  435. .goods-pros-t {
  436. display: flex;
  437. width: 100%;
  438. height: auto;
  439. padding: 12rpx 0;
  440. .pros-left {
  441. width: 210rpx;
  442. height: 100%;
  443. margin: 0 26rpx 0 0;
  444. }
  445. .pros-img {
  446. width: 210rpx;
  447. height: 210rpx;
  448. border-radius: 10rpx;
  449. border: 1px solid #f3f3f3;
  450. image {
  451. width: 100%;
  452. height: 100%;
  453. border-radius: 10rpx;
  454. }
  455. }
  456. }
  457. .product-total {
  458. width: 100%;
  459. height: 60rpx;
  460. float: left;
  461. border-bottom: 1px solid #e1e1e1;
  462. .total {
  463. float: right;
  464. font-size: 28rpx;
  465. line-height: 60rpx;
  466. color: #333333;
  467. font-weight: bold;
  468. text {
  469. color: #f94b4b;
  470. }
  471. }
  472. }
  473. .pros-product {
  474. width: 468rpx;
  475. height: 100%;
  476. line-height: 36rpx;
  477. font-size: $font-size-26;
  478. position: relative;
  479. .icon-genghuan {
  480. position: absolute;
  481. top: 50%;
  482. right: 0;
  483. font-size: $font-size-44;
  484. color: $color-system;
  485. }
  486. .product-view {
  487. width: 100%;
  488. height: auto;
  489. display: flex;
  490. .view-num {
  491. flex: 1;
  492. text-align: left;
  493. font-size: $font-size-26;
  494. color: #666666;
  495. line-height: 44rpx;
  496. .small {
  497. font-size: $font-size-20;
  498. color: #999999;
  499. }
  500. &.price {
  501. flex: 9;
  502. color: #f94b4b;
  503. font-weight: bold;
  504. }
  505. &.num {
  506. flex: 1;
  507. text-align: right;
  508. }
  509. }
  510. }
  511. .producttitle {
  512. width: 100%;
  513. display: inline-block;
  514. height: auto;
  515. text-overflow: ellipsis;
  516. display: -webkit-box;
  517. word-break: break-all;
  518. -webkit-box-orient: vertical;
  519. -webkit-line-clamp: 2;
  520. overflow: hidden;
  521. margin-bottom: 8rpx;
  522. font-size: $font-size-28;
  523. }
  524. .productspec {
  525. height: 44rpx;
  526. color: #666666;
  527. line-height: 44rpx;
  528. }
  529. .productprice {
  530. height: 48rpx;
  531. position: absolute;
  532. width: 100%;
  533. bottom: 0;
  534. .price {
  535. line-height: 48rpx;
  536. font-size: $font-size-28;
  537. width: 48%;
  538. color: #f94b4b;
  539. float: left;
  540. }
  541. .count {
  542. height: 100%;
  543. float: right;
  544. position: relative;
  545. .small {
  546. color: #666666;
  547. }
  548. }
  549. }
  550. }
  551. .goods-pros-m {
  552. width: 100%;
  553. height: auto;
  554. line-height: 76rpx;
  555. font-size: $font-size-26;
  556. color: $text-color;
  557. float: left;
  558. padding: 10rpx 0;
  559. border-bottom: 1px solid #f7f7f7;
  560. .m-text {
  561. width: 82rpx;
  562. float: left;
  563. padding-right: 20rpx;
  564. font-weight: bold;
  565. }
  566. .m-input {
  567. display: -webkit-box;
  568. display: -webkit-flex;
  569. display: flex;
  570. -webkit-box-align: center;
  571. -webkit-align-items: center;
  572. align-items: center;
  573. position: relative;
  574. width: 600rpx;
  575. height: auto;
  576. padding: 20rpx 0 10rpx 0;
  577. background: #ffffff;
  578. .text {
  579. width: 100%;
  580. height: 100%;
  581. font-size: $font-size-26;
  582. line-height: 36rpx;
  583. color: #333333;
  584. }
  585. }
  586. }
  587. .goods-pros-b {
  588. width: 100%;
  589. height: 40rpx;
  590. margin-top: 12rpx;
  591. float: left;
  592. .count {
  593. float: left;
  594. font-size: $font-size-28;
  595. line-height: 40rpx;
  596. color: $text-color;
  597. display: flex;
  598. justify-content: flex-end;
  599. }
  600. .money {
  601. float: right;
  602. font-size: $font-size-28;
  603. line-height: 40rpx;
  604. color: $text-color;
  605. display: flex;
  606. justify-content: flex-end;
  607. .red {
  608. color: #f94b4b;
  609. font-weight: bold;
  610. }
  611. }
  612. }
  613. }
  614. .information-record {
  615. width: 100%;
  616. height: auto;
  617. padding: 20rpx 24rpx;
  618. box-sizing: border-box;
  619. background-color: #ffffff;
  620. .record-title {
  621. width: 100%;
  622. font-size: $font-size-28;
  623. color: $text-color;
  624. text-align: left;
  625. line-height: 40rpx;
  626. margin-bottom: 12rpx;
  627. float: left;
  628. .record-title-l {
  629. font-weight: bold;
  630. float: left;
  631. }
  632. .record-title-r {
  633. float: right;
  634. .red {
  635. color: #ff2a2a;
  636. font-weight: bold;
  637. }
  638. }
  639. }
  640. .record-empty {
  641. font-size: $font-size-26;
  642. color: #999999;
  643. text-align: left;
  644. line-height: 40rpx;
  645. }
  646. .record-list {
  647. width: 100%;
  648. height: auto;
  649. float: left;
  650. margin-top: 12rpx;
  651. .record-item {
  652. height: 40rpx;
  653. width: 100%;
  654. padding: 12rpx 0;
  655. font-size: $font-size-28;
  656. line-height: 40rpx;
  657. float: left;
  658. display: flex;
  659. justify-content: center;
  660. flex-direction: row;
  661. .item-time {
  662. &.mm {
  663. flex: 1;
  664. color: $text-color;
  665. text-align: left;
  666. }
  667. &.tt {
  668. flex: 1;
  669. color: #999999;
  670. text-align: right;
  671. }
  672. }
  673. }
  674. }
  675. }
  676. .button-template {
  677. width: 100%;
  678. height: auto;
  679. position: fixed;
  680. bottom: 0;
  681. left: 0;
  682. background: #ffffff;
  683. .button-content {
  684. width: 702rpx;
  685. padding: 0 24rpx;
  686. height: auto;
  687. float: left;
  688. position: relative;
  689. .btn {
  690. width: 160rpx;
  691. height: 64rpx;
  692. margin: 22rpx;
  693. line-height: 64rpx;
  694. font-size: $font-size-26;
  695. color: #ffffff;
  696. text-align: center;
  697. border-radius: 10rpx;
  698. float: right;
  699. }
  700. .btn-color {
  701. background: $btn-confirm;
  702. margin: 22rpx 0 22rpx 22rpx;
  703. .tips {
  704. width: 160rpx;
  705. height: 34rpx;
  706. padding: 10rpx 10rpx;
  707. background: linear-gradient(45deg, rgba(0, 0, 0, 1) 0%, rgba(87, 87, 87, 1) 100%);
  708. box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.2);
  709. border-radius: 8rpx;
  710. position: absolute;
  711. color: #ffffff;
  712. line-height: 34rpx;
  713. font-size: $font-size-24;
  714. text-align: left;
  715. right: 24rpx;
  716. top: -45rpx;
  717. &:before {
  718. content: '';
  719. width: 25rpx;
  720. height: 25rpx;
  721. background: linear-gradient(45deg, rgba(0, 0, 0, 1) 0%, rgba(87, 87, 87, 1) 100%);
  722. position: absolute;
  723. bottom: -8rpx;
  724. right: 30rpx;
  725. z-index: -1;
  726. transform: rotate(45deg);
  727. }
  728. }
  729. }
  730. }
  731. }
  732. </style>