order-details.vue 17 KB

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