zhengkaixin 3 miesięcy temu
rodzic
commit
f52eadc882

+ 1 - 1
apis/index.js

@@ -1,5 +1,5 @@
 import request from '@/apis/utils/request.js';
 import requestWhite from '@/apis/utils/requestWhite.js';
 import Qs from 'qs';
- import  carhelp from '@/apis/utils/mixin.js'
+ import  jphelp from '@/apis/utils/mixin.js'
  

+ 5 - 166
apis/pagejs/index.js

@@ -1,87 +1,13 @@
 import request from '@/apis/utils/request'
-import carhelp from '@/apis/utils/mixin.js'
+import requestWhite from '@/apis/utils/requestWhite'
 
-export function companyKwhList(data) {
-	var url='/mobile/employee/companyKwhList';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-
-export function deviceStatusMonitoring(data) {
-	var url='mobile/employee/deviceStatusMonitoring';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-
-// 异常报警记录-详细
-export function alarmRecordDetails(id) {
-	var url='/mobile/employee/alarmRecordDetails';
-	return request({
-		method: 'post',
-		data: {id: id},
-		url: url
-	})
-}
-
-// 异常报警记录-异常查询条件
-export function alarmConfiguration() {
-	var url='/mobile/employee/alarmConfiguration';
-	return request({
-		method: 'post',
-		url: url
-	})
-}
-
-// 主页-异常告警记录
-export function alarmRecord(data) {
-	var url='/mobile/employee/alarmRecord';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
+import jphelp from '@/apis/utils/mixin.js'
 
-// 主页-设备状态
-export function homePageDeviceStatus(data) {
-	var url='/mobile/employee/homePageDeviceStatus';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-
-export function homePage(data) {
-	var url='/mobile/tenant/homePage';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
 
 export function findByOpenId(data) {
-	var url='/mobile/employeeUser/findByOpenId';
-	if(data){
-		data.code="reading"
-		data.unionid=carhelp.getUID()
-		
-	}
-	var obj = carhelp.get("xpgj_wx_user_info")
-	if ('prodv4'==process.car.NODE_ENV) {
-		url = "/mobile/employeeUser/findByCNameAndPhone"
-		data.phone = obj.unionPhone
-		data.companyName=obj.relationCompanyName
-		data.unionId=obj.unionId
-	}
-	return request({
+	var url='/mobile/sysUser/findByOpenId';
+	
+	return requestWhite({
 		method: 'get',
 		data: data,
 		url: url
@@ -89,90 +15,3 @@ export function findByOpenId(data) {
 }
 
 
-
-// 主页-用电量(设备远程抄表)
-export function homePageKwh(data) {
-	var url='/mobile/employee/homePageKwh';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-
-// 主页-设备数据检测(设备巡检)
-export function homePageDeviceData(data) {
-	var url='/mobile/employee/homePageDeviceData';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-
-// 主页-拥有的设备的单位
-export function deviceCompanyList() {
-	var url='/mobile/energyManage/deviceCompanyList';
-	return request({
-		method: 'post',
-		url: url
-	})
-}
-
-// 主页-累计报警
-export function deviceStatus(data) {
-	var url='/mobile/energyManage/deviceStatus';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-
-// 电量统计
-export function electricityStatistics(data) {
-	var url='/mobile/ElectricityMeter/electricityStatistics';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-
-// 时间段统计
-export function timeSlotStatistics(data) {
-	var url='/mobile/ElectricityMeter/timeSlotStatistics';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
- 
- 
- export function changeCompanyList(data) {
- 	var url='/mobile/employeeUser/changeCompanyList';
- 	return request({
- 		method: 'post',
- 		data: data,
- 		url: url
- 	})
- }
- export function changeCompany(data) {
- 	var url='/mobile/employeeUser/changeCompany';
- 	return request({
- 		method: 'post',
- 		data: data,
- 		url: url
- 	})
- }
- 
- export function alarmRecordTPUDetails(data) {
- 	var url='/mobile/employee/alarmRecordTPUDetails';
- 	return request({
- 		method: 'post',
- 		data: data,
- 		url: url
- 	})
- }
- 

+ 86 - 99
apis/pagejs/user.js

@@ -1,104 +1,91 @@
-import request from '@/apis/utils/request'
-import requestWhite from '@/apis/utils/requestWhite'
-import carhelp from '@/apis/utils/mixin.js'
-
-export function changePassword(data) {
-	var url = '/mobile/employeeUser/changePassword';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-
-
-export function changePhone(data) {
-	var url = '/mobile/employeeUser/changePhone';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-export function getVerifyCode(data) {
-	var url = '/mobile/employeeUser/getVerifyCode';
-	return requestWhite({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-export function logout(data) {
-	var url = '/mobile/employeeUser/logout';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-
-export function validateCode(data) {
-	var url = '/mobile/employeeUser/validateCode';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
+import request from '@/apis/utils/request'
+import requestWhite from '@/apis/utils/requestWhite'
+import jphelp from '@/apis/utils/mixin.js'
 
-export function personalCenter(data) {
-	var url = '/mobile/employee/personalCenter';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
+export function changePassword(data) {
+	var url = '/mobile/employeeUser/changePassword';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
 
 
-
-export function findByOpenId(data) {
-	var url = '/mobile/employeeUser/findByOpenId';
-	if(data){
-		 
-		data.code="reading"
-		
-		data.unionid=carhelp.getUID()
-		
-	}
-	var obj = carhelp.get("xpgj_wx_user_info")
-	if ('prodv4'==process.car.NODE_ENV) {
-		url = "/mobile/employeeUser/findByCNameAndPhone"
-		data.phone = obj.unionPhone
-		data.companyName=obj.relationCompanyName
-		data.unionId=obj.unionId
-	}
-	return requestWhite({
-		method: 'get',
-		data: data,
-		url: url
-	})
-}
-
-
-
-export function login(data) {
+export function changePhone(data) {
+	var url = '/mobile/employeeUser/changePhone';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+export function getVerifyCode(data) {
+	var url = '/mobile/employeeUser/getVerifyCode';
+	return requestWhite({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+export function logout(data) {
+	var url = '/mobile/employeeUser/logout';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function validateCode(data) {
+	var url = '/mobile/employeeUser/validateCode';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function personalCenter(data) {
+	var url = '/mobile/employee/personalCenter';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+
+
+export function findByOpenId(data) {
+	var url = '/mobile/sysUser/findByOpenId';
+	
+	return requestWhite({
+		method: 'get',
+		data: data,
+		url: url
+	})
+}
+
+
+
+export function login(data) {
 	var url = '/mobile/employeeUser/login';
-	data.code="reading"
-	return requestWhite({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-
-
-
-export function retrievePassword(data) {
-	var url = '/mobile/employeeUser/retrievePassword';
-	return requestWhite({
-		method: 'post',
-		data: data,
-		url: url
-	})
+	data.code="reading"
+	return requestWhite({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+
+
+export function retrievePassword(data) {
+	var url = '/mobile/employeeUser/retrievePassword';
+	return requestWhite({
+		method: 'post',
+		data: data,
+		url: url
+	})
 }

+ 108 - 141
apis/utils/init.js

@@ -1,147 +1,114 @@
-import carhelp from '@/apis/utils/mixin.js'
-
-import * as API_WeiXin from '@/apis/weixin.js'
-
-import {
-	getUrlParam,
-	getWeixinRedirectURI,
-	isWeiXin
-} from '@/apis/utils'
-var checkOpenId = true; //是否需要获取openId
-var openId = carhelp.getOpenId();
-var uid = carhelp.getUID();
-var unionPhone=carhelp.getUnionPhone()
-var app = {
-
-	init: function() {
-		// isWeiXin()|| 
-		const jpuid = getUrlParam('unionid');
-		const relationCompanyName = getUrlParam('relationCompanyName');
-		var unionPhone = getUrlParam('unionPhone');
-		
-		if (jpuid) {
-			var obj = carhelp.get("xpgj_wx_user_info")
-			if (obj == null || obj == '') {
-				obj = {
-					
-				}
-			}
-			obj.unionId = jpuid
-			if(obj.relationCompanyName!=relationCompanyName){
-				
-				carhelp.set("token_tdate",'');
+import jphelp from '@/apis/utils/mixin.js'
+
+import * as API_WeiXin from '@/apis/weixin.js'
+
+import {
+	getUrlParam,
+	getWeixinRedirectURI,
+	isWeiXin
+} from '@/apis/utils'
+var checkOpenId = true; //是否需要获取openId
+var openId = jphelp.getOpenId();
+var uid = jphelp.getUID();
+var unionPhone=jphelp.getUnionPhone()
+var app = {
+
+	init: function() {
+
+		
+		if (isWeiXin() || (process.env.NODE_ENV === "development")) {
+
+			if (checkOpenId) {
+				 if (!openId&&!uid) {
+					this.getOpenId();
+
+				} else {
+					this.getPersion(openId)
+				}
+			}
+		} else {
+			var NODE_NAME = process.env['NODE_NAME']
+			if (NODE_NAME == "production") {
+				alert("请使用微信打开本页面")
 			}
-			
-			obj.relationCompanyName = relationCompanyName
-			obj.unionPhone=unionPhone
-			carhelp.set("xpgj_wx_user_info", obj)
-			uid = carhelp.getUID();
-			unionPhone=carhelp.getUnionPhone()
-		}
-
-		if (isWeiXin() || (process.env.NODE_ENV === "development")) {
-
-			if (checkOpenId) {
-				 if (!openId&&!uid) {
-					this.getOpenId();
-
-				} else {
-					this.getPersion(openId)
-				}
-			}
-		} else {
-			var NODE_NAME = process.env['NODE_NAME']
-			if (NODE_NAME == "production") {
-				alert("请使用微信打开本页面")
-			}
-		}
-
-
-
-	},
-	
-	getPersion(thisopenId) {
-		console.log("init")
-		var tdate = new Date(+new Date() + 8 * 3600 * 1000).toJSON().substr(0, 15).replace("T", " ")
-		var token_tdate = carhelp.get("token_tdate"); //每10分钟存储一次token
-
-		if (token_tdate && token_tdate == tdate) {
-			return
-		}
-
-		var loginurl = "/mobile/employeeUser/findByOpenId"
-		var data = {
-			openId: thisopenId,
-			unionid: carhelp.getUID(),
-
-			//data.type="5"
-			code: "reading"
-		}
-		var obj = carhelp.get("xpgj_wx_user_info")
-		if ('prodv4'==process.car.NODE_ENV) {
-			loginurl = "/mobile/employeeUser/findByCNameAndPhone"
-			data.phone = obj.unionPhone
-			data.companyName=obj.relationCompanyName
-			data.unionId=obj.unionId
 		}
-		
-		 
-		uni.request({
-			method: 'get',
-			url: process.car.BASE_URL + loginurl,
-			data: data,
-			header: {
-				'Content-Type': 'application/x-www-form-urlencoded',
-				'X-Requested-With': 'XMLHttpRequest',
-				//'Authorization':token
-			}
-		}).then((response) => {
-			let [error, res] = response;
-
-			if (res.data.code == 200 && res.data.result) {
-
-				var token = res ? res.data.data.token : '';
-				carhelp.setPersonInfo(res.data.data.regUser);
-				carhelp.setPersonInfoPlus(res.data.data);
-
-				carhelp.setToken(token);
-
-			} else {
-				carhelp.logoff();
-			}
-		}).catch(error => {
-
-
-		})
-	},
-	getOpenId() {
+
+
+
+	},
+	
+	getPersion(thisopenId) {
+		console.log("init")
+		var tdate = new Date(+new Date() + 8 * 3600 * 1000).toJSON().substr(0, 15).replace("T", " ")
+		var token_tdate = jphelp.get("token_tdate"); //每10分钟存储一次token
+
+		if (token_tdate && token_tdate == tdate) {
+			return
+		}
+
+		var loginurl = "/mobile/sysUser/findByOpenId"
+	
+		var data= {
+				openId:thisopenId,
+				
+		}
+		 
+		uni.request({
+			method: 'get',
+			url: process.jphelp.BASE_URL + loginurl,
+			data: data,
+			header: {
+				'Content-Type': 'application/x-www-form-urlencoded',
+				'X-Requested-With': 'XMLHttpRequest',
+				//'Authorization':token
+			}
+		}).then((response) => {
+			let [error, res] = response;
+
+			if (res.data.code == 200 && res.data.result) {
+
+				var token = res ? res.data.data.token : '';
+				jphelp.setPersonInfo(res.data.data.regUser);
+				jphelp.setPersonInfoPlus(res.data.data);
+
+				jphelp.setToken(token);
+
+			} else {
+				jphelp.logoff();
+			}
+		}).catch(error => {
+
+
+		})
+	},
+	getOpenId() {
 		if (process.env.NODE_ENV === "development"){
-			carhelp.setOpenId(process.car.openId)
+			jphelp.setOpenId(process.jphelp.openId)
 			location.reload();
 			return
-		}
-		const code = getUrlParam('code');
-		var openId = carhelp.getOpenId()
-		if (!openId) {
-			if (!code) {
-				var url = document.URL;
-				var getUrl = getWeixinRedirectURI(process.car.VUE_APP_WXAPPID, url);
-
-				window.location.href = getUrl;
-			} else {
-
-				API_WeiXin.getDataByCode(code).then(response => {
-
-					carhelp.setOpenId(response.data.openid)
-					openId = response.data.openid;
-					carhelp.set("xpgj_wx_user_info", response.data)
-
-					location.reload();
-				}).catch(error => {
-					console.log(error);
-				});
-			}
-		}
-	}
-}
+		}
+		const code = getUrlParam('code');
+		var openId = jphelp.getOpenId()
+		if (!openId) {
+			if (!code) {
+				var url = document.URL;
+				var getUrl = getWeixinRedirectURI(process.jphelp.VUE_APP_WXAPPID, url);
+
+				window.location.href = getUrl;
+			} else {
+
+				API_WeiXin.getDataByCode(code).then(response => {
+
+					jphelp.setOpenId(response.data.openid)
+					openId = response.data.openid;
+					jphelp.set("xpgj_wx_user_info", response.data)
+
+					location.reload();
+				}).catch(error => {
+					console.log(error);
+				});
+			}
+		}
+	}
+}
 module.exports = app

+ 45 - 45
apis/utils/initALI.js

@@ -1,45 +1,45 @@
-import carhelp from '@/apis/utils/mixin.js'
-import * as API_WeiXin from '@/apis/weixin.js'
-
-import {
-	getUrlParam,
-	getAlipayRedirectURI,
- 
-} from '@/apis/utils'
-var checkOpenId = true; //是否需要获取openId
-var openId = carhelp.getOpenIdALI();
-
-var app = {
-	init: function() {
-		 
-		if (!openId) {
-			this.getOpenId();
-		} 
-		
-		
-	},
-	
-	getOpenId() {
-		
-		const code = getUrlParam('auth_code');
-		var openId= carhelp.getOpenIdALI()
-		
-		if (!openId) {
-			if (!code) {
-				
-				var authUrl = document.URL//.replace('pages/parking/search', 'pages/parking/auth');
-				window.location.href = getAlipayRedirectURI(process.car.VUE_APP_ALIAPPID, authUrl );
-			} else {
-				
-				API_WeiXin.getDataByCodeALI(code).then(response => {
-					
-					carhelp.setOpenIdALI(response.data.openid)
-					 location.reload();
-				}).catch(error => {
-					console.log(error);
-				});
-			}
-		}
-	}
-}
-module.exports = app
+import jphelp from '@/apis/utils/mixin.js'
+import * as API_WeiXin from '@/apis/weixin.js'
+
+import {
+	getUrlParam,
+	getAlipayRedirectURI,
+ 
+} from '@/apis/utils'
+var checkOpenId = true; //是否需要获取openId
+var openId = jphelp.getOpenIdALI();
+
+var app = {
+	init: function() {
+		 
+		if (!openId) {
+			this.getOpenId();
+		} 
+		
+		
+	},
+	
+	getOpenId() {
+		
+		const code = getUrlParam('auth_code');
+		var openId= jphelp.getOpenIdALI()
+		
+		if (!openId) {
+			if (!code) {
+				
+				var authUrl = document.URL//.replace('pages/parking/search', 'pages/parking/auth');
+				window.location.href = getAlipayRedirectURI(process.jphelp.VUE_APP_ALIAPPID, authUrl );
+			} else {
+				
+				API_WeiXin.getDataByCodeALI(code).then(response => {
+					
+					jphelp.setOpenIdALI(response.data.openid)
+					 location.reload();
+				}).catch(error => {
+					console.log(error);
+				});
+			}
+		}
+	}
+}
+module.exports = app

+ 97 - 137
apis/utils/mixin.js

@@ -1,138 +1,98 @@
-var prefix = 'jp-housekeep-manage-' + process.car.NODE_ENV + '_';
-
-var app = {
-
-	getGzDate: (key) => {
-		var tdate = new Date().toJSON().substr(0, 10).replace("T", " ")
-		var date = uni.getStorageSync(prefix + "is_gz_date")
-
-		if (tdate == date) {
-			return false
-		} else {
-			return true;
-		}
-
-	},
-	getUID: () => {
-		var obj = uni.getStorageSync(prefix + 'xpgj_wx_user_info')
-		if (!obj) {
-			obj = {}
-		}
-		if (obj.unionid && !obj.unionId) {
-			obj.unionId = obj.unionid
-		}
-		return obj.unionId
-	},
-	getUnionPhone: () => {
-		var obj = uni.getStorageSync(prefix + 'xpgj_wx_user_info')
-		if (!obj) {
-			obj = {}
-		}
-		
-		return obj.unionPhone
-		// if(!(process.env.NODE_ENV === "development") ){
-
-		// }else{
-		// 	return process.car.unionid
-		// }
-	},
-	setGzDate: () => uni.setStorageSync(prefix + "is_gz_date", new Date().toJSON().substr(0, 10).replace("T", " ")),
-
-	getGunIdCharge: () => {
-
-		var date = uni.getStorageSync(prefix + "GunId_Date_charge")
-		var now = new Date().getTime()
-		if (date + 5 * 60 * 1000 > now) {
-			return uni.getStorageSync(prefix + "GunId_Date_Show_charge")
-		} else {
-			return "";
-		}
-	},
-
-	setGunIdCharge: (value) => {
-		uni.setStorageSync(prefix + "GunId_Date_Show_charge", value)
-		uni.setStorageSync(prefix + "GunId_Date_charge", new Date().getTime())
-
-	},
-
-
-	getPrefix: () => prefix,
-	get: key => uni.getStorageSync(prefix + key),
-
-	set: (key, value) => uni.setStorageSync(prefix + key, value),
-	remove: key => uni.removeStorageSync(prefix + key),
-	setConfig: (value) => uni.setStorageSync(prefix + '_config_$', value),
-	getConfig: () => {
-		var config = uni.getStorageSync(prefix + '_config_$')
-		var configure = {}
-		if (config) {
-			for (var i in config) {
-				var con = config[i];
-				configure[con.key] = con.value
-			}
-		}
-		return configure;
-	},
-
-	setConfigMessage: (value) => uni.setStorageSync(prefix + '_config_tips_$', value),
-	getConfigMessage: () => {
-		var config = uni.getStorageSync(prefix + '_config_tips_$')
-		if (!config) {
-			config = []
-		}
-		return config;
-	},
-
-	logoff: () => {
-		uni.removeStorageSync(prefix + 'token_tdate')
-		uni.removeStorageSync(prefix + 'token')
-		uni.removeStorageSync(prefix + 'personInfo');
-		uni.removeStorageSync(prefix + 'personInfoPlus');
-		//	uni.removeStorageSync(prefix + 'getElderModeClass');
-		//uni.removeStorageSync(prefix+'wx_openId');
-
-	},
-
-	getPersonInfo: () => {
-		return uni.getStorageSync(prefix + 'personInfo')
-	},
-	getPersonInfoPlus: () => {
-		return uni.getStorageSync(prefix + 'personInfoPlus')
-	},
-	signOut: () => uni.removeStorageSync(prefix + 'personInfo'),
-	getOpenId: () => uni.getStorageSync(prefix + 'wx_openId' + process.car.VUE_APP_WXAPPID),
-	setOpenId: (value) => uni.setStorageSync(prefix + 'wx_openId' + process.car.VUE_APP_WXAPPID, value),
-
-	getOpenIdALI: () => uni.getStorageSync(prefix + 'ali_openId' + process.car.VUE_APP_WXAPPID),
-	setOpenIdALI: (value) => uni.setStorageSync(prefix + 'ali_openId' + process.car.VUE_APP_WXAPPID, value),
-
-	getUserInfo: () => {
-		return uni.getStorageSync(prefix + 'xpgj_wx_user_info')
-	},
-
-	setPersonInfo: (value) => uni.setStorageSync(prefix + 'personInfo', value),
-	setPersonInfoPlus: (value) => uni.setStorageSync(prefix + 'personInfoPlus', value),
-
-	setUserInfo: (value) => uni.setStorageSync(prefix + 'xpgj_wx_user_info', value),
-
-	getToken: (options) => {
-		//不同权限 ,不同token
-
-		return uni.getStorageSync(prefix + 'token')
-	},
-	setToken: (value) => {
-		uni.setStorageSync(prefix + 'token', value)
-
-		if (value) {
-			var tdate = new Date(+new Date() + 8 * 3600 * 1000).toJSON().substr(0, 15).replace("T", " ")
-			uni.setStorageSync(prefix + 'token_tdate', tdate)
-		}
-	},
-	getGetElderModeClass: () => {
-		return uni.getStorageSync(prefix + 'getElderModeClass')
-	},
-	setGetElderModeClass: (value) => uni.setStorageSync(prefix + 'getElderModeClass', value),
-
-}
-
+var prefix = 'jp-floorlock-manage-' + process.jphelp.NODE_ENV + '_';
+
+var app = {
+
+	getGzDate: (key) => {
+		var tdate = new Date().toJSON().substr(0, 10).replace("T", " ")
+		var date = uni.getStorageSync(prefix + "is_gz_date")
+
+		if (tdate == date) {
+			return false
+		} else {
+			return true;
+		}
+
+	},
+	
+	
+	setGzDate: () => uni.setStorageSync(prefix + "is_gz_date", new Date().toJSON().substr(0, 10).replace("T", " ")),
+
+	
+
+
+	getPrefix: () => prefix,
+	get: key => uni.getStorageSync(prefix + key),
+
+	set: (key, value) => uni.setStorageSync(prefix + key, value),
+	remove: key => uni.removeStorageSync(prefix + key),
+	setConfig: (value) => uni.setStorageSync(prefix + '_config_$', value),
+	getConfig: () => {
+		var config = uni.getStorageSync(prefix + '_config_$')
+		var configure = {}
+		if (config) {
+			for (var i in config) {
+				var con = config[i];
+				configure[con.key] = con.value
+			}
+		}
+		return configure;
+	},
+
+	setConfigMessage: (value) => uni.setStorageSync(prefix + '_config_tips_$', value),
+	getConfigMessage: () => {
+		var config = uni.getStorageSync(prefix + '_config_tips_$')
+		if (!config) {
+			config = []
+		}
+		return config;
+	},
+
+	logoff: () => {
+		uni.removeStorageSync(prefix + 'token_tdate')
+		uni.removeStorageSync(prefix + 'token')
+		uni.removeStorageSync(prefix + 'personInfo');
+		uni.removeStorageSync(prefix + 'personInfoPlus');
+		//	uni.removeStorageSync(prefix + 'getElderModeClass');
+		//uni.removeStorageSync(prefix+'wx_openId');
+
+	},
+
+	getPersonInfo: () => {
+		return uni.getStorageSync(prefix + 'personInfo')
+	},
+	getPersonInfoPlus: () => {
+		return uni.getStorageSync(prefix + 'personInfoPlus')
+	},
+	signOut: () => uni.removeStorageSync(prefix + 'personInfo'),
+	getOpenId: () => uni.getStorageSync(prefix + 'wx_openId' + process.jphelp.VUE_APP_WXAPPID),
+	setOpenId: (value) => uni.setStorageSync(prefix + 'wx_openId' + process.jphelp.VUE_APP_WXAPPID, value),
+
+	getOpenIdALI: () => uni.getStorageSync(prefix + 'ali_openId' + process.jphelp.VUE_APP_WXAPPID),
+	setOpenIdALI: (value) => uni.setStorageSync(prefix + 'ali_openId' + process.jphelp.VUE_APP_WXAPPID, value),
+
+	getUserInfo: () => {
+		return uni.getStorageSync(prefix + 'xpgj_wx_user_info')
+	},
+
+	setPersonInfo: (value) => uni.setStorageSync(prefix + 'personInfo', value),
+	setPersonInfoPlus: (value) => uni.setStorageSync(prefix + 'personInfoPlus', value),
+
+	setUserInfo: (value) => uni.setStorageSync(prefix + 'xpgj_wx_user_info', value),
+
+	getToken: (options) => {
+		//不同权限 ,不同token
+
+		return uni.getStorageSync(prefix + 'token')
+	},
+	setToken: (value) => {
+		uni.setStorageSync(prefix + 'token', value)
+
+		if (value) {
+			var tdate = new Date(+new Date() + 8 * 3600 * 1000).toJSON().substr(0, 15).replace("T", " ")
+			uni.setStorageSync(prefix + 'token_tdate', tdate)
+		}
+	},
+
+}
+
 module.exports = app

+ 13 - 21
apis/utils/request.js

@@ -1,18 +1,18 @@
-import  carhelp from '@/apis/utils/mixin.js'
+import  jphelp from '@/apis/utils/mixin.js'
 import requestSon from './requestSon.js';
 
 
 const request = (options) => {
 	//记录请求次数和响应次数
 	var tdate=new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().substr(0,15).replace("T"," ")
-	var token_tdate=carhelp.get("token_tdate");//每10分钟存储一次token
+	var token_tdate=jphelp.get("token_tdate");//每10分钟存储一次token
 	
-	var token=carhelp.getToken(options);
+	var token=jphelp.getToken(options);
 	
 	 if(token_tdate&&token_tdate==tdate){
 	 	return requestSon(options);
 	 }
-	 var openId=carhelp.getOpenId()
+	 var openId=jphelp.getOpenId()
 	 
 	var  urlindex="/wechat/findUserInfo"
 	var k=options.url.indexOf(urlindex)==-1;
@@ -25,24 +25,16 @@ const request = (options) => {
 	}
 	
 	return new Promise((resolve, reject) => {
-		 var loginurl="/mobile/employeeUser/findByOpenId"
+		 var loginurl="/mobile/sysUser/findByOpenId"
 		 var data= {
 				openId:openId,
-				//data.type="5"
-				unionid:carhelp.getUID(),
-				code:"reading"
+			
 				
-			}
-		 var obj = carhelp.get("xpgj_wx_user_info")
-		 if ('prodv4'==process.car.NODE_ENV) {
-		 	loginurl = "/mobile/employeeUser/findByCNameAndPhone"
-		 	data.phone = obj.unionPhone
-			data.companyName=obj.relationCompanyName
-			data.unionId=obj.unionId
-		 }
+		}
+		
 		uni.request({
 			method:'get',
-			url: process.car.BASE_URL + loginurl,
+			url: process.jphelp.BASE_URL + loginurl,
 			data:data,
 			
 			header: {
@@ -57,10 +49,10 @@ const request = (options) => {
 			if (res.data.code == 200&&res.data.result) {
 				
 				var token = res ? res.data.data.token : '';
-				carhelp.setPersonInfo(res.data.data.regUser );
+				jphelp.setPersonInfo(res.data.data.regUser );
 				
-				carhelp.setToken(token);
-				carhelp.setPersonInfoPlus(res.data.data);
+				jphelp.setToken(token);
+				jphelp.setPersonInfoPlus(res.data.data);
 				
 				options.token=token
 				
@@ -79,7 +71,7 @@ const request = (options) => {
 				if(options&&options.data&&options.data.jpcode){
 					thisurl+="?jpcode="+options.data.jpcode
 				}
-				carhelp.signOut()
+				jphelp.signOut()
 				uni.redirectTo({
 					url: thisurl
 				})

+ 4 - 4
apis/utils/requestSon.js

@@ -1,15 +1,15 @@
-import  carhelp from '@/apis/utils/mixin.js'
+import  jphelp from '@/apis/utils/mixin.js'
 
 //记录请求次数和响应次数
 let reqCount = 0,
 	resCount = 0;
-var baseUrl=process.car.BASE_URL;
+var baseUrl=process.jphelp.BASE_URL;
 
 if (process.env.NODE_ENV === "development") {
 	//baseUrl="http://192.168.33.230:8086/jp-employment-server";
 }
 const request = (options) => {
-	var token=carhelp.getToken(options);
+	var token=jphelp.getToken(options);
 	
 	reqCount++;
 	 
@@ -46,7 +46,7 @@ const request = (options) => {
 			
 			if (res.data.code == 415&&res.data.message=='请先注册信息') {
 				console.log("请先注册信息请先注册信息")
-				carhelp.signOut()
+				jphelp.signOut()
 				// uni.redirectTo({
 				// 	url: 'pages/login/index'
 				// })

+ 5 - 5
apis/utils/requestWhite.js

@@ -1,16 +1,16 @@
-import  carhelp from '@/apis/utils/mixin.js'
+import  jphelp from '@/apis/utils/mixin.js'
 
 //记录请求次数和响应次数
 let reqCount = 0,
 	resCount = 0;
-//var token=carhelp.getToken();
-var baseUrl=process.car.BASE_URL;
+//var token=jphelp.getToken();
+var baseUrl=process.jphelp.BASE_URL;
 
 if (process.env.NODE_ENV === "development") {
 	//baseUrl="http://192.168.33.90:8086/jp-employment-server";
 }
 const request = (options) => {
-	var token=carhelp.getToken(options);
+	var token=jphelp.getToken(options);
 	
 	reqCount++;
 	 
@@ -44,7 +44,7 @@ const request = (options) => {
 			let [error, res] = response;
 			
 			if (res.data.code == 415&&res.data.message=='请先注册信息') {
-				carhelp.signOut()
+				jphelp.signOut()
 				uni.redirectTo({
 					url: '/pages/login/login'
 				})

+ 1 - 1
apis/utils/wxJsApi.js

@@ -116,7 +116,7 @@ export function uploadPic(imgBase64) {
 
 //获取坐标
 export function getLocation() {
-	if(process.env.NODE_ENV === "development" && process.car.SIMPLE_RUN){
+	if(process.env.NODE_ENV === "development" && process.jphelp.SIMPLE_RUN){
 		
 		let promise =new Promise((resolve, reject) => {
 			var obj= {

+ 1 - 22
apis/weixin.js

@@ -6,9 +6,7 @@ import Qs from 'qs';
 
 //微信支付
 export function wxpay(data) {
-	if(data){
-		data.type="E"
-	}
+	
 	if(data&&!data.recordId){
 		data.recordId=''
 	}
@@ -20,25 +18,6 @@ export function wxpay(data) {
 }
 
 
-export function findByCNameAndPhone(code,phone,companyName) {
-	return requestWhite({
-		
-		url: '/mobile/employeeUser/findByCNameAndPhone?phone='+phone+'&companyName='+companyName+'&code=reading&unionId=' + code,
-		params: {},
-		method: 'get',
-	})
-}
-
-
-export function findByPhone(data,phone) {
-	var url='/mobile/employeeUser/findByPhone?phone='+phone+'&code=reading&unionId='+data;
-	
-	return requestWhite({
-		method: 'get',
-		
-		url: url
-	})
-}
 
 export function alpay(data) {
 	if(data&&!data.recordId){

+ 167 - 167
components/ShareServer.vue

@@ -1,167 +1,167 @@
-<template>
-	<view></view>
-</template>
-
-<script>
-
-	import wx from 'weixin-js-sdk'
-	import * as API_WeiXin from '@/apis/weixin'
-
-	export default {
-		name: 'Share',
-		props: {
-			 
-		},
-		data() {
-			return {
-				id:'',
-				title:'',
-				url:'',
-				isLoading: false,
-				nowItem: {
-					shareTitle: '',
-					shareImg: '',
-					shareDescription: ''
-				}
-			}
-		},
-		created() {},
-		methods: {
-			 addPoint(){
-				 if(this.id){
-					 API_WeiXin.addPoint({
-					 					 id:this.id,
-					 					 pointCode:"70007"
-					 }).then(response => {
-					 		//("积分添加成功")
-							uni.showToast({
-								title: "分享成功",
-								icon: "none"
-							})
-									 
-					 })
-				 }
-				 
-			 },
-			
-			//获取微信jssdk配置信息
-			get_wx_config() {
-				
-				
-				API_WeiXin.getConfig(window.location.href.split("#")[0]).then(response => {
-					
-					
-					var wxconfig = response.data.wxConfig;
-					
-					//(wxconfig.nonceStr)
-					//this.wxConfig = wxconfig;
-				
-					wx.config({
-						debug: false, // 开启调试模式,
-						appId: wxconfig.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
-						timestamp: wxconfig.timestamp, // 必填,生成签名的时间戳
-						nonceStr: wxconfig.nonceStr, // 必填,生成签名的随机串
-						signature: wxconfig.signature, // 必填,签名,见附录1
-						jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 
-						'onMenuShareQQ', 'onMenuShareQZone'] ,// 必填,需要使用的JS接口列表,所有JS接口列表见附录2
-						//'checkJsApi',,'updateAppMessageShareData','updateTimelineShareData'
-					});
-					
-						//("aaa")
-					//this.wxShare()
-				}).catch(error => {
-					//(error)
-						//("errorerror")
-				})
-			},
-			setUrl(url){
-				this.url=url;
-			},
-			setTitle(text,id){
-				this.title=text;
-				this.id=id;
-				this.wxShare() 
-				
-			},
-			//微信分享自定义
-			wxShare() {
-				var userInfo=this.carhelp.getPersonInfo()
-				var img=require("@/assets/img/logo.png")
-				
-				var title=this.title
-			//	var desc=
-				let joinUrl = this.url;
-				//(img);
-				//(title);
-				//(joinUrl);
-				var _this = this;
-				
-				wx.ready(function() {
-					
-					
-					// wx.updateTimelineShareData({
-					// 	title: title,
-					// //	desc:desc ,
-					// 	link: joinUrl,
-					// 	 imgUrl: img,
-					// 	success: function() {
-					// 		if(userInfo){
-					// 			//_this.addPoint()
-					// 		}
-					// 		// 设置成功
-					// 		_this.$emit("wxShare",null);
-					// 	}
-					// })
-					// wx.updateAppMessageShareData({
-					// 	title: title,
-					// //	desc:desc ,
-					// 	link: joinUrl,
-					// 	 imgUrl: img,
-					// 	success: function() {
-					// 		if(userInfo){
-					// 			//_this.addPoint()
-					// 		}
-					// 		// 设置成功
-					// 		_this.$emit("wxShare",null);
-					// 	}
-					// })
-					wx.onMenuShareAppMessage({
-						title: title,
-					 	desc:"[电管家]" ,
-						link: joinUrl,
-						 imgUrl: img,
-						success: function() {
-							//('111')
-							if(userInfo){
-								_this.addPoint()
-							}
-							// 设置成功
-							_this.$emit("wxShare",null);
-						}
-					})
-					wx.onMenuShareTimeline({
-						title: title,
-						desc:"[电管家]" ,
-						link: joinUrl,
-						 imgUrl: img,
-						success: function() {
-								//('222')
-							if(userInfo){
-								_this.addPoint()
-							}
-							// 设置成功
-							_this.$emit("wxShare",null);
-						}
-					})
-				});
-			}
-		},
-		mounted() {
-			this.url=window.location.href;
-			this.get_wx_config();
-		},
-	}
-</script>
-
-<style>
-</style>
+<template>
+	<view></view>
+</template>
+
+<script>
+
+	import wx from 'weixin-js-sdk'
+	import * as API_WeiXin from '@/apis/weixin'
+
+	export default {
+		name: 'Share',
+		props: {
+			 
+		},
+		data() {
+			return {
+				id:'',
+				title:'',
+				url:'',
+				isLoading: false,
+				nowItem: {
+					shareTitle: '',
+					shareImg: '',
+					shareDescription: ''
+				}
+			}
+		},
+		created() {},
+		methods: {
+			 addPoint(){
+				 if(this.id){
+					 API_WeiXin.addPoint({
+					 					 id:this.id,
+					 					 pointCode:"70007"
+					 }).then(response => {
+					 		//("积分添加成功")
+							uni.showToast({
+								title: "分享成功",
+								icon: "none"
+							})
+									 
+					 })
+				 }
+				 
+			 },
+			
+			//获取微信jssdk配置信息
+			get_wx_config() {
+				
+				
+				API_WeiXin.getConfig(window.location.href.split("#")[0]).then(response => {
+					
+					
+					var wxconfig = response.data.wxConfig;
+					
+					//(wxconfig.nonceStr)
+					//this.wxConfig = wxconfig;
+				
+					wx.config({
+						debug: false, // 开启调试模式,
+						appId: wxconfig.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
+						timestamp: wxconfig.timestamp, // 必填,生成签名的时间戳
+						nonceStr: wxconfig.nonceStr, // 必填,生成签名的随机串
+						signature: wxconfig.signature, // 必填,签名,见附录1
+						jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 
+						'onMenuShareQQ', 'onMenuShareQZone'] ,// 必填,需要使用的JS接口列表,所有JS接口列表见附录2
+						//'checkJsApi',,'updateAppMessageShareData','updateTimelineShareData'
+					});
+					
+						//("aaa")
+					//this.wxShare()
+				}).catch(error => {
+					//(error)
+						//("errorerror")
+				})
+			},
+			setUrl(url){
+				this.url=url;
+			},
+			setTitle(text,id){
+				this.title=text;
+				this.id=id;
+				this.wxShare() 
+				
+			},
+			//微信分享自定义
+			wxShare() {
+				var userInfo=this.jphelp.getPersonInfo()
+				var img=require("@/assets/img/logo.png")
+				
+				var title=this.title
+			//	var desc=
+				let joinUrl = this.url;
+				//(img);
+				//(title);
+				//(joinUrl);
+				var _this = this;
+				
+				wx.ready(function() {
+					
+					
+					// wx.updateTimelineShareData({
+					// 	title: title,
+					// //	desc:desc ,
+					// 	link: joinUrl,
+					// 	 imgUrl: img,
+					// 	success: function() {
+					// 		if(userInfo){
+					// 			//_this.addPoint()
+					// 		}
+					// 		// 设置成功
+					// 		_this.$emit("wxShare",null);
+					// 	}
+					// })
+					// wx.updateAppMessageShareData({
+					// 	title: title,
+					// //	desc:desc ,
+					// 	link: joinUrl,
+					// 	 imgUrl: img,
+					// 	success: function() {
+					// 		if(userInfo){
+					// 			//_this.addPoint()
+					// 		}
+					// 		// 设置成功
+					// 		_this.$emit("wxShare",null);
+					// 	}
+					// })
+					wx.onMenuShareAppMessage({
+						title: title,
+					 	desc:"[电管家]" ,
+						link: joinUrl,
+						 imgUrl: img,
+						success: function() {
+							//('111')
+							if(userInfo){
+								_this.addPoint()
+							}
+							// 设置成功
+							_this.$emit("wxShare",null);
+						}
+					})
+					wx.onMenuShareTimeline({
+						title: title,
+						desc:"[电管家]" ,
+						link: joinUrl,
+						 imgUrl: img,
+						success: function() {
+								//('222')
+							if(userInfo){
+								_this.addPoint()
+							}
+							// 设置成功
+							_this.$emit("wxShare",null);
+						}
+					})
+				});
+			}
+		},
+		mounted() {
+			this.url=window.location.href;
+			this.get_wx_config();
+		},
+	}
+</script>
+
+<style>
+</style>

+ 52 - 52
components/bobo-router/index.js

@@ -1,64 +1,64 @@
- 
-// import  carhelp from '@/utils/mixin.js'
-
+ 
+// import  jphelp from '@/utils/mixin.js'
+
 import Vue from 'vue'
-//  先运行yarn  初始化
-import uniCrazyRouter from "uni-crazy-router";
-Vue.use(uniCrazyRouter)
-//** 有bug, 第一次直接敲链接访问, 是访问bobo-router 前置守卫
-//**  后续操作,访问的是 uniCrazyRouter的前置守卫
-
-
-uniCrazyRouter.beforeEach(async (to, from, next) => {
-
+//  先运行yarn  初始化
+import uniCrazyRouter from "uni-crazy-router";
+Vue.use(uniCrazyRouter)
+//** 有bug, 第一次直接敲链接访问, 是访问bobo-router 前置守卫
+//**  后续操作,访问的是 uniCrazyRouter的前置守卫
+
+
+uniCrazyRouter.beforeEach(async (to, from, next) => {
+
 
 	routerBeforeEach(to, from, next);
-	
-})
-
-uniCrazyRouter.afterEach((to, from) => {
-	// 逻辑代码
+	
+})
+
+uniCrazyRouter.afterEach((to, from) => {
+	// 逻辑代码
 	console.log("afterEach")
-
-})
-
-uniCrazyRouter['on' + 'Error']((to, from) => {
-	// 逻辑代码
+
+})
+
+uniCrazyRouter['on' + 'Error']((to, from) => {
+	// 逻辑代码
 	console.log("Error+start")
 	console.log(to)
 	console.log(from)
 	console.log("Error+end")
-	
-})
-
-//import Router from './bobo-router'
-import carhelp from '@/apis/utils/mixin.js'
-
-//Vue.use(Router)
-
-// 路由配置 页面中全部使用this.$Router来操作路由,以实现路由的全局管理
-const router = new Router()
-
-// 路由全局拦截器 在这里处理登录、授权等相关操作
+	
+})
+
+//import Router from './bobo-router'
+import jphelp from '@/apis/utils/mixin.js'
+
+//Vue.use(Router)
+
+// 路由配置 页面中全部使用this.$Router来操作路由,以实现路由的全局管理
+const router = new Router()
+
+// 路由全局拦截器 在这里处理登录、授权等相关操作
 router.beforeEach(function(to, from, next) {
-	
+	
 	
 	routerBeforeEach(to, from, next);
-
-})
- 
-
-function routerBeforeEach(to, from, next) {
-	next();
-}
-// 路由后置拦截器
-router.afterEach(function(to, from) {
-	console.log('后置守卫')
-})
-
-// 路由跳转出错处理
-router.onError(function(e) {
-	console.log('错误:', e.message || '路由跳转失败')
-})
-
+
+})
+ 
+
+function routerBeforeEach(to, from, next) {
+	next();
+}
+// 路由后置拦截器
+router.afterEach(function(to, from) {
+	console.log('后置守卫')
+})
+
+// 路由跳转出错处理
+router.onError(function(e) {
+	console.log('错误:', e.message || '路由跳转失败')
+})
+
 export default router

+ 1 - 1
config/.env.dev.js

@@ -24,7 +24,7 @@ const UNI_APP = {
 	
 	//openId:"oLowyuMMjIkA_bLA4MXzRQ3KJB2E",//fjj
 	//openId:"oLowyuB1PliW0qAnJJ56axydeUOM",//zq
-	unionid:"",
+
 	//appid
 	VUE_APP_WXAPPID:"wx0b3c41a903053808",
 	VUE_APP_ALIAPPID:"2021003131641247",

+ 2 - 2
config/.env.js

@@ -36,9 +36,9 @@ function() {
 	
 
     if (ENV_VAR) {  
-		process.car = {};  
+		process.jphelp = {};  
         for (let key in ENV_VAR) {  
-			process.car[key] = ENV_VAR[key];			
+			process.jphelp[key] = ENV_VAR[key];			
         }  
     }  
 })();

+ 52 - 52
main.js

@@ -1,47 +1,47 @@
-import App from './App'
-import Vue from 'vue'
-import getOpenId from './apis/utils/init.js'
-import getALIOpenId from './apis/utils/initALI.js'
-//import './assets/font/font/font.css'
-var IS_WEIXIN = /MicroMessenger/.test(window.navigator.userAgent)
-var IS_ALI = /AlipayClient/.test(window.navigator.userAgent)
-
-if (IS_ALI) {
-
-	getALIOpenId.init()
-} else {
-	getOpenId.init()
-}
-
+import App from './App'
+import Vue from 'vue'
+import getOpenId from './apis/utils/init.js'
+import getALIOpenId from './apis/utils/initALI.js'
+//import './assets/font/font/font.css'
+var IS_WEIXIN = /MicroMessenger/.test(window.navigator.userAgent)
+var IS_ALI = /AlipayClient/.test(window.navigator.userAgent)
+
+if (IS_ALI) {
+
+	getALIOpenId.init()
+} else {
+	getOpenId.init()
+}
+
 import mixin from './apis/utils/mixin.js'
  
-Vue.prototype.carhelp = mixin
+Vue.prototype.jphelp = mixin
  window.wx = {}
- import Vconsole from 'vconsole'
+ import Vconsole from 'vconsole'
 //import uView from "uview-ui";
 import uView from '@/uni_modules/uview-ui'
-// import router from '@/components/bobo-router'
-
-Vue.use(uView);
-
-
+// import router from '@/components/bobo-router'
+
+Vue.use(uView);
+
+
 Vue.mixin({
-	
-	updated: function() {
-		
-	},
-	onReady() {
-
-
-	},
-	onLoad(option) {
-		if (option.test == 'test') {
-			let vConsole = new Vconsole()
+	
+	updated: function() {
+		
+	},
+	onReady() {
+
+
+	},
+	onLoad(option) {
+		if (option.test == 'test') {
+			let vConsole = new Vconsole()
 		}
 		
-		var ProjectName=process.car.ProjectName;
-		if(process.car.NODE_ENV=='dev'||process.car.NODE_ENV=='test'){
-			  ProjectName+='('+process.car.NODE_ENV+')';				 
+		var ProjectName=process.jphelp.ProjectName;
+		if(process.jphelp.NODE_ENV=='dev'||process.jphelp.NODE_ENV=='test'){
+			  ProjectName+='('+process.jphelp.NODE_ENV+')';				 
 		}
 		
 		uni.setNavigationBarTitle({
@@ -49,11 +49,11 @@ Vue.mixin({
 		}) 
 		
 		
-		this.personInfo=this.carhelp.getPersonInfo();
-		
-
-	},
-	methods: {
+		this.personInfo=this.jphelp.getPersonInfo();
+		
+
+	},
+	methods: {
 	
 		jpAmount(amount){
 			if(amount){
@@ -67,7 +67,7 @@ Vue.mixin({
 				return date.substr(0,11)
 			}
 			return ''
-		},
+		},
 		
 		gotoUrl(url) {
 			
@@ -95,14 +95,14 @@ Vue.mixin({
 					url: mod.clickUrl 
 				})
 			}
-		}
-	}
-})
-
-
-Vue.config.productionTip = false
-App.mpType = 'app'
-const app = new Vue({
-	...App
-})
+		}
+	}
+})
+
+
+Vue.config.productionTip = false
+App.mpType = 'app'
+const app = new Vue({
+	...App
+})
 app.$mount()

+ 2 - 8
pages.json

@@ -14,17 +14,11 @@
 				"navigationBarTitleText": "",
 				"enablePullDownRefresh": false
 			}
-		},
-
-
-		{
-			"path": "pages/index/homePage",
-			"style": {
-				"navigationBarTitleText": ""
-			}
 		}
 
 
+		
+
 	],
 
 

+ 0 - 188
pages/index/homePage.vue

@@ -1,188 +0,0 @@
-<template>
-	<view>
-		<u-navbar v-show="false"
-		 title="首页" title-color="#101010"></u-navbar>
-		 
-		<view class="navbar" >
-			智泊e家 运管端
-
-		</view>
-		<view class="tabs-box">
-			
-		</view>
-		<view class="main">
-			<view class="statistics">
-				<view class="title">
-					<view class="icon">
-						<image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
-					</view>
-					<view class="text">
-						设备监控度
-					</view>
-					<view class="check-all" @click="toEquipmentElectricity">
-						查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
-					</view>
-				</view>
-				
-				<view class="content"  >
-					<jpContent :status="jpContentMap.body1">
-						123
-					</jpContent>
-				</view>
-			</view>
-			
-			<view class="statistics">
-				<view class="title">
-					<view class="icon">
-						<image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
-					</view>
-					<view class="text">
-						在用场站
-					</view>
-				
-				</view>
-				
-				<view class="content"  >
-					<jpContent :status="jpContentMap.body1">
-						123
-					</jpContent>
-				</view>
-			</view>
-			
-		</view>
-		<tabbar :current="0"></tabbar>
-		
-	</view>
-</template>
-
-<script>
-	import Tabbar from '@/components/Tabbar.vue'
-	import jpContent from '@/components/JPcontent.vue'
-	
-	export default {
-		components: {
-			Tabbar,jpContent
-		},
-		data() {
-			return {
-				jpContentMap:{
-					body1:0
-				}
-			}
-		},
-		onLoad() {
-			
-		},
-		onReady() {
-			
-		},
-		methods: {
-			
-		}
-	}
-</script>
-
-<style scoped lang="scss">
-	// 导航栏
-	.navbar {
-		
-		
-		background-color: rgba(22, 119, 255, 1);
-		color: #fff;
-		line-height: 88rpx;
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		padding: 0 32rpx;
-		color: rgba(255, 255, 255, 1);
-		font-size: 36rpx;
-		position: fixed;
-		left: 0;
-		right: 0;
-		top: 0;
-		z-index: 999999;
-		    font-weight: bold;
-		
-	}
-	.main {
-		border-radius: 16px 16px 0px 0px;
-		background: linear-gradient(180deg, rgba(242, 244, 246, 1) 61%, rgba(255, 255, 255, 0) 100%);
-		margin-top: -24rpx;
-		padding: 32rpx 32rpx 32rpx 20rpx;
-		.statistics {
-			border-radius: 8px;
-			background-color: rgba(255, 255, 255, 1);
-			box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
-			margin-bottom: 24rpx;
-			padding: 40rpx;
-		
-			.title {
-				display: flex;
-				align-items: center;
-				margin-bottom: 16rpx;
-		
-				.img {
-					width: 36rpx;
-					height: 36rpx;
-					vertical-align: middle;
-					border-radius: 999px;
-		
-				}
-		
-				.change {
-					display: flex;
-					align-items: center;
-		
-					.change-img {
-						width: 32rpx;
-						height: 32rpx;
-						vertical-align: middle;
-					}
-		
-					text {
-		
-						margin-left: 8rpx;
-					}
-				}
-		
-		
-				.text {
-					color: rgba(16, 16, 16, 1);
-					font-size: 36rpx;
-					margin-left: 16rpx;
-					font-weight: bold;
-				}
-		
-				.change {
-					margin-left: 16rpx;
-					font-size: 24rpx;
-					color: #838383;
-		
-				}
-		
-				.check-all {
-					margin-left: auto;
-					color: rgba(131, 131, 131, 1);
-					font-size: 24rpx;
-				}
-			}
-		}
-	}
-	.tabs-box {
-		padding: 32rpx 0;
-		margin-top: 66rpx;
-		padding-right: 32rpx;
-		background-color: rgba(22, 119, 255, 1);
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-	
-		.tabs {
-			width: 97%;
-		}
-		.more{
-			padding-right: 12rpx;
-		}
-	
-	}
-</style>

+ 74 - 24
pages/index/index.vue

@@ -11,25 +11,7 @@
 			
 		</view>
 		<view class="main">
-			<view class="statistics">
-				<view class="title">
-					<view class="icon">
-						<image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
-					</view>
-					<view class="text">
-						设备监控度
-					</view>
-					<view class="check-all" @click="toEquipmentElectricity">
-						查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
-					</view>
-				</view>
-				
-				<view class="content"  >
-					<jpContent :status="jpContentMap.body1">
-						123
-					</jpContent>
-				</view>
-			</view>
+			
 			
 			<view class="statistics">
 				<view class="title">
@@ -37,14 +19,58 @@
 						<image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
 					</view>
 					<view class="text">
-						在用场站
+						综合统计
 					</view>
 				
 				</view>
 				
 				<view class="content"  >
 					<jpContent :status="jpContentMap.body1">
-						123
+						<table>
+							<tr>
+								<td rowspan="2" >
+									<view id="body1pie1" class="body1pie">
+										
+									</view>
+								</td>
+								<td>空闲5台</td>
+								<td>占用5台</td>
+							</tr>
+							<tr>
+								
+								<td>公共车位3台</td>
+								<td>私家车位1台</td>
+							</tr>
+							<tr>
+								<td rowspan="2" >
+									<view id="body1pie2" class="body1pie">
+										
+									</view>
+								</td>
+								<td>空闲5台</td>
+								<td>占用5台</td>
+							</tr>
+							<tr>
+								
+								<td>公共车位3台</td>
+								<td>私家车位1台</td>
+							</tr>
+							<tr>
+								<td rowspan="2" >
+									<view id="body1pie3" class="body1pie">
+										
+									</view>
+								</td>
+								<td>空闲5台</td>
+								<td>占用5台</td>
+							</tr>
+							<tr>
+								
+								<td>公共车位3台</td>
+								<td>私家车位1台</td>
+							</tr>
+							
+						</table>
 					</jpContent>
 				</view>
 			</view>
@@ -59,25 +85,49 @@
 	import Tabbar from '@/components/Tabbar.vue'
 	import jpContent from '@/components/JPcontent.vue'
 	
+	import * as API from '@/apis/pagejs/index.js'
+	
 	export default {
 		components: {
 			Tabbar,jpContent
 		},
 		data() {
 			return {
+				isReady:false,
 				jpContentMap:{
-					body1:0
+					body1:2
 				}
 			}
 		},
 		onLoad() {
-			
+			this.getfindByOpenId();
 		},
 		onReady() {
 			
 		},
 		methods: {
-			
+			init(){
+				
+			},
+			getfindByOpenId() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.findByOpenId({
+					openId: this.jphelp.getOpenId(),
+				}).then((response) => {
+					uni.hideLoading();
+					this.isReady = true;
+					
+					this.init()
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
 		}
 	}
 </script>

+ 6 - 6
pages/login/login.vue

@@ -46,9 +46,9 @@
 			loginset(response){
 				
 				var token = response ? response.data.token : '';
-				this.carhelp.setToken(token);
-				this.carhelp.setPersonInfo(response.data.regUser);
-				this.carhelp.setPersonInfoPlus(response.data)
+				this.jphelp.setToken(token);
+				this.jphelp.setPersonInfo(response.data.regUser);
+				this.jphelp.setPersonInfoPlus(response.data)
 				
 				//this.gotoUrl("pages/user/index")
 				uni.redirectTo({
@@ -63,9 +63,9 @@
 				
 				API.findByOpenId({
 					noerror:true,
-					openId: this.carhelp.getOpenId(),
+					openId: this.jphelp.getOpenId(),
 				 
-					unionid:this.carhelp.getUID(),
+				
 				}).then((response) => {
 					if(response.message){
 						uni.hideLoading();
@@ -120,7 +120,7 @@
 				API.login({
 					password:this.password,
 					phone:this.phone,
-					openId: this.carhelp.getOpenId(),
+					openId: this.jphelp.getOpenId(),
 					noerror:true,
 					//type:2,
 				}).then((response) => {

+ 349 - 350
uni_modules/uview-ui/components/u-navbar/u-navbar.vue

@@ -1,351 +1,350 @@
-<template>
-	<view class="">
-		<view class="u-navbar" :style="[navbarStyle]"
-			:class="{ 'u-navbar-fixed': isFixed, 'u-border-bottom': borderBottom }">
-			<view class="u-status-bar" :style="{ height: statusBarHeight* + 'rpx' }"></view>
-			<view class="u-navbar-inner" :style="[navbarInnerStyle]">
-				<view class="u-back-wrap" v-if="isBack" @tap="goBack">
-					<view class="u-icon-wrap">
-						<u-icon :name="backIconName" :color="backIconColor" :size="backIconSize"></u-icon>
-					</view>
-					<view class="u-icon-wrap u-back-text u-line-1" v-if="backText" :style="[backTextStyle]">
-						{{ backText }}</view>
-				</view>
-				<view class="u-navbar-content-title" v-if="title">
-					<view class="u-title u-line-1" :style="{
-							color: titleColor,
-							fontSize: titleSize + 'rpx',
-							fontWeight: titleBold ? 'bold' : 'normal'
-						}">
-						{{ title }}
-					</view>
-				</view>
-
-				<view class="u-slot-content">
-					<slot></slot>
-				</view>
-				<view class="u-slot-right">
-					<slot name="right"></slot>
-				</view>
-			</view>
-		</view>
-		<!-- 解决fixed定位后导航栏塌陷的问题 -->
-		<view class="u-navbar-placeholder" v-if="isFixed && !immersive"
-			:style="{ width: '100%', height: (Number(navbarHeight) + statusBarHeight)*2 + 'rpx' }"></view>
-	</view>
-</template>
-
-<script>
-	import {
-		getUrlParam,
-
-	} from '@/apis/utils'
-
-	// 获取系统状态栏的高度
-	let systemInfo = uni.getSystemInfoSync();
-	let menuButtonInfo = {};
-	// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
-	// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
-	menuButtonInfo = uni.getMenuButtonBoundingClientRect();
-	// #endif
-	/**
-	 * navbar 自定义导航栏
-	 * @description 此组件一般用于在特殊情况下,需要自定义导航栏的时候用到,一般建议使用uniapp自带的导航栏。
-	 * @tutorial https://www.uviewui.com/components/navbar.html
-	 * @property {String Number} height 导航栏高度(不包括状态栏高度在内,内部自动加上),注意这里的单位是px(默认44)
-	 * @property {String} back-icon-color 左边返回图标的颜色(默认#606266)
-	 * @property {String} back-icon-name 左边返回图标的名称,只能为uView自带的图标(默认arrow-left)
-	 * @property {String Number} back-icon-size 左边返回图标的大小,单位rpx(默认30)
-	 * @property {String} back-text 返回图标右边的辅助提示文字
-	 * @property {Object} back-text-style 返回图标右边的辅助提示文字的样式,对象形式(默认{ color: '#606266' })
-	 * @property {String} title 导航栏标题,如设置为空字符,将会隐藏标题占位区域
-	 * @property {String Number} title-width 导航栏标题的最大宽度,内容超出会以省略号隐藏,单位rpx(默认250)
-	 * @property {String} title-color 标题的颜色(默认#606266)
-	 * @property {String Number} title-size 导航栏标题字体大小,单位rpx(默认32)
-	 * @property {Function} custom-back 自定义返回逻辑方法
-	 * @property {String Number} z-index 固定在顶部时的z-index值(默认980)
-	 * @property {Boolean} is-back 是否显示导航栏左边返回图标和辅助文字(默认true)
-	 * @property {Object} background 导航栏背景设置,见官网说明(默认{ background: '#ffffff' })
-	 * @property {Boolean} is-fixed 导航栏是否固定在顶部(默认true)
-	 * @property {Boolean} immersive 沉浸式,允许fixed定位后导航栏塌陷,仅fixed定位下生效(默认false)
-	 * @property {Boolean} border-bottom 导航栏底部是否显示下边框,如定义了较深的背景颜色,可取消此值(默认true)
-	 * @example <u-navbar back-text="返回" title="剑未配妥,出门已是江湖"></u-navbar>
-	 */
-	export default {
-		name: "u-navbar",
-		props: {
-			// 导航栏高度,单位px,非rpx
-			height: {
-				type: [String, Number],
-				default: ''
-			},
-			// 返回箭头的颜色
-			backIconColor: {
-				type: String,
-				default: '#606266'
-			},
-			// 左边返回的图标
-			backIconName: {
-				type: String,
-				default: 'nav-back'
-			},
-			// 左边返回图标的大小,rpx
-			backIconSize: {
-				type: [String, Number],
-				default: '44'
-			},
-			// 返回的文字提示
-			backText: {
-				type: String,
-				default: ''
-			},
-			// 返回的文字的 样式
-			backTextStyle: {
-				type: Object,
-				default () {
-					return {
-						color: '#606266'
-					}
-				}
-			},
-			// 导航栏标题
-			title: {
-				type: String,
-				default: ''
-			},
-			titleLong: {
-				type: String,
-				default: ''
-			},
-			// 标题的宽度,如果需要自定义右侧内容,且右侧内容很多时,可能需要减少这个宽度,单位rpx
-			titleWidth: {
-				type: [String, Number],
-				default: '250'
-			},
-			// 标题的颜色
-			titleColor: {
-				type: String,
-				default: '#606266'
-			},
-			// 标题字体是否加粗
-			titleBold: {
-				type: Boolean,
-				default: false
-			},
-			// 标题的字体大小
-			titleSize: {
-				type: [String, Number],
-				default: 32
-			},
-			isBack: {
-				type: [Boolean, String],
-				default: true
-			},
-			// 对象形式,因为用户可能定义一个纯色,或者线性渐变的颜色
-			background: {
-				type: Object,
-				default () {
-					return {
-						background: '#ffffff'
-					}
-				}
-			},
-			// 导航栏是否固定在顶部
-			isFixed: {
-				type: Boolean,
-				default: true
-			},
-			// 是否沉浸式,允许fixed定位后导航栏塌陷,仅fixed定位下生效
-			immersive: {
-				type: Boolean,
-				default: false
-			},
-			// 是否显示导航栏的下边框
-			borderBottom: {
-				type: Boolean,
-				default: true
-			},
-			zIndex: {
-				type: [String, Number],
-				default: ''
-			},
-			// 自定义返回逻辑
-			customBack: {
-				type: Function,
-				default: null
-			}
-		},
-		data() {
-			return {
-				menuButtonInfo: menuButtonInfo,
-				statusBarHeight: systemInfo.statusBarHeight
-			};
-		},
-		computed: {
-			// 导航栏内部盒子的样式
-			navbarInnerStyle() {
-				let style = {};
-				// 导航栏宽度,如果在小程序下,导航栏宽度为胶囊的左边到屏幕左边的距离
-				style.height = this.navbarHeight * 2 + 'rpx';
-				// // 如果是各家小程序,导航栏内部的宽度需要减少右边胶囊的宽度
-				// #ifdef MP
-				let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
-				style.marginRight = rightButtonWidth + 'px';
-				// #endif
-				return style;
-			},
-			// 整个导航栏的样式
-			navbarStyle() {
-				let style = {};
-				style.zIndex = this.zIndex ? this.zIndex : this.$u.zIndex.navbar;
-				// 合并用户传递的背景色对象
-				Object.assign(style, this.background);
-				return style;
-			},
-			// 导航中间的标题的样式
-			titleStyle() {
-				let style = {};
-				// #ifndef MP
-				style.left = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
-				style.right = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
-				// #endif
-				// #ifdef MP
-				// 此处是为了让标题显示区域即使在小程序有右侧胶囊的情况下也能处于屏幕的中间,是通过绝对定位实现的
-				let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
-				style.left = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
-				style.right = rightButtonWidth - (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 +
-					rightButtonWidth +
-					'px';
-				// #endif
-				//style.width = uni.upx2px(this.titleWidth) + 'px';
-				return style;
-			},
-			// 转换字符数值为真正的数值
-			navbarHeight() {
-				// #ifdef APP-PLUS || H5
-				return this.height ? this.height : 44;
-				// #endif
-				// #ifdef MP
-				// 小程序特别处理,让导航栏高度 = 胶囊高度 + 两倍胶囊顶部与状态栏底部的距离之差(相当于同时获得了导航栏底部与胶囊底部的距离)
-				// 此方法有缺陷,暂不用(会导致少了几个px),采用直接固定值的方式
-				// return menuButtonInfo.height + (menuButtonInfo.top - this.statusBarHeight) * 2;//导航高度
-				let height = systemInfo.platform == 'ios' ? 44 : 48;
-				return this.height ? this.height : height;
-				// #endif
-			}
-		},
-		created() {},
-		methods: {
-			navberBack() {
-
-				const pages = getCurrentPages()
-				if (pages.length === 1) {
-					history.back()
-				} else {
-					uni.navigateBack();
-				}
-			},
-			goBack() {
-				const jpuid = getUrlParam('unionid');
-				if ('prodv4'==process.car.NODE_ENV) {
-					//window.location.href='https://xpgj.hbjp.com.cn/prod/jp-property-platform/index/#/master/'
-					//window.location.href = process.car.BACK_URL
-					window.history.back()
-					//'https://xpgj.hbjp.com.cn/prod/jp-property-platform/index/#/master/'
-				} else {
-					// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
-					if (typeof this.customBack === 'function') {
-						// 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
-						// 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
-						this.customBack.bind(this.$u.$parent.call(this))();
-					} else {
-						this.navberBack();
-					}
-				}
-
-
-			}
-		}
-	};
-</script>
-
-<style scoped lang="scss">
-	@import "../../libs/css/style.components.scss";
-
-	.u-navbar {
-		width: 100%;
-	}
-
-	.u-navbar-fixed {
-		position: fixed;
-		left: 0;
-		right: 0;
-		top: 0;
-		z-index: 991;
-	}
-
-	.u-status-bar {
-		width: 100%;
-	}
-
-	.u-navbar-inner {
-		@include vue-flex;
-		justify-content: space-between;
-		position: relative;
-		align-items: center;
-	}
-
-	.u-back-wrap {
-		@include vue-flex;
-		align-items: center;
-		flex: 1;
-		flex-grow: 0;
-		z-index: 999;
-		padding: 14rpx 14rpx 14rpx 24rpx;
-	}
-
-	.u-back-text {
-		padding-left: 4rpx;
-		font-size: 30rpx;
-	}
-
-	.u-navbar-content-title {
-		@include vue-flex;
-		align-items: center;
-		justify-content: center;
-		flex: 1;
-		position: absolute;
-		left: 0;
-		right: 0;
-		height: 60rpx;
-		text-align: center;
-		flex-shrink: 0;
-	}
-
-	.u-navbar-centent-slot {
-		flex: 1;
-	}
-
-	.u-title {
-		line-height: 60rpx;
-		font-size: 32rpx;
-		flex: 1;
-	}
-
-	.u-slot-right {
-		z-index: 99;
-	}
-
-	.u-navbar-right {
-		flex: 1;
-		@include vue-flex;
-		align-items: center;
-		justify-content: flex-end;
-	}
-
-	.u-slot-content {
-		flex: 1;
-		@include vue-flex;
-		align-items: center;
-	}
+<template>
+	<view class="">
+		<view class="u-navbar" :style="[navbarStyle]"
+			:class="{ 'u-navbar-fixed': isFixed, 'u-border-bottom': borderBottom }">
+			<view class="u-status-bar" :style="{ height: statusBarHeight* + 'rpx' }"></view>
+			<view class="u-navbar-inner" :style="[navbarInnerStyle]">
+				<view class="u-back-wrap" v-if="isBack" @tap="goBack">
+					<view class="u-icon-wrap">
+						<u-icon :name="backIconName" :color="backIconColor" :size="backIconSize"></u-icon>
+					</view>
+					<view class="u-icon-wrap u-back-text u-line-1" v-if="backText" :style="[backTextStyle]">
+						{{ backText }}</view>
+				</view>
+				<view class="u-navbar-content-title" v-if="title">
+					<view class="u-title u-line-1" :style="{
+							color: titleColor,
+							fontSize: titleSize + 'rpx',
+							fontWeight: titleBold ? 'bold' : 'normal'
+						}">
+						{{ title }}
+					</view>
+				</view>
+
+				<view class="u-slot-content">
+					<slot></slot>
+				</view>
+				<view class="u-slot-right">
+					<slot name="right"></slot>
+				</view>
+			</view>
+		</view>
+		<!-- 解决fixed定位后导航栏塌陷的问题 -->
+		<view class="u-navbar-placeholder" v-if="isFixed && !immersive"
+			:style="{ width: '100%', height: (Number(navbarHeight) + statusBarHeight)*2 + 'rpx' }"></view>
+	</view>
+</template>
+
+<script>
+	import {
+		getUrlParam,
+
+	} from '@/apis/utils'
+
+	// 获取系统状态栏的高度
+	let systemInfo = uni.getSystemInfoSync();
+	let menuButtonInfo = {};
+	// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
+	// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
+	menuButtonInfo = uni.getMenuButtonBoundingClientRect();
+	// #endif
+	/**
+	 * navbar 自定义导航栏
+	 * @description 此组件一般用于在特殊情况下,需要自定义导航栏的时候用到,一般建议使用uniapp自带的导航栏。
+	 * @tutorial https://www.uviewui.com/components/navbar.html
+	 * @property {String Number} height 导航栏高度(不包括状态栏高度在内,内部自动加上),注意这里的单位是px(默认44)
+	 * @property {String} back-icon-color 左边返回图标的颜色(默认#606266)
+	 * @property {String} back-icon-name 左边返回图标的名称,只能为uView自带的图标(默认arrow-left)
+	 * @property {String Number} back-icon-size 左边返回图标的大小,单位rpx(默认30)
+	 * @property {String} back-text 返回图标右边的辅助提示文字
+	 * @property {Object} back-text-style 返回图标右边的辅助提示文字的样式,对象形式(默认{ color: '#606266' })
+	 * @property {String} title 导航栏标题,如设置为空字符,将会隐藏标题占位区域
+	 * @property {String Number} title-width 导航栏标题的最大宽度,内容超出会以省略号隐藏,单位rpx(默认250)
+	 * @property {String} title-color 标题的颜色(默认#606266)
+	 * @property {String Number} title-size 导航栏标题字体大小,单位rpx(默认32)
+	 * @property {Function} custom-back 自定义返回逻辑方法
+	 * @property {String Number} z-index 固定在顶部时的z-index值(默认980)
+	 * @property {Boolean} is-back 是否显示导航栏左边返回图标和辅助文字(默认true)
+	 * @property {Object} background 导航栏背景设置,见官网说明(默认{ background: '#ffffff' })
+	 * @property {Boolean} is-fixed 导航栏是否固定在顶部(默认true)
+	 * @property {Boolean} immersive 沉浸式,允许fixed定位后导航栏塌陷,仅fixed定位下生效(默认false)
+	 * @property {Boolean} border-bottom 导航栏底部是否显示下边框,如定义了较深的背景颜色,可取消此值(默认true)
+	 * @example <u-navbar back-text="返回" title="剑未配妥,出门已是江湖"></u-navbar>
+	 */
+	export default {
+		name: "u-navbar",
+		props: {
+			// 导航栏高度,单位px,非rpx
+			height: {
+				type: [String, Number],
+				default: ''
+			},
+			// 返回箭头的颜色
+			backIconColor: {
+				type: String,
+				default: '#606266'
+			},
+			// 左边返回的图标
+			backIconName: {
+				type: String,
+				default: 'nav-back'
+			},
+			// 左边返回图标的大小,rpx
+			backIconSize: {
+				type: [String, Number],
+				default: '44'
+			},
+			// 返回的文字提示
+			backText: {
+				type: String,
+				default: ''
+			},
+			// 返回的文字的 样式
+			backTextStyle: {
+				type: Object,
+				default () {
+					return {
+						color: '#606266'
+					}
+				}
+			},
+			// 导航栏标题
+			title: {
+				type: String,
+				default: ''
+			},
+			titleLong: {
+				type: String,
+				default: ''
+			},
+			// 标题的宽度,如果需要自定义右侧内容,且右侧内容很多时,可能需要减少这个宽度,单位rpx
+			titleWidth: {
+				type: [String, Number],
+				default: '250'
+			},
+			// 标题的颜色
+			titleColor: {
+				type: String,
+				default: '#606266'
+			},
+			// 标题字体是否加粗
+			titleBold: {
+				type: Boolean,
+				default: false
+			},
+			// 标题的字体大小
+			titleSize: {
+				type: [String, Number],
+				default: 32
+			},
+			isBack: {
+				type: [Boolean, String],
+				default: true
+			},
+			// 对象形式,因为用户可能定义一个纯色,或者线性渐变的颜色
+			background: {
+				type: Object,
+				default () {
+					return {
+						background: '#ffffff'
+					}
+				}
+			},
+			// 导航栏是否固定在顶部
+			isFixed: {
+				type: Boolean,
+				default: true
+			},
+			// 是否沉浸式,允许fixed定位后导航栏塌陷,仅fixed定位下生效
+			immersive: {
+				type: Boolean,
+				default: false
+			},
+			// 是否显示导航栏的下边框
+			borderBottom: {
+				type: Boolean,
+				default: true
+			},
+			zIndex: {
+				type: [String, Number],
+				default: ''
+			},
+			// 自定义返回逻辑
+			customBack: {
+				type: Function,
+				default: null
+			}
+		},
+		data() {
+			return {
+				menuButtonInfo: menuButtonInfo,
+				statusBarHeight: systemInfo.statusBarHeight
+			};
+		},
+		computed: {
+			// 导航栏内部盒子的样式
+			navbarInnerStyle() {
+				let style = {};
+				// 导航栏宽度,如果在小程序下,导航栏宽度为胶囊的左边到屏幕左边的距离
+				style.height = this.navbarHeight * 2 + 'rpx';
+				// // 如果是各家小程序,导航栏内部的宽度需要减少右边胶囊的宽度
+				// #ifdef MP
+				let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
+				style.marginRight = rightButtonWidth + 'px';
+				// #endif
+				return style;
+			},
+			// 整个导航栏的样式
+			navbarStyle() {
+				let style = {};
+				style.zIndex = this.zIndex ? this.zIndex : this.$u.zIndex.navbar;
+				// 合并用户传递的背景色对象
+				Object.assign(style, this.background);
+				return style;
+			},
+			// 导航中间的标题的样式
+			titleStyle() {
+				let style = {};
+				// #ifndef MP
+				style.left = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
+				style.right = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
+				// #endif
+				// #ifdef MP
+				// 此处是为了让标题显示区域即使在小程序有右侧胶囊的情况下也能处于屏幕的中间,是通过绝对定位实现的
+				let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
+				style.left = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
+				style.right = rightButtonWidth - (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 +
+					rightButtonWidth +
+					'px';
+				// #endif
+				//style.width = uni.upx2px(this.titleWidth) + 'px';
+				return style;
+			},
+			// 转换字符数值为真正的数值
+			navbarHeight() {
+				// #ifdef APP-PLUS || H5
+				return this.height ? this.height : 44;
+				// #endif
+				// #ifdef MP
+				// 小程序特别处理,让导航栏高度 = 胶囊高度 + 两倍胶囊顶部与状态栏底部的距离之差(相当于同时获得了导航栏底部与胶囊底部的距离)
+				// 此方法有缺陷,暂不用(会导致少了几个px),采用直接固定值的方式
+				// return menuButtonInfo.height + (menuButtonInfo.top - this.statusBarHeight) * 2;//导航高度
+				let height = systemInfo.platform == 'ios' ? 44 : 48;
+				return this.height ? this.height : height;
+				// #endif
+			}
+		},
+		created() {},
+		methods: {
+			navberBack() {
+
+				const pages = getCurrentPages()
+				if (pages.length === 1) {
+					history.back()
+				} else {
+					uni.navigateBack();
+				}
+			},
+			goBack() {
+			
+				if ('prodv4'==process.jphelp.NODE_ENV) {
+					
+					window.history.back()
+					
+				} else {
+					// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
+					if (typeof this.customBack === 'function') {
+						// 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
+						// 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
+						this.customBack.bind(this.$u.$parent.call(this))();
+					} else {
+						this.navberBack();
+					}
+				}
+
+
+			}
+		}
+	};
+</script>
+
+<style scoped lang="scss">
+	@import "../../libs/css/style.components.scss";
+
+	.u-navbar {
+		width: 100%;
+	}
+
+	.u-navbar-fixed {
+		position: fixed;
+		left: 0;
+		right: 0;
+		top: 0;
+		z-index: 991;
+	}
+
+	.u-status-bar {
+		width: 100%;
+	}
+
+	.u-navbar-inner {
+		@include vue-flex;
+		justify-content: space-between;
+		position: relative;
+		align-items: center;
+	}
+
+	.u-back-wrap {
+		@include vue-flex;
+		align-items: center;
+		flex: 1;
+		flex-grow: 0;
+		z-index: 999;
+		padding: 14rpx 14rpx 14rpx 24rpx;
+	}
+
+	.u-back-text {
+		padding-left: 4rpx;
+		font-size: 30rpx;
+	}
+
+	.u-navbar-content-title {
+		@include vue-flex;
+		align-items: center;
+		justify-content: center;
+		flex: 1;
+		position: absolute;
+		left: 0;
+		right: 0;
+		height: 60rpx;
+		text-align: center;
+		flex-shrink: 0;
+	}
+
+	.u-navbar-centent-slot {
+		flex: 1;
+	}
+
+	.u-title {
+		line-height: 60rpx;
+		font-size: 32rpx;
+		flex: 1;
+	}
+
+	.u-slot-right {
+		z-index: 99;
+	}
+
+	.u-navbar-right {
+		flex: 1;
+		@include vue-flex;
+		align-items: center;
+		justify-content: flex-end;
+	}
+
+	.u-slot-content {
+		flex: 1;
+		@include vue-flex;
+		align-items: center;
+	}
 </style>