order-service-details.vue 15 KB

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