Commit 4b5e3864 by hank

bug

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