Browse Source

主页站点

wkyy 3 years ago
parent
commit
7ab5bf4ddb

+ 2 - 1
apis/site.js

@@ -1,4 +1,5 @@
 import request from '../utils/request.js';
 import request from '../utils/request.js';
+import requestWhite from '../utils/requestWhite.js';
 import Qs from 'qs';
 import Qs from 'qs';
 
 
 
 
@@ -29,7 +30,7 @@ export function getChargingStationData(data){
 
 
 export function searchStationData(data){
 export function searchStationData(data){
 	console.log('搜索站点数据')
 	console.log('搜索站点数据')
-	return request({
+	return requestWhite({
 		method: 'post',
 		method: 'post',
 		data: data,
 		data: data,
 		url: '/mobile/chargingStation/searchStationData'
 		url: '/mobile/chargingStation/searchStationData'

+ 9 - 4
pages/index/index.vue

@@ -161,7 +161,7 @@
 	 </view> -->
 	 </view> -->
 
 
 		<!-- 充值活动 -->
 		<!-- 充值活动 -->
-		<view class=" top-up">
+		<view class=" top-up" v-if="activityList.length > 0">
 			<view class="top-up-title"><text class="line"></text>充值活动</view>
 			<view class="top-up-title"><text class="line"></text>充值活动</view>
 			<view class="img-box">
 			<view class="img-box">
 				<view class="img-1" v-for="(item,index) in activityList" :key="item.id" @click="rechargeActivity">
 				<view class="img-1" v-for="(item,index) in activityList" :key="item.id" @click="rechargeActivity">
@@ -170,7 +170,7 @@
 			</view>
 			</view>
 		</view>
 		</view>
 		<!-- 新闻 -->
 		<!-- 新闻 -->
-		<view class="news-title">
+		<view class="news-title" v-if="newsList.length > 0">
 			<view class="news-title-left">
 			<view class="news-title-left">
 				<view class="line" style="margin-top:4px;"></view>新闻公告
 				<view class="line" style="margin-top:4px;"></view>新闻公告
 			</view>
 			</view>
@@ -192,7 +192,7 @@
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
-		<view class="bottom" v-if="newsList.length == recordsTotal">
+		<view class="bottom" v-if="newsList.length == recordsTotal && newsList.length != 0">
 			<view class="bot">
 			<view class="bot">
 				<view class="bot-line"></view>
 				<view class="bot-line"></view>
 				<view class="bot-text">已经到底了</view>
 				<view class="bot-text">已经到底了</view>
@@ -244,6 +244,11 @@
 						url:k
 						url:k
 					})
 					})
 				}
 				}
+				if(op.jpcode == 'toLogin') {
+					uni.navigateTo({
+						url: '/pages/login/login'
+					})
+				}
 			}
 			}
 			
 			
 		},
 		},
