Commit a72891f4 authored by Your Name's avatar Your Name

限制角色页面

parent acd48e7c
<template> <template>
<div class="my-tabbar"> <div class="my-tabbar">
<van-tabbar v-model="activeIndex" active-color="#EE0A24" route> <van-tabbar v-model="activeIndex" active-color="#EE0A24" route>
<van-tabbar-item v-for="item in iconList" :to="item.url" :key="item.title"> <van-tabbar-item @click="changeHandle(item.title, userInfo.roleList[0])" v-for="item in iconList" :to=" +userInfo.roleList[0] == 2 && item.title == '观影互动' || +userInfo.roleList[0] == 17 && item.title == '学习项目' ? '' : item.url" :key="item.title">
<span>{{item.title}}</span> <span>{{item.title}}</span>
<template #icon="props"> <template #icon="props">
<img :src="props.active ? item.icon.active : item.icon.inactive" /> <img :src="props.active ? item.icon.active : item.icon.inactive" />
...@@ -39,6 +39,7 @@ export default { ...@@ -39,6 +39,7 @@ export default {
}, },
data() { data() {
return { return {
userInfo: JSON.parse(sessionStorage.getItem('userInfo')),
activeIndex: this.active, activeIndex: this.active,
iconList: [ iconList: [
{ {
...@@ -75,6 +76,14 @@ export default { ...@@ -75,6 +76,14 @@ export default {
} }
] ]
}; };
},
methods: {
changeHandle(index1,index2) {
// console.log(index1,index2)
if(index1 == '观影互动' && index2 == 2 || index1 == '学习项目' && index2 == 17) {
this.$toast('暂无该权限!')
}
}
} }
}; };
</script> </script>
......
...@@ -8,15 +8,17 @@ ...@@ -8,15 +8,17 @@
<van-cell-group> <van-cell-group>
<van-field label="展板名称:" v-model="panelName" readonly /> <van-field label="展板名称:" v-model="panelName" readonly />
</van-cell-group> </van-cell-group>
<p>展板导览视频:</p> <van-row>
<!-- <embed type="video/mp4" :src="panelVideo" /> --> <van-col span="8" style="margin-top: 50px;"><div style="vertical-align:middle;font-size:14px;">展板导览视频:</div></van-col>
<van-col span="12"> <!-- <embed type="video/mp4" :src="panelVideo" /> -->
<video <video
placeholder="展板导览视频" controls placeholder="展板导览视频" controls
width="150px" width="150px"
height="100px"> height="100px">
        <source :src="panelVideo" type="video/mp4" />        <source :src="panelVideo" type="video/mp4" />
        <source :src="panelVideo" type="video/WebM">        <source :src="panelVideo" type="video/WebM">
      </video>      </video></van-col>
