From 8c120bc5bef9cc5fc4a2912483ddbe6f4f6c6410 Mon Sep 17 00:00:00 2001 From: song Date: Tue, 9 Nov 2021 18:11:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E7=A0=81=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/components/ConfigInfo/ConfigInfo.vue | 10 +-- src/components/GuidePage/GuidePage.vue | 10 +-- src/components/Upload/Upload.vue | 12 ++- src/pages.json | 87 ++++++++++++---------- src/pagesYanyuan/ascription/ascription.vue | 14 ++-- src/pagesYanyuan/hold-all/hold-all.vue | 8 +- src/pagesYanyuan/input-code/input-code.vue | 46 ++++++++++++ src/pagesYanyuan/scan-code/scan-code.vue | 85 ++++++++++++--------- src/utils/page.js | 14 ++++ src/utils/tall.js | 2 + 11 files changed, 184 insertions(+), 105 deletions(-) create mode 100644 src/pagesYanyuan/input-code/input-code.vue create mode 100644 src/utils/page.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 490fbbf..3b257f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ - | 模拟接口测试 | [69e7931](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/69e7931) - | 添加 环境变量,动态控制webview project的path | [8a40481](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/8a40481) - | 添加子任务插件 子项目插件 | [7bda7e2](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/7bda7e2) + - | 添加已测评页面,压缩代码 | [551e5ea](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/551e5ea) - | 添加引导页 | [4293f5a](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/4293f5a) - | 添加时间轴上下滚动 | [2b81bbc](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/2b81bbc) - | 添加药物使用记录界面 | [425cb63](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/425cb63) diff --git a/src/components/ConfigInfo/ConfigInfo.vue b/src/components/ConfigInfo/ConfigInfo.vue index 5afb24c..e840e2e 100644 --- a/src/components/ConfigInfo/ConfigInfo.vue +++ b/src/components/ConfigInfo/ConfigInfo.vue @@ -27,7 +27,7 @@ - + 扫码添加客服微信 @@ -46,10 +46,10 @@ export default { data() { return { itemList: [ - { head: '基本信息', open: true, body: '123', img: 'https://www.tall.wiki/staticrec/guide/menu1.png' }, - { head: '药物使用记录', open: false, body: '123', img: 'https://www.tall.wiki/staticrec/guide/menu2.png' }, - { head: 'Zarit照顾者分担量表', open: false, body: '123', img: 'https://www.tall.wiki/staticrec/guide/menu3.png' }, - { head: '家属成员', open: false, body: '123', img: 'https://www.tall.wiki/staticrec/guide/menu4.png' }, + { head: '基本信息', open: true, body: '123', img: 'https://www.tall.wiki/staticrec/yanyuan/menu1.png' }, + { head: '药物使用记录', open: false, body: '123', img: 'https://www.tall.wiki/staticrec/yanyuan/menu2.png' }, + { head: 'Zarit照顾者分担量表', open: false, body: '123', img: 'https://www.tall.wiki/staticrec/yanyuan/menu3.png' }, + { head: '家属成员', open: false, body: '123', img: 'https://www.tall.wiki/staticrec/yanyuan/menu4.png' }, ], headStyle: { borderBottom: '1px solid #f8f8f8', diff --git a/src/components/GuidePage/GuidePage.vue b/src/components/GuidePage/GuidePage.vue index 642ac3c..5d1fdd9 100644 --- a/src/components/GuidePage/GuidePage.vue +++ b/src/components/GuidePage/GuidePage.vue @@ -18,23 +18,23 @@ export default { current: 0, list: [ { - image: 'https://www.tall.wiki/staticrec/guide/1.png', + image: 'https://www.tall.wiki/staticrec/yanyuan/1.png', title: '1', }, { - image: 'https://www.tall.wiki/staticrec/guide/2.png', + image: 'https://www.tall.wiki/staticrec/yanyuan/2.png', title: '2', }, { - image: 'https://www.tall.wiki/staticrec/guide/3.png', + image: 'https://www.tall.wiki/staticrec/yanyuan/3.png', title: '3', }, { - image: 'https://www.tall.wiki/staticrec/guide/4.png', + image: 'https://www.tall.wiki/staticrec/yanyuan/4.png', title: '4', }, { - image: 'https://www.tall.wiki/staticrec/guide/5.png', + image: 'https://www.tall.wiki/staticrec/yanyuan/5.png', title: '5', }, ], diff --git a/src/components/Upload/Upload.vue b/src/components/Upload/Upload.vue index f823d9e..e1d001f 100644 --- a/src/components/Upload/Upload.vue +++ b/src/components/Upload/Upload.vue @@ -8,15 +8,13 @@ - - @@ -24,13 +22,13 @@ class="icons icon3" size="76" :class="showAddInfo ? '' : 'icon3-top'" - name="https://www.tall.wiki/staticrec/guide/icon3.png" + name="https://www.tall.wiki/staticrec/yanyuan/icon3.png" @click="openPage('/pagesYanyuan/ascription/ascription')" > @@ -74,7 +72,7 @@ export default { }, openPage(url) { - uni.navigateTo({ url: `${url}` }); + this.$t.page.openPage(url); this.showMenu = false; }, diff --git a/src/pages.json b/src/pages.json index 111ffbe..0892005 100644 --- a/src/pages.json +++ b/src/pages.json @@ -25,47 +25,54 @@ "root": "pagesYanyuan", "pages": [ { - "path": "scan-code/scan-code", - "style": { - "navigationBarTitleText": "扫码", - "navigationStyle": "default" - } - }, - { - "path": "add-info/add-info", - "style": { - "navigationBarTitleText": "基本信息", - "navigationStyle": "default" - } - }, - { - "path": "ascription/ascription", - "style": { - "navigationBarTitleText": "训练归属", - "navigationStyle": "default" - } - }, - { - "path": "hold-all/hold-all", - "style": { - "navigationBarTitleText": "工具箱", - "navigationStyle": "default" - } - }, - { - "path": "wifi-binding/wifi-binding", - "style": { - "navigationBarTitleText": "WIFI绑定", - "navigationStyle": "default" - } - }, - { - "path": "assess/assess", - "style": { - "navigationBarTitleText": "脑力测评", - "navigationStyle": "default" + "path": "scan-code/scan-code", + "style": { + "navigationBarTitleText": "扫码", + "navigationStyle": "default" + } + }, + { + "path": "input-code/input-code", + "style": { + "navigationBarTitleText": "输入工具码", + "navigationStyle": "default" + } + }, + { + "path": "add-info/add-info", + "style": { + "navigationBarTitleText": "基本信息", + "navigationStyle": "default" + } + }, + { + "path": "ascription/ascription", + "style": { + "navigationBarTitleText": "训练归属", + "navigationStyle": "default" + } + }, + { + "path": "hold-all/hold-all", + "style": { + "navigationBarTitleText": "工具箱", + "navigationStyle": "default" + } + }, + { + "path": "wifi-binding/wifi-binding", + "style": { + "navigationBarTitleText": "WIFI绑定", + "navigationStyle": "default" + } + }, + { + "path": "assess/assess", + "style": { + "navigationBarTitleText": "脑力测评", + "navigationStyle": "default" + } } - } ] }, { diff --git a/src/pagesYanyuan/ascription/ascription.vue b/src/pagesYanyuan/ascription/ascription.vue index 4ec6633..316c431 100644 --- a/src/pagesYanyuan/ascription/ascription.vue +++ b/src/pagesYanyuan/ascription/ascription.vue @@ -53,7 +53,7 @@ export default { lists: [ { title: '迷宫', - img: 'https://www.tall.wiki/staticrec/guide/1.png', + img: 'https://www.tall.wiki/staticrec/yanyuan/1.png', train: '', showTrain: false, trainer: ['张斌', '思南', '雪梅', '方圆', '张野', '马壮', '慧娟'], @@ -87,13 +87,13 @@ export default { left: 0, color: '#EDEDED', value: '非常困难', - bgPic: 'https://www.tall.wiki/staticrec/guide/bubble-gray.png', + bgPic: 'https://www.tall.wiki/staticrec/yanyuan/bubble-gray.png', boxBg: '', }, }, { title: '迷宫', - img: 'https://www.tall.wiki/staticrec/guide/1.png', + img: 'https://www.tall.wiki/staticrec/yanyuan/1.png', train: '', showTrain: false, trainer: ['张斌', '思南', '雪梅', '方圆', '张野', '马壮', '慧娟'], @@ -127,7 +127,7 @@ export default { left: 0, color: '#EDEDED', value: '非常困难', - bgPic: 'https://www.tall.wiki/staticrec/guide/bubble-gray.png', + bgPic: 'https://www.tall.wiki/staticrec/yanyuan/bubble-gray.png', boxBg: '', }, }, @@ -143,17 +143,17 @@ export default { if (value < 3) { position.color = '#EB5A0D'; position.value = '非常困难'; - position.bgPic = 'https://www.tall.wiki/staticrec/guide/bubble-red.png'; + position.bgPic = 'https://www.tall.wiki/staticrec/yanyuan/bubble-red.png'; position.boxBg = 'bg-red-500'; } else if (value < 5) { position.color = '#1890FF'; position.value = '略有困难'; - position.bgPic = 'https://www.tall.wiki/staticrec/guide/bubble-blue.png'; + position.bgPic = 'https://www.tall.wiki/staticrec/yanyuan/bubble-blue.png'; position.boxBg = 'bg-blue-500'; } else { position.color = '#F4C130'; position.value = '轻松完成'; - position.bgPic = 'https://www.tall.wiki/staticrec/guide/bubble-yellow.png'; + position.bgPic = 'https://www.tall.wiki/staticrec/yanyuan/bubble-yellow.png'; position.boxBg = 'bg-yellow-500'; } diff --git a/src/pagesYanyuan/hold-all/hold-all.vue b/src/pagesYanyuan/hold-all/hold-all.vue index 19fee86..172ac3b 100644 --- a/src/pagesYanyuan/hold-all/hold-all.vue +++ b/src/pagesYanyuan/hold-all/hold-all.vue @@ -5,7 +5,7 @@ {{ item.title }} {{ item.name }} - 绑定 + 绑定 @@ -47,11 +47,7 @@ export default { }; }, - methods: { - openPage(url) { - uni.navigateTo({ url: `${url}` }); - }, - }, + methods: {}, }; diff --git a/src/pagesYanyuan/input-code/input-code.vue b/src/pagesYanyuan/input-code/input-code.vue new file mode 100644 index 0000000..ada0d93 --- /dev/null +++ b/src/pagesYanyuan/input-code/input-code.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/pagesYanyuan/scan-code/scan-code.vue b/src/pagesYanyuan/scan-code/scan-code.vue index de42372..18b484f 100644 --- a/src/pagesYanyuan/scan-code/scan-code.vue +++ b/src/pagesYanyuan/scan-code/scan-code.vue @@ -1,21 +1,37 @@ @@ -25,7 +41,7 @@ let animation = wx.createAnimation({}); export default { data() { - return { animation }; + return { animation, open: false, flash: 'auto' }; }, onLoad() {}, onShow() { @@ -57,6 +73,12 @@ export default { let res = e.detail.result; console.log('res: ', res); }, + + // 打开手电筒 + openElectric() { + this.open = !this.open; + this.flash = !this.open ? 'on' : 'off'; + }, }, }; @@ -74,7 +96,7 @@ page { background-color: #010101; position: fixed; align-items: center; - justify-content: space-around; + padding-top: 150rpx; } .scan-camera { @@ -91,26 +113,6 @@ page { position: absolute; } -.cover-left-top { - left: 0; - top: 0; -} - -.cover-right-top { - right: 0; - top: 0; -} - -.cover-left-bottom { - left: 0; - bottom: 0; -} - -.cover-right-bottom { - right: 0; - bottom: 0; -} - .scan-animation { position: absolute; top: -10rpx; @@ -120,4 +122,17 @@ page { background-color: #08fdfe; border-radius: 50%; } + +.btns { + display: flex; + background: #fff; + position: absolute; + bottom: 0; + padding: 64rpx; +} + +.pic { + width: 100rpx; + height: 100rpx; +} diff --git a/src/utils/page.js b/src/utils/page.js new file mode 100644 index 0000000..0ff279b --- /dev/null +++ b/src/utils/page.js @@ -0,0 +1,14 @@ +// 返回上一页 +const back = () => uni.navigateBack(); + +/** + * 打开 某一页 + * @param {string} pageName + * @param {String} param "key=value" + */ +const openPage = (pageName, param) => { + const query = param || ''; + uni.navigateTo({ url: `${pageName}?${query}` }); +}; + +export default { back, openPage }; diff --git a/src/utils/tall.js b/src/utils/tall.js index 19c5b17..564dbf4 100644 --- a/src/utils/tall.js +++ b/src/utils/tall.js @@ -10,6 +10,7 @@ import upload from '@/utils/upload.js'; import user from '@/config/user.js'; import zIndex from '@/config/zIndex.js'; import task from '@/config/task.js'; +import page from './page'; const gateway = process.env.VUE_APP_API_URL; @@ -27,6 +28,7 @@ const $t = { $q: cacheAndRequest, user, // 用户相关配置 task, // 任务相关配置 + page, // 页面跳转相关配置 }; uni.$t = $t;