order-details.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. <template>
  2. <view class="details clearfix">
  3. <!-- <cu-custom :navbar-data='nvabarData'></cu-custom> -->
  4. <view class="container-details" 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. </view>
  48. </view>
  49. </view>
  50. <view class="goods-pros-m" v-show="orderInfo.note!=null">
  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.setStorage('shopOrderId',this.shopOrderId)
  139. this.$api.navigateTo('/supplier/pages/deliver/deliver-goods')
  140. break
  141. }
  142. },
  143. setStatusTextHtml(status){
  144. let TextHtml='';
  145. switch(status){
  146. case '1':
  147. TextHtml = '待付款'
  148. break;
  149. case '2':
  150. TextHtml = '部分付款'
  151. break;
  152. case '3':
  153. TextHtml = '已付款'
  154. break;
  155. }
  156. return TextHtml
  157. },
  158. setStatusTextHtml1(status){
  159. let TextHtml='';
  160. switch(status){
  161. case '1':
  162. TextHtml = '待结算'
  163. break;
  164. case '2':
  165. TextHtml = '部分结算'
  166. break;
  167. case '3':
  168. TextHtml = '已结算'
  169. break;
  170. }
  171. return TextHtml
  172. },
  173. setStatusTextHtml2(status){
  174. let TextHtml='';
  175. switch(status){
  176. case '1':
  177. TextHtml = '待发货'
  178. break;
  179. case '2':
  180. TextHtml = '部分发货'
  181. break;
  182. case '3':
  183. TextHtml = '已发货'
  184. break;
  185. }
  186. return TextHtml
  187. },
  188. setStatusText(status){
  189. let textColor='';
  190. switch(status){
  191. case '1':
  192. textColor = '#FF2A2A'
  193. break;
  194. case '2':
  195. textColor = '#E15616'
  196. break;
  197. case '3':
  198. textColor = '#38CB3D'
  199. break;
  200. }
  201. return textColor
  202. },
  203. onShareCode(){
  204. this.isShareModal = true
  205. },
  206. onShareAppMessage(res){//分享转发
  207. this.isShareModal = false
  208. if (res.from === 'button') {
  209. // 来自页面内转发按钮
  210. }
  211. return {
  212. title: '您有订单待处理,请点击查看~',
  213. path: `/supplier/pages/login/share-info?authority=3&shopOrderId=${this.shopOrderId}`,
  214. imageUrl:'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  215. }
  216. }
  217. },
  218. onPullDownRefresh() {//下拉刷新
  219. this.initShopOrderDetails()
  220. uni.stopPullDownRefresh()
  221. },
  222. onShow() {
  223. }
  224. }
  225. </script>
  226. <style lang="scss">
  227. page {
  228. background:#F7F7F7;
  229. }
  230. .details{
  231. padding-bottom: 130rpx;
  232. width: 100%;
  233. height: auto;
  234. }
  235. .container-details{
  236. background:#F7F7F7;
  237. }
  238. .information-content{
  239. width: 702rpx;
  240. height: auto;
  241. padding:10rpx 24rpx;
  242. background: #FFFFFF;
  243. margin-bottom: 24rpx;
  244. .info-item{
  245. height: 58rpx;
  246. width: 100%;
  247. display: flex;
  248. .item-view{
  249. flex: 1;
  250. line-height: 58rpx;
  251. font-size: $font-size-28;
  252. color: #333333;
  253. }
  254. }
  255. }
  256. .address-content{
  257. width: 702rpx;
  258. height: auto;
  259. padding:10rpx 24rpx;
  260. background: #FFFFFF;
  261. margin-bottom: 24rpx;
  262. .info-item{
  263. width: 100%;
  264. display: flex;
  265. line-height: 50rpx;
  266. font-size: $font-size-28;
  267. color: #333333;
  268. }
  269. }
  270. .goods-list{
  271. width: 100%;
  272. height: auto;
  273. background: #F7F7F7;
  274. .goods-item{
  275. width: 702rpx;
  276. padding:24rpx;
  277. height: auto;
  278. background: #FFFFFF;
  279. margin-bottom: 24rpx;
  280. &:last-child{
  281. margin-bottom: 0;
  282. }
  283. }
  284. .productlist{
  285. width: 100%;
  286. height: auto;
  287. }
  288. .goods-pros-t{
  289. display: flex;
  290. width: 100%;
  291. height: auto;
  292. padding: 12rpx 0;
  293. .pros-left{
  294. width: 210rpx;
  295. height: 100%;
  296. margin:0 26rpx 0 0;
  297. }
  298. .pros-img{
  299. width: 210rpx;
  300. height: 210rpx;
  301. border-radius: 10rpx;
  302. border:1px solid #f3f3f3;
  303. image{
  304. width: 100%;
  305. height: 100%;
  306. border-radius: 10rpx;
  307. }
  308. }
  309. }
  310. .pros-product{
  311. width: 468rpx;
  312. height: 100%;
  313. line-height: 36rpx;
  314. font-size: $font-size-26;
  315. position: relative;
  316. .icon-genghuan{
  317. position: absolute;
  318. top: 50%;
  319. right: 0;
  320. font-size: $font-size-44;
  321. color: $color-system;
  322. }
  323. .product-view{
  324. width: 100%;
  325. height: auto;
  326. display: flex;
  327. .view-num{
  328. flex: 1;
  329. text-align: left;
  330. font-size: $font-size-26;
  331. color: #666666;
  332. line-height: 44rpx;
  333. }
  334. }
  335. .producttitle{
  336. width: 100%;
  337. display: inline-block;
  338. height: auto;
  339. text-overflow:ellipsis;
  340. display: -webkit-box;
  341. word-break: break-all;
  342. -webkit-box-orient: vertical;
  343. -webkit-line-clamp: 2;
  344. overflow: hidden;
  345. margin-bottom: 8rpx;
  346. }
  347. .productspec{
  348. height: 44rpx;
  349. color: #666666;
  350. line-height: 44rpx;
  351. }
  352. .productprice{
  353. height: 48rpx;
  354. position: absolute;
  355. width: 100%;
  356. bottom: 0;
  357. .price{
  358. line-height: 48rpx;
  359. font-size: $font-size-28;
  360. width: 48%;
  361. color: #FF2A2A;
  362. float: left;
  363. }
  364. .count{
  365. height: 100%;
  366. float: right;
  367. position: relative;
  368. .small{
  369. color: #666666;
  370. }
  371. }
  372. }
  373. }
  374. .goods-pros-m{
  375. width: 100%;
  376. height: auto;
  377. line-height: 76rpx;
  378. font-size: $font-size-26;
  379. color: $text-color;
  380. float: left;
  381. padding: 10rpx 0;
  382. border-top: 1px solid #F7F7F7;
  383. border-bottom: 1px solid #F7F7F7;
  384. .m-text{
  385. width: 62rpx;
  386. float: left;
  387. padding-right: 20rpx;
  388. font-weight:bold;
  389. }
  390. .m-input{
  391. display: -webkit-box;
  392. display: -webkit-flex;
  393. display: flex;
  394. -webkit-box-align: center;
  395. -webkit-align-items: center;
  396. align-items: center;
  397. position: relative;
  398. width: 620rpx;
  399. height: auto;
  400. padding: 20rpx 0 10rpx 0;
  401. background: #FFFFFF;
  402. .text{
  403. width: 100%;
  404. height: 100%;
  405. font-size: $font-size-26;
  406. line-height: 36rpx;
  407. color: #333333;
  408. }
  409. }
  410. }
  411. .goods-pros-b{
  412. width:100%;
  413. height: 40rpx;
  414. margin-top: 12rpx;
  415. float: left;
  416. .count{
  417. float: right;
  418. font-size: $font-size-28;
  419. line-height: 40rpx;
  420. color: $text-color;
  421. display: flex;
  422. justify-content: flex-end;
  423. }
  424. }
  425. }
  426. .button-template{
  427. width: 100%;
  428. height: auto;
  429. position: fixed;
  430. bottom: 0;
  431. left: 0;
  432. background: #FFFFFF;
  433. .button-content{
  434. width: 702rpx;
  435. padding:0 24rpx;
  436. height: auto;
  437. float: left;
  438. position: relative;
  439. .btn{
  440. width: 160rpx;
  441. height: 64rpx;
  442. margin:22rpx;
  443. line-height: 64rpx;
  444. font-size:$font-size-26;
  445. color: #FFFFFF;
  446. text-align: center;
  447. border-radius: 10rpx;
  448. float: right;
  449. }
  450. .btn-color{
  451. background: $btn-confirm;
  452. margin: 22rpx 0 22rpx 22rpx;
  453. .tips{
  454. width: 160rpx;
  455. height: 34rpx;
  456. padding: 10rpx 10rpx;
  457. background:linear-gradient(45deg,rgba(0,0,0,1) 0%,rgba(87,87,87,1) 100%);
  458. box-shadow:0px 2px 4px 0px rgba(0,0,0,0.2);
  459. border-radius: 8rpx;
  460. position: absolute;
  461. color: #FFFFFF;
  462. line-height: 34rpx;
  463. font-size: $font-size-24;
  464. text-align: left;
  465. right: 24rpx;
  466. top: -45rpx;
  467. &:before{
  468. content: "";
  469. width: 25rpx;
  470. height: 25rpx;
  471. background:linear-gradient(45deg,rgba(0,0,0,1) 0%,rgba(87,87,87,1) 100%);
  472. position: absolute;
  473. bottom: -8rpx;
  474. right: 30rpx;
  475. z-index: -1;
  476. transform:rotate(45deg);
  477. }
  478. }
  479. }
  480. }
  481. }
  482. </style>