order-details.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  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'}" 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. </view>
  48. </view>
  49. </view>
  50. <view class="goods-pros-m" v-if="orderInfo.note!=''">
  51. <view class="m-text">留言:</view>
  52. <view class="m-input">
  53. <view class="text">{{orderInfo.note ? orderInfo.note : ''}}</view>
  54. </view>
  55. </view>
  56. <view class="goods-pros-b">
  57. <view class="count">共{{orderInfo.itemCount}}件商品</view>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- 底部button -->
  62. <order-button ref="orderButton"
  63. v-if= "isRequest"
  64. :status= "btnStatus"
  65. :shareCode= "shareCode"
  66. @buttonConfirm="handButtonConfirm">
  67. </order-button>
  68. </view>
  69. <share-alert :shopOrderID="shopOrderId"
  70. v-if="isShareModal"
  71. @shareConfirm ='onShareAppMessage'>
  72. </share-alert>
  73. </view>
  74. </template>
  75. <script>
  76. import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
  77. import orderAddress from '@/components/cm-module/orderDetails/orderAddress' //地址信息
  78. import goodsList from '@/components/cm-module/orderDetails/goodsList' //商品列表
  79. import orderButton from '@/components/cm-module/orderDetails/supplierDetaileButton' //底部按钮
  80. import shareAlert from '@/components/cm-module/modelAlert/supplierShareAlert' //分享弹窗
  81. import { queryOrderDetails,cancelOrder,deleteOrder,confirmReceipt,affirmOrder } from "@/api/order.js"
  82. export default {
  83. components:{
  84. headerBack,
  85. orderAddress,
  86. goodsList,
  87. orderButton,
  88. shareAlert,
  89. },
  90. data() {
  91. return {
  92. nvabarData: { //顶部自定义导航
  93. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  94. showSearch: 0,
  95. title: '订单详情', // 导航栏 中间的标题
  96. haveBack:false,
  97. textLeft:this.$store.state.isIphone
  98. },
  99. windowHeight: '',
  100. isIphoneX:this.$store.state.isIphoneX,
  101. CustomBar:this.CustomBar,// 顶部导航栏高度
  102. state:0,
  103. userID:'',
  104. shopOrderId:'',
  105. shareCode:'', //分享码
  106. payStatus:0,
  107. btnStatus:0, //按钮组件状态
  108. isRequest:false, //是否加载完成渲染子组件
  109. isOrderShare:false,
  110. isShareModal:false,
  111. orderInfo:{}, //订单信息
  112. }
  113. },
  114. onLoad(option){
  115. console.log(option.shopOrderId)
  116. this.shopOrderId = option.shopOrderId;
  117. this.initShopOrderDetails()
  118. },
  119. methods: {
  120. initShopOrderDetails(){//初始化页面数据@参数:订单ID
  121. this.ShopService.GetShopOrderDetails({ shopOrderId : this.shopOrderId }).then(res =>{
  122. this.orderInfo = res.data.shopOrder
  123. this.btnStatus = this.orderInfo.sendOutStatus
  124. this.isRequest = true
  125. }).catch(err =>{
  126. this.$util.msg(err.msg,2000);
  127. })
  128. },
  129. handButtonConfirm(data){//监听点击时间的按钮类型并执行...
  130. this.handShowAlert(data)
  131. },
  132. handShowAlert(type){//判断点击的按钮类型并执行...
  133. switch(type){
  134. case 'record':
  135. this.$api.navigateTo('/supplier/pages/deliver/deliver-record?shopOrderId='+this.shopOrderId)
  136. break
  137. case 'deliver':
  138. this.$api.navigateTo('/supplier/pages/deliver/deliver-goods?shopOrderId='+this.shopOrderId)
  139. break
  140. }
  141. },
  142. setStatusTextHtml(status){
  143. let TextHtml='';
  144. switch(status){
  145. case '1':
  146. TextHtml = '待付款'
  147. break;
  148. case '2':
  149. TextHtml = '部分付款'
  150. break;
  151. case '3':
  152. TextHtml = '已付款'
  153. break;
  154. }
  155. return TextHtml
  156. },
  157. setStatusTextHtml1(status){
  158. let TextHtml='';
  159. switch(status){
  160. case '1':
  161. TextHtml = '待结算'
  162. break;
  163. case '2':
  164. TextHtml = '部分结算'
  165. break;
  166. case '3':
  167. TextHtml = '已结算'
  168. break;
  169. }
  170. return TextHtml
  171. },
  172. setStatusTextHtml2(status){
  173. let TextHtml='';
  174. switch(status){
  175. case '1':
  176. TextHtml = '待发货'
  177. break;
  178. case '2':
  179. TextHtml = '部分发货'
  180. break;
  181. case '3':
  182. TextHtml = '已发货'
  183. break;
  184. }
  185. return TextHtml
  186. },
  187. setStatusText(status){
  188. let textColor='';
  189. switch(status){
  190. case '1':
  191. textColor = '#FF2A2A'
  192. break;
  193. case '2':
  194. textColor = '#E15616'
  195. break;
  196. case '3':
  197. textColor = '#38CB3D'
  198. break;
  199. }
  200. return textColor
  201. },
  202. onShareCode(){
  203. this.isShareModal = true
  204. },
  205. onShareAppMessage(res){//分享转发
  206. this.isShareModal = false
  207. if (res.from === 'button') {
  208. // 来自页面内转发按钮
  209. }
  210. return {
  211. title: '您有订单待处理,请点击查看~',
  212. path: `/supplier/pages/login/share-info?authority=3&shopOrderId=${this.shopOrderId}`,
  213. imageUrl:'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  214. }
  215. }
  216. },
  217. onPullDownRefresh() {//下拉刷新
  218. this.initShopOrderDetails()
  219. uni.stopPullDownRefresh()
  220. },
  221. onShow() {
  222. }
  223. }
  224. </script>
  225. <style lang="scss">
  226. page {
  227. background:#F7F7F7;
  228. }
  229. .details{
  230. padding-bottom: 130rpx;
  231. }
  232. .container-details{
  233. background:#F7F7F7;
  234. }
  235. .information-content{
  236. width: 702rpx;
  237. height: auto;
  238. padding:10rpx 24rpx;
  239. background: #FFFFFF;
  240. margin-bottom: 24rpx;
  241. .info-item{
  242. height: 58rpx;
  243. width: 100%;
  244. display: flex;
  245. .item-view{
  246. flex: 1;
  247. line-height: 58rpx;
  248. font-size: $font-size-28;
  249. color: #333333;
  250. }
  251. }
  252. }
  253. .address-content{
  254. width: 702rpx;
  255. height: auto;
  256. padding:10rpx 24rpx;
  257. background: #FFFFFF;
  258. margin-bottom: 24rpx;
  259. .info-item{
  260. width: 100%;
  261. display: flex;
  262. line-height: 50rpx;
  263. font-size: $font-size-28;
  264. color: #333333;
  265. }
  266. }
  267. .goods-list{
  268. width: 100%;
  269. height: auto;
  270. background: #F7F7F7;
  271. .goods-item{
  272. width: 702rpx;
  273. padding:24rpx;
  274. height: auto;
  275. background: #FFFFFF;
  276. margin-bottom: 24rpx;
  277. &:last-child{
  278. margin-bottom: 0;
  279. }
  280. }
  281. .productlist{
  282. width: 100%;
  283. height: auto;
  284. }
  285. .goods-pros-t{
  286. display: flex;
  287. width: 100%;
  288. height: auto;
  289. padding: 12rpx 0;
  290. .pros-left{
  291. width: 210rpx;
  292. height: 100%;
  293. margin:0 26rpx 0 0;
  294. }
  295. .pros-img{
  296. width: 210rpx;
  297. height: 210rpx;
  298. border-radius: 10rpx;
  299. border:1px solid #f3f3f3;
  300. image{
  301. width: 100%;
  302. height: 100%;
  303. border-radius: 10rpx;
  304. }
  305. }
  306. }
  307. .pros-product{
  308. width: 468rpx;
  309. height: 100%;
  310. line-height: 36rpx;
  311. font-size: $font-size-26;
  312. position: relative;
  313. .icon-genghuan{
  314. position: absolute;
  315. top: 50%;
  316. right: 0;
  317. font-size: $font-size-44;
  318. color: $color-system;
  319. }
  320. .product-view{
  321. width: 100%;
  322. height: auto;
  323. display: flex;
  324. .view-num{
  325. flex: 1;
  326. text-align: left;
  327. font-size: $font-size-26;
  328. color: #666666;
  329. line-height: 44rpx;
  330. }
  331. }
  332. .producttitle{
  333. width: 100%;
  334. display: inline-block;
  335. height: auto;
  336. text-overflow:ellipsis;
  337. display: -webkit-box;
  338. word-break: break-all;
  339. -webkit-box-orient: vertical;
  340. -webkit-line-clamp: 2;
  341. overflow: hidden;
  342. margin-bottom: 8rpx;
  343. }
  344. .productspec{
  345. height: 44rpx;
  346. color: #666666;
  347. line-height: 44rpx;
  348. }
  349. .productprice{
  350. height: 48rpx;
  351. position: absolute;
  352. width: 100%;
  353. bottom: 0;
  354. .price{
  355. line-height: 48rpx;
  356. font-size: $font-size-28;
  357. width: 48%;
  358. color: #FF2A2A;
  359. float: left;
  360. }
  361. .count{
  362. height: 100%;
  363. float: right;
  364. position: relative;
  365. .small{
  366. color: #666666;
  367. }
  368. }
  369. }
  370. }
  371. .goods-pros-m{
  372. width: 100%;
  373. height: auto;
  374. line-height: 76rpx;
  375. font-size: $font-size-26;
  376. color: $text-color;
  377. float: left;
  378. padding: 10rpx 0;
  379. border-top: 1px solid #F7F7F7;
  380. border-bottom: 1px solid #F7F7F7;
  381. .m-text{
  382. width: 62rpx;
  383. float: left;
  384. padding-right: 20rpx;
  385. font-weight:bold;
  386. }
  387. .m-input{
  388. display: -webkit-box;
  389. display: -webkit-flex;
  390. display: flex;
  391. -webkit-box-align: center;
  392. -webkit-align-items: center;
  393. align-items: center;
  394. position: relative;
  395. width: 620rpx;
  396. height: auto;
  397. padding: 20rpx 0 10rpx 0;
  398. background: #FFFFFF;
  399. .text{
  400. width: 100%;
  401. height: 100%;
  402. font-size: $font-size-26;
  403. line-height: 36rpx;
  404. color: #333333;
  405. }
  406. }
  407. }
  408. .goods-pros-b{
  409. width:100%;
  410. height: 40rpx;
  411. margin-top: 12rpx;
  412. float: left;
  413. .count{
  414. float: right;
  415. font-size: $font-size-28;
  416. line-height: 40rpx;
  417. color: $text-color;
  418. display: flex;
  419. justify-content: flex-end;
  420. }
  421. }
  422. }
  423. .button-template{
  424. width: 100%;
  425. height: auto;
  426. position: fixed;
  427. bottom: 0;
  428. left: 0;
  429. background: #FFFFFF;
  430. .button-content{
  431. width: 702rpx;
  432. padding:0 24rpx;
  433. height: auto;
  434. float: left;
  435. position: relative;
  436. .btn{
  437. width: 160rpx;
  438. height: 64rpx;
  439. margin:22rpx;
  440. line-height: 64rpx;
  441. font-size:$font-size-26;
  442. color: #FFFFFF;
  443. text-align: center;
  444. border-radius: 10rpx;
  445. float: right;
  446. }
  447. .btn-color{
  448. background: $btn-confirm;
  449. margin: 22rpx 0 22rpx 22rpx;
  450. .tips{
  451. width: 160rpx;
  452. height: 34rpx;
  453. padding: 10rpx 10rpx;
  454. background:linear-gradient(45deg,rgba(0,0,0,1) 0%,rgba(87,87,87,1) 100%);
  455. box-shadow:0px 2px 4px 0px rgba(0,0,0,0.2);
  456. border-radius: 8rpx;
  457. position: absolute;
  458. color: #FFFFFF;
  459. line-height: 34rpx;
  460. font-size: $font-size-24;
  461. text-align: left;
  462. right: 24rpx;
  463. top: -45rpx;
  464. &:before{
  465. content: "";
  466. width: 25rpx;
  467. height: 25rpx;
  468. background:linear-gradient(45deg,rgba(0,0,0,1) 0%,rgba(87,87,87,1) 100%);
  469. position: absolute;
  470. bottom: -8rpx;
  471. right: 30rpx;
  472. z-index: -1;
  473. transform:rotate(45deg);
  474. }
  475. }
  476. }
  477. }
  478. }
  479. </style>