Browse Source

版本检测和显示

aleyds 3 years ago
parent
commit
886b66c838
3 changed files with 28 additions and 37 deletions
  1. 1 35
      pages/index/index.vue
  2. 7 0
      pages/setting/setting.scss
  3. 20 2
      pages/setting/setting.vue

+ 1 - 35
pages/index/index.vue

@@ -33,18 +33,6 @@
 				</view>
 			</view>
 			<view class="feature-list u-flex u-flex-wrap u-row-between">				
-				<!-- <view class="feature-item" @click="speaks('贵AF113Z')">
-					<u-image width="160rpx" height="160rpx" src="/static/img/index-feature-02.png"></u-image>
-					<view class="feature-item-text">拍照取证</view>
-				</view> -->
-				<!-- <view class="feature-item" @click="$refs.uToast.show({title: '建设中'})">
-					<u-image width="160rpx" height="160rpx" src="/static/img/index-feature-03.png"></u-image>
-					<view class="feature-item-text">缴费</view>
-				</view> -->
-				<!-- <view class="feature-item" @click="$refs.uToast.show({title: '建设中'})">
-					<u-image width="160rpx" height="160rpx" src="/static/img/index-feature-04.png"></u-image>
-					<view class="feature-item-text">车位管理</view>
-				</view> -->
 				<view class="feature-item" @click="openPage('/pages/parking/parking')">
 					<u-image width="160rpx" height="160rpx" src="/static/img/index-feature-05.png"></u-image>
 					<view class="feature-item-text">车辆入场</view>
@@ -57,10 +45,6 @@
 					<u-image width="160rpx" height="160rpx" src="/static/img/index-feature-01.png"></u-image>
 					<view class="feature-item-text">签到打卡</view>
 				</view>
-				<!-- <view class="feature-item" @click="openPage('pages/modifypwd/modifypwd')">
-					<u-image width="160rpx" height="160rpx" src="/static/img/index-feature-07.png"></u-image>
-					<view class="feature-item-text">密码修改</view>
-				</view> -->
 				<view class="feature-item" @click="openPage('/pages/ownersquery/ownersquery')">
 					<u-image width="160rpx" height="160rpx" src="/static/img/index-feature-10.png"></u-image>
 					<view class="feature-item-text">车主查询</view>
@@ -72,11 +56,7 @@
 				<view class="feature-item" @click="openPage('/pages/setting/setting')">
 					<u-image width="160rpx" height="160rpx" src="/static/img/index-feature-08.png"></u-image>
 					<view class="feature-item-text">设置</view>
-				</view>
-				<!-- <view class="feature-item" @click="logout">
-					<u-image width="160rpx" height="160rpx" src="/static/img/index-feature-09.png"></u-image>
-					<view class="feature-item-text">退出登录</view>
-				</view>	 -->			
+				</view>		
 			</view>
 			<u-bottom color="#949494" :static="true"></u-bottom>
 		</view>
@@ -172,20 +152,6 @@
 					// window.location.replace(this.config.loginUrl)
 				}
 			},
-			logout(){
-				uni.clearStorage();
-				this.$u.vuex('vuex_token', null);
-				this.$u.vuex('vuex_user', null);
-				this.$u.vuex('vuex_hasLogin', false);
-				this.userInfo = [];
-				this.theRoad = [];
-				this.$refs.uToast.show({
-					title: '退出成功,即将跳转登录页!',
-					type: 'success',
-					url:'pages/login/login'
-				});
-				// this.$u.route(-1);
-			},
 			handleGetIndex(roadNo){
 				this.$u.api.getIndex({roadNo:roadNo})
 				.then(res=>{

+ 7 - 0
pages/setting/setting.scss

@@ -7,3 +7,10 @@ page{
 	border-radius: 20rpx;
 	overflow: hidden;
 }
+
+.version{
+	width: 100%;
+	position: fixed;
+	  bottom: 10rpx;
+	  text-align:center
+}

+ 20 - 2
pages/setting/setting.vue

@@ -20,6 +20,9 @@
 				<u-cell-item title="地锁控制" @click="lockControl()">
 					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="wodecheliang"></u-icon>
 				</u-cell-item>
+				<u-cell-item title="版本检测" @click="onCheckVersion()">
+					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="wodecheliang"></u-icon>
+				</u-cell-item>
 				<u-cell-item title="退出登录" @click="onLoginOut()">
 					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="wodecheliang"></u-icon>
 				</u-cell-item>
@@ -37,6 +40,11 @@
 		<u-select v-model="lockForm.cmdFlag" :list="list" @confirm="getCmdValue"></u-select>
 		<u-select v-model="lockListForm.show" :list="lockList" @confirm="onLockSelect"></u-select>
 		<u-toast ref="uToast" />
+		
+		<view class="version">
+			<view  > 版本号: {{wgtInfo.version + '-' + wgtInfo.versionCode}}</view>
+			<view > APPID: {{wgtInfo.appid}}</view>
+		</view>
 	</view>
 </template>
 
@@ -44,10 +52,12 @@
 	//#ifdef APP-PLUS
 	var device = uni.requireNativePlugin("DeviceInfo")
 	//#endif
+	import update from '@/utils/update.js';
 	export default{
 		data(){
 			return{
 				show: false,
+				wgtInfo:{},
 				lockForm:{
 					deviceNo:'',
 					cmd:'',
@@ -71,7 +81,7 @@
 			}
 		},
 		onLoad(){
-			
+			this.getVersion();
 		},
 		onShow(){
 			
@@ -154,6 +164,9 @@
 				this.lockListForm.deviceNo = val[0].value;
 				this.lockListForm.spaceName = val[0].label;
 			},
+			onCheckVersion(){
+				update(this); 
+			},
 			onLoginOut(){
 				uni.showModal({
 				  title: '温馨提示',  
@@ -169,7 +182,7 @@
 								  this.userInfo = [];
 								  this.theRoad = [];
 								  uni.setStorageSync('pushreg_switch', '1');
-								  plus.nativeUI.toast('切换路段成功');
+								  plus.nativeUI.toast('退成成功');
 								  uni.reLaunch({
 								      url: '/pages/login/login'
 								  });
@@ -186,6 +199,11 @@
 				  }  
 				})  
 				
+			},
+			getVersion(){
+				plus.runtime.getProperty(plus.runtime.appid, (info) => {
+					this.wgtInfo = info;
+				});
 			}
 			
 		}