diff --git a/src/assets/images/mobile_theme_active.png b/src/assets/images/mobile_theme_active.png new file mode 100644 index 0000000..15ed788 Binary files /dev/null and b/src/assets/images/mobile_theme_active.png differ diff --git a/src/views/form/PreView.vue b/src/views/form/PreView.vue index 34925f3..e572839 100644 --- a/src/views/form/PreView.vue +++ b/src/views/form/PreView.vue @@ -19,7 +19,7 @@ 电脑 - + @@ -32,19 +32,20 @@ import ProjectForm from './ProjectForm' export default { name: 'PreView', props: { - projectConfig: { - projectKey: '', - headImgUrl: '', - color: '' - } + projectKey: '' }, data() { - return {} + return { + projectConfig: { + projectKey: '', + showBtns: false + } + } }, mounted() { this.projectConfig = { - headImgUrl: 'http://cdn1.wenjuan.com/appear-PC-防疫13.png', - projectKey: 'afd5c3562c924d20b7da67b1f192ce25' + projectKey: 'afd5c3562c924d20b7da67b1f192ce25', + showBtns: false } }, components: { diff --git a/src/views/form/ProjectForm.vue b/src/views/form/ProjectForm.vue index fbe024b..48565ce 100644 --- a/src/views/form/ProjectForm.vue +++ b/src/views/form/ProjectForm.vue @@ -2,7 +2,8 @@
@@ -44,8 +45,6 @@ export default { }, props: { projectConfig: { - headImgUrl: '', - color: '', projectKey: '', showBtn: false } @@ -54,6 +53,9 @@ export default { return { key2: +new Date(), projectKey: '', + projectTheme: { + headImgUrl:'' + }, formConf: { fields: [], __methods__: {}, @@ -76,20 +78,12 @@ export default { watch: {}, created() { //不存去路由中尝试获取 - if (!this.projectConfig) { - this.projectConfig = { - headImgUrl: '', - color: '', - projectKey: '', - showBtn: false - } - } if (this.projectConfig && this.projectConfig.projectKey) { this.projectKey = this.projectConfig.projectKey } else if (this.$route.query.key) { this.projectKey = this.$route.query.key } - this.formConf.formBtns = this.projectConfig.showBtn + this.formConf.formBtns = this.projectConfig.showBtns this.formConf.size = window.innerWidth < 480 ? 'medium' : 'small' }, mounted() { @@ -100,6 +94,9 @@ export default { }) this.formConf.fields = fields this.formConf.title = res.data.project.name + if(res.data.userProjectTheme){ + this.projectTheme = res.data.userProjectTheme + } this.formConf.description = res.data.project.describe } }) diff --git a/src/views/form/theme.vue b/src/views/form/theme.vue index b0dbb02..9d39735 100644 --- a/src/views/form/theme.vue +++ b/src/views/form/theme.vue @@ -32,20 +32,26 @@ - - + +

+ +

- +
@@ -64,6 +70,7 @@ export default { }, data() { return { + projectKey: '', styleList: [ {'label': '全部', 'key': ''}, {'label': '节日', 'key': 'festival'}, @@ -88,12 +95,12 @@ export default { ], activeColor: '', activeStyle: '', - projectKey: '', + activeTheme: '', themeList: [] } }, mounted() { - this.projectKey = this.$route.query.key + this.projectConfig.projectKey = this.$route.query.key this.queryProjectTheme() }, methods: { @@ -101,6 +108,19 @@ export default { this.activeStyle = item.key this.queryProjectTheme() }, + activeThemeHandler(item) { + if (item) { + this.$confirm('切换主题,系统将不会保存您在上一主题所做的修改,请知悉。', '切换主题提醒', { + confirmButtonText: '确定', + cancelButtonText: '取消操作', + type: 'info' + }).then(() => { + this.activeTheme = item + }).catch(() => { + + }) + } + }, activeColorHandler(item) { this.activeColor = item this.queryProjectTheme() @@ -199,6 +219,21 @@ export default { border: 2px solid rgba(11, 141, 213, 100); } +.head-list-img-active { + border: 2px solid rgba(11, 141, 213, 100); +} + +.theme-img-view .head-list-view-select ::after { + content: ""; + background: url('~@/assets/images/mobile_theme_active.png'); + background-size: 18px; + width: 18px; + height: 18px; + position: absolute; + top: 4px; + right: 4px; +} + .right-container { width: 456px; height: 600px;