order-details.vue 17 KB

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