AI项目侧边栏付费会员模块

教育相关1年前 (2023)发布 nunotao
444 0 0

在/pages目录下创建一个ai_bing.vue复制下面代码进去,修改src="这里面的内容",保存即可
注意:ai_bing.vue你可以随意起xxx.vue,但是要确保和侧边栏的一致

<template>
   <main class="main overflow-auto ai-app">
    <div v-if="me_vip">
        <iframe
        id="bing"
        name="iframeContain"
        seamless
        scrolling="yes"
        src="输入你部署好项目的地址"
      >
        您当前的浏览器不支持页面上的功能,请升级您当前的浏览器版本或使用谷歌浏览器访问当前页面
     </iframe>
    </div>
       <p  v-else class="vip_test">无权限访问,请到个人中心订阅会员</p>
   </main>
</template>

<script setup lang="ts">
import {ref} from "vue";
import {useCounter} from '~/store/counter'
const token = useCookie('token')
const me_vip = ref({})
const aotu_url = ref({})
    if (!token.value) {
        //不是会员转跳到首页
        navigateTo('/');
    }else{

    }
const now_user = () =>{
    get_user().then((res:any) => {
        if(res._rawValue.vip==null){
            me_vip.value=res._rawValue.vip
        }
    }).catch((err:any) => {
         //不是会员转跳到首页
         navigateTo('/');
    })
}
now_user()
</script>
<style>
.w-100-svg svg{
    width: 100%;
}
.is_like{
    fill: #409eff;
    stroke: #409eff;
}
.ek_vip{
    width: 100%; height: 937px;
}
.vip_test{
    font-size: 2rem;
    text-align: center;
    margin: 0 auto;
    position: relative;
    top:40%;
    z-index: 9999;
}
#bing{ width: 100%; height: 937px; }
</style>

然后进入”前端根目录/components“,进入Navigation.vue,复制一份侧边栏代码,to改为to=“/ai_bing",重新打包即可,如果不会添加侧边栏,

© 版权声明

相关文章

暂无评论

暂无评论...