noAuthority.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. source:2,
  44. from_page:'活动详情'
  45. }).then(res=>{
  46. if(res.code===200){
  47. console.log('主动申请成功');
  48. }
  49. })
  50. }
  51. }
  52. },
  53. methods: {
  54. async handleGoApply(){
  55. await this.checkUserIsBind()
  56. if(this.info.type=='apply'){
  57. if(this.info.customer_info.has_apply){// 已经申请过
  58. this.pupData.show=true
  59. this.pupData.content=`<p>您已提交过申请,请耐心等待</p>`
  60. // uni.redirectTo({
  61. // url:"/pages-applyPermission/applyResult"
  62. // })
  63. }else{
  64. if(!this.info.customer_info.status||this.info.customer_info.status!='流失'||this.info.customer_info.status!='关闭'){
  65. uni.redirectTo({
  66. url:"/pages-applyPermission/applyPermission?source=2&from_page=活动详情"
  67. })
  68. }else{//主动调一次申请权限接口
  69. const res=await apiApplyPermission({
  70. company_name:this.info.customer_info.company_name,
  71. real_name:this.info.customer_info.name,
  72. source:2,
  73. from_page:'活动详情'
  74. })
  75. if(res.code===200){
  76. this.pupData.show=true
  77. this.pupData.content=`<p>申请已提交</p><p>请等待销售人员与您联系</p>`
  78. // uni.redirectTo({
  79. // url:"/pages-applyPermission/applyResult"
  80. // })
  81. }
  82. }
  83. }
  84. }
  85. },
  86. handleContact(){
  87. uni.makePhoneCall({
  88. phoneNumber: this.info.mobile
  89. });
  90. },
  91. handleBack(){
  92. uni.navigateBack({
  93. fail:()=>{
  94. uni.switchTab({ url: '/pages/report/report' })
  95. }
  96. })
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .noauthority-page{
  103. padding: 34rpx;
  104. text-align: center;
  105. font-size: $global-font-size-lg;
  106. .img{
  107. width: 100%;
  108. margin-bottom: 50rpx;
  109. }
  110. .btn{
  111. width: 380rpx;
  112. line-height: 70rpx;
  113. margin-left: auto;
  114. margin-right: auto;
  115. margin-top: 40rpx;
  116. }
  117. }
  118. </style>