login-share.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view class="container">
  3. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="7"></tui-skeleton>
  4. <template v-else>
  5. <view class="share-empty">
  6. <view class="icon"><image :src="imagePath" mode="widthFix"></image></view>
  7. <view class="text">暂无权限查看</view>
  8. </view>
  9. </template>
  10. </view>
  11. </template>
  12. <script>
  13. import { mapMutations } from 'vuex'
  14. import authorize from '@/common/config/authorize.js'
  15. export default {
  16. computed: {
  17. },
  18. data() {
  19. return {
  20. CustomBar:this.CustomBar,// 顶部导航栏高度
  21. imagePath:'https://static.caimei365.com/app/img/icon/icon-noremb.png',
  22. skeletonShow:true,
  23. receiptId:0,
  24. receiptType:1// 收款款项类型:1订单款,2非订单款,3返佣款 4订单款或者非订单款(因财务阶段无法区分订单非订单), 5供应商退款
  25. }
  26. },
  27. onLoad(option) {
  28. this.receiptId = option.id
  29. },
  30. methods: {
  31. ...mapMutations(['login', 'logout']),
  32. async getWxAuthorize(){// 初始化授权登录
  33. const WxCode = await authorize.getCode('weixin')
  34. const Wx = await authorize.getUserInfo('weixin')
  35. this.UserService.UserLoginAuthApplets({
  36. code:WxCode,
  37. encryptedData:Wx.encryptedData,
  38. iv:Wx.iv ,
  39. })
  40. .then(response =>{
  41. let data = response.data
  42. this.login(response.data)
  43. this.$store.commit('updateStatus',response.data)
  44. setTimeout(()=>{
  45. this.getOrderReceiptDetailType(this.receiptId,response.data)
  46. },1000)
  47. }).catch(error =>{
  48. this.logout()
  49. this.skeletonShow = false
  50. this.$store.commit('updateStatus',error.data)
  51. this.$api.navigateTo('/pages/login/login-account')
  52. })
  53. },
  54. getOrderReceiptDetailType(id,data) {
  55. this.OrderService.orderReceiptDetailType({ id: id })
  56. .then(response => {
  57. /**
  58. * 用户类型(userType) 1协销人员,2客服,3财务,4超级管理员
  59. * 1. 协销人员跳转到收款列表页面
  60. * 2. 客服跳转到收款列表页面
  61. * 3. 财务人员跳转到款项识别页面
  62. * 4. 超级管理员跳转到款项识别页面
  63. * */
  64. const receipt = response.data
  65. switch(data.userType){
  66. case 1:// 协销
  67. this.navigateLinkJump(receipt)
  68. break
  69. case 2:// 客服
  70. this.navigateLinkJump(receipt)
  71. break
  72. case 3:// 财务
  73. this.$api.navigateTo('/pages/collection/list')
  74. break
  75. case 4:// 超级管理员
  76. this.navigateLinkJump(receipt)
  77. break
  78. }
  79. })
  80. .catch(err => {
  81. console.log('分享查询收款详情异常====>',err)
  82. })
  83. },
  84. navigateLinkJump(receipt){// 收款详情查询跳转URL 收款款项类型:1订单款,2非订单款,3返佣款 4订单款或者非订单款(因财务阶段无法区分订单非订单), 5供应商退款
  85. switch(receipt.receiptType){
  86. case 1:// 1:订单 1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销【线上支付成功为审核通过】
  87. if(receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5){// 订单待确认
  88. console.log('订单待确认')
  89. this.$api.navigateTo(`/pages/relation/ordinary/index?type=share&id=${receipt.id}`)
  90. }else if(receipt.receiptStatus == 2){// 待审核
  91. console.log('待审核')
  92. this.$api.navigateTo(`/pages/relation/ordinary/examine-detail?type=share&id=${receipt.id}`)
  93. }else if(receipt.receiptStatus == 3){// 审核通过
  94. console.log('审核通过')
  95. this.$api.navigateTo(`/pages/relation/ordinary/detail?type=share&id=${receipt.id}`)
  96. }
  97. break
  98. case 2:// 2:非订单
  99. this.$api.navigateTo(`/pages/relation/nonorder/detail?type=share&id=${receipt.id}`)
  100. break
  101. case 3:// 3:返佣
  102. if(receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5){// 返佣待确认
  103. this.$api.navigateTo(`/pages/relation/return/index?type=share&id=${receipt.id}`)
  104. }else if(receipt.receiptStatus == 2){
  105. this.$api.navigateTo(`/pages/relation/return/detail?type=share&id=${receipt.id}`)
  106. }
  107. break
  108. case 5:// 4:供应商退款
  109. if(receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5){// 返佣待确认
  110. this.$api.navigateTo(`/pages/relation/refund/index?type=share&id=${receipt.id}`)
  111. }else if(receipt.receiptStatus == 2){
  112. this.$api.navigateTo(`/pages/relation/refund/detail?type=share&id=${receipt.id}`)
  113. }
  114. break
  115. }
  116. }
  117. },
  118. onShow() {
  119. this.getWxAuthorize()
  120. }
  121. }
  122. </script>
  123. <style lang="scss">
  124. .container {
  125. width: 100%;
  126. height:100%;
  127. background: #FFFFFF;
  128. display: flex;
  129. align-items: center;
  130. justify-content:center;
  131. .share-empty{
  132. width: 260rpx;
  133. height: 412rpx;
  134. .icon{
  135. width: 260rpx;
  136. height: 260rpx;
  137. image{
  138. width: 100%;
  139. height: 100%;
  140. display: block;
  141. }
  142. }
  143. .text{
  144. font-size: $font-size-28;
  145. line-height: 60rpx;
  146. color: $color-system;
  147. text-align: center;
  148. }
  149. }
  150. }
  151. </style>