Browse Source

Merge branch 'master' of http://47.92.161.104:10080/zkx/JP-ChargeTeam51 into master

zhupeng 3 years ago
parent
commit
3ad5d486f8
4 changed files with 34 additions and 32 deletions
  1. 2 2
      .env.test.js
  2. 9 8
      pages.json
  3. 15 22
      pages/login/welcome.vue
  4. 8 0
      utils/mixin.js

+ 2 - 2
.env.test.js

@@ -1,8 +1,8 @@
 const UNI_APP = {  
 		ProjectName :"51充电联盟",
     // BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
-	//BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
-    BASE_URL: 'https://charging.xiaoxinda.com/charging-station-server/',
+	BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
+    //BASE_URL: 'https://charging.xiaoxinda.com/charging-station-server/',
    
 
 	NODE_ENV :"test",

+ 9 - 8
pages.json

@@ -3,6 +3,14 @@
 		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
 	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages	
+		
+		{
+			"name": "欢迎页",
+			"path": "pages/login/welcome",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
 		{
 			"name": "充电中",
 			"path": "pages/index/index",
@@ -34,14 +42,7 @@
 			}
 
 		},
-		{
-			"name": "欢迎页",
-			"path": "pages/login/welcome",
-			"style": {
-				//"navigationStyle": "custom" // 隐藏系统导航栏
-			}
-		},
-		
+
 		{
 			"name": "主页",
 			"path": "pages/index/index",

+ 15 - 22
pages/login/welcome.vue

@@ -2,7 +2,7 @@
 	<view>
 		<view class="welcome">
 			<view class="welcome-state1">
-				<view class="welcome-next">跳过</view>
+				<view class="welcome-next" @click="gotoIndex()">跳过</view>
 				<view class="welcome-foot">
 					<u-image width="185px" height="48px" src="../../static/img/logo.png"></u-image>
 				</view>
@@ -28,17 +28,7 @@
 			}
 		},
 		methods: {
-			gotoMain(k){
-				if(k){
-					uni.navigateTo({
-						url:"/pagesA/pages/login/index"
-					})
-				}else{
-					uni.switchTab({
-						url: '/pages/index/index'
-					});
-				}
-			},
+			 
 			findByOpenId(){
 				var openId=this.carhelp.getOpenId()
 				if(openId==""){
@@ -60,30 +50,26 @@
 					}
 				}).then((response) => {
 					let [error, res] = response;
-					
+					 
 					//var backImg="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"
 					this.carhelp.setConfig(res.data.data.configure) 
 					this.setBackImg()
 					
 					if (res.data.code == 200&&res.data.result) {			
 						var token = res ? res.data.data.token : '';					
-						this.carhelp.setPersonInfo(res.data.data.memberInfo );
+						this.carhelp.setPersonInfo(res.data.data.regUser );
 						this.carhelp.setToken(token);
 						this.carhelp.setPersonInfoPlus(res.data.data);
 						
-						setTimeout(()=>{
-							uni.switchTab({
-								url: '/pages/index/index'
-							});
-						},1000)
+						
 					
 					} else{
 						this.carhelp.logoff()
-						this.bottonShow=true
+					
 					}
 				}).catch(error => {
 					this.carhelp.logoff()
-					this.bottonShow=true
+				
 				})
 			},
 			setBackImg(){
@@ -91,7 +77,12 @@
 				if(img){
 					this.customStyle0="background:url("+img+") no-repeat;background-size: 100%;"
 				}
+			},gotoIndex(){
+				uni.redirectTo({
+					url: '/pages/index/index'
+				});
 			}
+			
 		},
 		onLoad() {
 			 
@@ -99,7 +90,9 @@
 			 
 		},
 		onReady() {
-			
+			setTimeout(()=>{
+				this.gotoIndex()
+			},3000)
 			this.findByOpenId()
 		}
 	}

+ 8 - 0
utils/mixin.js

@@ -18,6 +18,14 @@ var app = {
 		}
 		 return configure;
 	},
+	logoff:()=>{
+		uni.removeStorageSync(prefix + 'token_tdate')
+		uni.removeStorageSync(prefix + 'token')
+		uni.removeStorageSync(prefix  + 'personInfo');
+		uni.removeStorageSync(prefix + 'personInfoPlus');
+		//uni.removeStorageSync(prefix+'wx_openId');
+		
+	},
 	setConfig : (value) => uni.setStorageSync(prefix + '_config_$', value),
 	
 	getPersonInfo : () => {