优化代码

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 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: {

View File

@ -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
}

View File

@ -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',

View File

@ -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
},

View File

@ -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);
//
},