noAuthority.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="noauthority-page">
  3. <image class="img" :src="globalImgUrls.activityNoAuth" mode="widthFix"></image>
  4. <view>您暂无权限参加此活动</view>
  5. <view v-if="info.type=='contact'">若想参加,可以联系对口销售</view>
  6. <view v-else>若想参加可以申请开通</view>
  7. <view class="global-btn-yellow-change btn" @click="handleContact" v-if="info.type=='contact'">联系销售</view>
  8. <view class="global-btn-yellow-change btn" @click="handleGoApply" v-else>立即申请</view>
  9. <view class="global-btn-yellow-plain btn" @click="handleBack">返回</view>
  10. <!-- 弹窗 -->
  11. <van-popup :show="pupData.show" @close="pupData.show=false" :close-on-click-overlay="false">
  12. <view class="global-pup">
  13. <view class="content">
  14. <rich-text :nodes="pupData.content"></rich-text>
  15. </view>
  16. <view class="flex bot">
  17. <view @click="pupData.show=false">知道了</view>
  18. </view>
  19. </view>
  20. </van-popup>
  21. </view>
  22. </template>
  23. <script>
  24. import {apiApplyPermission} from '@/api/user'
  25. export default {
  26. name:"noAuthority",
  27. data () {
  28. return {
  29. info:{},
  30. pupData:{
  31. show:false,
  32. content:'',//弹窗html字符串
  33. }
  34. }
  35. },
  36. onLoad(options){
  37. this.info=JSON.parse(options.data)
  38. if(this.info.type=='contact'&&!this.info.customer_info.has_apply){
  39. if(this.info.customer_info.status=='冻结'||(this.info.customer_info.status=='试用'&&this.info.customer_info.is_suspend==1)){
  40. apiApplyPermission({
  41. company_name:this.info.customer_info.company_name,
  42. real_name:this.info.customer_info.name,
  43. }).then(res=>{
  44. if(res.code===200){
  45. console.log('主动申请成功');
  46. }
  47. })
  48. }
  49. }
  50. },
  51. methods: {
  52. async handleGoApply(){
  53. if(this.info.type=='apply'){
  54. if(this.info.customer_info.has_apply){// 已经申请过
  55. this.pupData.show=true
  56. this.pupData.content=`<p>您已提交过申请,请耐心等待</p>`
  57. // uni.redirectTo({
  58. // url:"/pages-applyPermission/applyResult"
  59. // })
  60. }else{
  61. if(!this.info.customer_info.status||this.info.customer_info.status!='流失'){
  62. uni.redirectTo({
  63. url:"/pages-applyPermission/applyPermission"
  64. })
  65. }else{//主动调一次申请权限接口
  66. const res=await apiApplyPermission({
  67. company_name:this.info.customer_info.company_name,
  68. real_name:this.info.customer_info.name,
  69. })
  70. if(res.code===200){
  71. this.pupData.show=true
  72. this.pupData.content=`<p>申请已提交</p><p>请等待销售人员与您联系</p>`
  73. // uni.redirectTo({
  74. // url:"/pages-applyPermission/applyResult"
  75. // })
  76. }
  77. }
  78. }
  79. }
  80. },
  81. handleContact(){
  82. uni.makePhoneCall({
  83. phoneNumber: this.info.mobile
  84. });
  85. },
  86. handleBack(){
  87. uni.navigateBack()
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss">
  93. .noauthority-page{
  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>