Commit 8f4de510 authored by 乐宝呗666's avatar 乐宝呗666

修改功能

parent 71a3fdcb
......@@ -20,7 +20,7 @@ const routes= [
meta: {
title: '登录'
},
component: () => import('@/views/setTopBoxManage/login')
component: () => import('@/views/login')
},
{
path: '/success',
......@@ -28,7 +28,7 @@ const routes= [
meta: {
title: '操作成功'
},
component: () => import('@/views/setTopBoxManage/success')
component: () => import('@/views/success')
},
{
path: '/opt',
......@@ -81,7 +81,7 @@ const router = new VueRouter({
})
router.beforeEach((to, from, next) => {
let user = localStorage.getItem("token");
if (!user && to.path !=='/login') { // 通过vuex state获取当前的token是否存在
if (!user && to.path !=='/login' && to.path !=='/success') { // 通过vuex state获取当前的token是否存在
next({
path: '/login',
})
......
<template>
<div class="commit-container">
<div class="commit-bg"></div>
<div class="commit-page">
<div class="commit-page-title">观展互动</div>
<div class="commit-page-content">
<div class="field-title">
<span>基本信息</span>
</div>
<div class="field-content">
<van-field
class="field-form-item"
v-for="(item,index) in baseInfo"
:key="index"
:label="item.label"
:value="item.value"
:placeholder="item.pla"
:border="item.border"
readonly
/>
<div class="field-calendar">
<van-cell class="field-form-item" title="学习时间" :value="date" @click="onDisplay" :icon="cellIcon"/>
<van-calendar v-model="show" @close="onClose" @confirm="onConfirm" />
<van-field
class="field-form-item"
label="观影人数"
v-model="downInfo.num"
placeholder="请输入观影人数"
/>
<van-field
class="field-form-item"
type="password"
label="账号密码"
v-model="downInfo.psd"
placeholder="请输入账号密码"
/>
</div>
</div>
<div class="field-title">
<span>上传视频</span>
</div>
<div class="field-content">
<div class="upload-content">
<div class="uplaod-video" style="min-height: 60px">
<van-uploader
:max-count="3"
v-model="fileList"
accept="video/*"
multiple>
<div class="avatar-plus">
<span>+</span>
</div>
</van-uploader>
</div>
<div class="tips">
<img src="/images/applets/tip.png" alt="">
<span>最多支持上传 <b>3</b> 段视频,每段时长<b>20s</b></span>
</div>
</div>
</div>
<div class="field-title">
<span>上传照片</span>
</div>
<div class="field-content">
<div class="upload-content">
<div class="uplaod-video" style="min-height: 60px">
<van-uploader
:max-count="10"
accept="image/png, image/jpeg"
v-model="imgFileList"
multiple>
<div class="avatar-plus">
<span>+</span>
</div>
</van-uploader>
</div>
<div class="tips">
<img src="/images/applets/tip.png" alt="" >
<span>最多支持上传 <b>6</b> 张照片</span>
</div>
</div>
</div>
<div class="field-title">
<span>上传资料简介</span>
<img class="icon-upload" src="/images/applets/upload.png" alt="">
</div>
<div class="field-content">
<van-field
class="field-textarea"
type="textarea"
v-model="fieldInfo"
maxlength="500"
show-word-limit
/>
</div>
</div>
<div class="commit-page-button">
<van-button type="default" @click="onSubmit">提交</van-button>
</div>
</div>
</div>
</template>
<script>
export default {
data(){
return {
baseInfo:[
{
label:'展板名称',
pla:'请输入展板名称',
value:'伟大成就',
border:false,
},
{
label:'账户名称',
pla:'请输入账户名称',
value:'中国国家博物馆',
border:false,
}
],
downInfo:{},
date: '',
show: false,
cellIcon:'/images/applets/date.png',
fileList: [],
imgFileList:[],
fieldInfo:''
}
},
methods:{
onDisplay() {
this.show = true
},
onClose() {
this.show = false
},
formatDate(date) {
date = new Date(date);
return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;
},
onConfirm(event) {
this.show = false
this.date = this.formatDate(event)
},
onSubmit(){
this.$toast.success('提交成功');
}
}
}
</script>
<style lang="scss">
.commit-container{
width: 100%;
height: 100%;
max-width: 1024px;
.commit-bg{
width: 100%;
height: 100%;
margin: 0 auto;
background: #a4171d;
&:before{
display: inline-block;
content: "";
width: 100%;
height: 100%;
background: url('/images/applets/bg02.png') no-repeat;
background-size: 100% 100%;
}
&:after{
display: inline-block;
content: "";
width: 100%;
height: 328px;
background: url('/images/applets/bg_top.png') no-repeat;
background-size: 100% 100%;
position: absolute;
top: 0;
left: 0;
}
.page-title{
font-size: 18px;
color: #fff;
}
}
.commit-page{
width: 100vw;
height: 100vh;
position: absolute;
left: 0;
top: 0;
.commit-page-title{
font-size: 18px;
color: #fff;
text-align: center;
margin: 20px 0 20px 0;
}
}
.commit-page-content{
padding: 0 40px;
height: calc(100% - 200px);
overflow-y: auto;
.field-title{
margin: 40px 0 34px 0;
position: relative;
span{
color: #FFECB1;
font-size: 18px;
line-height: 20px;
&:before{
content: "";
width: 20px;
height: 2px;
border-radius: 1px;
display: inline-block;
background-image: linear-gradient(135deg, #FFF7E1 0%, #C4913E 100%);
position: absolute;
left: 0;
bottom: -10px;
}
}
.icon-upload{
width: 24px;
vertical-align: middle;
float: right;
}
}
}
.commit-page-button{
padding: 0 40px;
position: absolute;
bottom: 83px;
left: 0px;
box-sizing: border-box;
width: 100%;
.van-button--normal{
background-image: linear-gradient(135deg, #FFF7E1 0%, #C4913E 100%);
border-radius: 4px;
height: 40px;
width: 100%;
color: #250002;
border: none;
font-size: 16px;
}
}
.field-form-item.van-cell{
display: block;
padding: 10px 0 16px 0;
background-color: transparent;
border-bottom: 1px solid rgba(172,147,116,0.40);;
.van-field__label{
color: #fff;
font-size: 14px;
font-weight: normal;
margin-bottom: 14px;
}
.van-field__control{
color: #fff;
font-size: 14px;
font-weight: normal;
}
}
.field-textarea{
.van-field__control{
color: #fff;
font-size: 16px;
font-weight: normal;
}
}
.field-calendar{
position: relative;
margin-bottom: -20px;
.van-icon{
position: absolute;
width: 20px;
height: 20px;
right: 10px;
bottom: 29px;
z-index: 2;
}
.field-form-item{
border-bottom: none;
}
.van-cell:after{
display: none;
}
.van-cell__title{
font-size: 14px;
color: #fff;
}
.van-cell__value{
width: 100%;
height: 40px;
background: #8B0008;
margin-top: 16px;
font-size: 14px;
text-align: left;
color: #fff;
line-height: 40px;
padding: 0 20px;
box-sizing: border-box;
}
}
.upload-content{
.avatar-plus{
width: 48px;
height: 48px;
line-height: 48px;
text-align: center;
background-color: #8B0008;
border-radius: 1px;
font-size: 25px;
color: #FFECB1;
margin-bottom: 12px;
}
.tips{
img{
width: 12px;
height: 12px;
vertical-align: middle;
}
span{
margin-left: 4px;
color: #fff;
font-size: 12px;
vertical-align: middle;
}
}
}
.field-textarea{
margin-bottom: 30px;
background: #8B0008;
min-height: 80px
}
}
</style>
......@@ -80,7 +80,7 @@ export default {
.login-container {
width: 100%;
height: 100%;
max-width: 1024px;
max-width: 1280px;
.login-bg {
width: 100%;
height: 100%;
......
......@@ -109,8 +109,12 @@ export default {
)
.then((res) => {
if (res.data.resultCode === "200") {
// 调用激活接口
this.$router.replace("/success");
if(status === '2'){
this.$router.replace({path:"/success",query:{txt:'激活成功'}})
}else{
this.$router.replace({path:"/success",query:{txt:'上报成功'}})
}
} else {
this.$toast(res.data.message);
}
......
<template>
<div class="success-container">
<img src="images/applets/success.png" alt="" />
<p>操作成功</p>
<p>{{txt}}</p>
<van-button type="default" @click="sureBtn">确定</van-button>
</div>
</template>
<script>
export default {};
export default {
data(){
return {
txt:'',
url:''
}
},
mounted(){
this.txt = this.$route.query.txt || '操作成功'
this.url = this.$route.query.url || '/commit'
},
methods:{
sureBtn(){
this.$router.push(this.url)
}
}
};
</script>
<style lang="scss">
.success-container {
......@@ -22,6 +39,16 @@ export default {};
font-size: 18px;
color: #333;
}
.van-button--normal {
background: #a4151d;
border-radius: 4px;
height: 40px;
width: 85%;
color: #fff;
border: none;
font-size: 16px;
margin-top: 30px;
}
}
</style>
<template>
<div class="commit-container">
<div class="commit-bg"></div>
<div class="commit-page">
<div class="commit-page-title">我有话对党说</div>
<div class="commit-page-content">
<div class="field-title">
<span>基本信息</span>
</div>
<div class="field-content">
<van-field
class="field-form-item"
v-for="(item,index) in baseInfo"
:key="index"
:label="item.label"
v-model="item.value"
:placeholder="item.pla"
:border="item.border"
readonly
/>
<!-- <div class="field-calendar">
<van-cell class="field-form-item" title="观看时间" :value="date" @click="onDisplay" :icon="cellIcon"/>
<van-calendar v-model="show" @close="onClose" @confirm="onConfirm" />
</div> -->
</div>
<div class="field-title">
<span>我有话对党说</span>
</div>
<div class="field-content">
<van-field
class="field-textarea"
type="textarea"
v-model="fieldInfo"
placeholder="我有话要对党说..."
maxlength="500"
show-word-limit
/>
</div>
<div class="add-btn">
<van-button type="default" @click="showView=!showView">附加视频</van-button>
</div>
<div class="field-content" v-show="showView">
<div class="upload-content">
<div class="uplaod-video" style="min-height: 60px">
<van-uploader
:max-count="3"
v-model="fileList"
accept="video/*"
multiple>
<div class="avatar-plus">
<span>+</span>
</div>
</van-uploader>
</div>
<div class="tips">
<img src="/images/applets/tip.png" alt="">
<span>最多支持上传3段视频,每段时长20s。</span>
</div>
</div>
</div>
<div class="add-btn">
<van-button type="default" @click="showImg=!showImg">附加照片</van-button>
</div>
<div class="field-content" v-show="showImg">
<div class="upload-content">
<div class="uplaod-video" style="min-height: 60px">
<van-uploader
:max-count="10"
accept="image/png, image/jpeg"
v-model="imgFileList"
multiple>
<div class="avatar-plus">
<span>+</span>
</div>
</van-uploader>
</div>
<div class="tips">
<img src="/images/applets/tip.png" alt="" >
<span>最多支持上传6张照片</span>
</div>
</div>
</div>
</div>
<div class="commit-page-button">
<van-button type="default" @click="onSubmit">提交</van-button>
</div>
</div>
</div>
</template>
<script>
export default {
data(){
return {
showView:false,
showImg:false,
baseInfo:[
{
label:'展板名称',
pla:'请输入展板名称',
value:'',
border:false,
},
{
label:'姓名',
pla:'请输入姓名',
value:'',
border:false,
},
{
label:'单位名称',
pla:'请输入所属组织单位',
value:'',
border:false,
}
],
date: '',
show: false,
cellIcon:'/images/applets/date.png',
fileList: [],
imgFileList:[],
fieldInfo:''
}
},
methods:{
onDisplay() {
this.show = true
},
onClose() {
this.show = false
},
formatDate(date) {
date = new Date(date);
return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;
},
onConfirm(event) {
this.show = false
this.date = this.formatDate(event)
},
onSubmit(){
this.$toast.success('提交成功');
}
}
}
</script>
<style lang="scss">
.commit-container{
width: 100%;
height: 100%;
max-width: 1024px;
.commit-bg{
width: 100%;
height: 100%;
margin: 0 auto;
background: #a4171d;
&:before{
display: inline-block;
content: "";
width: 100%;
height: 100%;
background: url('/images/applets/bg02.png') no-repeat;
background-size: 100% 100%;
}
&:after{
display: inline-block;
content: "";
width: 100%;
height: 328px;
background: url('/images/applets/bg_top.png') no-repeat;
background-size: 100% 100%;
position: absolute;
top: 0;
left: 0;
}
.page-title{
font-size: 18px;
color: #fff;
}
}
.commit-page{
width: 100vw;
height: 100vh;
position: absolute;
left: 0;
top: 0;
.commit-page-title{
font-size: 18px;
color: #fff;
text-align: center;
margin: 20px 0 20px 0;
}
}
.commit-page-content{
padding: 0 40px;
height: calc(100% - 200px);
overflow-y: auto;
.field-title{
margin: 40px 0 34px 0;
position: relative;
span{
color: #FFECB1;
font-size: 18px;
line-height: 20px;
&:before{
content: "";
width: 20px;
height: 2px;
border-radius: 1px;
display: inline-block;
background-image: linear-gradient(135deg, #FFF7E1 0%, #C4913E 100%);
position: absolute;
left: 0;
bottom: -10px;
}
}
.icon-upload{
width: 24px;
vertical-align: middle;
float: right;
}
}
.add-btn {
margin: 40px 0 34px 0;
.van-button--normal{
background-image: linear-gradient(135deg, #FFF7E1 0%, #C4913E 100%);
border-radius: 4px;
height: 40px;
width: 100%;
color: #250002;
border: none;
font-size: 16px;
}
}
}
.commit-page-button{
padding: 0 40px;
position: absolute;
bottom: 83px;
left: 0px;
box-sizing: border-box;
width: 100%;
.van-button--normal{
background-image: linear-gradient(135deg, #FFF7E1 0%, #C4913E 100%);
border-radius: 4px;
height: 40px;
width: 100%;
color: #250002;
border: none;
font-size: 16px;
}
}
.field-form-item.van-cell{
display: block;
padding: 10px 0 16px 0;
background-color: transparent;
border-bottom: 1px solid rgba(172,147,116,0.40);;
.van-field__label{
color: #fff;
font-size: 14px;
font-weight: normal;
margin-bottom: 14px;
}
.van-field__control{
color: #fff;
font-size: 14px;
font-weight: normal;
}
}
.field-textarea{
.van-field__control{
color: #fff;
font-size: 16px;
font-weight: normal;
}
}
.field-calendar{
position: relative;
margin-bottom: -20px;
.van-icon{
position: absolute;
width: 20px;
height: 20px;
right: 10px;
bottom: 29px;
z-index: 2;
}
.field-form-item{
border-bottom: none;
}
.van-cell:after{
display: none;
}
.van-cell__title{
font-size: 14px;
color: #fff;
}
.van-cell__value{
width: 100%;
height: 40px;
background: #8B0008;
margin-top: 16px;
font-size: 14px;
text-align: left;
color: #fff;
line-height: 40px;
padding: 0 20px;
box-sizing: border-box;
}
}
.upload-content{
.avatar-plus{
width: 48px;
height: 48px;
line-height: 48px;
text-align: center;
background-color: #8B0008;
border-radius: 1px;
font-size: 25px;
color: #FFECB1;
margin-bottom: 12px;
}
.tips{
img{
width: 12px;
height: 12px;
vertical-align: middle;
}
span{
margin-left: 4px;
color: #fff;
font-size: 12px;
vertical-align: middle;
}
}
}
.field-textarea{
margin-bottom: 30px;
background: #8B0008;
min-height: 80px
}
}
</style>
......@@ -2,10 +2,18 @@
<div class="admin-conatiner">
<Header title="管理员信息" />
<ul>
<li v-for="(item,index) in list" :key="index" @click="goDetail(item)">
<span>{{item.userName}}</span>
<img v-if="item.id===currentUserId" src="/images/applets/edit.png" alt />
<img v-if="item.id!==currentUserId" src="/images/applets/detail.png" alt />
<li v-for="(item, index) in list" :key="index" @click="goDetail(item)">
<span>{{ item.userName }}</span>
<img
v-if="item.id === currentUserId"
src="/images/applets/edit.png"
alt
/>
<img
v-if="item.id !== currentUserId"
src="/images/applets/detail.png"
alt
/>
</li>
</ul>
<my-tabbar active="2"></my-tabbar>
......@@ -19,7 +27,7 @@ export default {
data() {
return {
list: [],
currentUserId: JSON.parse(localStorage.getItem("userInfo")).id
currentUserId: JSON.parse(localStorage.getItem("userInfo")).id,
};
},
mounted() {
......@@ -32,21 +40,25 @@ export default {
let param = {
_index: 1,
_size: 10,
type: JSON.parse(localStorage.getItem("userInfo")).type
type: JSON.parse(localStorage.getItem("userInfo")).type,
};
vm.$https(
{
url: "tUser/getPageList",
method: "get",
authType: this.backToken
authType: this.backToken,
},
param
)
.then(res => {
.then((res) => {
if (res.data.resultCode === "200") {
let data = res.data.data;
vm.list = data.records;
} else {
this.$toast(res.data.message);
}
})
.catch(function(err) {
.catch(function (err) {
console.log(err);
});
},
......@@ -55,17 +67,17 @@ export default {
// 修改页面
this.$router.push({
path: "/adminInfo",
query: { id: item.id, disabled: false }
query: { id: item.id, disabled: false },
});
} else {
// 详情页面
this.$router.push({
path: "/adminInfo",
query: { id: item.id, disabled: true }
query: { id: item.id, disabled: true },
});
}
}
}
},
},
};
</script>
......@@ -73,7 +85,7 @@ export default {
.admin-conatiner {
width: 100%;
height: 100vh;
padding: 50px 16px 60px;
padding: 50px 24px 60px;
display: flex;
flex-direction: column;
box-sizing: border-box;
......
<template>
<div class="home">
<Header title="观影互动"/>
<Header title="观影互动" />
<div class="commit-container">
<van-tabs type="card" v-model="activeTab">
<van-tab title="观影互动">
<div class="commit-page">
<commit-tab @updateActive="updateActive"/>
<commit-tab @updateActive="updateActive" />
</div>
</van-tab>
<van-tab title="互动历史">
......@@ -20,58 +20,31 @@
</template>
<script>
import Header from '@/components/Header/index.vue'
import commitTab from './components/commitTab.vue'
import historyTab from './components/historyTab.vue'
import Header from "@/components/Header/index.vue";
import commitTab from "./components/commitTab.vue";
import historyTab from "./components/historyTab.vue";
export default {
components:{
components: {
Header,
commitTab,
historyTab
historyTab,
},
data() {
return {
activeTab: 1,
form: {},
cellIcon:'/images/applets/date.png',
cellIcon: "/images/applets/date.png",
show: false,
fileList: [],
imgFileList: []
imgFileList: [],
};
},
mounted() {},
methods: {
updateActive(active){
this.activeTab = active
updateActive(active) {
this.activeTab = active;
},
onOversize(file) {
console.log(file);
this.$toast("文件大小不能超过 500kb");
},
// 打开日历
onDisplay() {
this.show = true;
},
// 关闭日历
onClose() {
this.show = false;
},
// 确认日历
onConfirm(event) {
this.show = false;
this.form.studyTime = this.formatDate(event);
},
// 格式化日历
formatDate(date) {
date = new Date(date);
return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;
},
// 提交数据
onSubmit() {
console.log(this.form);
this.$toast.success("提交成功");
}
}
};
</script>
......@@ -79,32 +52,35 @@ export default {
.home {
width: 100%;
height: 100vh;
padding: 50px 16px 60px;
padding: 60px 16px;
display: flex;
flex-direction: column;
box-sizing: border-box;
.commit-container {
height: 100%;
/deep/.van-tabs--card>.van-tabs__wrap {
/deep/.van-tabs--card > .van-tabs__wrap {
height: 40px;
.van-tabs__nav {
background: rgba(164, 21, 29, 0.1);
}
.van-tabs__nav--card {
margin: 0;
height: 40px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border: 1px solid #A4151D;
border: 1px solid #a4151d;
.van-tab {
color: #A4151D;
border-right: 1px solid #A4151D;
color: #a4151d;
border-right: 1px solid #a4151d;
&.van-tab--active {
color: #fff;
background-color: #A4151D;
background-color: #a4151d;
}
&:last-child {
border-top-right-radius:8px;
border-top-right-radius: 8px;
}
&:first-child {
border-top-left-radius:8px;
border-top-left-radius: 8px;
}
}
}
......
<template>
<div class="admin-detail-content">
<Header title="管理员详情"/>
<Header title="管理员详情" />
<div class="input-box">
<van-field
label="管理员姓名"
......@@ -49,93 +49,95 @@
</template>
<script>
import Header from '@/components/Header/index.vue'
import Header from "@/components/Header/index.vue";
export default {
components:{Header},
components: { Header },
data() {
return {
disabled: false,
form: {}
form: {},
};
},
mounted() {
this.adminId = this.$route.query.id;
// 查询管理员信息
if (this.$route.query.disabled === "true") {
console.log("查看");
this.disabled = true;
this.disabled = true
// 新增
} else {
// 修改
console.log("修改");
this.disabled = false;
this.disabled = false
}
this.getUserInfo()
this.getUserInfo();
},
methods: {
getUserInfo(){
let vm = this;
getUserInfo() {
let vm = this
let param = {
id:this.adminId
id: this.adminId,
};
vm.$https(
{
url: "tUser/getById",
method: "get",
authType: this.backToken
},param)
.then(res => {
if(res.data.resultCode==='200'){
this.form = res.data.data;
console.log(this.form)
}else{
authType: this.backToken,
},
param
)
.then((res) => {
if (res.data.resultCode === "200") {
this.form = res.data.data
} else {
this.$toast(res.data.message)
}
})
.catch(function(err) {
.catch(function (err) {
console.log(err);
});
},
onCancel() {
this.$router.go(-1);
this.$router.go(-1)
},
// 提交数据
onSubmit() {
console.log(this.form);
let vm = this;
let param = {};
console.log(this.form)
let vm = this
let param = {}
for (let key in this.form) {
if (this.form[key]) {
param[key] = this.form[key];
}
}
console.log(param)
vm.$https(
{
url: "tUser/update",
method: "put",
authType: this.backToken
},param)
.then(res => {
if(res.data.resultCode==='200'){
authType: this.backToken,
},
param
)
.then((res) => {
if (res.data.resultCode === "200") {
this.form = res.data.data;
this.$toast.success("信息修改成功");
this.$router.replace('/admin')
}else{
this.$toast(res.data.message)
this.$router.replace({
path: "/success",
query: { txt: "信息修改成功", url: "/admin" },
});
} else {
this.$toast(res.data.message);
}
})
.catch(function(err) {
.catch(function (err) {
console.log(err);
});
}
}
},
},
};
</script>
<style lang="scss" scoped>
.admin-detail-content {
padding: 50px 16px 0;
padding: 50px 24px 0;
// height: calc(100% - 150px);
overflow-y: auto;
.input-box {
......@@ -151,7 +153,7 @@ export default {
}
}
.admin-detail-button {
padding: 0 40px;
padding: 0 24px;
box-sizing: border-box;
width: 100%;
margin: 0 auto;
......@@ -175,12 +177,11 @@ export default {
color: #b40011;
}
}
.cancel {
.van-button--normal{
.cancel {
.van-button--normal {
width: 100%;
}
}
}
.van-field__control,
.van-cell__value {
color: #333;
......
......@@ -110,6 +110,7 @@
v-model="imgFileList"
multiple
:after-read="uploadImg"
:before-delete="deleteImg"
>
<div class="avatar-plus">
<span>+</span>
......@@ -177,7 +178,6 @@ export default {
})
.then((res) => {
if (res.data.resultCode === "200") {
console.log(res.data.data);
vm.boardList = res.data.data;
vm.boardNameList = res.data.data.map((item) => item.name);
}
......@@ -186,6 +186,7 @@ export default {
console.log(err);
});
},
// 下拉框确认按钮
onConfirmBoard(value, index) {
this.form.boardName = value;
this.form.boardId = this.boardList[index].id;
......@@ -257,10 +258,13 @@ export default {
}
return `${value}分`;
},
// 上传图片
uploadImg(file) {
let vm = this;
// if(Array.isArray(file)){}
const param = new FormData();
param.append("file", file.file);
console.log(file)
vm.$https(
{
url: "file/image/upload",
......@@ -270,12 +274,17 @@ export default {
param
)
.then((res) => {
this.form.images.push(res.data.url);
if(res.data.resultCode==='200'){
this.form.images.push(res.data.data.url);
}else{
this.$toast(res.data.message)
}
})
.catch(function (err) {
console.log(err);
});
},
// 上传视频
uploadVideo(file) {
let vm = this;
const param = new FormData();
......@@ -289,12 +298,21 @@ export default {
param
)
.then((res) => {
this.form.videos.push(...res.data.urlList);
if(res.data.resultCode==='200'){
this.form.videos.push(...res.data.data.urlList);
}else{
this.$toast(res.data.message)
}
})
.catch(function (err) {
console.log(err);
});
},
deleteImg(file,detail){
this.form.images.splice(detail.index,1)
return true
},
// 提交数据
onSubmit() {
let vm = this;
......@@ -318,15 +336,13 @@ export default {
)
.then((res) => {
if (res.data.resultCode === "200") {
this.$toast.success("提交成功");
// this.$emit('updateActive',1)
this.$router.replace("/success");
this.$router.replace({path:"/success",query:{txt:'提交成功',url:'/commit'}})
} else {
this.$toast(res.data.message);
this.$toast(res.data.message)
}
})
.catch(function (err) {
console.log(err);
console.log(err)
});
},
},
......@@ -335,7 +351,7 @@ export default {
<style lang="scss" scoped>
.commit-page-content {
padding: 24px 12px;
padding: 24px 20px;
height: calc(100% - 200px);
overflow-y: auto;
.field-title {
......@@ -345,7 +361,6 @@ export default {
color: #333;
font-size: 16px;
line-height: 20px;
padding-left: 16px;
&:before {
content: "";
height: 16px;
......@@ -354,7 +369,7 @@ export default {
display: inline-block;
background: #a4151d;
position: absolute;
left: 0;
left: -20px;
top: 2px;
}
}
......@@ -405,6 +420,7 @@ export default {
/deep/.field-textarea {
min-height: 80px;
padding: 0;
.van-field__value {
background-color: #f5f5f5;
}
......
......@@ -21,23 +21,29 @@
@load="onLoad"
offset="50"
>
<van-cell v-for="(item,index) in tableData" :key="index">
<van-cell v-for="(item, index) in tableData" :key="index">
<van-swipe-cell :stop-propagation="true">
<van-card :title="item.name" :thumb="item.cover" @click="goDetail(item)"/>
<van-card
:title="item.name"
:thumb="item.cover"
@click="goDetail(item)"
/>
<template #right>
<van-button
@click="optFn(item)"
square
:text="active?'启用':'删除'"
:text="active ? '启用' : '删除'"
type="danger"
:class="{'delete-button':active===0,'enable-button':active===1}"
:class="{
'delete-button': active === 0,
'enable-button': active === 1,
}"
/>
</template>
</van-swipe-cell>
</van-cell>
</van-list>
</van-pull-refresh>
</div>
</div>
</div>
......@@ -45,67 +51,69 @@
<script>
export default {
props: ["active","proId"],
props: ["active", "proId"],
data() {
return {
searchVal:"",
searchVal: "",
pageNum: 1,
pageSize: 8,
tableData:[],
tableData: [],
loading: false,
finished: false,
refreshing: false,
flag:true,
flag: true,
};
},
watch:{
"active"(val,oldVal){
this.onRefresh()
}
watch: {
active() {
this.onRefresh();
},
},
mounted() {
this.getList()
this.getList();
},
methods: {
// 获得数据接口
getList() {
let vm = this;
let param = {
_index:this.pageNum,
_size:this.pageSize,
isPublished: this.active!==1,
learningProjectId:this.proId,
nameOrCode: this.searchVal
_index: this.pageNum,
_size: this.pageSize,
isPublished: this.active !== 1,
learningProjectId: this.proId,
nameOrCode: this.searchVal,
};
vm.$https(
{
url: "learningContent/getPageList",
method: "post",
authType: this.backToken
authType: this.backToken,
},
vm.$qs.stringify(param)
).then(res => {
if(res.data.resultCode==='200'){
vm.loading = false
)
.then((res) => {
if (res.data.resultCode === "200") {
vm.loading = false;
let data = res.data.data;
vm.tableData = vm.flag ? data.records :vm.tableData.concat(data.records)
vm.flag = false
vm.tableData = vm.flag
? data.records
: vm.tableData.concat(data.records);
vm.flag = false;
vm.refreshing = false;
vm.pageNum = vm.pageNum + 1
vm.finished = data.records.length < vm.pageSize ? true : false
vm.tableData = [...vm.tableData]
}else{
vm.$message({type:'error',message:res.data.message})
vm.pageNum = vm.pageNum + 1;
vm.finished = data.records.length < vm.pageSize;
vm.tableData = [...vm.tableData];
} else {
vm.$toast( res.data.message );
}
})
.catch(function(err) {
.catch(function (err) {
console.log(err);
})
});
},
// 列表的load上拉加载事件
onLoad() {
if(!this.flag){
if (!this.flag) {
console.log("加载数据");
this.loading = true;
this.flag = false;
......@@ -122,47 +130,49 @@ export default {
},
optFn(item) {
if (this.active === 1) {
this.changeStatus(true,item.id)
this.changeStatus(true, item.id);
} else {
this.changeStatus(false,item.id)
this.changeStatus(false, item.id);
}
},
// 启用 禁用
changeStatus(flag,id){
changeStatus(flag, id) {
let vm = this;
let param = {
id:id,
isPublish:flag
id: id,
isPublish: flag,
};
vm.$https(
{
url: `learningContent/enable/${id}`,
method: "put",
authType: this.backToken
},vm.$qs.stringify(param))
.then(res => {
if(res.data.resultCode==='200'){
this.$toast(res.data.message)
this.onRefresh()
}else{
this.$toast(res.data.message)
authType: this.backToken,
},
vm.$qs.stringify(param)
)
.then((res) => {
if (res.data.resultCode === "200") {
this.$toast(res.data.message);
this.onRefresh();
} else {
this.$toast(res.data.message);
}
})
.catch(function(err) {
.catch(function (err) {
console.log(err);
});
},
goDetail(item) {
this.$router.push({path:'/learnDetail',query:{id:item.id}})
}
}
this.$router.push({ path: "/learnDetail", query: { id: item.id } });
},
},
};
</script>
<style lang="scss" scoped>
.learn-detail-content {
height: calc(100vh - 100px);
.page-wrapper{
.page-wrapper {
height: 100%;
}
.van-search {
......
......@@ -127,7 +127,7 @@ export default {
vm.finished = data.records.length < vm.pageSize ? true : false
vm.tableData = [...vm.tableData]
}else{
vm.$message({type:'error',message:res.data.message})
vm.$toast(res.data.message)
}
})
......@@ -158,7 +158,7 @@ export default {
<style lang="scss" scoped>
.history-page-content {
padding: 24px 12px;
padding: 24px 0px;
height: calc(100% - 200px);
overflow-y: auto;
.van-pull-refresh {
......@@ -168,12 +168,15 @@ export default {
padding-left: 0;
padding-right: 0;
}
/deep/.van-collapse-item__title {
font-size: 16px;
}
.van-hairline--top-bottom::after {
border-width: 0;
}
.field-title {
position: relative;
// padding-bottom: 20px;
font-size: 16px;
span {
color: #333;
font-size: 16px;
......@@ -193,6 +196,7 @@ export default {
}
.author {
float: right;
margin-right: 20px;
}
.content {
.learn-title {
......
<template>
<div class="learn-content-container">
<Header title="学习内容"/>
<Header title="学习内容" />
<div class="content">
<van-tabs type="card" v-model="activeTab">
<van-tab title="启用列表">
<content-tab :active="activeTab" :proId="proId"/>
<content-tab :active="activeTab" :proId="proId" />
</van-tab>
<van-tab title="禁用列表">
<content-tab :active="activeTab" :proId="proId"/>
<content-tab :active="activeTab" :proId="proId" />
</van-tab>
</van-tabs>
</div>
</div>
</template>
<script>
import contentTab from './contentTab.vue'
import Header from '@/components/Header/index.vue'
import contentTab from "./contentTab.vue";
import Header from "@/components/Header/index.vue";
export default {
components:{Header,contentTab},
components: { Header, contentTab },
data() {
return {
activeTab: 0,
proId:''
proId: "",
};
},
mounted() {
this.proId = this.$route.query.id;
},
methods: {
}
methods: {},
};
</script>
......@@ -38,13 +36,16 @@ export default {
.learn-content-container {
width: 100%;
height: 100vh;
padding: 50px 16px 16px;
padding: 60px 16px 16px;
box-sizing: border-box;
.content {
height: calc(100vh - 66px);
}
/deep/.van-tabs--card > .van-tabs__wrap {
height: 40px;
.van-tabs__nav {
background: rgba(164, 21, 29, 0.1);
}
.van-tabs__nav--card {
margin: 0;
height: 40px;
......
<template>
<div class="learn-detail-page-content">
<Header title="学习内容详情"/>
<Header title="学习内容详情" />
<div class="page-wrapper">
<div class="title-content">
<div class="row-body">
<div class="title-label">学习内容名称</div>
<div class="title-body">{{list.name}}</div>
<div class="title-body">{{ list.name }}</div>
</div>
<div class="row-body">
<div class="title-label">学习内容宣传图</div>
<div class="title-body">
<img :src="list.cover" alt="">
<img :src="list.cover" alt="" />
</div>
</div>
</div>
<van-collapse v-model="activeNames" accordion>
<van-collapse-item :name="item.id" :title="item.name" v-for="(item,index) in list.exhibitionBoardList" :key="index">
<van-collapse-item
:name="item.id"
:title="item.name"
v-for="(item, index) in list.exhibitionBoardList"
:key="index"
>
<div class="content">
<div class="row-body">
<div class="title-label">展板版权方</div>
<div class="title-body">{{item.assetCopyrightOwnerName}}</div>
<div class="title-body">{{ item.assetCopyrightOwnerName }}</div>
</div>
<div class="row-body">
<div class="title-label">展板宣传图</div>
<div class="title-body">
<img :src="item.cover" alt="">
<img :src="item.cover" alt="" />
</div>
</div>
<div class="detail-body">
<div class="learn-title">展板简介</div>
<div class="learn-body textarea">
{{item.remarks}}
{{ item.remarks }}
</div>
</div>
<div class="detail-body">
<div class="learn-title">展板视频</div>
<div class="learn-body">
<span class="file-box" v-for="(s,i) in item.videoUrl" :key="i">
<video controls width='100%' height='100%' poster="images/applets/video.png">
<span class="file-box" v-for="(s, i) in item.videoUrl" :key="i">
<video
controls
width="100%"
height="100%"
poster="images/applets/video.png"
>
<source :src="s.fileUrl" />
</video>
<span>{{s.fileName}}</span>
<span>{{ s.fileName }}</span>
</span>
</div>
</div>
<div class="detail-body">
<div class="learn-title">展板音频</div>
<div class="learn-body">
<span class="file-box" v-for="(s,i) in item.guideAudioUrl" :key="i">
<audio controls width='100%' height='100%' poster="images/applets/audio.png">
<span
class="file-box"
v-for="(s, i) in item.guideAudioUrl"
:key="i"
>
<audio
controls
width="100%"
height="100%"
poster="images/applets/audio.png"
>
<source :src="s.fileUrl" />
</audio>
<span>{{s.fileName}}</span>
<span>{{ s.fileName }}</span>
</span>
</div>
</div>
......@@ -65,49 +83,51 @@
</template>
<script>
import Header from '@/components/Header/index.vue'
import Header from "@/components/Header/index.vue";
export default {
components:{Header},
components: { Header },
data() {
return {
activeNames: [],
list:[]
list: [],
};
},
mounted() {
this.id = this.$route.query.id;
this.getContentInfo()
this.getContentInfo();
},
methods: {
// 获取详情
getContentInfo(){
getContentInfo() {
let vm = this;
let param = {
id:this.id
id: this.id,
};
vm.$https(
{
url: `learningContent/get/${this.id}`,
method: "get",
authType: this.backToken
},param)
.then(res => {
if(res.data.resultCode==='200'){
authType: this.backToken,
},
param
)
.then((res) => {
if (res.data.resultCode === "200") {
this.list = res.data.data;
this.activeNames = this.list.exhibitionBoardList[0].id
this.list.exhibitionBoardList.forEach(item=>{
item.videoUrl =JSON.parse(item.videoUrl)
item.guideAudioUrl =JSON.parse(item.guideAudioUrl)
})
}else{
this.$toast(res.data.message)
this.activeNames = this.list.exhibitionBoardList[0].id;
this.list.exhibitionBoardList.forEach((item) => {
item.videoUrl = JSON.parse(item.videoUrl);
item.guideAudioUrl = JSON.parse(item.guideAudioUrl);
});
} else {
this.$toast(res.data.message);
}
})
.catch(function(err) {
.catch(function (err) {
console.log(err);
});
},
}
},
};
</script>
......@@ -161,7 +181,7 @@ export default {
.detail-body {
margin-bottom: 20px;
.learn-body{
.learn-body {
display: flex;
flex-wrap: wrap;
padding-bottom: 12px;
......@@ -183,7 +203,6 @@ export default {
color: #333;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="edit-psd-conatiner">
<Header title="修改密码"/>
<Header title="修改密码" />
<div class="edit-container">
<van-form @submit="onSubmit">
<div class="input-box">
......@@ -17,7 +17,7 @@
v-model="form.oldPassWord"
placeholder="请输入当前密码"
input-align="right"
:rules="[{ required: true}]"
:rules="[{ required: true }]"
/>
<van-field
label="新密码"
......@@ -25,18 +25,18 @@
v-model="form.password"
placeholder="请输入新密码"
input-align="right"
:rules="[{ required: true}]"
:rules="[{ required: true }]"
/>
<van-field
label="再次输入新密码"
v-model="form.againPsd"
placeholder="请再次输入新密码"
input-align="right"
:rules="[{ required: true}]"
:rules="[{ required: true }]"
/>
</div>
<div class="admin-detail-button">
<van-button type="default" plain native-type="button" @click="onCancle">取消</van-button>
<!-- <van-button type="default" plain native-type="button" @click="onCancle">取消</van-button> -->
<van-button type="default" native-type="submit">提交</van-button>
</div>
</van-form>
......@@ -46,14 +46,14 @@
</template>
<script>
import Header from '@/components/Header/index.vue'
import Header from "@/components/Header/index.vue";
export default {
components:{Header},
components: { Header },
data() {
return {
form: {
username:JSON.parse(localStorage.getItem('userInfo')).userName
}
username: JSON.parse(localStorage.getItem("userInfo")).userName,
},
};
},
mounted() {
......@@ -61,15 +61,15 @@ export default {
},
methods: {
onCancle() {
this.form ={
username:JSON.parse(localStorage.getItem('userInfo')).userName
}
this.form = {
username: JSON.parse(localStorage.getItem("userInfo")).userName,
};
},
// 提交数据
onSubmit() {
if(this.form.password !== this.form.againPsd){
this.$toast('两次输入的密码不一致')
return false
if (this.form.password !== this.form.againPsd) {
this.$toast("两次输入的密码不一致");
return false;
}
let vm = this;
let param = {
......@@ -80,28 +80,30 @@ export default {
{
url: "tUser/editPwd",
method: "put",
authType: this.backToken
authType: this.backToken,
},
vm.$qs.stringify(param)
)
.then(res => {
if(res.data.resultCode==='200'){
localStorage.removeItem('token')
localStorage.removeItem('userInfo')
this.$toast.success("密码已修改,请用新密码重新登录系统");
this.$router.replace('/login')
}else{
.then((res) => {
if (res.data.resultCode === "200") {
localStorage.removeItem("token");
localStorage.removeItem("userInfo");
this.$router.replace({
path: "/success",
query: {
txt: "密码已修改,请用新密码重新登录系统",
url: "/login",
},
});
} else {
this.$toast(res.data.message);
}
})
.catch(function(err) {
.catch(function (err) {
console.log(err);
});
}
}
},
},
};
</script>
......@@ -109,12 +111,11 @@ export default {
.edit-psd-conatiner {
width: 100%;
height: 100vh;
padding: 50px 16px 60px;
padding: 50px 24px 60px;
display: flex;
flex-direction: column;
box-sizing: border-box;
.edit-container {
}
.input-box {
......@@ -130,16 +131,17 @@ export default {
}
}
.admin-detail-button {
padding: 0 40px;
padding: 0 24px;
box-sizing: border-box;
width: 100%;
margin: 0 auto;
text-align: center;
.van-button--normal {
background: #a4151d;
border-radius: 4px;
height: 40px;
width: 45%;
width: 100%;
color: #fff;
border: none;
font-size: 16px;
......
......@@ -9,8 +9,12 @@
@load="onLoad"
offset="5"
>
<van-cell v-for="(item,index) in list" :key="index" @click="goDetail(item)">
<span>{{item.name}}</span>
<van-cell
v-for="(item, index) in list"
:key="index"
@click="goDetail(item)"
>
<span>{{ item.name }}</span>
<img src="/images/applets/coming.png" alt />
</van-cell>
</van-list>
......@@ -29,7 +33,7 @@ export default {
finished: false,
pageNum: 1,
pageSize: 10,
flag:true,
flag: true,
list: [],
refreshing: false,
};
......@@ -44,32 +48,36 @@ export default {
let param = {
_index: this.pageNum,
_size: this.pageSize,
type: JSON.parse(localStorage.getItem("userInfo")).type
type: JSON.parse(localStorage.getItem("userInfo")).type,
};
vm.$https(
{
url: "learningProject/getPageList",
method: "post",
authType: this.backToken
authType: this.backToken,
},
vm.$qs.stringify(param)
)
.then(res => {
.then((res) => {
if (res.data.resultCode === "200") {
let data = res.data.data;
this.loading = false
vm.list = this.flag ? data.records : vm.list.concat(data.records)
this.pageNum = this.pageNum + 1
this.finished = data.records.length < this.pageSize ? true : false
this.loading = false;
vm.list = this.flag ? data.records : vm.list.concat(data.records);
this.pageNum = this.pageNum + 1;
this.finished = data.records.length < this.pageSize;
this.flag = false;
this.refreshing = false;
} else {
this.$toast(res.data.message);
}
})
.catch(function(err) {
.catch(function (err) {
console.log(err);
});
},
// 列表的load上拉加载事件
onLoad() {
if(!this.flag){
if (!this.flag) {
console.log("加载数据");
this.loading = true;
this.flag = false;
......@@ -81,13 +89,13 @@ export default {
this.finished = false;
this.flag = true;
this.loading = true;
this.pageNum =1;
this.pageNum = 1;
this.getList();
},
goDetail(item) {
this.$router.push({ path: "/learnContent", query: { id: item.id } });
}
}
},
},
};
</script>
......@@ -100,7 +108,8 @@ export default {
flex-direction: column;
box-sizing: border-box;
.van-pull-refresh {
overflow-y:auto;
overflow-y: auto;
padding: 0 8px;
}
.van-cell {
padding: 0;
......
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