order-details.vue 18 KB

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