diff --git a/CHANGELOG.md b/CHANGELOG.md index f1338ea..cde8059 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.1.0 (2021-12-20) +# 0.1.0 (2021-12-22) ### 🌟 新功能 范围|描述|commitId @@ -192,6 +192,7 @@ - | 时间轴无任务时时间刻度加载修改 | [4921672](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/4921672) - | 时间轴滚动位置修改 | [551da63](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/551da63) - | 时间轴骨架屏修改 | [ca78d02](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/ca78d02) + - | 测试页面标题修改 | [decbcf1](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/decbcf1) - | 添加canvas | [9bc13c7](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/9bc13c7) - | 添加绑定WiFi | [c523022](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/c523022) - | 监听时间基本点 | [033fca0](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/033fca0) diff --git a/src/App.vue b/src/App.vue index 89e5484..e89684f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,6 +8,7 @@ export default { async onLaunch(options) { // TODO: this 先判断是不是通过扫二维码进来的 console.log('options: ', options); + this.setScene(options.scene); if (options.scene === 1047) { // 扫描小程序码 if (options.query && options.query.scene) { @@ -52,7 +53,7 @@ export default { ...mapActions('socket', ['initSocket']), ...mapMutations(['setSystemInfo']), ...mapMutations('user', ['setToken', 'setUser']), - ...mapMutations('yanyuan', ['setToolCode', 'setEnterByCode']), + ...mapMutations('yanyuan', ['setToolCode', 'setEnterByCode', 'setScene']), // 登录 async signin() { diff --git a/src/apis/yanyuan.js b/src/apis/yanyuan.js index df758e3..c8740e2 100644 --- a/src/apis/yanyuan.js +++ b/src/apis/yanyuan.js @@ -24,6 +24,8 @@ const install = (Vue, vm) => { vm.$u.api.bindTool = param => vm.$u.post(`${yanyuan}/tool/bind`, param); // 查询工具箱列表 vm.$u.api.queryToolList = param => vm.$u.post(`${yanyuan}/tool/queryToolList`, param); + // 查询工具箱的使用者 + vm.$u.api.getUserName = param => vm.$u.post(`${yanyuan}/tool/getUserName`, param); // 试题查询 vm.$u.api.getQuestion = param => vm.$u.post(`${yanyuan}/question/get`, param); @@ -52,6 +54,8 @@ const install = (Vue, vm) => { vm.$u.api.queryAuditNum = param => vm.$u.post(`${yanyuan}/family/queryAuditNum`, param); // 查询家属成员列表 vm.$u.api.queryFamilyList = param => vm.$u.post(`${yanyuan}/family/queryList`, param); + // 查询用户是否是项目成员 + vm.$u.api.familyIsMember = param => vm.$u.post(`${yanyuan}/family/isMember`, param); // 试题答案保存 vm.$u.api.chooseTool = param => vm.$u.post(`${yanyuan}/trainPlan/chooseTool`, param); diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 12a05e3..01df4e5 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -90,12 +90,19 @@ export default { }, async onLoad(options) { + console.log('index options: ', options); this.options = options; if (options.code === 'true') { console.log('onLoad options: ', options); // 首页用户身份判断 await this.homeIdentity(); } + + // 分享 + wx.showShareMenu({ + withShareTicket: true, + menus: ['shareAppMessage', 'shareTimeline'], + }); }, methods: { diff --git a/src/pagesProject/project/project.vue b/src/pagesProject/project/project.vue index af524c9..30b96bc 100644 --- a/src/pagesProject/project/project.vue +++ b/src/pagesProject/project/project.vue @@ -18,10 +18,30 @@ + + + + + + + + + + + + diff --git a/src/pagesYanyuan/hold-all/hold-all.vue b/src/pagesYanyuan/hold-all/hold-all.vue index fbaaf94..d4ab953 100644 --- a/src/pagesYanyuan/hold-all/hold-all.vue +++ b/src/pagesYanyuan/hold-all/hold-all.vue @@ -15,23 +15,38 @@ class="mr-2" :class=" item.equipmentStatus === 0 - ? 'text-blue-500' - : item.equipmentStatus === 1 ? 'text-gray-500' + : item.equipmentStatus === 1 + ? 'text-green-500' : item.equipmentStatus === 2 - ? 'text-red-500' - : 'text-green-500' + ? 'text-yellow-500' + : 'text-red-500' " > {{ item.code }} - - - + + - + + + + + {{ item.electricQuantity }} @@ -40,6 +55,8 @@ + + @@ -49,23 +66,25 @@ export default { return { lists: [], tips: [ + { + value: '未设置', + bg: 'bg-gray-500', + }, { value: '开机', - bg: 'bg-blue-500', + bg: 'bg-green-500', }, { value: '休眠', - bg: 'bg-gray-500', + bg: 'bg-yellow-500', }, { - value: '断电', + value: '关机', bg: 'bg-red-500', }, - { - value: '正常', - bg: 'bg-green-500', - }, ], + content: '', + show: false, }; }, @@ -101,6 +120,32 @@ export default { console.error('error: ', error); } }, + + /** + * 查询工具箱的使用者 + * @param string equipmentId 设备id + */ + async getUserName(equipmentId) { + try { + const params = { equipmentId }; + const data = await this.$u.api.getUserName(params); + console.log('data: ', data); + if (data.status === -2) { + this.show = true; + this.content = '使用前请先选择长者!'; + } + if (data.status === -1) { + this.show = true; + this.content = '尚未填写长者信息!'; + } + if (data.status === 0) { + this.show = true; + this.content = `绑定者为 ${data.userName},性别 ${data.sex === 1 ? '男' : '女'}`; + } + } catch (error) { + console.error('error: ', error); + } + }, }, }; diff --git a/src/store/yanyuan/mutations.js b/src/store/yanyuan/mutations.js index d01b551..3382408 100644 --- a/src/store/yanyuan/mutations.js +++ b/src/store/yanyuan/mutations.js @@ -160,6 +160,15 @@ const mutations = { setTestNumber(state, data) { state.testNumber = data; }, + + /** + * 设置场景值 + * @param {object} state + * @param {object} data + */ + setScene(state, data) { + state.scene = data; + }, }; export default mutations; diff --git a/src/store/yanyuan/state.js b/src/store/yanyuan/state.js index e3755ef..e67433f 100644 --- a/src/store/yanyuan/state.js +++ b/src/store/yanyuan/state.js @@ -18,6 +18,7 @@ const state = { enterByCode: false, // 是不是通过扫码进入 toolCode: '', // 二维码携带的工具箱code testNumber: 0, // 已经完成的试题编号 + scene: '', // 场景值 }; export default state;