From 93061d43e42247737b7ef8d9f6808de0684a3ca8 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Thu, 18 Aug 2022 11:40:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 25 ++++++++++++++++++++++++- conf/config.js | 39 ++++++++++++++++++++++++--------------- constant/url.js | 1 + pages.json | 6 ++++-- pages/index/index.vue | 7 ++++++- 5 files changed, 59 insertions(+), 19 deletions(-) diff --git a/App.vue b/App.vue index 6f28788..0e6ee67 100755 --- a/App.vue +++ b/App.vue @@ -4,7 +4,12 @@ const loginFactory = context.factory.login; const userFactory = context.factory.user; - import {reciveMessage} from './api/webView/webViewApi.js' + import {reciveMessage} from './api/webView/webViewApi.js'; + + import {requestNoAuth} from './lib/java110/java110Request.js'; + + + import url from './constant/url.js' export default { // 小程序启动生命周期 @@ -24,6 +29,24 @@ animationType:'slide-in-bottom' }) }) + + requestNoAuth({ + url: url.listSystemInfo, + method: "GET", + data: { + page:1, + row:1 + }, + success: function(res) { + console.log(res.data); + if(res.data.data && res.data.data.length >0){ + uni.setStorageSync('java110SystemConfig',res.data.data[0]) + } + //reslove(res); + }, + fail: function(e) {} + + }); }, // app全局数据 globalData: { diff --git a/conf/config.js b/conf/config.js index 1c56aba..e2951aa 100755 --- a/conf/config.js +++ b/conf/config.js @@ -7,7 +7,7 @@ * @author 吴学文 * @QQ 928255095 */ - +let _systemConfig = uni.getStorageSync('java110SystemConfig'); // #ifdef H5 // 服务器域名 公众号时,配置为 / 就可以 const baseUrl = '/'; @@ -15,26 +15,18 @@ const baseUrl = '/'; // #ifndef H5 //服务器域名 小程序 或者 app 时 后端地址 -const baseUrl = 'http://demo.homecommunity.cn/'; +const baseUrl = 'http://192.168.1.108:8088/'; // #endif -const commonBaseUrl = 'http://demo.homecommunity.cn/'; +let commonBaseUrl = 'http://demo.homecommunity.cn/'; //商城的url -const mallUrl = 'http://mallapp.homecommunity.cn/'; - -const mallUrlIndexPage = mallUrl + '#/pages/index/index?mallFrom=HC'; - -//商城token 刷新页面 -const mallUrlRefresh = mallUrl + "#/pages/mallTokenRefresh/mallTokenRefresh?mallFrom=HC" - - +let mallUrl = 'http://mallapp.homecommunity.cn/'; //默认的小区ID和名称,用户还没有登录时显示的小区信息 -const DEFAULT_COMMUNITY_ID = "2021081177860471"; //HC测试小区id 用于没有登录时展示相关信息 -const DEFAULT_COMMUNITY_NAME = "HC演示小区"; - +let DEFAULT_COMMUNITY_ID = "2021081177860471"; //HC测试小区id 用于没有登录时展示相关信息 +let DEFAULT_COMMUNITY_NAME = "HC演示小区"; // APP 或者 公众号 appId const wAppId = ""; //微信AppId @@ -44,6 +36,22 @@ const appPayKey = ""; const logLevel = "DEBUG"; // 日志级别 +let systemName="业主版"; + +if(_systemConfig){ + mallUrl = _systemConfig.mallUrl; + commonBaseUrl = _systemConfig.imgUrl; + systemName = _systemConfig.ownerTitle; + DEFAULT_COMMUNITY_ID = _systemConfig.defaultCommunityId; +} + +const mallUrlIndexPage = mallUrl + '#/pages/index/index?mallFrom=HC'; + +//商城token 刷新页面 +const mallUrlRefresh = mallUrl + "#/pages/mallTokenRefresh/mallTokenRefresh?mallFrom=HC" + + + export default { baseUrl: baseUrl, mallUrl: mallUrl, @@ -55,5 +63,6 @@ export default { wAppId: wAppId, logLevel: logLevel, appPayKey: appPayKey, - imgUrl:commonBaseUrl + imgUrl:commonBaseUrl, + systemName:systemName } diff --git a/constant/url.js b/constant/url.js index ea415ee..7259550 100755 --- a/constant/url.js +++ b/constant/url.js @@ -147,6 +147,7 @@ export default { saveAddVisit: baseUrl + "callComponent/addVisit/save", queryReportInfoAnswerByOpenId : baseUrl + "app/reportInfoAnswer/queryReportInfoAnswerByOpenId", listOwnerVisit: baseUrl + "callComponent/visitManage/list", + listSystemInfo:baseUrl+"app/system.listSystemInfo", NEED_NOT_LOGIN_PAGE: [ 'pages/login/login', diff --git a/pages.json b/pages.json index 0a9a6d0..7631424 100755 --- a/pages.json +++ b/pages.json @@ -2,7 +2,7 @@ "pages": [{ "path": "pages/index/index", "style": { - "navigationBarTitleText": "HC智慧家园", + "navigationBarTitleText": "业主版", "backgroundColor": "#ffffff" } @@ -579,6 +579,7 @@ "selectedColor": "#00AA00", "backgroundColor": "#fff", "borderStyle": "black", + // #ifdef H5 "midButton": { "width": "65px", "height": "65px", @@ -586,6 +587,7 @@ "text": "开门", "iconWidth": "45px" }, + // #endif "list": [{ "pagePath": "pages/index/index", "text": "首页", @@ -623,7 +625,7 @@ "globalStyle": { "navigationBarTextStyle": "white", "navigationBarBackgroundColor": "#2B7FF0", - "navigationBarTitleText": "HC智慧家园", + "navigationBarTitleText": "业主版", "usingComponents": { //这里为方便,全局引入了所有组件,也可以在某个page下单独引用某个组件 }, diff --git a/pages/index/index.vue b/pages/index/index.vue index eb6daec..37efaec 100755 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -39,7 +39,9 @@ import { hasOwner - } from '../../api/owner/ownerApi.js' + } from '../../api/owner/ownerApi.js'; + + import conf from '@/conf/config.js' export default { data() { return { @@ -68,6 +70,9 @@ */ onLoad: function(options) { let _that = this; + uni.setNavigationBarTitle({ + title:conf.systemName + }) this.vc.onLoad(options); //查询目录 },