Ver código fonte

[功能增加][techtron]:记住密码

yxp 2 anos atrás
pai
commit
89fa466f4c

+ 5 - 4
pages/bluetooth/index/wifi.vue

@@ -5,7 +5,7 @@
                    :refresher-enabled="false">
         <view v-for="(item, index) in deviceListDataShow" :key="item.id" class="list-item" hover-class="list-item-hover"
               hover-start-time="0" hover-stay-time="100" @click="listViewTap(item.id)">
-          <image v-if="item.manufacturer==='eciot'" src="/static/img/ecble.png" class="list-item-img"></image>
+          <image v-if="item.manufacturer==='eciot'" src="/static/images/new/starts/WiFi.png" class="list-item-img"></image>
           <image v-else src="/static/img/ble.png" class="list-item-img"></image>
           <text class="list-item-name">{{item.name}}</text>
           <image v-if="item.rssi >= -41" src="/static/img/s5.png" mode="aspectFit" class="list-item-rssi-img"></image>
@@ -51,7 +51,7 @@
             <u--input
                 v-model="SSID"
                 disabled
-                disabledColor="#ffffff"
+                disabledColor="#dddddd"
                 placeholder="Choose wifi:"
                 border="none"
                 labelWidth="auto"
@@ -95,7 +95,7 @@
             ></u--input>
             <u-icon
                 slot="right"
-                name="arrow-right"
+                name="arrow-right-double"
             ></u-icon>
           </u-form-item>
           <u-form-item
