提交 023ee1b6 authored 作者: JaxBBLL's avatar JaxBBLL

fix: init 2

上级 7409b5f4
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
plus.screen.lockOrientation("landscape-primary"); //锁定横屏 plus.screen.lockOrientation("landscape-primary"); //锁定横屏
// #endif // #endif
// this.init(); this.init();
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.android.requestPermissions( plus.android.requestPermissions(
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
if (now_user.user) { if (now_user.user) {
this.$store.commit("SET_USER", now_user); this.$store.commit("SET_USER", now_user);
} }
this.init(); // this.init();
}, },
onLoad: function (query) { onLoad: function (query) {
console.log("即将开始初始化app"); console.log("即将开始初始化app");
......
<template> <template>
<!-- 首页 --> <!-- 首页 -->
<view class="container"> <view class="container">
<view class="flex">
<navigator
url="/pages/inspectionContent/inspectionContentList?uid=23"
hover-class="navigator-hover"
>
<button type="default" class="uni-btn">23</button>
</navigator>
<navigator
url="/pages/inspectionContent/inspectionContentList?uid=16"
hover-class="navigator-hover"
>
<button type="default" class="uni-btn">16</button>
</navigator>
</view>
<!-- 第一个模块 --> <!-- 第一个模块 -->
<view class="header"> <view class="header">
<view class="title">杭州内网监管在线-运维在线</view> <view class="title">杭州内网监管在线-运维在线</view>
......
...@@ -8,14 +8,35 @@ ...@@ -8,14 +8,35 @@
</view> </view>
<view class="form_wrap"> <view class="form_wrap">
<view class="input_wrap"> <view class="input_wrap">
<uni-easyinput class="log-input" clearSize="0" v-model="person.account" prefixIcon="person" <uni-easyinput
placeholder="用户名"></uni-easyinput> class="log-input"
<uni-easyinput v-if="passwordVisible" class="log-input" prefixIcon="locked" clearSize="0" clearSize="0"
v-model="person.pwd" @iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder" v-model="person.account"
:passwordIcon="false" :type="passwordVisible ? 'text' : 'password'"></uni-easyinput> prefixIcon="person"
<uni-easyinput v-else class="log-input" prefixIcon="locked-filled" clearSize="0" v-model="person.pd" placeholder="用户名"
@iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder" :passwordIcon="false" ></uni-easyinput>
:type="passwordVisible ? 'text' : 'password'"></uni-easyinput> <uni-easyinput
v-if="passwordVisible"
class="log-input"
prefixIcon="locked"
clearSize="0"
v-model="person.pwd"
@iconClick="togglePasswordVisible"
:placeholder="passwordPlaceholder"
:passwordIcon="false"
:type="passwordVisible ? 'text' : 'password'"
></uni-easyinput>
<uni-easyinput
v-else
class="log-input"
prefixIcon="locked-filled"
clearSize="0"
v-model="person.pd"
@iconClick="togglePasswordVisible"
:placeholder="passwordPlaceholder"
:passwordIcon="false"
:type="passwordVisible ? 'text' : 'password'"
></uni-easyinput>
</view> </view>
<view class="login_btn" @click="login"> <view class="login_btn" @click="login">
<view class="login_btn_text"> 登录 </view> <view class="login_btn_text"> 登录 </view>
...@@ -26,19 +47,17 @@ ...@@ -26,19 +47,17 @@
</template> </template>
<script> <script>
import userApi from "@/api/user.js" import userApi from "@/api/user.js";
import SqlliteDbUtil from '@/utils/sqllitedb' import SqlliteDbUtil from "@/utils/sqllitedb";
import table from '@/api/sqllite/table.js' import table from "@/api/sqllite/table.js";
import { import { getUserList } from "@/utils/systemCofig";
getUserList, import {
} from "@/utils/systemCofig";
import {
LOG_TYPE_ENUM, LOG_TYPE_ENUM,
getLogContent, getLogContent,
addLog, addLog,
readLogData, readLogData,
} from "@/utils/IoReadingAndWriting.js"; } from "@/utils/IoReadingAndWriting.js";
export default { export default {
components: {}, components: {},
data() { data() {
return { return {
...@@ -61,9 +80,7 @@ ...@@ -61,9 +80,7 @@
created() {}, created() {},
onShow() {}, onShow() {},
async mounted() { async mounted() {},
},
// 定义返回退出 // 定义返回退出
onBackPress(options) { onBackPress(options) {
this.backButtonPress++; this.backButtonPress++;
...@@ -79,7 +96,7 @@ ...@@ -79,7 +96,7 @@
} else { } else {
plus.nativeUI.toast("再划一次退出应用"); plus.nativeUI.toast("再划一次退出应用");
} }
setTimeout(function() { setTimeout(function () {
this.backButtonPress = 0; this.backButtonPress = 0;
}, 1000); }, 1000);
return true; return true;
...@@ -95,12 +112,18 @@ ...@@ -95,12 +112,18 @@
if (res.data) { if (res.data) {
this.personList = res.data; this.personList = res.data;
this.$store.commit("SET_USER", this.personList); this.$store.commit("SET_USER", this.personList);
uni.setStorageSync("now_user", this.personList);
uni.setStorageSync(
"last_time",
this.personList.LastSynchronizationTime || ""
);
uni.navigateTo({ uni.navigateTo({
url: "/pages/home/home", url: "/pages/home/home",
}); });
}else{ } else {
uni.showToast({ uni.showToast({
title: '账号密码错误,请重新输入', title: "账号密码错误,请重新输入",
icon: "none", icon: "none",
duration: 2000, duration: 2000,
}); });
...@@ -108,11 +131,11 @@ ...@@ -108,11 +131,11 @@
}); });
}, },
}, },
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.content { .content {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
// background-color: red; // background-color: red;
...@@ -141,7 +164,8 @@ ...@@ -141,7 +164,8 @@
} }
} }
.login_wrap {} .login_wrap {
}
.log-input { .log-input {
width: 350px; width: 350px;
...@@ -200,5 +224,5 @@ ...@@ -200,5 +224,5 @@
color: #fff; color: #fff;
} }
} }
} }
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论