From 4c9c81253e37c3e1ea0b3809b0dcb5ca14f5dcdb Mon Sep 17 00:00:00 2001 From: song Date: Mon, 6 Dec 2021 18:02:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B7=A5=E5=85=B7=E7=AE=B1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +- src/apis/yanyuan.js | 5 + src/common/styles/tailwind.scss | 6 + .../components/GuidePage/GuidePage.vue | 18 ++- src/pagesYanyuan/hold-all/hold-all.vue | 142 ++++++++++++++---- 5 files changed, 140 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4055eb8..9b45d0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.1.0 (2021-12-03) +# 0.1.0 (2021-12-06) ### 🌟 新功能 范围|描述|commitId @@ -243,6 +243,7 @@ - | 修改代码格式 | [14123d7](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/14123d7) - | 修改定期任务骨架屏高度 | [909a734](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/909a734) - | 修改时间轴自动滚动到当天任务的时间 | [20bbf6a](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/20bbf6a) + - | 压缩代码,提交体验版 | [c5f50ff](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/c5f50ff) - | 小红点api缓存修改 | [e992343](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/e992343) - | 提交本地代码 | [e0cf2ed](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/e0cf2ed) - | 提升性能的代码更改 | [3548af7](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/3548af7) diff --git a/src/apis/yanyuan.js b/src/apis/yanyuan.js index 7c95399..d10f248 100644 --- a/src/apis/yanyuan.js +++ b/src/apis/yanyuan.js @@ -21,6 +21,11 @@ const install = (Vue, vm) => { // 绑定工具箱 vm.$u.api.bindTool = param => vm.$u.post(`${yanyuan}/tool/bind`, param); + // 查询指定工具箱二维码 + vm.$u.api.qrCode = param => vm.$u.post(`${yanyuan}/tool/qrCode`, param); + // 查询工具箱列表 + vm.$u.api.queryToolList = param => vm.$u.post(`${yanyuan}/tool/queryToolList`, param); + // 用户身份判断 vm.$u.api.identityUserPower = param => vm.$u.post(`${yanyuan}/userPower/identity`, param); diff --git a/src/common/styles/tailwind.scss b/src/common/styles/tailwind.scss index 1e489d8..53be035 100644 --- a/src/common/styles/tailwind.scss +++ b/src/common/styles/tailwind.scss @@ -1126,6 +1126,12 @@ .h-screen { height: 100vh; } +.w-1 { + width: 0.25rem; +} +.w-2 { + width: 0.5rem; +} .w-4 { width: 1rem !important; } diff --git a/src/pagesProject/project/components/GuidePage/GuidePage.vue b/src/pagesProject/project/components/GuidePage/GuidePage.vue index 0f28bb3..5d991c8 100644 --- a/src/pagesProject/project/components/GuidePage/GuidePage.vue +++ b/src/pagesProject/project/components/GuidePage/GuidePage.vue @@ -1,11 +1,6 @@ @@ -17,37 +46,61 @@ export default { data() { return { - lists: [ + lists: [], + tips: [ { - title: '工具箱1', - name: 'ccsens_5G', - bound: true, + value: '开机', + bg: 'bg-blue-500', }, { - title: '工具箱2', - name: 'ccsens_5G', - bound: true, + value: '休眠', + bg: 'bg-gray-500', }, { - title: '工具箱3', - name: 'ccsens_5G', - bound: true, + value: '断电', + bg: 'bg-red-500', }, { - title: '工具箱4', - name: '', - bound: false, - }, - { - title: '工具箱5', - name: '', - bound: false, + value: '正常', + bg: 'bg-green-500', }, ], }; }, - methods: {}, + async created() { + await this.queryToolList(); + }, + + methods: { + openBinding() { + uni.navigateToMiniProgram({ + appId: 'wx1989853133e3da70', + path: '', + extraData: {}, + success(res) { + // 打开成功 + console.log('打开成功res: ', res); + }, + }); + }, + + setWidth(res) { + return (res * 21) / 100 + 'px'; + }, + + /** + * 查询工具箱列表 + */ + async queryToolList() { + try { + const data = await this.$u.api.queryToolList(); + this.lists = data; + } catch (error) { + console.error('error: ', error); + } + }, + }, }; @@ -55,4 +108,41 @@ export default { page { background-color: $uni-bg-color-grey; } + +.battery-box { + width: 26px; + height: 12px; + background: url(https://www.tall.wiki/staticrec/yanyuan/battery.png) center no-repeat; + background-size: 100% 100%; + position: relative; +} + +.battery-text { + width: 21px; + height: 8px; + line-height: 8px; + text-align: center; + margin: 2px 0; + position: absolute; + left: 2px; + z-index: 99; +} + +.battery { + height: 8px; + margin: 2px 0; + background: #e0e0e0; + position: absolute; + left: 2px; +} + +.bg-gray-500 { + --tw-bg-opacity: 1; + background-color: rgba(107, 114, 128, var(--tw-bg-opacity)); +} + +.bg-green-500 { + --tw-bg-opacity: 1; + background-color: rgba(16, 185, 129, var(--tw-bg-opacity)); +}