Bläddra i källkod

Merge branch 'master' of http://172.16.90.201:3000/parking/parking_pda

gcz 4 år sedan
förälder
incheckning
90d160caac
3 ändrade filer med 34 tillägg och 21 borttagningar
  1. 5 4
      pages.json
  2. 10 0
      pages/index/index.vue
  3. 19 17
      pages/login/login.vue

+ 5 - 4
pages.json

@@ -4,21 +4,22 @@
 	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
-
-
-			"path": "pages/index/index",
+			"path": "pages/login/login",
 			"style": {
 				"navigationStyle":"custom",// 隐藏系统导航栏
 				"navigationBarTitleText": "城市智慧停车"
 			}
 		},
 		{
-			"path": "pages/login/login",
+
+
+			"path": "pages/index/index",
 			"style": {
 				"navigationStyle":"custom",// 隐藏系统导航栏
 				"navigationBarTitleText": "城市智慧停车"
 			}
 		},
+	
 		{
 			"path": "pages/modifypwd/modifypwd",
 			"style": {

+ 10 - 0
pages/index/index.vue

@@ -102,6 +102,16 @@
 		onLoad() {			
 			this.getLocation();
 		},
+		onBackPress(options) {
+			 uni.showModal({
+			   title: '温馨提示',  
+			   content: '已经到头了',  
+			   showCancel: false,
+			   success: (res) => { }  
+			 })  
+			 // 禁止默认返回  
+			 return true  
+		},
 		onShow() {
 			if(this.$store.state.vuex_hasLogin){
 				this.userInfo = this.$store.state.vuex_user;

+ 19 - 17
pages/login/login.vue

@@ -54,23 +54,23 @@
 			})
 		
 		},
+		onBackPress(options) {
+			 if (options.from === 'backbutton') {  
+				uni.showModal({  
+				  title: '温馨提示',  
+				  content: '已经到头了',  
+				  showCancel: false,
+				  success: (res) => { }  
+				})  
+				// 禁止默认返回  
+				return true  
+			  } 
+		},
 		methods: {
-			openPage(path) {
-				console.log('path',path);
-				this.$u.route({ 
-					url: path
-				})
-			},
-			//登录判断
-			// login(status){
-			// 	if(!status){
-			// 		console.log('config',this.config);
-			// 		window.location.replace(this.config.loginUrl)
-			// 	}
-			// },
+
 			handleLogin(){
-				this.form.deviceNo = '1122334455';
-				// this.form.deviceNo = device?.getDeviceInfo()?.deviceId;
+				// this.form.deviceNo = '1122334455';
+				this.form.deviceNo = device?.getDeviceInfo()?.deviceId;
 				this.$u.api.login(this.form)
 				.then(res=>{
 					this.$refs.uToast.show({
@@ -90,8 +90,10 @@
 							key:'loginData'
 						})
 					};
-					this.$u.route('pages/index/index', {});
-					console.log('login',res)
+					// this.$u.route('pages/index/index', {});
+					uni.redirectTo({
+						url:'../index/index'
+					});
 				}).catch(err=>{
 					if(err.errMsg){
 						this.$refs.uToast.show({