From 93d6a8fa2e0817994194649e9bea2d81e9b25b6e Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Fri, 31 May 2024 14:51:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E6=B3=A8=E5=85=AC=E4=BC=97=E5=8F=B7?= =?UTF-8?q?=E5=8A=9F=E8=83=BD,=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- src/api/house.js | 10 ++++++++ src/router/index.js | 8 +++++- src/router/router.config.js | 2 +- src/store/modules/app.js | 11 ++++++--- src/views/houseQR/index.less | 11 +++++++++ src/views/houseQR/index.vue | 48 +++++++++++++++++++++++++----------- 7 files changed, 71 insertions(+), 21 deletions(-) create mode 100644 src/api/house.js diff --git a/README.md b/README.md index 2b87b59..2e0de92 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ 然后跑起来之后你本地的域名就会变成epmet-cloud.elinkservice.cn ↓↓↓↓ 在你小程序的公众号开发中输入以下网址就能够访问了 -http://epmet-cloud.elinkservice.cn:80/?appId=wx1078fa1e99424de9&redirect=epmet-cloud.elinkservice.cn +http://epmet-cloud.elinkservice.cn:80/?appId=wx1078fa1e99424de9&redirect=epmet-cloud.elinkservice.cn&houseId=123 ### Node 版本要求 diff --git a/src/api/house.js b/src/api/house.js new file mode 100644 index 0000000..a73c999 --- /dev/null +++ b/src/api/house.js @@ -0,0 +1,10 @@ +// axios +import request from '@/utils/request' + +//扫描二维码获取房屋信息 +export function getHouseInfoQR(id) { + return request({ + url: `/actual/base/communityHouse/houseQrCode/info/${id}`, + method: 'get', + }) + } diff --git a/src/router/index.js b/src/router/index.js index e06c157..e580d1a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,7 +5,7 @@ import { constantRouterMap } from './router.config.js' import { checkWxmpRegister, login } from '@/api/user' import { title } from '@/config' -const whiteList = ['/login', '/register', '/errorPage','/selectAgency'] +const whiteList = ['/login', '/register', '/errorPage','/selectAgency','/houseQR'] const originalPush = Router.prototype.push Router.prototype.push = function push(location, onResolve, onReject) { if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject) @@ -51,6 +51,12 @@ function paramsFormat(params) { router.beforeEach((to, from, next) => { let urlParams = getQueryParams() + if(urlParams.houseId){ + console.log(urlParams); + store.commit('SET_HOUSE_ID', urlParams.houseId) + }else{ + store.commit('SET_HOUSE_ID', null) + } if (urlParams.appId) { if (localStorage.getItem('appId') && urlParams.appId !== localStorage.getItem('appId')) { localStorage.removeItem('token') diff --git a/src/router/router.config.js b/src/router/router.config.js index 9aeff6f..cd1f57b 100644 --- a/src/router/router.config.js +++ b/src/router/router.config.js @@ -6,7 +6,7 @@ export const constantRouterMap = [ { path: '/', name: 'home', - component: () => import('@/views/houseQR'), + component: () => import('@/views/home'), meta: { title: '首页', keepAlive: false } }, { diff --git a/src/store/modules/app.js b/src/store/modules/app.js index f5f709c..03e3ffb 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -4,7 +4,8 @@ const state = { userInfo: {}, appId: '', realNameFlag:null, - agencyId:null + agencyId:null, + houseId:null } const mutations = { SET_USER_INFO(state, userInfo) { @@ -12,9 +13,13 @@ const mutations = { state.agencyId = userInfo.agencyId; state.realNameFlag = userInfo.realName; }, - SET_APP_ID(state, appId) { + SET_APP_ID(state, appId){ state.appId = appId - } + }, + SET_HOUSE_ID(state, houseId){ + console.log(houseId,'houseIdVueX'); + state.houseId = houseId; + }, } const actions = { // 设置是否注册 diff --git a/src/views/houseQR/index.less b/src/views/houseQR/index.less index f18d56e..2b02fa5 100644 --- a/src/views/houseQR/index.less +++ b/src/views/houseQR/index.less @@ -78,4 +78,15 @@ a{ padding-top: 8px; box-sizing: border-box; font-family: pingfang-bold; +} +.footer{ + color: #ffffff; + background-color: rgba(51,51,51,0.9) ; + border-radius: 7px; + height: 38px; + padding: 7px 16px; + position: relative; + bottom: 20px; + box-sizing: border-box; + z-index: 10; } \ No newline at end of file diff --git a/src/views/houseQR/index.vue b/src/views/houseQR/index.vue index fc8b220..6e0660c 100644 --- a/src/views/houseQR/index.vue +++ b/src/views/houseQR/index.vue @@ -1,15 +1,14 @@ - + - + - 青岛市市北区重青岛市市北区重庆南路青岛市市北区重庆南路庆南路青岛市市北区重庆南路 - 120号205户 + {{ formData.houseAddress }} @@ -18,14 +17,14 @@ 所属社区: - 市北区 + {{ formData.communityName || '--' }} 所属网格: - 第一网格 + {{ formData.gridName || '--' }} @@ -33,9 +32,9 @@ 社区电话: - 0532-66778080 + {{ formData.communityTel || '--' }} - 拨打 + 拨打 @@ -46,7 +45,7 @@ - + {{ item.title }} @@ -55,22 +54,28 @@ 服务矩阵 + v-for="(item, index) in serverList" :key="index" @click="handelCLickJump"> {{ item.title }} +