From c5e06ad1f287faf5cf439bbee507380cccfac4ed Mon Sep 17 00:00:00 2001 From: Yer <17633066053@163.com> Date: Wed, 9 Aug 2023 14:42:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=AB=AF=E6=A5=BC=E5=B1=82=E8=A3=85=E4=BF=AE?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=88=B0=E6=9C=AC=E5=9C=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lili-dialog/template/marketing.vue | 3 ++ .../src/views/goods/goods-info/goodsApply.vue | 1 + .../src/views/goods/goods-manage/brand.vue | 1 + .../src/views/page-decoration/renovation.vue | 44 +++++++++++++++++++ .../src/views/page-decoration/wap/index.vue | 17 +++++++ .../src/views/page-decoration/wap/navbar.vue | 21 ++++++++- .../src/views/sys/user-manage/userManage.vue | 1 + 7 files changed, 87 insertions(+), 1 deletion(-) diff --git a/manager/src/components/lili-dialog/template/marketing.vue b/manager/src/components/lili-dialog/template/marketing.vue index 3715f52b..4585087d 100644 --- a/manager/src/components/lili-dialog/template/marketing.vue +++ b/manager/src/components/lili-dialog/template/marketing.vue @@ -112,6 +112,7 @@ export default { { props: { // type: this.index == params.index ? "primary" : "", + type: 'default', size: "small", }, on: { @@ -204,6 +205,7 @@ export default { { props: { // type: this.index == params.index ? "primary" : "", + type: 'default', size: "small", }, on: { @@ -255,6 +257,7 @@ export default { { props: { // type: this.index == params.index ? "primary" : "", + type: 'default', size: "small", }, on: { diff --git a/manager/src/views/goods/goods-info/goodsApply.vue b/manager/src/views/goods/goods-info/goodsApply.vue index fa7f7222..30deb6a4 100644 --- a/manager/src/views/goods/goods-info/goodsApply.vue +++ b/manager/src/views/goods/goods-info/goodsApply.vue @@ -208,6 +208,7 @@ export default { "Button", { props: { + type: 'default', size: "small", }, on: { diff --git a/manager/src/views/goods/goods-manage/brand.vue b/manager/src/views/goods/goods-manage/brand.vue index 6fac602f..7438def2 100644 --- a/manager/src/views/goods/goods-manage/brand.vue +++ b/manager/src/views/goods/goods-manage/brand.vue @@ -213,6 +213,7 @@ export default { "Button", { props: { + type: 'default', size: "small", }, style: { diff --git a/manager/src/views/page-decoration/renovation.vue b/manager/src/views/page-decoration/renovation.vue index 28b3576a..546a0592 100644 --- a/manager/src/views/page-decoration/renovation.vue +++ b/manager/src/views/page-decoration/renovation.vue @@ -18,6 +18,9 @@
+ + +
@@ -32,16 +35,57 @@ export default { ModelForm, }, mounted() { + // 先读缓存,如果缓存有值则读缓存。 + const cache = this.getStore('managerPCPageCache') + this.hasCache = !!cache; + if(cache){ + this.$Modal.confirm({ + title: '提示', + content: '获取到本地有缓存数据,是否使用缓存数据?', + okText: '使用', + cancelText: '取消', + onOk: () => { + let pageData = cache; + if (pageData) { + pageData = JSON.parse(pageData); + if (pageData.list[0].type === "topAdvert") { + // topAdvert 为顶部广告 navList为导航栏 + this.$refs.modelForm.topAdvert = pageData.list[0]; + this.$refs.modelForm.navList = pageData.list[1]; + pageData.list.splice(0, 2); + this.modelForm = pageData; + } else { + this.modelForm = { list: [] }; + } + } else { + this.modelForm = { list: [] }; + } + } + }); + } this.getTemplateItem(this.$route.query.id); }, data() { return { + hasCache:false, modelData, // 可选模块数据 modelForm: { list: [] }, // 模板数据 submitLoading: false, // 提交加载状态 }; }, methods: { + clearCache(){ + this.setStore('managerPCPageCache', '') + this.$Message.success('清除成功') + }, + // 将楼层装修的内容写入到本地缓存中 + witeLocalStore(){ + const data ={...this.modelForm} + data.list.unshift(this.$refs.modelForm.navList); + data.list.unshift(this.$refs.modelForm.topAdvert); + this.setStore('managerPCPageCache', data) + this.$Message.success('写入成功') + }, saveTemplate() { // 保存模板 this.submitTemplate(this.$route.query.pageShow ? 'OPEN' : 'CLOSE') diff --git a/manager/src/views/page-decoration/wap/index.vue b/manager/src/views/page-decoration/wap/index.vue index ded9627a..861494b3 100644 --- a/manager/src/views/page-decoration/wap/index.vue +++ b/manager/src/views/page-decoration/wap/index.vue @@ -113,12 +113,29 @@ export default { methods: { // 初始化数据 init() { + // 先读缓存,如果缓存有值则读缓存。 + const cache = this.getStore('managerMobilePageCache') + if(cache){ + this.$Modal.confirm({ + title: '提示', + content: '获取到本地有缓存数据,是否使用缓存数据?', + okText: '使用', + cancelText: '取消', + onOk: () => { + const data = JSON.parse(cache); + this.contentData = data; + } + }); + + } if (!this.$route.query.id) return false; + API_Other.getHomeData(this.$route.query.id).then((res) => { this.contentData = JSON.parse(res.result.pageData); this.handleComponent(this.contentData.list[0], 0); }); + }, // 中间组件拖动,右侧数据绑定不变 diff --git a/manager/src/views/page-decoration/wap/navbar.vue b/manager/src/views/page-decoration/wap/navbar.vue index 58f623c4..fa848aef 100644 --- a/manager/src/views/page-decoration/wap/navbar.vue +++ b/manager/src/views/page-decoration/wap/navbar.vue @@ -20,6 +20,7 @@
--> + 关 +
+ 将当前装修内容写入到本地缓存中,下次进入页面时可继续使用 + +
@@ -56,6 +61,7 @@ export default { props: ["pagetype"], data() { return { + hasCache:false, // 是否有缓存 progress: true, // 展示进度 num: 20, // 提交进度 saveDialog: false, // 加载状态 @@ -103,8 +109,21 @@ export default { immediate: true, }, }, - mounted() {}, + mounted() { + console.log( this.getStore('managerMobilePageCache') ) + this.hasCache = this.getStore('managerMobilePageCache') ? true : false; + }, methods: { + clearCache(){ + this.setStore('managerMobilePageCache',''); + this.$Message.success('清空成功') + }, + // 将楼层装修的内容写入到本地缓存中 + witeLocalStore(){ + this.setStore('managerMobilePageCache', this.$store.state.styleStore) + this.$Message.success('写入成功') + }, + clickBtn(val) { this.way.forEach((item, index) => { item.selected = false; diff --git a/manager/src/views/sys/user-manage/userManage.vue b/manager/src/views/sys/user-manage/userManage.vue index 16d22cbe..2dc31a63 100644 --- a/manager/src/views/sys/user-manage/userManage.vue +++ b/manager/src/views/sys/user-manage/userManage.vue @@ -267,6 +267,7 @@ export default { "Button", { props: { + type: 'default', size: "small" }, style: {