order-details.vue 18 KB

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