order-service-details.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. <template>
  2. <view class="details clearfix" :style="{ paddingBottom: isIphoneX ? 130 + 68 + 'rpx' : '130rpx' }">
  3. <cu-custom :navbar-data="nvabarData"></cu-custom>
  4. <view class="container-details" :style="{ paddingTop: CustomBar + 'px' }" v-show="isRequest">
  5. <!-- 订单信息 -->
  6. <view class="information-content">
  7. <view class="info-item"
  8. ><view class="item-view"
  9. ><text class="label">供应商:{{ orderInfo.shopName ? orderInfo.shopName : '' }}</text></view
  10. ></view
  11. >
  12. <view class="info-item"
  13. ><view class="item-view"
  14. ><text class="label">订单号:{{ orderInfo.shopOrderNo }}</text></view
  15. ></view
  16. >
  17. <view class="info-item"
  18. ><view class="item-view"
  19. ><text class="label">下单时间:{{ orderInfo.orderTime }}</text></view
  20. ></view
  21. >
  22. <view class="info-item">
  23. <view class="item-view"
  24. ><text class="label"
  25. >收款状态:<text :style="{ color: setStatusText(orderInfo.receiptStatus) }">{{
  26. setStatusTextHtml(orderInfo.receiptStatus)
  27. }}</text></text
  28. ></view
  29. >
  30. <view class="item-view"
  31. ><text class="label"
  32. >结算状态:<text :style="{ color: setStatusText(orderInfo.payStatus) }">{{
  33. setStatusTextHtml1(orderInfo.payStatus)
  34. }}</text></text
  35. ></view
  36. >
  37. </view>
  38. <view class="info-item">
  39. <view class="item-view"
  40. ><text class="label"
  41. >发货状态:<text :style="{ color: setStatusText(orderInfo.sendOutStatus) }">{{
  42. setStatusTextHtml2(orderInfo.sendOutStatus)
  43. }}</text></text
  44. ></view
  45. >
  46. </view>
  47. </view>
  48. <!-- 地址信息 -->
  49. <view class="address-content">
  50. <view class="info-item"
  51. ><text class="label">收货人:{{ orderInfo.userInfo.receiver }}</text></view
  52. >
  53. <view class="info-item"
  54. ><text class="label">联系方式:{{ orderInfo.userInfo.mobile }}</text></view
  55. >
  56. <view class="info-item"
  57. ><text class="label"
  58. >收货地址:<text style="color: #666666;">{{ orderInfo.userInfo.address }}</text></text
  59. ></view
  60. >
  61. </view>
  62. <!-- 商品 -->
  63. <view class="goods-list">
  64. <view class="goods-item clearfix">
  65. <view class="productlist" v-for="(pros, idx) in orderInfo.orderProductList" :key="idx">
  66. <view class="goods-pros-t" @click="hanldOperationConfim(pros)">
  67. <view class="pros-left">
  68. <view class="pros-img"><image :src="pros.image" alt="" mode="aspectFill"/></view>
  69. </view>
  70. <view class="pros-product">
  71. <view class="producttitle">{{ pros.aliasName ? pros.aliasName : '' }}</view>
  72. <view class="productspec">规格:{{ pros.productUnit ? pros.productUnit : '' }}</view>
  73. <view class="productspec">商品编码:{{ pros.productNo ? pros.productNo : '' }}</view>
  74. <view class="product-view">
  75. <view class="view-num">数量:{{ pros.num + pros.presentNum }}</view>
  76. </view>
  77. <view class="product-view">
  78. <view class="view-num">已发货:{{ pros.shipmentsNum }}</view>
  79. <view class="view-num">未发货:{{ pros.notOutStore - pros.actualCancelNum }}</view>
  80. </view>
  81. <view class="product-view">
  82. <view class="view-num" v-if="pros.returnedNum > 0"
  83. >已退货:{{ pros.returnedNum }}</view
  84. >
  85. <view class="view-num" v-if="pros.actualCancelNum > 0"
  86. >已取消:{{ pros.actualCancelNum }}</view
  87. >
  88. </view>
  89. <text class="iconfont icon-genghuan"></text>
  90. </view>
  91. </view>
  92. </view>
  93. <view class="goods-pros-m" v-if="orderInfo.note != null || orderInfo.note != ''">
  94. <view class="m-text">留言:</view>
  95. <view class="m-input">
  96. <view class="text">{{ orderInfo.note ? orderInfo.note : '' }}</view>
  97. </view>
  98. </view>
  99. <view class="goods-pros-b">
  100. <view class="count">共{{ orderInfo.itemCount }}件商品</view>
  101. </view>
  102. </view>
  103. </view>
  104. <!-- 底部按钮 -->
  105. <view class="button-template" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }">
  106. <view class="button-content">
  107. <!-- #ifdef MP-WEIXIN -->
  108. <button class="btn btn-color" open-type="share" @click="onShareAppMessage">分享订单</button>
  109. <!-- #endif -->
  110. </view>
  111. </view>
  112. <!--底部选择模态层弹窗组件 -->
  113. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="discard" @tap="hideSpec">
  114. <!-- 遮罩层 -->
  115. <view class="mask"></view>
  116. <view
  117. class="layer"
  118. @tap.stop="discard"
  119. :style="{ paddingBottom: isIphoneX ? '68rpx' : '36rpx', bottom: isIphoneX ? '-332rpx' : '-294rpx' }"
  120. >
  121. <view class="content">
  122. <view class="layer-title">商品显示名:</view>
  123. <view class="layer-name">{{ handleData.name }}</view>
  124. <view class="layer-text">
  125. <view class="layer-text-fl">
  126. 售价:<text style="color: #666;">¥{{ toFixedFn(handleData.discountPrice) }}</text>
  127. </view>
  128. <view class="layer-text-fr">
  129. <text style="color: #666;">共计{{ handleData.num + handleData.presentNum }}件商品</text>
  130. </view>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. </view>
  136. </view>
  137. </template>
  138. <script>
  139. import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
  140. export default {
  141. components: {
  142. headerBack
  143. },
  144. data() {
  145. return {
  146. nvabarData: {
  147. //顶部自定义导航
  148. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  149. showSearch: 0,
  150. title: '订单详情', // 导航栏 中间的标题
  151. haveBack: false,
  152. textLeft: this.$store.state.isIphone
  153. },
  154. isIphoneX: this.$store.state.isIphoneX,
  155. CustomBar: this.CustomBar, // 顶部导航栏高度
  156. specClass: '', //规格弹窗css类,控制开关动画
  157. handleData: {},
  158. state: 0,
  159. userID: '',
  160. shopOrderId: '',
  161. shareCode: '', //分享码
  162. orderInfo: {}, //订单信息
  163. payStatus: 0,
  164. btnStatus: 0, //按钮组件状态
  165. isRequest: false, //是否加载完成渲染子组件
  166. isOrderShare: false,
  167. addressData: {}, //地址信息初始化
  168. information: {} //订单信息初始化
  169. }
  170. },
  171. onLoad(option) {
  172. console.log(option)
  173. this.shopOrderId = option.shopOrderId
  174. this.initShopOrderDetails()
  175. },
  176. methods: {
  177. initShopOrderDetails() {
  178. //初始化页面数据@参数:订单ID
  179. this.ShopService.GetShopOrderDetails({ shopOrderId: this.shopOrderId })
  180. .then(res => {
  181. this.orderInfo = res.data.shopOrder
  182. this.isRequest = true
  183. })
  184. .catch(err => {
  185. this.$util.msg(err.msg, 2000)
  186. })
  187. },
  188. handButtonConfirm(data) {
  189. //监听点击时间的按钮类型并执行...
  190. this.handShowAlert(data)
  191. },
  192. setStatusTextHtml(status) {
  193. let TextHtml = ''
  194. switch (status) {
  195. case 1:
  196. TextHtml = '待付款'
  197. break
  198. case 2:
  199. TextHtml = '部分付款'
  200. break
  201. case 3:
  202. TextHtml = '已付款'
  203. break
  204. }
  205. return TextHtml
  206. },
  207. setStatusTextHtml1(status) {
  208. let TextHtml = ''
  209. switch (status) {
  210. case 1:
  211. TextHtml = '待结算'
  212. break
  213. case 2:
  214. TextHtml = '部分结算'
  215. break
  216. case 3:
  217. TextHtml = '已结算'
  218. break
  219. }
  220. return TextHtml
  221. },
  222. setStatusTextHtml2(status) {
  223. let TextHtml = ''
  224. switch (status) {
  225. case 1:
  226. TextHtml = '待发货'
  227. break
  228. case 2:
  229. TextHtml = '部分发货'
  230. break
  231. case 3:
  232. TextHtml = '已发货'
  233. break
  234. }
  235. return TextHtml
  236. },
  237. setStatusText(status) {
  238. let textColor = ''
  239. switch (status) {
  240. case 1:
  241. textColor = '#FF2A2A'
  242. break
  243. case 2:
  244. textColor = '#FF5B00'
  245. break
  246. case 3:
  247. textColor = '#38CB3D'
  248. break
  249. }
  250. return textColor
  251. },
  252. hanldOperationConfim(data) {
  253. //显示选择数量确认弹窗
  254. this.specClass = 'show'
  255. this.handleData = data
  256. },
  257. toFixedFn(text) {
  258. return Number(text).toFixed(2)
  259. },
  260. hideSpec() {
  261. //关闭选择数量确认弹窗
  262. this.specClass = 'hide'
  263. setTimeout(() => {
  264. this.specClass = 'none'
  265. }, 200)
  266. },
  267. onShareAppMessage(res) {
  268. //分享转发
  269. if (res.from === 'button') {
  270. // 来自页面内转发按钮
  271. }
  272. return {
  273. title: '您有订单待处理,请点击查看~',
  274. path: `/pages/supplier/login/share-info?authority=2&shopOrderId=${this.shopOrderId}`,
  275. imageUrl: 'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  276. }
  277. },
  278. discard() {
  279. //丢弃
  280. }
  281. },
  282. onPullDownRefresh() {
  283. //下拉刷新
  284. this.initShopOrderDetails()
  285. uni.stopPullDownRefresh()
  286. },
  287. onShow() {}
  288. }
  289. </script>
  290. <style lang="scss">
  291. page {
  292. height: 100%;
  293. background: #f7f7f7;
  294. }
  295. .details {
  296. padding-bottom: 130rpx;
  297. width: 100%;
  298. height: auto;
  299. }
  300. .container-details {
  301. background: #f7f7f7;
  302. }
  303. .information-content {
  304. width: 702rpx;
  305. height: auto;
  306. padding: 10rpx 24rpx;
  307. background: #ffffff;
  308. margin-bottom: 24rpx;
  309. .info-item {
  310. height: 58rpx;
  311. width: 100%;
  312. display: flex;
  313. .item-view {
  314. flex: 1;
  315. line-height: 58rpx;
  316. font-size: $font-size-28;
  317. color: #333333;
  318. }
  319. }
  320. }
  321. .address-content {
  322. width: 702rpx;
  323. height: auto;
  324. padding: 10rpx 24rpx;
  325. background: #ffffff;
  326. margin-bottom: 24rpx;
  327. .info-item {
  328. width: 100%;
  329. display: flex;
  330. line-height: 50rpx;
  331. font-size: $font-size-28;
  332. color: #333333;
  333. }
  334. }
  335. .goods-list {
  336. width: 100%;
  337. height: auto;
  338. background: #f7f7f7;
  339. .goods-item {
  340. width: 702rpx;
  341. padding: 24rpx;
  342. height: auto;
  343. background: #ffffff;
  344. margin-bottom: 24rpx;
  345. &:last-child {
  346. margin-bottom: 0;
  347. }
  348. }
  349. .productlist {
  350. width: 100%;
  351. height: auto;
  352. }
  353. .goods-pros-t {
  354. display: flex;
  355. width: 100%;
  356. height: auto;
  357. padding: 12rpx 0;
  358. .pros-left {
  359. width: 210rpx;
  360. height: 100%;
  361. margin: 0 26rpx 0 0;
  362. }
  363. .pros-img {
  364. width: 210rpx;
  365. height: 210rpx;
  366. border-radius: 10rpx;
  367. border: 1px solid #f3f3f3;
  368. image {
  369. width: 100%;
  370. height: 100%;
  371. border-radius: 10rpx;
  372. }
  373. }
  374. }
  375. .pros-product {
  376. width: 468rpx;
  377. height: 100%;
  378. line-height: 36rpx;
  379. font-size: $font-size-26;
  380. position: relative;
  381. .icon-genghuan {
  382. position: absolute;
  383. top: 50%;
  384. right: 0;
  385. font-size: $font-size-44;
  386. color: $color-system;
  387. }
  388. .product-view {
  389. width: 100%;
  390. height: auto;
  391. display: flex;
  392. .view-num {
  393. flex: 1;
  394. text-align: left;
  395. font-size: $font-size-26;
  396. color: #666666;
  397. line-height: 44rpx;
  398. }
  399. }
  400. .producttitle {
  401. width: 100%;
  402. display: inline-block;
  403. height: auto;
  404. text-overflow: ellipsis;
  405. display: -webkit-box;
  406. word-break: break-all;
  407. -webkit-box-orient: vertical;
  408. -webkit-line-clamp: 2;
  409. overflow: hidden;
  410. margin-bottom: 8rpx;
  411. }
  412. .productspec {
  413. height: 44rpx;
  414. color: #666666;
  415. line-height: 44rpx;
  416. }
  417. .productprice {
  418. height: 48rpx;
  419. position: absolute;
  420. width: 100%;
  421. bottom: 0;
  422. .price {
  423. line-height: 48rpx;
  424. font-size: $font-size-28;
  425. width: 48%;
  426. color: #ff2a2a;
  427. float: left;
  428. }
  429. .count {
  430. height: 100%;
  431. float: right;
  432. position: relative;
  433. .small {
  434. color: #666666;
  435. }
  436. }
  437. }
  438. }
  439. .goods-pros-m {
  440. width: 100%;
  441. height: auto;
  442. line-height: 76rpx;
  443. font-size: $font-size-26;
  444. color: $text-color;
  445. float: left;
  446. padding: 10rpx 0;
  447. border-top: 1px solid #f7f7f7;
  448. border-bottom: 1px solid #f7f7f7;
  449. .m-text {
  450. width: 62rpx;
  451. float: left;
  452. padding-right: 20rpx;
  453. font-weight: bold;
  454. }
  455. .m-input {
  456. display: -webkit-box;
  457. display: -webkit-flex;
  458. display: flex;
  459. -webkit-box-align: center;
  460. -webkit-align-items: center;
  461. align-items: center;
  462. position: relative;
  463. width: 620rpx;
  464. height: auto;
  465. padding: 20rpx 0 10rpx 0;
  466. background: #ffffff;
  467. .text {
  468. width: 100%;
  469. height: 100%;
  470. font-size: $font-size-26;
  471. line-height: 36rpx;
  472. color: #333333;
  473. }
  474. }
  475. }
  476. .goods-pros-b {
  477. width: 100%;
  478. height: 40rpx;
  479. margin-top: 12rpx;
  480. float: left;
  481. .count {
  482. float: right;
  483. font-size: $font-size-28;
  484. line-height: 40rpx;
  485. color: $text-color;
  486. display: flex;
  487. justify-content: flex-end;
  488. }
  489. }
  490. }
  491. .button-template {
  492. width: 100%;
  493. height: auto;
  494. position: fixed;
  495. bottom: 0;
  496. left: 0;
  497. background: #ffffff;
  498. -webkit-border-radius: 20rpx 20rpx 0 0;
  499. border-radius: 20rpx 20rpx 0 0;
  500. -webkit-box-shadow: 0px 3px 10px rgba(51, 51, 51, 0.5);
  501. box-shadow: 0px 3px 10px rgba(51, 51, 51, 0.5);
  502. .button-content {
  503. width: 702rpx;
  504. padding: 0 24rpx;
  505. height: auto;
  506. float: left;
  507. position: relative;
  508. .btn {
  509. width: 160rpx;
  510. height: 64rpx;
  511. margin: 22rpx;
  512. line-height: 64rpx;
  513. font-size: $font-size-26;
  514. color: #ffffff;
  515. text-align: center;
  516. border-radius: 10rpx;
  517. float: right;
  518. }
  519. .btn-color {
  520. background: $btn-confirm;
  521. margin: 22rpx 0 22rpx 22rpx;
  522. .tips {
  523. width: 160rpx;
  524. height: 34rpx;
  525. padding: 10rpx 10rpx;
  526. background: linear-gradient(45deg, rgba(0, 0, 0, 1) 0%, rgba(87, 87, 87, 1) 100%);
  527. box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.2);
  528. border-radius: 8rpx;
  529. position: absolute;
  530. color: #ffffff;
  531. line-height: 34rpx;
  532. font-size: $font-size-24;
  533. text-align: left;
  534. right: 24rpx;
  535. top: -45rpx;
  536. &:before {
  537. content: '';
  538. width: 25rpx;
  539. height: 25rpx;
  540. background: linear-gradient(45deg, rgba(0, 0, 0, 1) 0%, rgba(87, 87, 87, 1) 100%);
  541. position: absolute;
  542. bottom: -8rpx;
  543. right: 30rpx;
  544. z-index: -1;
  545. transform: rotate(45deg);
  546. }
  547. }
  548. }
  549. }
  550. }
  551. .popup {
  552. position: fixed;
  553. top: 0;
  554. width: 100%;
  555. height: 100%;
  556. z-index: 999;
  557. display: none;
  558. .mask {
  559. position: fixed;
  560. top: 0;
  561. width: 100%;
  562. height: 100%;
  563. z-index: 21;
  564. background-color: rgba(0, 0, 0, 0.6);
  565. }
  566. .layer {
  567. position: fixed;
  568. z-index: 22;
  569. bottom: -294rpx;
  570. width: 702rpx;
  571. padding: 24rpx 24rpx 36rpx 24rpx;
  572. height: 236rpx;
  573. border-radius: 20rpx 20rpx 0 0;
  574. background-color: #fff;
  575. display: flex;
  576. flex-wrap: wrap;
  577. align-content: space-between;
  578. .content {
  579. width: 100%;
  580. .layer-title {
  581. font-size: $font-size-28;
  582. color: $text-color;
  583. line-height: 58rpx;
  584. }
  585. .layer-name {
  586. width: 100%;
  587. display: inline-block;
  588. height: auto;
  589. text-overflow: ellipsis;
  590. display: -webkit-box;
  591. word-break: break-all;
  592. -webkit-box-orient: vertical;
  593. -webkit-line-clamp: 2;
  594. overflow: hidden;
  595. margin-bottom: 8rpx;
  596. font-size: $font-size-28;
  597. color: #666;
  598. }
  599. .layer-text {
  600. margin-top: 10rpx;
  601. font-size: $font-size-28;
  602. color: $text-color;
  603. line-height: 58rpx;
  604. .layer-text-fl {
  605. float: left;
  606. }
  607. .layer-text-fr {
  608. float: right;
  609. }
  610. }
  611. }
  612. }
  613. &.show {
  614. display: block;
  615. .mask {
  616. animation: showPopup 0.2s linear both;
  617. }
  618. .layer {
  619. animation: showLayer 0.2s linear both;
  620. }
  621. }
  622. &.hide {
  623. display: block;
  624. .mask {
  625. animation: hidePopup 0.2s linear both;
  626. }
  627. .layer {
  628. animation: hideLayer 0.2s linear both;
  629. }
  630. }
  631. &.none {
  632. display: none;
  633. }
  634. }
  635. </style>