login-share.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. navigateLink(data){// 根据用户权限跳转对应页面
  55. switch(data.userType){
  56. case 1:// 协销
  57. this.getOrderReceiptDetailType(this.receiptId,data)
  58. break
  59. case 2:// 客服
  60. this.getOrderReceiptDetailType(this.receiptId,data)
  61. break
  62. case 3:// 财务
  63. this.getOrderReceiptDetailType(this.receiptId,data)
  64. break
  65. case 4:// 超级管理员
  66. this.getOrderReceiptDetailType(this.receiptId,data)
  67. break
  68. }
  69. },
  70. getOrderReceiptDetailType(id,data) {
  71. this.OrderService.orderReceiptDetailType({ id: id })
  72. .then(response => {
  73. /**
  74. * 用户类型(userType) 1协销人员,2客服,3财务,4超级管理员
  75. * 1. 协销人员跳转到收款列表页面
  76. * 2. 客服跳转到收款列表页面
  77. * 3. 财务人员跳转到款项识别页面
  78. * 4. 超级管理员跳转到款项识别页面
  79. * */
  80. const receipt = response.data
  81. switch(data.userType){
  82. case 1:// 协销
  83. this.navigateLinkJump(receipt)
  84. break
  85. case 2:// 客服
  86. this.navigateLinkJump(receipt)
  87. break
  88. case 3:// 财务
  89. this.$api.navigateTo('/pages/collection/list')
  90. break
  91. case 4:// 超级管理员
  92. this.navigateLinkJump(receipt)
  93. break
  94. }
  95. })
  96. .catch(err => {
  97. console.log('分享查询收款详情异常====>',err)
  98. })
  99. },
  100. navigateLinkJump(receipt){// 收款详情查询跳转URL 收款款项类型:1订单款,2非订单款,3返佣款 4订单款或者非订单款(因财务阶段无法区分订单非订单), 5供应商退款
  101. switch(receipt.receiptType){
  102. case 1:// 1:订单 1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销【线上支付成功为审核通过】
  103. if(receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5){// 订单待确认
  104. console.log('订单待确认')
  105. this.$api.navigateTo(`/pages/relation/ordinary/index?type=share&id=${receipt.id}`)
  106. }else if(receipt.receiptStatus == 2){// 待审核
  107. console.log('待审核')
  108. this.$api.navigateTo(`/pages/relation/ordinary/examine-detail?type=share&id=${receipt.id}`)
  109. }else if(receipt.receiptStatus == 3){// 审核通过
  110. console.log('审核通过')
  111. this.$api.navigateTo(`/pages/relation/ordinary/detail?type=share&id=${receipt.id}`)
  112. }
  113. break
  114. case 2:// 2:非订单
  115. this.$api.navigateTo(`/pages/relation/nonorder/detail?type=share&id=${receipt.id}`)
  116. break
  117. case 3:// 3:返佣
  118. if(receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5){// 返佣待确认
  119. this.$api.navigateTo(`/pages/relation/return/index?type=share&id=${receipt.id}`)
  120. }else if(receipt.receiptStatus == 2){
  121. this.$api.navigateTo(`/pages/relation/return/detail?type=share&id=${receipt.id}`)
  122. }
  123. break
  124. case 5:// 4:供应商退款
  125. if(receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5){// 返佣待确认
  126. this.$api.navigateTo(`/pages/relation/refund/index?type=share&id=${receipt.id}`)
  127. }else if(receipt.receiptStatus == 2){
  128. this.$api.navigateTo(`/pages/relation/refund/detail?type=share&id=${receipt.id}`)
  129. }
  130. break
  131. }
  132. }
  133. },
  134. onShow() {
  135. this.getWxAuthorize()
  136. }
  137. }
  138. </script>
  139. <style lang="scss">
  140. .container {
  141. width: 100%;
  142. height:100%;
  143. background: #FFFFFF;
  144. display: flex;
  145. align-items: center;
  146. justify-content:center;
  147. .share-empty{
  148. width: 260rpx;
  149. height: 412rpx;
  150. .icon{
  151. width: 260rpx;
  152. height: 260rpx;
  153. image{
  154. width: 100%;
  155. height: 100%;
  156. display: block;
  157. }
  158. }
  159. .text{
  160. font-size: $font-size-28;
  161. line-height: 60rpx;
  162. color: $color-system;
  163. text-align: center;
  164. }
  165. }
  166. }
  167. </style>