From 80c3fc7941961ea5cb86840e45810212758b47dd Mon Sep 17 00:00:00 2001 From: song Date: Fri, 3 Dec 2021 15:40:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=B9=E6=8E=A5=E5=BC=95=E5=AF=BC?= =?UTF-8?q?=E9=A1=B5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/apis/yanyuan.js | 5 ++ .../components/GuidePage/GuidePage.vue | 16 +++--- src/pagesProject/project/project.vue | 50 ++++++++++++++----- 4 files changed, 51 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3ffb06..ff5d1ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -178,6 +178,7 @@ - | 添加canvas | [9bc13c7](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/9bc13c7) - | 监听时间基本点 | [033fca0](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/033fca0) - | 绘制canvas | [3c9d471](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/3c9d471) + - | 绘图背景图显示及路径绘制 | [964e41e](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/964e41e) - | 角色显示状态修改 | [7d3b906](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/7d3b906) - | 角色栏修改 | [19228d6](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/19228d6) - | 解决error | [b1975e5](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/b1975e5) diff --git a/src/apis/yanyuan.js b/src/apis/yanyuan.js index d6aa3bd..7c95399 100644 --- a/src/apis/yanyuan.js +++ b/src/apis/yanyuan.js @@ -63,6 +63,11 @@ const install = (Vue, vm) => { vm.$u.api.queryZaritHistory = param => vm.$u.post(`${yanyuan}/zarit/queryHistory`, param); // 查询照顾者负担表列表 vm.$u.api.queryZaritList = param => vm.$u.post(`${yanyuan}/zarit/queryList`, param); + + // 查询是否显示引导页 + vm.$u.api.queryGuide = param => vm.$u.post(`${yanyuan}/guide/query`, param); + // 修改引导页状态 + vm.$u.api.updateGuide = param => vm.$u.post(`${yanyuan}/guide/update`, param); }; export default { install }; diff --git a/src/pagesProject/project/components/GuidePage/GuidePage.vue b/src/pagesProject/project/components/GuidePage/GuidePage.vue index 0043679..0f28bb3 100644 --- a/src/pagesProject/project/components/GuidePage/GuidePage.vue +++ b/src/pagesProject/project/components/GuidePage/GuidePage.vue @@ -1,6 +1,11 @@ @@ -27,12 +27,12 @@ import { setPlaceholderTasks, computeFillPlaceholderTaskCount } from '@/utils/ta import Title from './components/Title/Title'; import Roles from './components/Roles/Roles'; import TimeLine from './components/TimeLine/TimeLine'; -// import GuidePage from './components/GuidePage/GuidePage'; +import GuidePage from './components/GuidePage/GuidePage'; import ConfigInfo from './components/ConfigInfo/ConfigInfo'; // import { flatten } from 'lodash'; export default { - components: { Title, Roles, TimeLine, ConfigInfo }, + components: { Title, Roles, TimeLine, ConfigInfo, GuidePage }, data() { return { height: '', @@ -116,13 +116,12 @@ export default { }, mounted() { - const system = uni.getSystemInfoSync(); - this.height = system.windowHeight + 'px'; - - // TODO: 判断用户第一次进来才会显示 - setTimeout(() => { - this.showGuide = true; - }, 1000); + this.$nextTick(async () => { + const system = uni.getSystemInfoSync(); + this.height = system.windowHeight + 'px'; + // TODO: 判断用户第一次进来才会显示引导页 + await this.queryGuide(); + }); }, onUnload() { @@ -466,9 +465,34 @@ export default { this.clearEndFlag(); }, - // 退出引导页 - quitGuide() { - this.showGuide = false; + /** + * 查询是否显示引导页 + * @param {object} templateCode 模板code + */ + async queryGuide() { + try { + const params = { templateCode: this.project.templateCode }; + const data = await this.$u.api.queryGuide(params); + if (data.status === 0) { + this.showGuide = true; + } + } catch (error) { + console.error('error: ', error); + } + }, + + /** + * 退出引导页 修改引导页状态 + * @param {object} templateCode 模板code + */ + async quitGuide() { + try { + const params = { templateCode: this.project.templateCode }; + await this.$u.api.updateGuide(params); + this.showGuide = false; + } catch (error) { + console.log('error: ', error); + } }, }, };