order-details.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. <template>
  2. <view class="container details clearfix" :style="{paddingBottom :isIphoneX ? (130+68)+'rpx' : '130rpx'}">
  3. <!-- 自定义返回 -->
  4. <header-back :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :isShare='isOrderShare'></header-back>
  5. <view class="container-details" :style="{paddingTop:navbarHeight+'px'}">
  6. <view class="status-text">
  7. <view class="view-type">{{ information.status | TextFormat }}</view>
  8. <view class="Rebate " v-if="information.rebateFlag==1">返佣</view>
  9. <text class="bage-buss btn" v-if="information.orderSubmitType == 3 || information.orderSubmitType == 4">协销</text>
  10. <text class="bage-auto btn" v-if="information.orderSubmitType == 0 || information.orderSubmitType == 1 ||information.orderSubmitType == 2">自主</text>
  11. </view>
  12. <!-- 地址选择 -->
  13. <order-address ref="orderAddress" v-if="isRequest && !rechargeGoods" :addressData="addressData"></order-address>
  14. <!-- 商品 -->
  15. <goods-list ref='goods' v-if="isRequest" :shopOrderData="shopOrderData" :information="information" @popupClick="hanldePopupFn"></goods-list>
  16. <!-- 订单信息 -->
  17. <order-information ref="information" v-if="isRequest" :information="information"></order-information>
  18. <!-- 发票信息 -->
  19. <invoice-tent ref="invoice" v-if="isRequest" :orderInvoice="orderInvoice"></invoice-tent>
  20. <!-- 转账信息 -->
  21. <!-- <transfe-record ref="transfe" v-if="isRequest"></transfe-record> -->
  22. <!-- 支付记录 -->
  23. <payment-record ref="payment" v-if="isRequest" :discernReceiptList="discernReceiptList" :receiptAmount="receiptAmount"></payment-record>
  24. <!-- 退款记录 -->
  25. <refund-record ref="refund" v-if="isRequest" :returnedPurchaseList="returnedPurchaseList" :returnedPurchaseFee="returnedPurchaseFee"></refund-record>
  26. <view class="clause" v-if="information.secondHandOrderFlag!=1" @click="openclauseConten(clauseData.id)" :class="clauseData.name=='无条款'?'noclick':''">
  27. 售后条款:<label class="text" :class="clauseData.name=='无条款'?'color-bg':''">{{clauseData.name}}</label>
  28. </view>
  29. <!-- 底部button -->
  30. <order-button ref="orderButton"
  31. v-if= "isRequest"
  32. :status= "btnStatus"
  33. :order="information"
  34. :rechargeGoods = "rechargeGoods"
  35. :ableUserMoney = "ableUserMoney"
  36. :shareCode= "shareCode"
  37. :serviceProviderId = "serviceProviderId"
  38. :secondHandOrderFlag = "information.secondHandOrderFlag"
  39. @buttonConfirm="handButtonConfirm">
  40. </order-button>
  41. </view>
  42. <!-- 付款弹窗 -->
  43. <order-model v-if="isPayModel"
  44. :payModelData="payModelData"
  45. :modelType='modelType'
  46. @paymentConfirm ='hanldPaymentConfirm'/>
  47. <!-- 分享弹窗 -->
  48. <share-alert :orderID="orderID"
  49. v-if="isShareModal"
  50. @shareConfirm ='onShareAppMessage'>
  51. </share-alert>
  52. <!-- 促销活动弹窗 -->
  53. <activi-popup :Promotion="handlerPros" :popupShow="popupShow"></activi-popup>
  54. </view>
  55. </template>
  56. <script>
  57. import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
  58. import orderAddress from '@/components/cm-module/orderDetails/orderAddress' //地址信息
  59. import goodsList from '@/components/cm-module/orderDetails/goodsList' //商品列表
  60. import invoiceTent from '@/components/cm-module/orderDetails/invoiceTent' //发票信息
  61. import orderInformation from '@/components/cm-module/orderDetails/orderInformation' //订单信息
  62. import transfeRecord from '@/components/cm-module/orderDetails/transfeRecord' //转账信息
  63. import paymentRecord from '@/components/cm-module/orderDetails/paymentRecord' //支付记录
  64. import refundRecord from '@/components/cm-module/orderDetails/refundRecord' //退款记录
  65. import orderButton from '@/components/cm-module/orderDetails/sellerDetaileButton' //底部按钮
  66. import shareAlert from '@/components/cm-module/modelAlert/sellerShareAlert.vue' //分享弹窗
  67. import orderModel from '@/components/cm-module/modelAlert/order-alert' //付款弹窗
  68. import activiPopup from "@/components/cm-module/orderDetails/activipopu" //促销活动弹窗
  69. export default {
  70. components:{
  71. headerBack,
  72. orderInformation,
  73. orderAddress,
  74. invoiceTent,
  75. goodsList,
  76. transfeRecord,
  77. paymentRecord,
  78. refundRecord,
  79. orderButton,
  80. shareAlert,
  81. orderModel,
  82. activiPopup
  83. },
  84. data() {
  85. return {
  86. state:0,
  87. userID:'',
  88. orderID:'',
  89. clubUserId:0,
  90. serviceProviderId:'', //协销ID
  91. shareCode:'', //分享码
  92. shareType:'', //分享登录页过来记录的状态
  93. cellPhone:'', //客服电话
  94. payStatus:0,
  95. btnStatus:0, //按钮组件状态
  96. isRequest:false, //是否加载完成渲染子组件
  97. isOrderShare:false,
  98. isShareModal:false,
  99. isPayModel:false,
  100. modelType:0,
  101. ableUserMoney:'', //机构余额
  102. payModelData:{},
  103. addressData:{}, //地址信息初始化
  104. information:{}, //订单信息初始化
  105. shopOrderData:{}, //商品信息初始化
  106. orderInvoice:{}, //发票信息初始化
  107. returnedPurchaseList:{}, //退款信息初始化
  108. discernReceiptList:{}, //支付信息初始化
  109. receiptAmount:0, //支付金额
  110. returnedPurchaseFee:0, //退款金额
  111. navbarHeight:'',
  112. rechargeGoods:false,
  113. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  114. systeminfo: this.setSysteminfo(), //获取设备信息
  115. isIphoneX:this.$store.state.isIphoneX,
  116. CustomBar:this.CustomBar,// 顶部导航栏高度
  117. popupShow:false,
  118. handlerPros:{},
  119. nvabarData: { //顶部自定义导航
  120. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示
  121. title: '订单详情', // 导航栏 中间的标题
  122. },
  123. clauseData:{},
  124. againUserId:0,//用户id
  125. }
  126. },
  127. onLoad(option){
  128. console.log(option)
  129. this.shareType = option.type;
  130. this.orderID = option.orderID
  131. this.clubUserId = option.userId
  132. if(this.shareType ==='share'){
  133. this.listType = 0
  134. this.isOrderShare = true
  135. }else if(option.type === 'confim' || option.type === 'search' || option.type === 'cash'){
  136. this.listType = 0
  137. }else{
  138. this.listType = option.listType
  139. }
  140. this.$api.getStorage().then((resolve) =>{
  141. this.againUserId = resolve.userId ? resolve.userId : 0
  142. })
  143. this.getHeaderTopHeight()
  144. this.initOrderDetaileData()
  145. },
  146. filters:{
  147. NumFormat(value) {//处理金额
  148. return Number(value).toFixed(2);
  149. },
  150. TextFormat(status) {//处理金额
  151. let HtmlText,
  152. typeTextObject={
  153. 0:'待确认',
  154. 4:'交易完成',
  155. 5:'订单完成',
  156. 6:'已关闭',
  157. 7:'交易全退',
  158. 77:'交易全退',
  159. 11:'待付款待发货',
  160. 12:'待付款部分发货',
  161. 13:'待付款已发货',
  162. 21:'部分付款待发货',
  163. 22:'部分付款部分发货',
  164. 23:'部分付款已发货',
  165. 31:'已付款待发货',
  166. 32:'已付款部分发货',
  167. 33:'已付款已发货',
  168. 111:'待付款待发货',
  169. };
  170. Object.keys(typeTextObject).forEach(key => {
  171. if(key == status){
  172. HtmlText = typeTextObject[key]
  173. }
  174. })
  175. return HtmlText
  176. },
  177. },
  178. methods: {
  179. openclauseConten(id){
  180. this.$api.navigateTo(`/pages/service/sellconten?clauseId=${id}`)
  181. },
  182. initOrderDetaileData(){//初始化页面数据@参数:订单ID
  183. this.OrderService.QueryOrderDetails({ orderID : this.orderID ,userId : this.clubUserId}).then(response =>{
  184. let resData = response.data;
  185. this.isRequest = true
  186. this.userID = resData.order.userID
  187. this.shareCode = resData.shareCode
  188. this.addressData = resData.userInfo
  189. this.information = resData.order
  190. this.rechargeGoods = resData.order.rechargeGoods
  191. this.btnStatus = resData.order.status
  192. this.payStatus = resData.order.payStatus
  193. this.shopOrderData = resData.shopOrderList
  194. this.orderInvoice = resData.orderInvoice
  195. this.returnedPurchaseList = resData.returnedPurchaseList
  196. this.discernReceiptList = resData.discernReceiptList
  197. this.receiptAmount = resData.order.receiptAmount
  198. this.returnedPurchaseFee = resData.order.returnedPurchaseFee
  199. this.ableUserMoney = resData.ableUserMoney
  200. this.clauseData = resData.clause
  201. if(this.clauseData && this.clauseData.name.length>10){
  202. this.clauseData.name = this.clauseData.name.substr(0,10)+'...'
  203. }
  204. }).catch(error =>{
  205. this.$util.modal('提示','订单查询失败,请稍后重试~','确定','',false,() =>{
  206. this.$api.switchTabTo('/pages/seller/index/index')
  207. })
  208. })
  209. },
  210. handButtonConfirm(data){//监听点击时间的按钮类型并执行...
  211. this.handShowAlert(data)
  212. },
  213. handShowAlert(data){//判断点击的按钮类型并执行...
  214. switch(data.type){
  215. case 'query':
  216. this.isModalLayer = true;
  217. this.$api.navigateTo('/pages/user/order/order-logistics?orderID='+data.orderId)
  218. break
  219. case 'delete':
  220. this.handOrderDetele();
  221. break;
  222. case 'cancel':
  223. this.handCenceConfirm();
  224. break;
  225. case 'confirm':
  226. this.handOrderConfirm(data)
  227. break;
  228. case 'balance':
  229. this.getOrderPaymentValidation(data)
  230. break;
  231. case 'again':
  232. this.handOrderAgain(data.orderId);
  233. break
  234. }
  235. },
  236. handOrderAgain(id){
  237. this.aganOrderID = id;
  238. this.SellerService.SellerCreateOrderAgain({orderId:this.aganOrderID,userId:this.againUserId,confirmFlag:0}).then(res =>{
  239. if(res.code==0){
  240. this.$api.setStorage('orderUserInfo',{clubID:res.data.clubId,againBuyProductIds:res.data.againBuyProductIds,userID:res.data.userId})
  241. this.$api.navigateTo('/pages/seller/cart/cart');
  242. }
  243. }).catch(error =>{
  244. if(error.code== -3){
  245. this.showAgan = true;
  246. this.promptitle = error.msg;
  247. this.failList = error.data;
  248. }else if(error.code== -2){
  249. this.$util.modal('',error.msg,'确定','',false,() =>{})
  250. }else{
  251. this.$util.msg(error.msg,2000)
  252. }
  253. })
  254. },
  255. handOrderConfirm(data){//确认订单
  256. this.$util.modal('提示','确认此订单?','确定','取消',true,() =>{
  257. this.OrderService.AffirmOrder({orderID:this.orderID}).then(response =>{
  258. this.$util.msg(response.msg,2000,true,'success');
  259. this.initOrderDetaileData()
  260. }).catch(error =>{
  261. this.$util.msg(error.msg,2000)
  262. })
  263. })
  264. },
  265. hanldPaymentConfirm(data){//监听余额抵扣按钮
  266. switch(data.type){
  267. case 3:
  268. this.OrderService.OrderBalanceDeduction({orderId:this.orderID}).then(response =>{
  269. this.$util.msg('余额抵扣成功',2000)
  270. this.initOrderDetaileData()
  271. }).catch(error =>{
  272. this.$util.msg(error.msg,2000)
  273. })
  274. break;
  275. }
  276. },
  277. getOrderPaymentValidation(data){//监听根据付款状态做操作
  278. this.OrderService.OrderPaymentValidation({orderId:data.orderId}).then(response =>{
  279. let dataCode = response.data.code
  280. this.payModelData = response.data
  281. if(dataCode == -1){
  282. this.$util.modal('','订单已申请全部退款,无需再付款!','确定','',false,() =>{})
  283. }else{
  284. this.isPayModel = true;
  285. this.modelType = 3
  286. }
  287. }).catch(error =>{
  288. this.$util.msg(error.msg,2000)
  289. })
  290. },
  291. handOrderDetele(){//删除订单
  292. this.$util.modal('提示','确认删除该订单吗?','确定','取消',true,() =>{
  293. this.OrderService.DeleteOrder({orderID:this.orderID}).then(response =>{
  294. this.$util.msg(response.msg,2000,true,'success');
  295. setTimeout(() => {
  296. if(this.shareType ==='share'){
  297. this.$api.navigateTo('/pages/seller/index/index')
  298. }else{
  299. this.$api.navigateTo(`/pages/seller/order/order-list?type=detele&listType=${this.listType}`)
  300. }
  301. },500)
  302. }).catch(error =>{
  303. this.$util.msg(error.msg,2000)
  304. })
  305. })
  306. },
  307. handCenceConfirm(){//取消订单
  308. this.$util.modal('提示','确认取消该订单吗?','确定','取消',true,() =>{
  309. this.OrderService.CancelOrder({orderID:this.orderID}).then(response =>{
  310. this.$util.msg(response.msg,2000,true,'success');
  311. this.initOrderDetaileData()
  312. }).catch(error =>{
  313. this.$util.msg(error.msg,2000)
  314. })
  315. })
  316. },
  317. hanldePopupFn(data){//监听活动内容
  318. this.popupShow = true
  319. this.handlerPros = data
  320. },
  321. onShareAppMessage(res){//分享转发
  322. this.isShareModal = false
  323. if (res.from === 'button') {
  324. // 来自页面内转发按钮
  325. }
  326. return {
  327. title: '您有新的订单,请点击查看~',
  328. path: `/pages/user/order/order-sharelogin?orderID=${this.orderID}&userID=${this.userID}&serviceProviderId=${this.serviceProviderId}`,
  329. imageUrl:'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  330. }
  331. },
  332. getHeaderTopHeight(){
  333. let statusBarHeight = this.systeminfo.statusBarHeight // 状态栏高度
  334. let headerPosi = this.headerBtnPosi
  335. let btnPosi = { // 胶囊实际位置,坐标信息不是左上角原点
  336. height: headerPosi.height,
  337. width: headerPosi.width,
  338. // 胶囊top - 状态栏高度
  339. top: headerPosi.top - statusBarHeight,
  340. // 胶囊bottom - 胶囊height - 状态栏height (现胶囊bottom 为距离导航栏底部的长度)
  341. bottom: headerPosi.bottom - headerPosi.height - statusBarHeight,
  342. // 屏幕宽度 - 胶囊right
  343. right: this.systeminfo.screenWidth - headerPosi.right
  344. }
  345. this.navbarHeight= headerPosi.bottom + btnPosi.bottom// 原胶囊bottom + 现胶囊bottom
  346. },
  347. setHeaderBtnPosi(){
  348. // 获得胶囊按钮位置信息
  349. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  350. return headerBtnPosi
  351. },
  352. setSysteminfo(){
  353. let systeminfo;
  354. uni.getSystemInfo({ // 获取设备信息
  355. success: (res) => {
  356. systeminfo = res
  357. },
  358. })
  359. return systeminfo
  360. },
  361. },
  362. onShow() {
  363. this.$api.getStorage().then((resolve) =>{
  364. this.serviceProviderId = resolve.serviceProviderId
  365. })
  366. }
  367. }
  368. </script>
  369. <style lang="scss">
  370. page {
  371. height: auto;
  372. background:#F7F7F7;
  373. }
  374. .btn-hover{
  375. background: #FFFFFF;
  376. }
  377. .animation{
  378. /* transition: transform 0.3s ease;*/
  379. transition-property: transform;
  380. transition-duration: 0.3s;
  381. transition-timing-function: ease;
  382. }
  383. .invoice-balance{
  384. width: 702rpx;
  385. height: auto;
  386. padding:0 24rpx;
  387. background: #FFFFFF;
  388. float: left;
  389. margin-top: 24rpx;
  390. margin-bottom: 24rpx;
  391. .balabce-t{
  392. width: 100%;
  393. height: 86rpx;
  394. line-height: 86rpx;
  395. font-size: $font-size-28;
  396. color: $text-color;
  397. float: left;
  398. .balabce-t-le{
  399. float: left;
  400. font-weight: bold;
  401. }
  402. .balabce-t-ri{
  403. float: right;
  404. display: flex;
  405. align-items: center;
  406. .money{
  407. display: flex;
  408. float: left;
  409. }
  410. .checkbox-box{
  411. display: flex;
  412. width: 60rpx;
  413. float: left;
  414. height: 100%;
  415. font-size: $font-size-24;
  416. .checkbox{
  417. width: 40rpx;
  418. text-align: right;
  419. box-sizing: border-box;
  420. text-align: center;
  421. text-decoration: none;
  422. border-radius: 0;
  423. -webkit-tap-highlight-color: transparent;
  424. overflow: hidden;
  425. }
  426. }
  427. }
  428. }
  429. .balabce-b{
  430. width: 100%;
  431. float: left;
  432. overflow: hidden;
  433. .balabce-b-text{
  434. width: 100%;
  435. line-height: 58rpx;
  436. font-size: $font-size-24;
  437. color: #FF2A2A;
  438. text-align: right;
  439. float: right;
  440. }
  441. &.balabce-b--hide {
  442. padding: 0 0;
  443. height: 0px;
  444. line-height: 0px;
  445. }
  446. }
  447. }
  448. .clause{
  449. float: right;
  450. font-size: 24rpx;
  451. color: #999999;
  452. margin-top: 60rpx;
  453. margin-right: 24rpx;
  454. &.noclick{
  455. pointer-events: none;
  456. }
  457. .text{
  458. color: #1890f9;
  459. &.color-bg{
  460. color: #333333;
  461. }
  462. }
  463. }
  464. .status-text{
  465. overflow: hidden;
  466. padding: 24rpx;
  467. background: #fff;
  468. font-size: $font-size-26;
  469. .view-type{
  470. float: left;
  471. color: #ff2a2a;
  472. }
  473. .bage-buss{
  474. display: inline-block;
  475. width: 72rpx;
  476. height: 32rpx;
  477. background:radial-gradient(circle,rgba(255,39,180,1) 0%,rgba(193,77,245,1) 100%);
  478. border-radius: 6rpx;
  479. line-height: 32rpx;
  480. text-align: center;
  481. color: #FFFFFF;
  482. margin-top: 10rpx;
  483. float: right;
  484. font-size: $font-size-24;
  485. }
  486. .bage-auto{
  487. display: inline-block;
  488. width: 72rpx;
  489. height: 32rpx;
  490. background:radial-gradient(circle,rgba(255,180,39,1) 0%,rgba(245,142,77,1) 100%);
  491. border-radius: 6rpx;
  492. line-height: 32rpx;
  493. text-align: center;
  494. color: #FFFFFF;
  495. margin-top: 10rpx;
  496. float: right;
  497. font-size: $font-size-24;
  498. }
  499. .Rebate{
  500. display: inline-block;
  501. width: 72rpx;
  502. height: 32rpx;
  503. background:#ff7a51;
  504. border-radius: 6rpx;
  505. line-height: 32rpx;
  506. text-align: center;
  507. color: #FFFFFF;
  508. margin-top: 10rpx;
  509. float: right;
  510. font-size: $font-size-24;
  511. margin-left: 20rpx;
  512. }
  513. }
  514. </style>