order-service-details.vue 15 KB

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