xhj %!s(int64=3) %!d(string=hai) anos
pai
achega
125c5b954a

+ 6 - 19
machineAndCell/map/map.vue

@@ -40,7 +40,7 @@
 			</view>
 			<view class="ddflex info-card-item">
 				<view class="fflex">
-					地址:{{info.address}}
+					地址:{{info.address?info.address:''}}
 				</view>
 			</view>
 		</view>
@@ -72,7 +72,7 @@
 		},
 		async onLoad(options) {
 			this.id = options.id
-			await this.getMap()
+			// await this.getMap()
 			this.toLocation()
 		},
 		onShow() {
@@ -98,21 +98,7 @@
 							id: 0,
 							latitude: this.info.weidu, //纬度
 							longitude: this.info.jingdu, //经度
-							iconPath: '', //显示的图标        
-							rotate: 0, // 旋转度数
-							width: 20, //宽
-							height: 30, //高
-							//   title:'我在这里',//标注点名
-							alpha: 0.5, //透明度
-							callout: { //自定义标记点上方的气泡窗口 点击有效  
-								content: this.info.user_name, //文本
-								color: '#ffffff', //文字颜色
-								fontSize: 14, //文本大小
-								borderRadius: 15, //边框圆角
-								borderWidth: '10',
-								bgColor: '#e51860', //背景颜色
-								display: 'ALWAYS', //常显
-							}
+							
 						}]
 						this.getAddress()
 						uni.setNavigationBarTitle({
@@ -130,7 +116,8 @@
 			callouttap(e) {
 				console.log('地图点击事件', e)
 			},
-			toLocation() {
+			async toLocation() {
+				await this.getMap()
 				console.log('地图控件回到原位');
 				req.getLocation((res) => {
 					console.log('当前位置:', res);
@@ -144,7 +131,7 @@
 			},
 			getAddress() {
 				QQMapWX.initMap();
-				this.location = {
+				let location = {
 					longitude: this.info.jingdu,
 					latitude: this.info.weidu
 				}

+ 1 - 0
pages/authorize/authorize.css

@@ -13,6 +13,7 @@ page{
 .xieyi text{color: #4A99DF !important;}
 .agree-icon{
 	width: 24rpx;height: 24rpx;margin-right: 17rpx;margin-top: 58rpx;
+	    padding: 0rpx 0 30rpx 30rpx;
 }
 .copy {font-size: 24rpx;color: #9b9b9b;}
 .btnphone, .goloing {width: 600rpx !important;height: 86rpx !important;line-height: 86rpx !important;background: var(--mina);border-radius: 6rpx !important;font-size: 32rpx;color: #FFFFFF;position: fixed;left: 50%;transform: translateX(-50%);bottom: 514rpx;}

+ 18 - 11
pages/authorize/authorize.vue

@@ -1,5 +1,6 @@
 <template>
-	<view style="padding: 77rpx;box-sizing: border-box;">
+	<view>
+	<view style="padding: 77rpx 77rpx 0rpx;box-sizing: border-box;">
 		<!--pages/authorize/authorize.wxml-->
 		<block>
 			<view class="authorize-title">
@@ -20,19 +21,25 @@
 			</view>
 			
 			<button class="login" @click="submitLogin()">授权登录</button>
-			<view class="dflex">
-				<image v-if='agree' class="agree-icon" src="../../static/pages/images/agree_h.png" @click="agree=false"></image>
-				<image v-else class="agree-icon" src="../../static/pages/images/agree.png" @click="agree=true"></image>
-				<view hover-class="none" class="xieyi fflex">
-					已阅读并同意
-					<text @click="jump('/mine/page/page?title=用户协议&isXieyi=true')">《皮小电用户服务协议》</text>
-					与
-					<text @click="jump('/mine/page/page?title=隐私声明&isYinsi=true')">《皮小电隐私协议》</text>
-				</view>
-			</view>
+			
 		</block>
 		
 	</view>
+	<view class="dflex" style="margin: 0 77rpx 0 47rpx;">
+		<view v-if='agree' class="agree-icon" @click="agree=false">
+			<image style="width: 100%;height: 100%;" src="../../static/pages/images/agree_h.png" ></image>
+		</view>
+		<view v-else class="agree-icon" @click="agree=true">
+			<image style="width: 100%;height: 100%;" src="../../static/pages/images/agree.png" ></image>
+		</view>
+		<view hover-class="none" class="xieyi fflex">
+			已阅读并同意
+			<text @click="jump('/mine/page/page?title=用户协议&isXieyi=true')">《皮小电用户服务协议》</text>
+			与
+			<text @click="jump('/mine/page/page?title=隐私声明&isYinsi=true')">《皮小电隐私协议》</text>
+		</view>
+	</view>
+	</view>
 </template>
 
 <script>

+ 5 - 4
pages/cell/cell.vue

@@ -207,16 +207,17 @@
 		methods: {
 			getP(type){
 				let p = 0
+				console.log('111')
 				if(type==1){
-					if(this.count.leaseCount == 0){}
+					if(this.count.leaseCount == 0 || this.count.leaseCount == undefined){}
 					else{
-						return (this.count.leaseCount/(this.count.leaseCount+this.count.noLeaseCount)).toFixed(4)*100
+						return (this.count.leaseCount/(this.count.leaseCount+(this.count.noLeaseCount?this.count.noLeaseCount:0))).toFixed(4)*100
 					}
 				}
 				if(type==2){
-					if(this.count.noLeaseCount == 0){}
+					if(this.count.noLeaseCount == 0 || this.count.noLeaseCount == undefined){}
 					else{
-						return (this.count.noLeaseCount/(this.count.leaseCount+this.count.noLeaseCount)).toFixed(4)*100
+						return (this.count.noLeaseCount/(this.count.leaseCount+(this.count.noLeaseCount?this.count.noLeaseCount:0))).toFixed(4)*100
 					}
 				}
 				return p*100

+ 5 - 1
pages/index/index.css

@@ -156,4 +156,8 @@ page {
 	opacity: 1;
 	background-color: #E6E6E6;
 	margin: 30rpx auto;
-}
+}
+
+.wei-login{font-size: 24rpx;color: #333;text-align: center;padding: 0 30rpx 60rpx;}
+.wei-login image{width: 495rpx;height: 424rpx;margin: 0 auto 20rpx;}
+.cart-login{border: 1rpx solid var(--mina);font-size: 30rpx;color: var(--mina);font-weight: bold;height: 80rpx;line-height: 80rpx;border-radius: 40rpx;width: 260rpx;margin: 65rpx auto 0;}

+ 28 - 12
pages/index/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<view>
+	<view v-if="isLogin">
 		<!-- 背景图 -->
 		<view class="index-bg">
 			<image src="../../static/pages/images/self/indexBg.png"></image>
@@ -144,6 +144,14 @@
 		</view>
 		<foot channel="home" :isUpdate="isUpdate"></foot>
 	</view>
+	<view v-else>
+		<view class="wei-login" v-if="!isLogin">
+			<image :src="picUrlss + 'wei_login.png'"></image>
+			<view>暂未登录</view>
+			<navigator url="/pages/authorize/authorize" hover-class="none" class="cart-login">立即登录</navigator>
+		</view>
+		<foot channel="home" :isUpdate="isUpdate"></foot>
+	</view>
 </template>
 
 <script>
@@ -164,10 +172,13 @@
 	export default {
 		data() {
 			return {
+				picUrlss: req.public.picUrls,
 				systems: {},
 				bottomBlankHeight: app.globalData.isIPhoneX ? 68 : 0,
 				pxToRpxScale: 0,
 				rpxTopxScale: 0,
+				
+				isLogin:false,
 
 				timeType: 1, //统计时间 1.按日 2.按月 3.按季度
 				storeType:1,//营业额查询1.商家 2.门店
@@ -231,7 +242,7 @@
 					series: [{
 							name: '订单数',
 							type: 'line',
-							data: [300, 270, 340, 344, 300, 320, 310],
+							data: [],
 							showSymbol: false,
 							smooth: true,
 							itemStyle: {
@@ -244,7 +255,7 @@
 						{
 							name: '订单金额',
 							type: 'line',
-							data: [120, 102, 141, 174, 190, 250, 220],
+							data: [],
 							showSymbol: false,
 							smooth: true,
 							itemStyle: {
@@ -257,7 +268,7 @@
 						{
 							name: '收益金额',
 							type: 'line',
-							data: [120, 102, 141, 174, 190, 250, 120],
+							data: [],
 							showSymbol: false,
 							smooth: true,
 							itemStyle: {
@@ -338,7 +349,7 @@
 								align:'right'
 							},
 						},
-						data: [300, 270, 340, 344, 300, 320, 310],
+						data: [],
 						barWidth: 5,
 						itemStyle: {
 							// 颜色
@@ -556,13 +567,18 @@
 		},
 
 		async onShow() {
-			await this.getEchartData()
-			await this.getStatisticData()
-			await this.getStoreData()
-			
-			this.init()
-			
-			this.getUserInfo()
+			if(req.isLogins(false)){
+				this.isLogin = true
+				await this.getEchartData()
+				await this.getStatisticData()
+				await this.getStoreData()
+				
+				this.init()
+				
+				this.getUserInfo()
+			}else{
+				this.isLogin = false
+			}
 		},
 
 		onUnload() {},

+ 4 - 2
utils/request.js

@@ -64,13 +64,15 @@ const loadToken = (success) => {
 	// 		msg('access_token 获取失败');
 	// 	}
 	// })
+	console.log('token')
 	let token = getStorage('AUTH_TOKEN');
 	if (token) {
 		success.call(this, token);
 		return false;
 	} else {
-		msg('access_token 获取失败');
-		return redirectIndex();
+		// msg('access_token 获取失败');
+		removeStorage('userInfo')
+		// return redirectIndex();
 	}
 	
 }

+ 8 - 4
warning/userAlarm/userAlarm.vue

@@ -12,21 +12,21 @@
 			<view class="order-item-body">
 				<view class="order-item-content ddflex">
 					<view class="order-item-content-label">机柜编号</view>
-					<view class="order-item-content-data fflex tover">{{item.devId}}</view>
+					<view class="order-item-content-data fflex tover">{{item.devId?item.devId:'/'}}</view>
 				</view>
 				<view class="order-item-content ddflex">
 					<view class="order-item-content-label">电池ID</view>
-					<view class="order-item-content-data fflex tover">{{item.batteryId}}</view>
+					<view class="order-item-content-data fflex tover">{{item.batteryId?item.batteryId:'/'}}</view>
 				</view>
 				<view class="order-item-content ddflex">
 					<view class="order-item-content-label">报障问题</view>
-					<view class="order-item-content-data fflex tover">{{item.type}}</view>
+					<view class="order-item-content-data fflex tover">{{getTypeString(item.type)}}</view>
 				</view>
 			</view>
 			<view class="order-item-body2">
 				<view class="order-item-content-label">问题补充描述</view>
 				<view class="order-item-content ddflex" style="font-size: 24rpx;font-weight: 400;">
-					{{item.content}}
+					{{item.content?item.content:'暂无'}}
 				</view>
 				<view class="images-box ddflex">
 					<image class="images" v-for="it in imageList" :src="it"></image>
@@ -98,6 +98,10 @@
 				if (!req.isLogin()) return false;
 				app.globalData.navigateTo(url);
 			},
+			getTypeString(type){
+				let arr = ['充电柜故障','电池故障','电池断电故障','电池损坏故障','其它故障']
+				return arr[Number(type)-1]?arr[Number(type)-1]:'其它故障'
+			},
 			// 弹窗弹出
 			openPop(item) {
 				this.tempData = JSON.parse(JSON.stringify(item))