Commit 4b5e3864 by hank

bug

parent 23fe7361
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
<div class="content"> <div class="content">
<div class="content-left"> <div class="content-left">
<div class="content-left-top"> <div class="content-left-top">
<van-button size="mini" @click="createPage(currentPage)">新增此页</van-button>
<van-button size="mini" @click="deletePage(currentPage)">删除此页</van-button>
<van-button size="mini" @click="pageShow">页面排序</van-button>
<van-button size="mini" @click="preview">预览</van-button>
<!-- <div class="top-right"> <!-- <div class="top-right">
<span class="im">*</span> <span class="im">*</span>
视片名称: 视片名称:
...@@ -25,7 +29,7 @@ ...@@ -25,7 +29,7 @@
scrolling="no" scrolling="no"
style="height:70vw;width: 100vw;" style="height:70vw;width: 100vw;"
:style=" :style="
templateData.templateShow === 'VERTICAL' ? 'height:130vw;' : 'height:70vw;' templateData.templateShow === 'VERTICAL' ? 'height:130vw;' : 'height:60vw;'
" "
v-show="!isPreview" v-show="!isPreview"
@load="setList" @load="setList"
...@@ -50,9 +54,9 @@ ...@@ -50,9 +54,9 @@
</slider> </slider>
<div class="page-manage-right"> <div class="page-manage-right">
<div>{{templateData.listData.length}}</div> <div>{{templateData.listData.length}}</div>
<div class="page-manage"> <!-- <div class="page-manage">
<span @click="pageShow">去管理</span> <span @click="pageShow">去管理</span>
</div> </div>-->
</div> </div>
</div> </div>
<div class="content-right"> <div class="content-right">
...@@ -71,8 +75,9 @@ ...@@ -71,8 +75,9 @@
</div> </div>
</div> </div>
<div class="createBtn"> <div class="createBtn">
<van-button type="info" @click="preview">预览视片</van-button> <van-button type="info" @click="enterSubmit" v-show="!templateData.filmId">下一步</van-button>
<van-button type="info" @click="enterSubmit">更新并同步到设备</van-button> <van-button type="info" @click="enterSubmit" v-show="templateData.filmId">更新并同步</van-button>
<van-button type="info" @click="navToWx" v-show="templateData.filmId">选择设备</van-button>
</div> </div>
<van-popup v-model="show" position="bottom"> <van-popup v-model="show" position="bottom">
<div class="pub-container"> <div class="pub-container">
...@@ -116,7 +121,7 @@ ...@@ -116,7 +121,7 @@
<span @click="pageViews=false">关闭</span> <span @click="pageViews=false">关闭</span>
</div> </div>
</van-nav-bar> </van-nav-bar>
<div class="page-default-list"> <!-- <div class="page-default-list">
<div class="tips">选择页面并拖拽至下方:</div> <div class="tips">选择页面并拖拽至下方:</div>
<div class="list-over"> <div class="list-over">
<draggable <draggable
...@@ -137,7 +142,7 @@ ...@@ -137,7 +142,7 @@
</div> </div>
</draggable> </draggable>
</div> </div>
</div> </div>-->
<div class="page-count">视片页面,共{{templateData.listData.length}}页:</div> <div class="page-count">视片页面,共{{templateData.listData.length}}页:</div>
<div class="page-list"> <div class="page-list">
<draggable <draggable
...@@ -261,6 +266,7 @@ export default { ...@@ -261,6 +266,7 @@ export default {
); );
if (this.$route.query.filmId) { if (this.$route.query.filmId) {
this.mode = "film"; this.mode = "film";
this.templateData.filmId = this.$route.query.filmId;
this.getFilmDetail(); this.getFilmDetail();
} }
if (this.$route.query.templateId) { if (this.$route.query.templateId) {
...@@ -347,6 +353,10 @@ export default { ...@@ -347,6 +353,10 @@ export default {
this.pageViews = false; this.pageViews = false;
}, },
deletePage(index) { deletePage(index) {
if (this.templateData.listData.length < 2) {
this.$toast.fail("至少存留一页");
return false;
}
this.$toast.loading({ this.$toast.loading({
mask: true, mask: true,
message: "删除中..." message: "删除中..."
...@@ -361,6 +371,10 @@ export default { ...@@ -361,6 +371,10 @@ export default {
pages: this.templateData.listData pages: this.templateData.listData
}); });
this.$toast.success("删除成功"); this.$toast.success("删除成功");
if (this.templateData.listData.length <= this.currentPage) {
this.goPage(this.templateData.listData.length - 1);
alert(this.templateData.listData.length)
}
}, 1000); }, 1000);
}, },
valueChange() { valueChange() {
...@@ -502,7 +516,8 @@ export default { ...@@ -502,7 +516,8 @@ export default {
return; return;
} }
if (this.mode === "film" || window.sessionStorage.getItem("filmId")) { if (this.mode === "film" || window.sessionStorage.getItem("filmId")) {
const filmId = this.$route.query.filmId || window.sessionStorage.getItem("filmId") const filmId =
this.$route.query.filmId || window.sessionStorage.getItem("filmId");
updateFilmInfo( updateFilmInfo(
filmId, filmId,
JSON.stringify({ JSON.stringify({
...@@ -515,7 +530,7 @@ export default { ...@@ -515,7 +530,7 @@ export default {
this.show = false; this.show = false;
this.$toast.success("更新成功"); this.$toast.success("更新成功");
// window.sessionStorage.setItem("filmId"); // window.sessionStorage.setItem("filmId");
this.navToWx(filmId) // this.navToWx(filmId);
// this.$router.back(); // this.$router.back();
}); });
} else { } else {
...@@ -534,15 +549,25 @@ export default { ...@@ -534,15 +549,25 @@ export default {
filmDescribe: this.templateData.filmDescribe filmDescribe: this.templateData.filmDescribe
}).then(res => { }).then(res => {
window.sessionStorage.setItem("filmId", res.data.data); window.sessionStorage.setItem("filmId", res.data.data);
this.templateData.filmId = res.data.data;
this.navToWx(res.data.data); this.navToWx(res.data.data);
}); });
} }
}, },
navToWx(filmId) { navToWx(fId) {
const filmId =
this.$route.query.filmId ||
window.sessionStorage.getItem("filmId") ||
fId;
window.wx.miniProgram.navigateTo({ window.wx.miniProgram.navigateTo({
url: `/pages/home/film/schedule_add/components/device/index?fId=${filmId}` url: `/pages/home/film/schedule_add/components/device/index?fId=${filmId}`
}); });
}, },
getFilmId() {
const filmId =
this.$route.query.filmId || window.sessionStorage.getItem("filmId");
return filmId;
},
enterSubmit() { enterSubmit() {
this.message({ this.message({
type: "getList" type: "getList"
...@@ -669,7 +694,7 @@ export default { ...@@ -669,7 +694,7 @@ export default {
} }
} }
.content-left { .content-left {
padding-top: 20px; padding-top: 10px;
flex: 1; flex: 1;
// padding: 40px 40px 0 30px; // padding: 40px 40px 0 30px;
background: #eeeeee; background: #eeeeee;
...@@ -681,6 +706,7 @@ export default { ...@@ -681,6 +706,7 @@ export default {
font-size: 21px; font-size: 21px;
color: #333333; color: #333333;
justify-content: space-between; justify-content: space-between;
padding: 0 10px;
.top-left { .top-left {
display: flex; display: flex;
.left-item { .left-item {
...@@ -893,7 +919,7 @@ export default { ...@@ -893,7 +919,7 @@ export default {
line-height: 60px; line-height: 60px;
} }
} }
padding-bottom: 70px; padding-bottom: 50px;
.createBtn { .createBtn {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
...@@ -904,9 +930,11 @@ export default { ...@@ -904,9 +930,11 @@ export default {
justify-content: space-between; justify-content: space-between;
background: white; background: white;
box-sizing: border-box; box-sizing: border-box;
padding: 0 5%;
.van-button { .van-button {
width: 45%; width: 50%;
border: none;
outline: none;
background-color: #179b16;
} }
} }
} }
......
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 sign in to comment