order-details.vue 17 KB

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