优化代码

This commit is contained in:
java110 2022-08-18 11:40:49 +08:00
parent 9a71cba1c7
commit 93061d43e4
5 changed files with 59 additions and 19 deletions

25
App.vue
View File

@ -4,7 +4,12 @@
const loginFactory = context.factory.login; const loginFactory = context.factory.login;
const userFactory = context.factory.user; 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 { export default {
// //
@ -24,6 +29,24 @@
animationType:'slide-in-bottom' 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 // app
globalData: { globalData: {

View File

@ -7,7 +7,7 @@
* @author 吴学文 * @author 吴学文
* @QQ 928255095 * @QQ 928255095
*/ */
let _systemConfig = uni.getStorageSync('java110SystemConfig');
// #ifdef H5 // #ifdef H5
// 服务器域名 公众号时,配置为 / 就可以 // 服务器域名 公众号时,配置为 / 就可以
const baseUrl = '/'; const baseUrl = '/';
@ -15,26 +15,18 @@ const baseUrl = '/';
// #ifndef H5 // #ifndef H5
//服务器域名 小程序 或者 app 时 后端地址 //服务器域名 小程序 或者 app 时 后端地址
const baseUrl = 'http://demo.homecommunity.cn/'; const baseUrl = 'http://192.168.1.108:8088/';
// #endif // #endif
const commonBaseUrl = 'http://demo.homecommunity.cn/'; let commonBaseUrl = 'http://demo.homecommunity.cn/';
//商城的url //商城的url
const mallUrl = 'http://mallapp.homecommunity.cn/'; let mallUrl = 'http://mallapp.homecommunity.cn/';
const mallUrlIndexPage = mallUrl + '#/pages/index/index?mallFrom=HC';
//商城token 刷新页面
const mallUrlRefresh = mallUrl + "#/pages/mallTokenRefresh/mallTokenRefresh?mallFrom=HC"
//默认的小区ID和名称用户还没有登录时显示的小区信息 //默认的小区ID和名称用户还没有登录时显示的小区信息
const DEFAULT_COMMUNITY_ID = "2021081177860471"; //HC测试小区id 用于没有登录时展示相关信息 let DEFAULT_COMMUNITY_ID = "2021081177860471"; //HC测试小区id 用于没有登录时展示相关信息
const DEFAULT_COMMUNITY_NAME = "HC演示小区"; let DEFAULT_COMMUNITY_NAME = "HC演示小区";
// APP 或者 公众号 appId // APP 或者 公众号 appId
const wAppId = ""; //微信AppId const wAppId = ""; //微信AppId
@ -44,6 +36,22 @@ const appPayKey = "";
const logLevel = "DEBUG"; // 日志级别 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 { export default {
baseUrl: baseUrl, baseUrl: baseUrl,
mallUrl: mallUrl, mallUrl: mallUrl,
@ -55,5 +63,6 @@ export default {
wAppId: wAppId, wAppId: wAppId,
logLevel: logLevel, logLevel: logLevel,
appPayKey: appPayKey, appPayKey: appPayKey,
imgUrl:commonBaseUrl imgUrl:commonBaseUrl,
systemName:systemName
} }

View File

@ -147,6 +147,7 @@ export default {
saveAddVisit: baseUrl + "callComponent/addVisit/save", saveAddVisit: baseUrl + "callComponent/addVisit/save",
queryReportInfoAnswerByOpenId : baseUrl + "app/reportInfoAnswer/queryReportInfoAnswerByOpenId", queryReportInfoAnswerByOpenId : baseUrl + "app/reportInfoAnswer/queryReportInfoAnswerByOpenId",
listOwnerVisit: baseUrl + "callComponent/visitManage/list", listOwnerVisit: baseUrl + "callComponent/visitManage/list",
listSystemInfo:baseUrl+"app/system.listSystemInfo",
NEED_NOT_LOGIN_PAGE: [ NEED_NOT_LOGIN_PAGE: [
'pages/login/login', 'pages/login/login',

View File

@ -2,7 +2,7 @@
"pages": [{ "pages": [{
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "HC智慧家园", "navigationBarTitleText": "业主版",
"backgroundColor": "#ffffff" "backgroundColor": "#ffffff"
} }
@ -579,6 +579,7 @@
"selectedColor": "#00AA00", "selectedColor": "#00AA00",
"backgroundColor": "#fff", "backgroundColor": "#fff",
"borderStyle": "black", "borderStyle": "black",
// #ifdef H5
"midButton": { "midButton": {
"width": "65px", "width": "65px",
"height": "65px", "height": "65px",
@ -586,6 +587,7 @@
"text": "开门", "text": "开门",
"iconWidth": "45px" "iconWidth": "45px"
}, },
// #endif
"list": [{ "list": [{
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"text": "首页", "text": "首页",
@ -623,7 +625,7 @@
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#2B7FF0", "navigationBarBackgroundColor": "#2B7FF0",
"navigationBarTitleText": "HC智慧家园", "navigationBarTitleText": "业主版",
"usingComponents": { //便page "usingComponents": { //便page
}, },

View File

@ -39,7 +39,9 @@
import { import {
hasOwner hasOwner
} from '../../api/owner/ownerApi.js' } from '../../api/owner/ownerApi.js';
import conf from '@/conf/config.js'
export default { export default {
data() { data() {
return { return {
@ -68,6 +70,9 @@
*/ */
onLoad: function(options) { onLoad: function(options) {
let _that = this; let _that = this;
uni.setNavigationBarTitle({
title:conf.systemName
})
this.vc.onLoad(options); this.vc.onLoad(options);
// //
}, },