</van-row>
</div> </div>
</div> </div>
</div> </div>
...@@ -26,33 +28,52 @@ ...@@ -26,33 +28,52 @@
export default { export default {
data() { data() {
return { return {
url: 'https://www.baidu.com/h5/guide?id=1&name=长征之路&video=2', // 扫描者携带的信息参数 url: 'https://www.baidu.com/h5/guide?panelId=1&panelName=长征之路&panelVideo=https://www.runoob.com/try/demo_source/movie.mp4', // 扫描者携带的信息参数
panelId: '', // 展板id panelId: '', // 展板id
panelName: '', // 展板名称 panelName: '', // 展板名称
panelVideo:'https://www.runoob.com/try/demo_source/movie.mp4', // 展板导览视频地址 panelVideo:'', // 展板导览视频地址
u:''
}; };
}, },
created() { created() {
// var url = window.location.href ; //获取url中"?"符后的字串 var url = window.location.href ; // 获取url中"?"符后的字串
// var cs = this.url.split('?')[1]; //获取?之后的参数字符串 this.u = this.url.split('?')[0];//
//alert(url+'地址');//orderCode=20200721093517378188743943022 console.log(this.u)
// var cc =''; var cs = this.url.split('?')[1]; // 获取?之后的参数字符串
// var cs2 = ''; // alert(url+'地址');//orderCode=20200721093517378188743943022
// if (cs.length > 0) var cc ='';
// { var cs2 = '';
// cs = cs.replace('id=', ''); // 去除参数名称 if (cs.length > 0)
// var cc =cs.split('&')[0];//获取展板id {
// var cs3 = cs.split('&')[1]; cs = cs.replace('panelId=', ''); // 去除参数名称
// var ccs = cs3.replace('name=', '') // 获取展板名称 var cc =cs.split('&')[0];//获取展板id
// var cs1 = cs.split('&')[2];//ocd=20200818103843816416953617735 var cs3 = cs.split('&')[1];
// var cs2 = cs1.replace('video=', '');//20200818103843816416953617735 var ccs = cs3.replace('panelName=', '') // 去除参数名称
// } var cs1 = cs.split('&')[2]; // 获取展板名称
// this.panelName = ccs; var cs2 = cs1.replace('panelVideo=', '');// 获取展板导览视频
// // this.panelVideo = cs2; }
// this.panelId = ccs this.panelName = ccs;
this.panelVideo = cs2;
this.panelId = cc
this.initData()
}, },
methods: { methods: {
initData() {
let vm = this
let param = {
id: this.panelId,
};
vm.$https(
{
url: "screen/statistic",
method: "get",
authType: this.backToken,
},
param
).catch(function (err) {
console.log(err);
});
}
} }
}; };
</script> </script>
...@@ -65,7 +86,7 @@ export default { ...@@ -65,7 +86,7 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: 0 auto; margin: 0 auto;
background: #a4171d; background: #776d6e;
&:before { &:before {
display: inline-block; display: inline-block;
content: ""; content: "";
...@@ -96,7 +117,7 @@ export default { ...@@ -96,7 +117,7 @@ export default {
left: 24px; left: 24px;
right: 24px; right: 24px;
padding: 24px; padding: 24px;
background: #ffffff; background: #f5f5f5;
box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.2); box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.2);
border-radius: 8px; border-radius: 8px;
.login-page-form { .login-page-form {
......
...@@ -64,14 +64,14 @@ export default { ...@@ -64,14 +64,14 @@ export default {
duration: 5000 duration: 5000
}) })
} }
const isOpt = data.user.type; const isOpt = +data.user.roleList[0];
sessionStorage.setItem("token", data.token); sessionStorage.setItem("token", data.token);
sessionStorage.setItem("userInfo", JSON.stringify(data.user)); sessionStorage.setItem("userInfo", JSON.stringify(data.user));
// let redirectPath = decodeURIComponent(this.$route.fullPath).split('redirect=')[1] // let redirectPath = decodeURIComponent(this.$route.fullPath).split('redirect=')[1]
if (isOpt == "4") { if (isOpt == 17) {
this.$router.push("/opt");
}else if (isOpt == "2") {
this.$router.push("/commit"); this.$router.push("/commit");
}else if (isOpt == 2) {
this.$router.push("/learn");
}else{ }else{
this.$toast.fail("您登录的账号既不是运维账号也不是单位用户账号,不能使用H5的功能"); this.$toast.fail("您登录的账号既不是运维账号也不是单位用户账号,不能使用H5的功能");
} }
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
input-align="right" input-align="right"
:rules="[{ pattern: /^[1-9]\d{0,9}$/, message: '请输入正确内容,最多10位数',trigger:'blur'}]" :rules="[{ pattern: /^[1-9]\d{0,9}$/, message: '请输入正确内容,最多10位数',trigger:'blur'}]"
/> />
<!-- <van-field <van-field
required required
label="管理员账号" label="管理员账号"
v-model="form.name" v-model="form.name"
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
placeholder="请输入管理员密码" placeholder="请输入管理员密码"
input-align="right" input-align="right"
:rules="[{ required: true }]" :rules="[{ required: true }]"
/> --> />
</div> </div>
<div class="field-title"> <div class="field-title">
<span>上传视频</span> <span>上传视频</span>
...@@ -164,6 +164,7 @@ ...@@ -164,6 +164,7 @@
</template> </template>
<script> <script>
import util from "@/utils/index.js";
export default { export default {
data() { data() {
return { return {
...@@ -410,6 +411,7 @@ export default { ...@@ -410,6 +411,7 @@ export default {
param[key] = this.form[key]; param[key] = this.form[key];
} }
} }
param.password = util.encrypt(this.form.password),
param.images = [...param.images, ...param.videos]; param.images = [...param.images, ...param.videos];
param.images = param.images.join(","); param.images = param.images.join(",");
delete param.videos; delete param.videos;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment