noAuth.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="voice-no-auth">
  3. <image class="img" :src="globalImgUrls.activityNoAuth" mode="widthFix"></image>
  4. <template v-if="userInfo&&userInfo.is_bind==0">
  5. <view style="margin-bottom:15px">您尚未登录,请登录后查看更多信息</view>
  6. <view class="global-btn-yellow-change btn" @click="handleGoLogin">立即登录</view>
  7. </template>
  8. <template v-else>
  9. <view style="margin-bottom:15px">您暂无权限查看线上路演</view>
  10. <view v-if="info.type==='contact'" style="margin-bottom:15px">若想查看可以联系对口销售</view>
  11. <view v-else style="margin-bottom:15px">若想查看可以申请开通</view>
  12. <view v-if="info.type==='contact'">
  13. {{info.name||''}}:<text @click="handleCall" style="color:#E3B377">{{info.mobile||''}}</text>
  14. </view>
  15. <view class="global-btn-yellow-change btn" @click="handleApply" v-else style="margin-top:30px">立即申请</view>
  16. </template>
  17. </view>
  18. </template>
  19. <script>
  20. import {apiApplyPermission} from '@/api/user'
  21. export default {
  22. props: {
  23. info:null
  24. },
  25. watch:{
  26. info(){
  27. this.handleAutoApply()
  28. }
  29. },
  30. computed: {
  31. userInfo() {
  32. return this.$store.state.user.userInfo;
  33. }
  34. },
  35. methods: {
  36. handleCall(){
  37. uni.makePhoneCall({
  38. phoneNumber: this.info.mobile,
  39. success: (result) => {},
  40. fail: (error) => {}
  41. })
  42. },
  43. handleAutoApply(){
  44. if(this.info.type=='contact'&&!this.info.customer_info.has_apply){
  45. if(this.info.customer_info.status=='冻结'||(this.info.customer_info.status=='试用'&&this.info.customer_info.is_suspend==1)){
  46. apiApplyPermission({
  47. company_name:this.info.customer_info.company_name,
  48. real_name:this.info.customer_info.name,
  49. source:10,
  50. from_page:'线上路演'
  51. }).then(res=>{
  52. if(res.code===200){
  53. console.log('主动申请成功');
  54. }
  55. })
  56. }
  57. }
  58. },
  59. handleGoLogin(){
  60. uni.navigateTo({
  61. url:'/pages/login?from=tologin'
  62. })
  63. },
  64. async handleApply(){
  65. await this.checkUserIsBind()
  66. const {customer_info}=this.info
  67. if(customer_info.has_apply){
  68. uni.showToast({
  69. title:'您已提交过申请,请耐心等待',
  70. icon:'none'
  71. })
  72. }else{
  73. if (!customer_info.status || customer_info.status != '流失'|| customer_info.status != '关闭') {
  74. uni.navigateTo({
  75. url: "/pages-applyPermission/applyPermission?source=10&from_page=线上路演"
  76. })
  77. }else{
  78. apiApplyPermission({
  79. company_name:customer_info.company_name,
  80. real_name:customer_info.name,
  81. source:10,
  82. from_page:'线上路演'
  83. }).then(res=>{
  84. uni.navigateTo({url:'/pages-applyPermission/applyResult'})
  85. })
  86. }
  87. }
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .voice-no-auth{
  94. padding: 34rpx;
  95. text-align: center;
  96. font-size: $global-font-size-lg;
  97. .img{
  98. width: 100%;
  99. margin-bottom: 50rpx;
  100. }
  101. .btn{
  102. width: 380rpx;
  103. line-height: 70rpx;
  104. margin-left: auto;
  105. margin-right: auto;
  106. margin-top: 40rpx;
  107. }
  108. }
  109. </style>