@@ -255,6 +260,7 @@
 		onReady() {
 		onReady() {
 			if (this.carhelp.getPersonInfo()) {
 			if (this.carhelp.getPersonInfo()) {
 				this.userId = this.carhelp.getPersonInfo().id;
 				this.userId = this.carhelp.getPersonInfo().id;
+				this.getFindChargeData();
 			}
 			}
 
 
 			WxJsApi.getWxConfig(['getLocation', 'addEventListener', 'scanQRCode']).then((res) => {
 			WxJsApi.getWxConfig(['getLocation', 'addEventListener', 'scanQRCode']).then((res) => {
@@ -266,7 +272,6 @@
 			this.getPoint();
 			this.getPoint();
 			this.getNewsList();
 			this.getNewsList();
 			this.getActivityInfoList();
 			this.getActivityInfoList();
-			this.getFindChargeData();
 		},
 		},
 		methods: {
 		methods: {
 			getFindChargeData() {
 			getFindChargeData() {

+ 1 - 1
pages/login/login.vue

@@ -183,7 +183,7 @@
 					this.carhelp.setPersonInfo(response.data.regUser);
 					this.carhelp.setPersonInfo(response.data.regUser);
 					
 					
 					if(this.code == 'A') {
 					if(this.code == 'A') {
-						uni.redirectTo({
+						uni.navigateBack({
 							url: '/pages/searchPile/stationAndPile/chargingPileDetails?id=' + this.codeId
 							url: '/pages/searchPile/stationAndPile/chargingPileDetails?id=' + this.codeId
 						})
 						})
 					} else {
 					} else {

+ 4 - 4
pages/user/car/carAdd.vue

@@ -105,7 +105,7 @@
 					uni.hideLoading();
 					uni.hideLoading();
 					
 					
 					this.show = false;
 					this.show = false;
-					uni.redirectTo({
+					uni.navigateBack({
 						url: '/pages/user/car/index'
 						url: '/pages/user/car/index'
 					})
 					})
 				}).catch(error => {
 				}).catch(error => {
@@ -124,12 +124,12 @@
 					uni.hideLoading();				
 					uni.hideLoading();				
 							
 							
 					if(this.code == 'A') {
 					if(this.code == 'A') {
-						uni.redirectTo({
+						uni.navigateBack({
 							url: '/pages/searchPile/stationAndPile/chargingPileDetails?id=' + this.codeId
 							url: '/pages/searchPile/stationAndPile/chargingPileDetails?id=' + this.codeId
 						})
 						})
 					} else {
 					} else {
-						uni.redirectTo({
-							url: '/pages/user/car/index'
+						uni.navigateBack({
+							
 						})
 						})
 					}
 					}
 				}).catch(error => {
 				}).catch(error => {

+ 1 - 1
pages/user/car/index.vue

@@ -27,7 +27,7 @@
 				carList: [],
 				carList: [],
 			}
 			}
 		},
 		},
-		onReady() {
+		onShow() {
 			this.getCarList();
 			this.getCarList();
 		},
 		},
 		methods: {
 		methods: {

+ 2 - 2
pages/user/data.vue

@@ -82,8 +82,8 @@
 					
 					
 					this.carhelp.getPersonInfo().nickName = this.form.nickName;
 					this.carhelp.getPersonInfo().nickName = this.form.nickName;
 					this.carhelp.getPersonInfo().headImg = this.form.headImg;
 					this.carhelp.getPersonInfo().headImg = this.form.headImg;
-					uni.redirectTo({
-						url: '/pages/user/index'
+					uni.navigateBack({
+						
 					})
 					})
 				}).catch(error => {
 				}).catch(error => {
 					uni.showToast({
 					uni.showToast({

+ 4 - 1
pages/user/index.vue

@@ -10,7 +10,7 @@
 		</view>
 		</view>
 		<view class="userData">
 		<view class="userData">
 			<view class="userData-num" @click="toBalance">
 			<view class="userData-num" @click="toBalance">
-				<view class="userData-data">{{personAccount.availableAmount != null ? personAccount.availableAmount.toFixed(2) : '0.00'}}</view>
+				<view class="userData-data">{{personAccount.availableAmount != null ? personAccount.availableAmount.toFixed(2) : '0.00'}}</view>
 				<view class="userData-foot">可用余额</view>
 				<view class="userData-foot">可用余额</view>
 			</view>
 			</view>
 			<view class="userInfo-btn" @click="toRecharge">充值</view>
 			<view class="userInfo-btn" @click="toRecharge">充值</view>
@@ -94,6 +94,9 @@
 			}
 			}
 		},
 		},
 		onShow() {
 		onShow() {
+			this.userId = '';
+			this.headImg = '';
+			this.userPhone = '';
 			if(this.carhelp.getPersonInfo()) {
 			if(this.carhelp.getPersonInfo()) {
 				this.userId = this.carhelp.getPersonInfo().id;
 				this.userId = this.carhelp.getPersonInfo().id;
 				this.headImg = this.carhelp.getPersonInfo().headImg;
 				this.headImg = this.carhelp.getPersonInfo().headImg;

+ 2 - 2
pages/user/logout.vue

@@ -45,8 +45,8 @@
 				userApi.deleteUser().then((res) => {
 				userApi.deleteUser().then((res) => {
 					uni.hideLoading();
 					uni.hideLoading();
 					
 					
-					uni.redirectTo({
-						url: '/pages/login/login'
+					uni.reLaunch({
+						url: '/pages/index/index?id=' + 'toLogin'
 					})
 					})
 				}).catch(error => {
 				}).catch(error => {
 					uni.showToast({
 					uni.showToast({

+ 5 - 4
pages/user/phone.vue

@@ -9,8 +9,8 @@
 			</view>
 			</view>
 			<view class="login-form-item">
 			<view class="login-form-item">
 				<view class="input">
 				<view class="input">
-					<view class="code" @click="getCode">{{codeTips}}</view>
 					<u-input v-model="form.verifyCode" type="number" placeholder="请输入验证码" placeholder-style="font-size:16px;color:#ccc;"/>
 					<u-input v-model="form.verifyCode" type="number" placeholder="请输入验证码" placeholder-style="font-size:16px;color:#ccc;"/>
+					<view class="code" @click="getCode">{{codeTips}}</view>
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
@@ -23,6 +23,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
+	import * as userApi from '@/apis/user.js'
 	import * as loginApi from '@/apis/login.js'
 	import * as loginApi from '@/apis/login.js'
 	import {
 	import {
 		checkPhone
 		checkPhone
@@ -119,11 +120,11 @@
 					title: "加载中",
 					title: "加载中",
 					mask: true,
 					mask: true,
 				})		
 				})		
-				loginApi.changePhone(this.form).then((response) => {
+				userApi.changePhone(this.form).then((response) => {
 					uni.hideLoading();
 					uni.hideLoading();
 					
 					
-					uni.redirectTo({
-						url: '/pages/login/login'
+					uni.reLaunch({
+						url: '/pages/index/index?id=' + 'toLogin'
 					})
 					})
 				}).catch(error => {
 				}).catch(error => {
 					uni.showToast({
 					uni.showToast({

+ 1 - 1
pages/user/setting.vue

@@ -53,7 +53,7 @@
 					uni.hideLoading();
 					uni.hideLoading();
 					this.show = false;
 					this.show = false;
 					this.carhelp.logoff()
 					this.carhelp.logoff()
-					uni.reLaunch({
+					uni.redirectTo({
 						url: '/pages/login/login'
 						url: '/pages/login/login'
 					})
 					})
 				}).catch(error => {
 				}).catch(error => {