@@ -775,6 +775,7 @@ export default {
   font-weight: bold;
   display: flex;
   justify-content: center;
+  color: aliceblue;
 }
 
 .list-item-line {
@@ -801,7 +802,7 @@ export default {
 .text-area {
   display: flex;
   justify-content: center;
-  background: white;
+  background: #dddddd;
   width: 100%;
   height: 100%;
 }

+ 59 - 40
pages/index.vue

@@ -14,26 +14,45 @@
 		<view style="height: 10vh;text-align: center;">
 			<image style="height: 3vh;width: 15vh;margin-top: 5vh;"
 				src="../static/images/new/starts/login/backImg2.png"></image>
-				
+
 		</view>
 		<view style="text-align: center;top:12vh;position: relative;color: aliceblue;">
-						<view style="font-size: 30rpx;">Please choose from the below options:</view>
-						<view style="font-size: 20rpx;">Charge up quickly & easily to enjoy a smarter life!</view>
-					</view>
-		<view
-			style="margin:0 5vw;left:0px;right:0px;text-align: center;top:45vh;position: absolute;display: flex;flex-direction: rows;justify-content: space-evenly;">
+			<view style="font-size: 30rpx;">Please choose from the below options:</view>
+			<view style="font-size: 20rpx;">Charge up quickly & easily to enjoy a smarter life!</view>
+		</view>
+		<view style="margin:0 5vw;left:0px;right:0px;text-align: center;top:45vh;position: absolute;display: flex;flex-direction: rows;justify-content: space-evenly;">
 			<!-- <view style="color:white;width:80px;">
    					设备编号
    				</view> -->
 			<view style="text-align: center;">
-				<view class="blue" @click="buleTeeth()">
-					<image src="../static/images/new/starts/index/blue.png" style="width: 60px;height: 60px;margin-top: 2vh;"></image>
+				<view>
+					<view class="blue" @click="buleTeeth()">
+						<image src="../static/images/new/starts/index/blue.png"
+							style="width: 60px;height: 60px;margin-top: 2vh;"></image>
+					</view>
+					<view style="color: aliceblue;">
+						Scan with Bluetooth
 					</view>
+				</view>
+				<view>
 					<view class="" @click="scan">
-				<image src="../static/images/new/starts/index/scan.png" style="width: 60px;height: 60px;margin-top: 2vh;"
-					></image>
+						<image src="../static/images/new/starts/index/scan.png"
+							style="width: 60px;height: 60px;margin-top: 2vh;"></image>
+					</view>
+					<view style="color: aliceblue;">
+						Scan QR Code
+					</view>
+				</view>
+				<view>
+					<view class="" @click="wifi">
+						<image src="../static/images/new/starts/WiFi.png"
+							style="width: 60px;height: 60px;margin-top: 2vh;"></image>
+					</view>
+					<view style="color: aliceblue;">
+						Scan with WIFI
 					</view>
-					<!-- <view class="" @click="scan">
+				</view>
+				<!-- <view class="" @click="scan">
 					<image src="../static/images/new/starts/index/bind.png" style="width: 60px;height: 60px;margin-top: 2vh;"
 						></image>
 						</view> -->
@@ -43,20 +62,20 @@
    							style="background: #505086;color:white;border-radius: 100vh;width: 120px;margin-right: -10px;">绑 定</u-button>
    					</u--input> -->
 			</view>
-      <view style="position:fixed;bottom:10px;display: flex;align-items: center;justify-content: center;">
-        <view @click="skip(0)" style="margin:0px 10px;">
-          <image src="@/static/images/new/starts/tabbar/one_on.png"
-                 style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
-        </view>
-        <view @click="skip(1)" style="margin:0px 10px;">
-          <image src="@/static/images/new/starts/tabbar/two_off.png"
-                 style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
-        </view>
-        <view @click="skip(2)" style="margin:0px 10px;">
-          <image src="@/static/images/new/starts/tabbar/three_off.png"
-                 style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
-        </view>
-      </view>
+			<view style="position:fixed;bottom:10px;display: flex;align-items: center;justify-content: center;">
+				<view @click="skip(0)" style="margin:0px 10px;">
+					<image src="@/static/images/new/starts/tabbar/one_on.png"
+						style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
+				</view>
+				<view @click="skip(1)" style="margin:0px 10px;">
+					<image src="@/static/images/new/starts/tabbar/two_off.png"
+						style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
+				</view>
+				<view @click="skip(2)" style="margin:0px 10px;">
+					<image src="@/static/images/new/starts/tabbar/three_off.png"
+						style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
+				</view>
+			</view>
 
 		</view>
 
@@ -110,21 +129,21 @@
 			})
 		},
 		methods: {
-      skip(type){
-        if(type==0){
-          uni.reLaunch({
-            url:'/pages/index'
-          })
-        }else if(type==1){
-          uni.reLaunch({
-            url:'/pages/weitiandi/deviceList'
-          })
-        }else if(type==2){
-          uni.reLaunch({
-            url:'/pages/mine/index'
-          })
-        }
-      },
+			skip(type) {
+				if (type == 0) {
+					uni.reLaunch({
+						url: '/pages/index'
+					})
+				} else if (type == 1) {
+					uni.reLaunch({
+						url: '/pages/weitiandi/deviceList'
+					})
+				} else if (type == 2) {
+					uni.reLaunch({
+						url: '/pages/mine/index'
+					})
+				}
+			},
 			devicelist() {
 				uni.navigateTo({
 					url: '/pages/weitiandi/deviceList'

+ 18 - 1
pages/login.vue

@@ -37,7 +37,7 @@
 		<uni-col :span="2">
 		<uni-icons class="icon" type="locked-filled" size="20" color="#e3e3e3"></uni-icons>
 		</uni-col>
-		<uni-col :span="22">
+		<uni-col :span="18">
         <uni-easyinput style="margin-left:-10px ;color: #000000;" :inputBorder="false" v-model="loginForm.password"  type="password" class="input"  :placeholder="$t('login.pwdInput')" maxlength="30" />
 		</uni-col>
 		</uni-row>
@@ -190,8 +190,22 @@
 			}
 		});
       this.checkLogin();
+	  this.readLoginInfo()
     },
     methods: {
+		readLoginInfo(){
+		  let loginForm = uni.getStorageSync("loginInfo");
+		  if(loginForm){
+		   this.loginForm = loginForm;
+		   this.pwdLogin()
+		  }
+		
+		},
+		saveLoginInfo(){
+		  if(this.loginForm.username.length>0){
+		    uni.setStorageSync("loginInfo",this.loginForm);
+		  }
+		},
       forgetPwd(){
         let self = this;
         uni.showModal({
@@ -389,6 +403,8 @@
       },
       // 登录成功后,处理函数
       loginSuccess(result) {
+		  //保存用户信息
+		  this.saveLoginInfo()
         // 设置用户信息
         this.$store.dispatch('GetInfo').then(res => {
           this.$tab.reLaunch('/pages/index')
@@ -540,6 +556,7 @@
 		  font-size: 15px;
 		  font-family: Source Han Sans CN;
 		  font-weight: 400;
+		  color: aliceblue;
 	  }
 
 	  .welcome1 {

+ 1 - 0
pages/mine/index.vue

@@ -220,6 +220,7 @@
 			handleLogout() {
 			  this.$modal.confirm('确定注销并退出系统吗?').then(() => {
 			    this.$store.dispatch('LogOut').then(() => {
+					uni.setStorageSync("loginInfo",'');
 			      this.$tab.reLaunch('/pages/index')
 			    })
 			  })

+ 2 - 2
pages/weitiandi/bluetooth/status.vue

@@ -252,7 +252,7 @@
 		<view style="display: flex;align-items: center;flex-direction: column;color: aliceblue;margin-top: 3vh;">
 			<view
           style="position:relative;justify-content: center;display: flex;justify-items: center;flex-direction: row;text-align: center;width: 100%;height: 30px;}">
-        <view  style="width: 5vh;left:10%;position: absolute">
+        <view  style="width: 5vh;left:10%;position: absolute;font-size: 12px;">
 					<view style="margin-left: 1vh;;width: 100px">
 						<view><span v-if="portDetail.portStatus == 6">{{i18('剩余时间')}}</span>
 							<span  v-else>{{$t('charge.chargetime')}}</span></view>
@@ -287,7 +287,7 @@
 										</view> -->
 				</view>
         <view span="3" style="width: 80px;left:65%;position: absolute">
-					<view style="margin-left: 1vh;">
+					<view style="margin-left: 1vh;font-size: 12px;">
 						<view> Ampere</view>
 						<view class="demo-layout bg-purple"
 							style="border-radius: 8px;background-color: aliceblue;color: #000;">

+ 9 - 7
pages/weitiandi/device/status.vue

@@ -120,23 +120,23 @@
 		</view>
 		<view style="display: flex;align-items: center;flex-direction: column;color: aliceblue;margin-top: 5vh;">
 			<view
-				style="background-color: black;justify-content: center;display: flex;justify-items: center;flex-direction: row;text-align: center;width: 32vh;;border-radius: 27px;">
-				<view span="3" style="width: 8vh;">
+				style="background-color: black;justify-content: center;display: flex;justify-items: center;flex-direction: row;text-align: center;width: 36vh;;border-radius: 27px;">
+				<view span="3" style="width: 9vh;">
 					<view class="item-value">{{ deviceV  }}V</view>
 					<span class="item-text">{{$t('charge.voltage')}}</span>
 				</view>
 				<u-line direction="col" color="#6F84AC" length="50"></u-line>
-				<view span="3" style="width: 8vh;">
+				<view span="3" style="width: 9vh;">
 					<view class="item-value">{{ gonglv  }}W</view>
 					<span class="item-text">{{$t('charge.power')}}</span>
 				</view>
 				<u-line direction="col" color="#6F84AC" length="50"></u-line>
-				<view span="3" style="width: 8vh;">
+				<view span="3" style="width: 9vh;">
 					<view class="item-value">{{deviceTemp}}℃</view>
 					<span class="item-text">{{$t('charge.devtemper')}}</span>
 				</view>
 				<u-line direction="col" color="#6F84AC" length="50"></u-line>
-				<view span="3" style="width: 8vh;">
+				<view span="3" style="width: 9vh;">
 					<view class="item-value" v-if="portDetail.voltage == 0">0 {{ i18('度') }}</view>
 					<view class="item-value" v-else>{{ dianliang }} {{ i18('度') }}</view>
 					<span class="item-text">{{$t('charge.elec')}}</span>
@@ -147,7 +147,7 @@
 		<view style="display: flex;align-items: center;flex-direction: column;color: aliceblue;margin-top: 3vh;">
 			<view
 				style="position:relative;justify-content: center;display: flex;justify-items: center;flex-direction: row;text-align: center;width: 100%;height: 30px;}">
-				<view  style="width: 5vh;left:10%;position: absolute">
+				<view  style="width: 80px;left:10%;position: absolute;font-size: 12px;">
 					<view style="margin-left: 1vh;width: 100px">
 						<view><span v-if="portDetail.portStatus == 6">{{i18('剩余时间')}}</span>
 							<span  v-else>{{$t('charge.chargetime')}}</span></view>
@@ -182,7 +182,7 @@
 										</view> -->
 				</view>
 				<view span="3" style="width: 80px;left:65%;position: absolute">
-					<view style="margin-left: 1vh;">
+					<view style="margin-left: 1vh;font-size: 12px;">
 						<view> Ampere</view>
 						<view class="demo-layout bg-purple"
 							style="border-radius: 8px;background-color: aliceblue;color: #000;">
@@ -413,9 +413,11 @@
 			handleLogout() {
 				this.$modal.confirm('确定注销并退出系统吗?').then(() => {
 					this.$store.dispatch('LogOut').then(() => {
+						uni.setStorageSync("loginInfo",'');
 						this.$tab.reLaunch('/pages/index')
 					})
 				})
+						
 			},
 			changeDrawer(event) {
 				if (event) {

+ 9 - 0
pages/weitiandi/deviceList.vue

@@ -154,6 +154,15 @@ export default {
 	  		this.clickRightTag = 0
 	  	}
 	  },
+	  handleLogout() {
+	  	this.$modal.confirm('确定注销并退出系统吗?').then(() => {
+	  		this.$store.dispatch('LogOut').then(() => {
+	  			uni.setStorageSync("loginInfo",'');
+	  			this.$tab.reLaunch('/pages/index')
+	  		})
+	  	})
+	  			
+	  },
     unbind(qrcode){
       let self = this;
       this.$modal.confirm("确认解绑该设备?").then(res=>{