order-service-details.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  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">已退货:{{pros.returnedNum}}</view>
  45. <view class="view-num">已取消:{{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!=''">
  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}}件商品</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. }
  250. .container-details{
  251. background:#F7F7F7;
  252. }
  253. .information-content{
  254. width: 702rpx;
  255. height: auto;
  256. padding:10rpx 24rpx;
  257. background: #FFFFFF;
  258. margin-bottom: 24rpx;
  259. .info-item{
  260. height: 58rpx;
  261. width: 100%;
  262. display: flex;
  263. .item-view{
  264. flex: 1;
  265. line-height: 58rpx;
  266. font-size: $font-size-28;
  267. color: #333333;
  268. }
  269. }
  270. }
  271. .address-content{
  272. width: 702rpx;
  273. height: auto;
  274. padding:10rpx 24rpx;
  275. background: #FFFFFF;
  276. margin-bottom: 24rpx;
  277. .info-item{
  278. width: 100%;
  279. display: flex;
  280. line-height: 50rpx;
  281. font-size: $font-size-28;
  282. color: #333333;
  283. }
  284. }
  285. .goods-list{
  286. width: 100%;
  287. height: auto;
  288. background: #F7F7F7;
  289. .goods-item{
  290. width: 702rpx;
  291. padding:24rpx;
  292. height: auto;
  293. background: #FFFFFF;
  294. margin-bottom: 24rpx;
  295. &:last-child{
  296. margin-bottom: 0;
  297. }
  298. }
  299. .productlist{
  300. width: 100%;
  301. height: auto;
  302. }
  303. .goods-pros-t{
  304. display: flex;
  305. width: 100%;
  306. height: auto;
  307. padding: 12rpx 0;
  308. .pros-left{
  309. width: 210rpx;
  310. height: 100%;
  311. margin:0 26rpx 0 0;
  312. }
  313. .pros-img{
  314. width: 210rpx;
  315. height: 210rpx;
  316. border-radius: 10rpx;
  317. border:1px solid #f3f3f3;
  318. image{
  319. width: 100%;
  320. height: 100%;
  321. border-radius: 10rpx;
  322. }
  323. }
  324. }
  325. .pros-product{
  326. width: 468rpx;
  327. height: 100%;
  328. line-height: 36rpx;
  329. font-size: $font-size-26;
  330. position: relative;
  331. .icon-genghuan{
  332. position: absolute;
  333. top: 50%;
  334. right: 0;
  335. font-size: $font-size-44;
  336. color: $color-system;
  337. }
  338. .product-view{
  339. width: 100%;
  340. height: auto;
  341. display: flex;
  342. .view-num{
  343. flex: 1;
  344. text-align: left;
  345. font-size: $font-size-26;
  346. color: #666666;
  347. line-height: 44rpx;
  348. }
  349. }
  350. .producttitle{
  351. width: 100%;
  352. display: inline-block;
  353. height: auto;
  354. text-overflow:ellipsis;
  355. display: -webkit-box;
  356. word-break: break-all;
  357. -webkit-box-orient: vertical;
  358. -webkit-line-clamp: 2;
  359. overflow: hidden;
  360. margin-bottom: 8rpx;
  361. }
  362. .productspec{
  363. height: 44rpx;
  364. color: #666666;
  365. line-height: 44rpx;
  366. }
  367. .productprice{
  368. height: 48rpx;
  369. position: absolute;
  370. width: 100%;
  371. bottom: 0;
  372. .price{
  373. line-height: 48rpx;
  374. font-size: $font-size-28;
  375. width: 48%;
  376. color: #FF2A2A;
  377. float: left;
  378. }
  379. .count{
  380. height: 100%;
  381. float: right;
  382. position: relative;
  383. .small{
  384. color: #666666;
  385. }
  386. }
  387. }
  388. }
  389. .goods-pros-m{
  390. width: 100%;
  391. height: auto;
  392. line-height: 76rpx;
  393. font-size: $font-size-26;
  394. color: $text-color;
  395. float: left;
  396. padding: 10rpx 0;
  397. border-top: 1px solid #F7F7F7;
  398. border-bottom: 1px solid #F7F7F7;
  399. .m-text{
  400. width: 62rpx;
  401. float: left;
  402. padding-right: 20rpx;
  403. font-weight:bold;
  404. }
  405. .m-input{
  406. display: -webkit-box;
  407. display: -webkit-flex;
  408. display: flex;
  409. -webkit-box-align: center;
  410. -webkit-align-items: center;
  411. align-items: center;
  412. position: relative;
  413. width: 620rpx;
  414. height: auto;
  415. padding: 20rpx 0 10rpx 0;
  416. background: #FFFFFF;
  417. .text{
  418. width: 100%;
  419. height: 100%;
  420. font-size: $font-size-26;
  421. line-height: 36rpx;
  422. color: #333333;
  423. }
  424. }
  425. }
  426. .goods-pros-b{
  427. width:100%;
  428. height: 40rpx;
  429. margin-top: 12rpx;
  430. float: left;
  431. .count{
  432. float: right;
  433. font-size: $font-size-28;
  434. line-height: 40rpx;
  435. color: $text-color;
  436. display: flex;
  437. justify-content: flex-end;
  438. }
  439. }
  440. }
  441. .button-template{
  442. width: 100%;
  443. height: auto;
  444. position: fixed;
  445. bottom: 0;
  446. left: 0;
  447. background: #FFFFFF;
  448. -webkit-border-radius: 20rpx 20rpx 0 0;
  449. border-radius: 20rpx 20rpx 0 0;
  450. -webkit-box-shadow: 0px 3px 10px rgba(51, 51, 51, 0.5);
  451. box-shadow: 0px 3px 10px rgba(51, 51, 51, 0.5);
  452. .button-content{
  453. width: 702rpx;
  454. padding:0 24rpx;
  455. height: auto;
  456. float: left;
  457. position: relative;
  458. .btn{
  459. width: 160rpx;
  460. height: 64rpx;
  461. margin:22rpx;
  462. line-height: 64rpx;
  463. font-size:$font-size-26;
  464. color: #FFFFFF;
  465. text-align: center;
  466. border-radius: 10rpx;
  467. float: right;
  468. }
  469. .btn-color{
  470. background: $btn-confirm;
  471. margin: 22rpx 0 22rpx 22rpx;
  472. .tips{
  473. width: 160rpx;
  474. height: 34rpx;
  475. padding: 10rpx 10rpx;
  476. background:linear-gradient(45deg,rgba(0,0,0,1) 0%,rgba(87,87,87,1) 100%);
  477. box-shadow:0px 2px 4px 0px rgba(0,0,0,0.2);
  478. border-radius: 8rpx;
  479. position: absolute;
  480. color: #FFFFFF;
  481. line-height: 34rpx;
  482. font-size: $font-size-24;
  483. text-align: left;
  484. right: 24rpx;
  485. top: -45rpx;
  486. &:before{
  487. content: "";
  488. width: 25rpx;
  489. height: 25rpx;
  490. background:linear-gradient(45deg,rgba(0,0,0,1) 0%,rgba(87,87,87,1) 100%);
  491. position: absolute;
  492. bottom: -8rpx;
  493. right: 30rpx;
  494. z-index: -1;
  495. transform:rotate(45deg);
  496. }
  497. }
  498. }
  499. }
  500. }
  501. .popup {
  502. position: fixed;
  503. top: 0;
  504. width: 100%;
  505. height: 100%;
  506. z-index: 999;
  507. display: none;
  508. .mask{
  509. position: fixed;
  510. top: 0;
  511. width: 100%;
  512. height: 100%;
  513. z-index: 21;
  514. background-color: rgba(0, 0, 0, 0.6);
  515. }
  516. .layer {
  517. position: fixed;
  518. z-index: 22;
  519. bottom: -294rpx;
  520. width: 702rpx;
  521. padding: 24rpx 24rpx 36rpx 24rpx;
  522. height: 236rpx;
  523. border-radius: 30rpx 30rpx 0 0;
  524. background-color: #fff;
  525. display: flex;
  526. flex-wrap: wrap;
  527. align-content: space-between;
  528. .content {
  529. width: 100%;
  530. .layer-title{
  531. font-size: $font-size-28;
  532. color: $text-color;
  533. line-height: 58rpx;
  534. }
  535. .layer-name{
  536. width: 100%;
  537. display: inline-block;
  538. height: auto;
  539. text-overflow:ellipsis;
  540. display: -webkit-box;
  541. word-break: break-all;
  542. -webkit-box-orient: vertical;
  543. -webkit-line-clamp: 2;
  544. overflow: hidden;
  545. margin-bottom: 8rpx;
  546. font-size: $font-size-28;
  547. color: #666;
  548. }
  549. .layer-text{
  550. margin-top: 10rpx;
  551. font-size: $font-size-28;
  552. color: $text-color;
  553. line-height: 58rpx;
  554. .layer-text-fl{
  555. float: left;
  556. }
  557. .layer-text-fr{
  558. float: right;
  559. }
  560. }
  561. }
  562. }
  563. &.show {
  564. display: block;
  565. .mask{
  566. animation: showPopup 0.2s linear both;
  567. }
  568. .layer {
  569. animation: showLayer 0.2s linear both;
  570. }
  571. }
  572. &.hide {
  573. display: block;
  574. .mask{
  575. animation: hidePopup 0.2s linear both;
  576. }
  577. .layer {
  578. animation: hideLayer 0.2s linear both;
  579. }
  580. }
  581. &.none {
  582. display: none;
  583. }
  584. }
  585. </style>