Ver Fonte

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

# Conflicts:
#	pages/user/finance/recharge.vue
zhengkaixin há 3 anos atrás
pai
commit
713f5acf58

+ 8 - 0
apis/index.js

@@ -1,6 +1,14 @@
 import request from '../utils/request.js';
+import requestWhite from '../utils/requestWhite.js';
 import Qs from 'qs';
 
+export function activityInfoList(data) {
+	return requestWhite({
+		method: 'post',
+		data: data,
+		url: '/mobile/activityInfo/activityInfoList'
+	})
+}
 
 export function test(data) {
 	return request({

+ 11 - 0
apis/news.js

@@ -0,0 +1,11 @@
+import requestWhite from '../utils/requestWhite.js';
+import Qs from 'qs';
+
+export function newsInfoList(data) {
+	 
+	return requestWhite({
+		method: 'post',
+		data:data ,
+		url: '/mobile/newsInfo/newsInfoList'
+	})
+}

+ 3 - 1
apis/site.js

@@ -1,6 +1,8 @@
 import request from '../utils/request.js';
 import Qs from 'qs';
-
+export function geChargingStationData(data){
+	
+}
 export function getPileDetails(data){
 	var p = new Promise(function(resolve,rejct){
 		if(data != null)

+ 1 - 1
pages/article/newsNotice.vue

@@ -18,7 +18,7 @@
 		
 		<view class="news">
 		
-			<view class="news-content">
+			<view class="news-content" @click="gotoUrl('pages/article/articleDetails?id=')">
 				<view class="content-text">
 					日印计划联手开发低成本充电桩 推动新兴市场电动车发展
 					<view class="news-time">05-01 09:00</view>

+ 23 - 6
pages/index/index.vue

@@ -102,7 +102,7 @@
 		<view class=" top-up">
 					<view class="top-up-title"><text class="line"></text>充值活动</view>
 					<view class="img-box">
-						<view class="img-1">
+						<view class="img-1" @click="rechargeActivity">
 							<img src="/static/img/瓷片区1.png" alt="">
 							<view class="img-text">
 								充100送20
@@ -131,7 +131,7 @@
 				</view>
 				<view class="news">
 
-					<view class="news-content">
+					<view class="news-content" @click="gotoUrl('pages/article/articleDetails?id=')">
 						<view class="content-text">
 							日印计划联手开发低成本充电桩 推动新兴市场电动车发展
 							<view class="news-time">05-01 09:00</view>
@@ -195,6 +195,8 @@
 </template>
 
 <script>
+	import * as Api from '@/apis/index.js'
+	import * as newsApi from '@/apis/news.js'
 	import * as WxJsApi from '@/utils/wxJsApi.js'
 	import MapLoader from '@/utils/AMap'
 	import Tabbar from '@/components/Tabbar.vue'
@@ -205,7 +207,9 @@
 		},
 		data() {
 			return {
+				activityList: [],
 				userId: '',
+				nickname: '',
 				newsList: [],
 				pageIndex: 1,
 				recordsTotal: 0,
@@ -227,11 +231,12 @@
 			WxJsApi.getWxConfig(['getLocation','addEventListener','scanQRCode']).then((res)=>{
 				// console.log(res)
 			}).catch(error => {
-					console.log(res)
+					// console.log(res)
 			})
 			
 			this.getPoint();
 			this.getNewsList();
+			this.getActivityInfoList();
 		},
 		methods: {
 			toLogin() {
@@ -246,7 +251,7 @@
 			},
 			//微信扫二维码
 			scanCode() {
-				if(this.userId != null) {
+				if(this.userId != '') {
 					WxJsApi.scanQRCode(1).then(res => {
 						
 					}).catch(error => {
@@ -259,7 +264,7 @@
 				}
 			},
 			fastRecharge() {
-				if(this.userId != null) {
+				if(this.userId != '') {
 					this.gotoUrl('pages/user/finance/recharge?id=' + this.userId)
 				} else {
 					uni.redirectTo({
@@ -268,13 +273,25 @@
 				}
 			},
 			chargingRecord() {
-				if(this.userId != null) {
+				if(this.userId != '') {
 					this.gotoUrl('pages/user/finance/rechargeList?id=' + this.userId)
 				} else {
 					uni.redirectTo({
 						url: '/pages/login/login'
 					})
 				}
+			},
+			rechargeActivity() {
+				if(this.userId != '') {
+					this.gotoUrl('pages/user/finance/recharge?id=' + this.userId)
+				} else {
+					uni.redirectTo({
+						url: '/pages/login/login'
+					})
+				}
+			},
+			getActivityInfoList() {
+				
 			},
 			getPoint() {
 				WxJsApi.getLocation().then((res) => {

+ 1 - 0
pages/login/login.vue

@@ -156,6 +156,7 @@
 				loginApi.validateCode({
 					verifyCode: this.form.verifyCode,
 					telephone: this.form.telephone,
+					nickName: this.carhelp.getUserInfo().nickname,
 					openId: this.carhelp.getOpenId(),
 				}).then((response) => {
 					uni.hideLoading();

+ 5 - 1
pages/searchPile/searchPile.vue

@@ -46,6 +46,7 @@
 						<u-tag
 							class="preference_item"
 							v-for="(item, index) in info.miles_type"
+							:key="index"
 							:style="index == preference.miles_index ? 'background-color:#00B962;color:#FFFFFF' : 'background-color:#EFF4F2;color:#926666'"
 							shape="circle"
 							:text="item.text"
@@ -59,6 +60,7 @@
 						<u-tag
 							class="preference_item"
 							v-for="(item, index) in info.obc_type"
+							:key="index"
 							:style="index == preference.obc_type_index ? 'background-color:#00B962;color:#FFFFFF' : 'background-color:#EFF4F2;color:#926666'"
 							shape="circle"
 							:text="item.text"
@@ -73,6 +75,7 @@
 						<u-tag
 							class="preference_item_plus"
 							v-for="(item, index) in info.obc_status"
+							:key="index"
 							:style="index == preference.obc_status_index ? 'background-color:#00B962;color:#FFFFFF' : 'background-color:#EFF4F2;color:#926666'"
 							shape="circle"
 							:text="item.text"
@@ -86,6 +89,7 @@
 						<u-tag
 							class="preference_item_plus"
 							v-for="(item, index) in info.obc_voltage"
+							:key="index"
 							:style="index == preference.obc_voltage_index ? 'background-color:#00B962;color:#FFFFFF' : 'background-color:#EFF4F2;color:#926666'"
 							shape="circle"
 							:text="item.text"
@@ -164,7 +168,7 @@
 				 
 				<view v-if="stations.length>0" class="chargerCard" style="border-radius: 20rpx;" > 
 					<swiper :current="currentIndex" @change="swiperChange" @transition="swiperTransition" style="height: 100%;">
-					 	<swiper-item v-for="(item,index) in stations" style="height: 100%;">							 
+					 	<swiper-item v-for="(item,index) in stations" :key="index" style="height: 100%;">							 
 							
 							<view class="swiper-item" style="height: 100%; background-color: #ffffff;">
 								<view class="card_item" style="font-size: 35rpx;padding-top: 5rpx;">

+ 40 - 38
pages/searchPile/searchPileMap.vue

@@ -47,7 +47,7 @@
 				</view>
 			</view>
 			<view class="station-icon3"><text class="iconfont">&#xe606;</text>
-				<view class="corner"></view>
+				<view class="corner3"></view>
 			</view>
 			<img src="/static/img/地图@1x.png" alt="">
 		</view>
@@ -205,32 +205,7 @@
 			}
 		}
 
-		.station-icon3 {
-			width: 36px;
-			height: 36px;
-			line-height: 36px;
-			text-align: center;
-			border: 1px solid rgba(0, 185, 98, 100);
-			color: #00b962;
-			border-radius: 999px;
-			position: absolute;
-			top: 124px;
-			left: 255px;
-
-			.corner {
-				width: 0;
-				height: 0;
-				position: absolute;
-				top: 34px;
-				left: 0;
-				right: 0;
-				margin: auto;
-				border-bottom: 4px solid transparent;
-				border-left: 4px solid transparent;
-				border-right: 4px solid transparent;
-				border-top: 6px solid #b58cff;
-			}
-		}
+		
 
 		.station-icon2 {
 			width: 100px;
@@ -260,22 +235,49 @@
 				line-height: 14px;
 				padding: 4px;
 			}
+			.corner2 {
+				width: 0;
+				height: 0;
+				position: absolute;
+				top: 36px;
+				left: 0;
+				right: 0;
+				margin: auto;
+				border-bottom: 6px solid transparent;
+				border-left: 6px solid transparent;
+				border-right: 6px solid transparent;
+				border-top: 8px solid #00bacb;
+			
+			}
 		}
 
-		.corner2 {
-			width: 0;
-			height: 0;
+.station-icon3 {
+			width: 36px;
+			height: 36px;
+			line-height: 36px;
+			text-align: center;
+			border: 1px solid rgba(0, 185, 98, 100);
+			color: #00b962;
+			border-radius: 999px;
 			position: absolute;
-			top: 36px;
-			left: 0;
-			right: 0;
-			margin: auto;
-			border-bottom: 6px solid transparent;
-			border-left: 6px solid transparent;
-			border-right: 6px solid transparent;
-			border-top: 8px solid #00b962;
+			top: 124px;
+			left: 255px;
 
+			.corner3 {
+				width: 0;
+				height: 0;
+				position: absolute;
+				top: 34px;
+				left: 0;
+				right: 0;
+				margin: auto;
+				border-bottom: 4px solid transparent;
+				border-left: 4px solid transparent;
+				border-right: 4px solid transparent;
+				border-top: 6px solid #00b962;
+			}
 		}
+		
 	}
 
 	.charing-slow {

+ 1 - 1
pages/searchPile/stationAndPile/chargePriceDetails.vue

@@ -7,7 +7,7 @@
 					:current="current" @change="change"></u-tabs>
 			</view>
 			<view class="line-box"><u-line color="#999999" /></view>
-			<view class="time-frame" v-for="(item,index) in list[current].items">
+			<view class="time-frame" v-for="(item,index) in list[current].items" :key="index">
 				<view class="time-items">
 					<view class="time-price">
 						<view class="time">

+ 1 - 1
pages/searchPile/stationAndPile/chargingPileDetails.vue

@@ -42,7 +42,7 @@
 			</view>
 			<!-- 时段分类 -->
 		<view class="time-rates">
-			<view class="time-part"  v-for="(item,index) in pile.price">
+			<view class="time-part"  v-for="(item,index) in pile.price" :key="index">
 				<view class="part-top">
 					<view class="time">
 						{{item.time}}

+ 2 - 2
pages/searchPile/stationAndPile/stationDetails.vue

@@ -39,7 +39,7 @@
 					<view class="iconfont right-font">&#xe600;</view>
 				</view>
 			</view>
-			<view class="price-item" v-for="(item,index) in info.prices">
+			<view class="price-item" v-for="(item,index) in info.prices" :key="index">
 				<view :class="item.name=='慢充'?'text1':'text5'">{{item.name}}</view>
 				<view class="text2">{{item.price}}</view>
 				<view class="text3">起 元/度</view>
@@ -90,7 +90,7 @@
 				<view class="type">
 					{{item.description}}
 				</view>
-				<view class="charging-gun" v-for="(item1,index1) in item.plugs" >
+				<view class="charging-gun" v-for="(item1,index1) in item.plugs" :key="index1" >
 					<view class="iconfont">
 						&#xe618;
 					</view>

+ 9 - 1
pages/user/index.vue

@@ -53,7 +53,8 @@
 				<span>0716-8123456</span>
 			</view>
 			<view>
-				<u-modal v-model="show" @confirm="confirmPhone" :show-cancel-button="true" ref="uModal" :asyncClose="true" :title="title" :content="content"></u-modal>
+				<u-modal v-model="show" @confirm="confirmPhone" :confirm-text="confirmText" confirm-color="#606266" :show-cancel-button="true" ref="uModal" 
+					:asyncClose="true" :title="title" :content="content"></u-modal>
 			</view>
 			<view class="userCell-item" @click="setUp">
 				<view class="userCell-title">
@@ -77,14 +78,21 @@
 		},
 		data() {
 			return {
+				userId: '',
 				show: false,
 				title: '联系客服',
 				content: '0716-8123456',
+				confirmText: '拨打电话',
 				background:{
 					background: 'none'
 				},
 			}
 		},
+		onReady() {
+			if(this.carhelp.getPersonInfo().id != null) {
+				this.userId = this.carhelp.getPersonInfo().id;
+			}
+		},
 		methods: {
 			toBalance() {
 				uni.navigateTo({

BIN
static/img/定位.png


+ 7 - 1
utils/mixin.js

@@ -33,9 +33,15 @@ var app = {
 	},
 	signOut:()=>  uni.removeStorageSync(prefix  + 'personInfo'),
 	getOpenId : () =>   uni.getStorageSync(prefix + 'wx_openId'),
+	
+	getUserInfo : () => {
+		 return uni.getStorageSync(prefix + 'xpgj_wx_user_info')
+	},
 
 	setOpenId : (value) => uni.setStorageSync(prefix + 'wx_openId', value),
-	setPersonInfo : (value) => uni.setStorageSync(prefix + 'personInfo', value),
+	setPersonInfo : (value) => uni.setStorageSync(prefix + 'personInfo', value),
+	
+	setUserInfo : (value) => uni.setStorageSync(prefix + 'xpgj_wx_user_info', value),
 	
 	getToken : (options) => {
 		//不同权限 ,不同token