123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <template>
- <view class="noauthority-page">
- <image class="img" :src="globalImgUrls.activityNoAuth" mode="widthFix"></image>
- <view>您暂无权限参加此活动</view>
- <view v-if="info.type=='contact'">若想参加,可以联系对口销售</view>
- <view v-else>若想参加可以申请开通</view>
- <view class="global-btn-yellow-change btn" @click="handleContact" v-if="info.type=='contact'">联系销售</view>
- <view class="global-btn-yellow-change btn" @click="handleGoApply" v-else>立即申请</view>
- <view class="global-btn-yellow-plain btn" @click="handleBack">返回</view>
- <!-- 弹窗 -->
- <van-popup :show="pupData.show" @close="pupData.show=false" :close-on-click-overlay="false">
- <view class="global-pup">
- <view class="content">
- <rich-text :nodes="pupData.content"></rich-text>
- </view>
- <view class="flex bot">
- <view @click="pupData.show=false">知道了</view>
- </view>
- </view>
- </van-popup>
- </view>
- </template>
- <script>
- import {apiApplyPermission} from '@/api/user'
- export default {
- name:"noAuthority",
- data () {
- return {
- info:{},
- pupData:{
- show:false,
- content:'',//弹窗html字符串
- }
- }
- },
- onLoad(options){
- this.info=JSON.parse(options.data)
-
- if(this.info.type=='contact'&&!this.info.customer_info.has_apply){
- if(this.info.customer_info.status=='冻结'||(this.info.customer_info.status=='试用'&&this.info.customer_info.is_suspend==1)){
- apiApplyPermission({
- company_name:this.info.customer_info.company_name,
- real_name:this.info.customer_info.name,
- source:2,
- from_page:'活动详情'
- }).then(res=>{
- if(res.code===200){
- console.log('主动申请成功');
- }
- })
- }
- }
- },
- methods: {
- async handleGoApply(){
- await this.checkUserIsBind()
- if(this.info.type=='apply'){
- if(this.info.customer_info.has_apply){// 已经申请过
- this.pupData.show=true
- this.pupData.content=`<p>您已提交过申请,请耐心等待</p>`
- // uni.redirectTo({
- // url:"/pages-applyPermission/applyResult"
- // })
- }else{
- if(!this.info.customer_info.status||this.info.customer_info.status!='流失'||this.info.customer_info.status!='关闭'){
- uni.redirectTo({
- url:"/pages-applyPermission/applyPermission?source=2&from_page=活动详情"
- })
- }else{//主动调一次申请权限接口
- const res=await apiApplyPermission({
- company_name:this.info.customer_info.company_name,
- real_name:this.info.customer_info.name,
- source:2,
- from_page:'活动详情'
- })
- if(res.code===200){
- this.pupData.show=true
- this.pupData.content=`<p>申请已提交</p><p>请等待销售人员与您联系</p>`
- // uni.redirectTo({
- // url:"/pages-applyPermission/applyResult"
- // })
- }
- }
- }
-
- }
-
- },
- handleContact(){
- uni.makePhoneCall({
- phoneNumber: this.info.mobile
- });
- },
- handleBack(){
- uni.navigateBack({
- fail:()=>{
- uni.switchTab({ url: '/pages/report/report' })
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .noauthority-page{
- padding: 34rpx;
- text-align: center;
- font-size: $global-font-size-lg;
- .img{
- width: 100%;
- margin-bottom: 50rpx;
- }
- .btn{
- width: 380rpx;
- line-height: 70rpx;
- margin-left: auto;
- margin-right: auto;
- margin-top: 40rpx;
- }
- }
- </style>
|