order-details.vue 16 KB

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