优化部分样式问题,新增部分功能,解决发现的bug,暂未完全测试通过。

This commit is contained in:
lemon橪
2021-06-10 18:31:54 +08:00
parent 8b3d19625f
commit c9ea7ba898
30 changed files with 1143 additions and 1131 deletions

View File

@@ -3,13 +3,7 @@
<div class="model-title">
<div>店铺装修</div>
<div class="btns">
<Button
@click="clickBtn(item)"
size="small"
v-for="(item, index) in way"
:key="index"
:type="item.selected ? 'primary' : ''"
>
<Button @click="clickBtn(item)" size="small" v-for="(item, index) in way" :key="index" :type="item.selected ? 'primary' : ''">
{{ item.title }}
</Button>
</div>
@@ -21,17 +15,9 @@
<div ref="qrCodeUrl"></div>
</div>
</Poptip>
<Button size="default" type="primary" @click="handleSpinShow"
>保存模板</Button
>
<Button size="default" type="primary" @click="handleSpinShow">保存模板</Button>
<Modal
title="保存中"
v-model="saveDialog"
:closable="true"
:mask-closable="false"
:footer-hide="true"
>
<Modal title="保存中" v-model="saveDialog" :closable="true" :mask-closable="false" :footer-hide="true">
<div v-if="progress">
<div class="model-item">
模板名称 <Input style="width: 200px" v-model="submitWay.name" />
@@ -61,7 +47,8 @@ export default {
progress: true, // 展示进度
num: 20, // 提交进度
saveDialog: false, // 加载状态
way: [ // 装修tab栏切换
way: [
// 装修tab栏切换
{
title: "首页",
name: "index",
@@ -80,7 +67,8 @@ export default {
},
],
qrcode: "", // 二维码
submitWay: { // 表单信息
submitWay: {
// 表单信息
pageShow: this.$route.query.type || false,
name: this.$route.query.name || "模板名称",
pageClientType: "H5",
@@ -124,11 +112,13 @@ export default {
// 更新
update() {
this.progress = false;
this.progress = false;
API_Other.updateHome(this.$route.query.id, {
pageData: JSON.stringify(this.$store.state.styleStore),
name: this.submitWay.name,
pageShow: this.submitWay.pageShow,
pageType: "INDEX",
pageClientType: "H5",
})
.then((res) => {
this.num = 50;
@@ -171,7 +161,7 @@ export default {
this.goback();
}, 1000);
} else {
this.progress = true;
this.progress = true;
this.saveDialog = false;
this.$Message.error("保存失败,请稍后重试");
}

View File

@@ -1,6 +1,6 @@
.image-mode {
max-width: 100%;
height: auto;
width: 100%;
height: 100%;
display: block;
padding: 1px;
}

View File

@@ -1,11 +1,11 @@
<template>
<div class="layout">
<img class="image-mode" :src="res.list[0].img" alt="">
<img class="image-mode" :src="res.list[1].img" alt="">
<img class="image-mode" :src="res.list[2].img" alt="">
<img class="image-mode" :src="res.list[3].img" alt="">
<img class="image-mode" :src="res.list[4].img" alt="">
<img class="image-mode" :src="res.list[0].img" alt="">
<img class="image-mode" :src="res.list[1].img" alt="">
<img class="image-mode" :src="res.list[2].img" alt="">
<img class="image-mode" :src="res.list[3].img" alt="">
<img class="image-mode" :src="res.list[4].img" alt="">
</div>
</template>
@@ -13,21 +13,18 @@
export default {
title: "五列单行图片模块",
props: ["res"],
mounted() {
console.log(this.res);
}
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.layout {
background: #e8e8e8;
display: flex;
align-items: center;
justify-content: center;
background-size: cover;
}
img{
img {
width: 67px;
}
</style>
</style>

View File

@@ -12,21 +12,22 @@
export default {
title: "四列单行图片模块",
props: ["res"],
mounted() {
console.log(this.res);
}
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.layout {
height: 84px;
// background: #e8e8e8;
// height: 84px;
display: flex;
padding: 0 8px;
align-items: center;
justify-content: center;
background-size: cover;
}
img{
width: 84px;
}
</style>
</style>

View File

@@ -11,14 +11,12 @@
export default {
title: "三列单行图片模块",
props: ["res"],
mounted() {
console.log(this.res);
}
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.layout {
background: #e8e8e8;
height: 110px;
display: flex;
align-items: center;
@@ -28,4 +26,4 @@ export default {
img{
width: 111px;
}
</style>
</style>

View File

@@ -20,7 +20,7 @@ export default {
title: "左一右二",
props: ["res"],
mounted() {
console.log(this.res);
}
};
</script>
@@ -34,4 +34,4 @@ export default {
background-size: cover;
}
</style>
</style>

View File

@@ -10,7 +10,7 @@
</div>
</div>
<div class="view-height-150">
<img class="image-mode" :src="res.list[2].img" />
<img class="image-mode" style="height:150px;" :src="res.list[2].img" />
</div>
</div>
</template>
@@ -21,18 +21,22 @@ export default {
props: ["res"],
mounted() {
console.log(this.res);
}
},
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.layout {
height: 167px;
height: 150px;
display: flex;
align-items: center;
justify-content: center;
background-size: cover;
}
</style>
.view-height-75 {
.image-mode {
height: 75px;
}
}
</style>

View File

@@ -23,12 +23,7 @@
</Row>
<!-- 拼图验证码 -->
<verify
ref="verify"
class="verify-con"
verifyType="LOGIN"
@change="verifyChange"
></verify>
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
<div v-if="socialLogining">
<RectLoading />
</div>
@@ -48,7 +43,7 @@ import LangSwitch from "@/views/main-components/lang-switch";
import RectLoading from "@/views/my-components/lili/rect-loading";
import CountDownButton from "@/views/my-components/lili/count-down-button";
import util from "@/libs/util.js";
import verify from '@/views/my-components/verify';
import verify from "@/views/my-components/verify";
export default {
components: {
@@ -57,18 +52,20 @@ export default {
LangSwitch,
Header,
Footer,
verify
verify,
},
data() {
return {
loading: false, // 加载状态
form: { // 表单数据
form: {
// 表单数据
username: "",
password: "",
mobile: "",
code: "",
},
rules: { // 验证规则
rules: {
// 验证规则
username: [
{
required: true,
@@ -88,7 +85,8 @@ export default {
},
methods: {
mounted() {},
afterLogin(res) { // 登录成功后处理
afterLogin(res) {
// 登录成功后处理
let accessToken = res.result.accessToken;
let refreshToken = res.result.refreshToken;
this.setStore("accessToken", accessToken);
@@ -109,28 +107,35 @@ export default {
}
});
},
submitLogin() { // 登录操作
submitLogin() {
// 登录操作
this.$refs.usernameLoginForm.validate((valid) => {
if (valid) {
this.$refs.verify.show = true;
}
});
},
verifyChange (con) { // 拼图验证码回显
verifyChange(con) {
// 拼图验证码回显
if (!con.status) return;
this.loading = true;
login({
username: this.form.username,
password: this.md5(this.form.password),
}).then((res) => {
if (res && res.success) {
this.afterLogin(res);
} else {
})
.then((res) => {
if (res && res.success) {
this.afterLogin(res);
} else {
this.loading = false;
}
})
.catch(() => {
this.loading = false;
}
}).catch(()=>{this.loading = false});
}
});
this.$refs.verify.show = false;
},
},
};
</script>
@@ -154,7 +159,7 @@ export default {
position: relative;
zoom: 1;
}
.verify-con{
.verify-con {
position: absolute;
top: 90px;
z-index: 10;
@@ -198,5 +203,4 @@ export default {
.flex {
justify-content: center;
}
</style>

View File

@@ -2,7 +2,6 @@
<div>
<Row class="header">
<img src="../../assets/logo.png" class="logo" width="220px">
<!-- <div class="description">{{ $t('LILISHOP-ADMIN') }}</div> -->
</Row>
</div>
</template>
@@ -15,13 +14,13 @@ export default {
<style lang="scss" scoped>
.header {
margin-bottom: 6vh;
text-align: center;
display: flex;
justify-content: center !important;
}
.logo {
transform: scale(2);
width: 440px;
height: 158px;
}
</style>

View File

@@ -15,20 +15,8 @@
</div>
</div>
<Modal
title="编辑html代码"
v-model="showHTMLModal"
:mask-closable="false"
:width="900"
:fullscreen="full"
>
<Input
v-if="!full"
v-model="dataEdit"
:rows="15"
type="textarea"
style="max-height:60vh;overflow:auto;"
/>
<Modal title="编辑html代码" v-model="showHTMLModal" :mask-closable="false" :width="900" :fullscreen="full">
<Input v-if="!full" v-model="dataEdit" :rows="15" type="textarea" style="max-height:60vh;overflow:auto;" />
<Input v-if="full" v-model="dataEdit" :rows="32" type="textarea" />
<div slot="footer">
<Button @click="full=!full" icon="md-expand">全屏开/</Button>
@@ -56,21 +44,21 @@ export default {
props: {
id: {
type: String,
default: "editor"
default: "editor",
},
value: String,
base64: {
type: Boolean,
default: false
default: false,
},
showExpand: {
type: Boolean,
default: true
default: true,
},
openXss: {
type: Boolean,
default: false
}
default: false,
},
},
data() {
return {
@@ -79,16 +67,17 @@ export default {
dataEdit: "", // 编辑数据
showHTMLModal: false, // 显示html
full: false, // html全屏开关
fullscreenModal: false // 显示全屏预览
fullscreenModal: false, // 显示全屏预览
};
},
methods: {
initEditor() {
let that = this;
// 详见wangeditor3官网文档 https://www.kancloud.cn/wangfupeng/wangeditor3/332599
editor = new E(`#${this.id}`);
// 编辑内容绑定数据
editor.config.onchange = html => {
editor.config.onchange = (html) => {
if (this.openXss) {
this.data = xss(html);
} else {
@@ -108,30 +97,30 @@ export default {
editor.config.uploadImgServer = uploadFile;
// lili如要header中传入token鉴权
editor.config.uploadImgHeaders = {
accessToken: that.getStore("accessToken")
accessToken: that.getStore("accessToken"),
};
editor.config.uploadFileName = "file";
editor.config.uploadImgHooks = {
before: function(xhr, editor, files) {
before: function (xhr, editor, files) {
// 图片上传之前触发
},
success: function(xhr, editor, result) {
success: function (xhr, editor, result) {
// 图片上传并返回结果,图片插入成功之后触发
},
fail: function(xhr, editor, result) {
fail: function (xhr, editor, result) {
// 图片上传并返回结果,但图片插入错误时触发
that.$Message.error("上传图片失败");
},
error: function(xhr, editor) {
error: function (xhr, editor) {
// 图片上传出错时触发
that.$Message.error("上传图片出错");
},
timeout: function(xhr, editor) {
timeout: function (xhr, editor) {
// 图片上传超时时触发
that.$Message.error("上传图片超时");
},
// 如果服务器端返回的不是 {errno:0, data: [...]} 这种格式,可使用该配置
customInsert: function(insertImg, result, editor) {
customInsert: function (insertImg, result, editor) {
if (result.success == true) {
let url = result.result;
insertImg(url);
@@ -139,10 +128,11 @@ export default {
} else {
that.$Message.error(result.message);
}
}
},
};
}
editor.config.customAlert = function(info) {
editor.config.customAlert = function (info) {
// info 是需要提示的内容
// that.$Message.info(info);
};
@@ -156,8 +146,8 @@ export default {
// type -> 'emoji' / 'image'
type: "image",
// content -> 数组
content: sina
}
content: sina,
},
];
editor.create();
if (this.value) {
@@ -187,7 +177,7 @@ export default {
editor.txt.html(this.data);
this.$emit("input", this.data);
this.$emit("on-change", this.data);
}
},
});
},
setData(value) {
@@ -200,22 +190,21 @@ export default {
this.$emit("input", this.data);
this.$emit("on-change", this.data);
}
}
},
},
watch: {
value(val) {
this.setData(val);
}
},
},
mounted() {
this.initEditor();
}
},
};
</script>
<style lang="scss" scoped>
.e-menu {
z-index: 101;
position: absolute;
cursor: pointer;

View File

@@ -57,7 +57,7 @@
<Input type="number" v-model="form.sort" clearable style="width: 10%" />
</FormItem>
<FormItem class="form-item-view-el" label="文章内容" prop="content">
<editor v-model="form.content"></editor>
<editor openXss v-model="form.content"></editor>
</FormItem>
<FormItem label="是否展示" prop="openStatus">
<i-switch size="large" v-model="form.openStatus" :true-value="open" :false-value="close">
@@ -72,7 +72,7 @@
</div>
</Modal>
</template>
</Card>
</Col>
@@ -123,7 +123,7 @@ export default {
searchTreeValue: "", // 切换
form: {
// 添加或编辑表单对象初始化数据
openStatus:false,
openStatus: false,
title: "",
categoryId: "",
sort: 1,
@@ -380,7 +380,6 @@ export default {
//为了在是否展示一列展示开关 需要改一下数据类型,最终提交再次更改
this.data = [];
if (res.result.records.length > 0) {
this.data = res.result.records;
}
}
@@ -390,7 +389,6 @@ export default {
},
handleSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.submitLoading = true;
@@ -403,7 +401,6 @@ export default {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
});
} else {
@@ -414,8 +411,6 @@ export default {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
});
}
@@ -440,10 +435,25 @@ export default {
this.form.categoryId = res.result.categoryId;
this.treeValue = data.articleCategoryName;
this.form.id = data.id;
this.form.content = res.result.content;
this.form.content = htmlEscape(res.result.content);
this.form.title = res.result.title;
this.form.sort = res.result.sort;
this.form.openStatus = res.result.openStatus
this.form.openStatus = res.result.openStatus;
}
});
},
htmlEscape(text) {
return text.replace(/[<>"&]/g, function (match, pos, originalText) {
switch (match) {
case "<":
return "&lt;";
case ">":
return "&gt;";
case "&":
return "&amp;";
case '"':
return "&quot;";
}
});
},

View File

@@ -347,6 +347,7 @@ export default {
this.form.versionUpdateDate / 1000
);
this.form.versionUpdateDate = versionUpdateDate;
this.form.updateTime = versionUpdateDate;
if (this.modalType == 0) {
// 添加 避免编辑后传入id等数据 记得删除