login-share.vue 5.5 KB

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