noAuth.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view class="chart-no-auth">
  3. <image class="img" :src="globalImgUrls.activityNoAuth" mode="widthFix" v-if="authType!=4"></image>
  4. <image class="img-wait" :src="globalImgUrls.chartWait" mode="widthFix" v-else></image>
  5. <block v-if="authType==1">
  6. <view style="margin-bottom:15px">您暂无权限查看图库</view>
  7. <view>若想查看请联系对口销售</view>
  8. <!-- <view>{{info.name}}:{{info.mobile}}</view> -->
  9. <view class="global-btn-yellow-change btn" style="margin-top:30px" @click="handleCall">联系销售</view>
  10. </block>
  11. <block v-if="authType==2">
  12. <view style="margin-bottom:15px">您的权限已到期,暂时无法查看图库</view>
  13. <view>若想继续查看请联系对口销售</view>
  14. <!-- <view>{{info.name}}:{{info.mobile}}</view> -->
  15. <view class="global-btn-yellow-change btn" style="margin-top:30px" @click="handleCall">联系销售</view>
  16. </block>
  17. <block v-if="authType==3">
  18. <view style="margin-bottom:15px">您暂无权限查看图库</view>
  19. <view>若想查看可以申请开通</view>
  20. <view class="global-btn-yellow-change btn" style="margin-top:30px" @click="handleApply">立即申请</view>
  21. </block>
  22. <block v-if="authType==4">
  23. <view style="margin-bottom:15px">您已提交申请</view>
  24. <view>请等待销售人员与您联系</view>
  25. </block>
  26. </view>
  27. </template>
  28. <script>
  29. import {apiApplyPermission} from '@/api/user'
  30. export default {
  31. props: {
  32. info:null
  33. },
  34. computed: {
  35. authType(){
  36. if(!this.info) return
  37. // 该客户为冻结、试用暂停状态;该客户为正式、试用、永续状态,但联系人图表权限未开启或禁用
  38. if(this.info.type==='contact'){
  39. this.handleAutoApply()
  40. return 1
  41. }
  42. if(this.info.type==='expired'){
  43. return 2
  44. }
  45. if(this.info.type==='apply'&&!this.info.customer_info.has_apply){
  46. return 3
  47. }
  48. if(this.info.type==='apply'&&this.info.customer_info.has_apply){
  49. return 4
  50. }
  51. }
  52. },
  53. methods: {
  54. handleCall(){
  55. if(this.authType==1){
  56. this.handleAutoApply()
  57. }
  58. uni.makePhoneCall({
  59. phoneNumber: this.info.mobile,
  60. success: (result) => {},
  61. fail: (error) => {}
  62. })
  63. },
  64. handleAutoApply(){
  65. if(!this.info.customer_info.has_apply){
  66. if(this.info.customer_info.status=='冻结'||(this.info.customer_info.status=='试用'&&this.info.customer_info.is_suspend==1)){
  67. apiApplyPermission({
  68. company_name:this.info.customer_info.company_name,
  69. real_name:this.info.customer_info.name,
  70. source:3,
  71. from_page:'图库列表'
  72. }).then(res=>{
  73. if(res.code===200){
  74. console.log('主动申请成功');
  75. }
  76. })
  77. }
  78. }
  79. },
  80. async handleApply(){
  81. await this.checkUserIsBind()
  82. if(this.info.customer_info.status=='流失'||this.info.customer_info.status=='关闭'){
  83. apiApplyPermission({
  84. company_name:this.info.customer_info.company_name,
  85. real_name:this.info.customer_info.name,
  86. source:3,
  87. from_page:'图库列表'
  88. }).then(res=>{
  89. uni.navigateTo({url:'/pages-applyPermission/applyResult'})
  90. })
  91. return
  92. }
  93. uni.navigateTo({ url: '/pages-applyPermission/applyPermission?source=3&from_page=图库列表' })
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .chart-no-auth{
  100. padding: 34rpx;
  101. text-align: center;
  102. font-size: $global-font-size-lg;
  103. .img{
  104. width: 100%;
  105. margin-bottom: 50rpx;
  106. }
  107. .img-wait{
  108. margin-top: 200rpx;
  109. width: 186rpx;
  110. margin-bottom: 50rpx;
  111. }
  112. .btn{
  113. width: 380rpx;
  114. line-height: 70rpx;
  115. margin-left: auto;
  116. margin-right: auto;
  117. margin-top: 40rpx;
  118. }
  119. }
  120. </style>