noAuth.vue 3.1 KB

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