Parcourir la source

登录页逻辑优化

xiaohaizhao il y a 2 ans
Parent
commit
bfb493913e
1 fichiers modifiés avec 3 ajouts et 8 suppressions
  1. 3 8
      pages/login/login.vue

+ 3 - 8
pages/login/login.vue

@@ -19,7 +19,7 @@
 import account from "./modules/account.vue";
 import phone from "./modules/phone.vue";
 import otherLogin from "./modules/otherLogin.vue";
-
+import { getCity } from "../../utils/tool";
 export default {
 	components: {
 		account,
@@ -29,17 +29,12 @@ export default {
 	data() {
 		return {
 			loginMethod: "",
-			height: ""
+			height: this.usePort == 'h5' ? "100px" : "150px"
 		};
 	},
 	onLoad() {
 		this.loginMethod = uni.getStorageSync('loginMethod') || 'account';//登录方式
-		// #ifdef H5
-		this.height = "100px";
-		// #endif
-		// #ifndef H5
-		this.height = "150px";
-		// #endif 
+		getCity.bind(this)().then(res => res && uni.setStorageSync("city", res))
 	},
 	methods: {
 		/* 修改登录方式 */