noAuth.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. uni.makePhoneCall({
  56. phoneNumber: this.info.mobile,
  57. success: (result) => {},
  58. fail: (error) => {}
  59. })
  60. },
  61. handleAutoApply(){
  62. if(!this.info.customer_info.has_apply){
  63. if(this.info.customer_info.status=='冻结'||(this.info.customer_info.status=='试用'&&this.info.customer_info.is_suspend==1)){
  64. apiApplyPermission({
  65. company_name:this.info.customer_info.company_name,
  66. real_name:this.info.customer_info.name,
  67. source:3,
  68. from_page:'图库列表'
  69. }).then(res=>{
  70. if(res.code===200){
  71. console.log('主动申请成功');
  72. }
  73. })
  74. }
  75. }
  76. },
  77. handleApply(){
  78. if(this.info.customer_info.status=='流失'){
  79. apiApplyPermission({
  80. company_name:this.info.customer_info.company_name,
  81. real_name:this.info.customer_info.name,
  82. source:3,
  83. from_page:'图库列表'
  84. }).then(res=>{
  85. uni.navigateTo({url:'/pages-applyPermission/applyResult'})
  86. })
  87. return
  88. }
  89. uni.navigateTo({ url: '/pages-applyPermission/applyPermission?source=3&from_page=图库列表' })
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. .chart-no-auth{
  96. padding: 34rpx;
  97. text-align: center;
  98. font-size: $global-font-size-lg;
  99. .img{
  100. width: 100%;
  101. margin-bottom: 50rpx;
  102. }
  103. .img-wait{
  104. margin-top: 200rpx;
  105. width: 186rpx;
  106. margin-bottom: 50rpx;
  107. }
  108. .btn{
  109. width: 380rpx;
  110. line-height: 70rpx;
  111. margin-left: auto;
  112. margin-right: auto;
  113. margin-top: 40rpx;
  114. }
  115. }
  116. </style>