浏览代码

主页扫码

wkyy 3 年之前
父节点
当前提交
a996248268
共有 4 个文件被更改,包括 43 次插入16 次删除
  1. 32 15
      pages/index/index.vue
  2. 5 0
      pages/user/finance/recharge.vue
  3. 5 0
      pages/user/finance/rechargeList.vue
  4. 1 1
      pages/user/index.vue

+ 32 - 15
pages/index/index.vue

@@ -50,25 +50,25 @@
 		</view>
 
 		<!-- 站点 -->
-		<!-- <view class="station">
+		<view class="station" v-if="message == 'getLocation:ok'">
 			<view class="img-box">
 				<img src="/static/img/Frame 198 (1).png" alt="">
 			</view>
-			<view class="text"> -->
+			<view class="text">
 				<!-- 站点头部 -->
-				<!-- <view class="station-title">
+				<view class="station-title">
 					<text class="title-left">快充</text>
 					<text class="title-right">荆沙大道救助站充电站</text>
-				</view> -->
+				</view>
 				<!-- 价格 -->
-				<!-- <view class="station-price">
+				<view class="station-price">
 					<view class="price-left">1.25</view>
 					<view class="price-right">
 						起 元/度
 					</view>
-				</view> -->
+				</view>
 				<!-- park -->
-				<!-- <view class="park">
+				<view class="park">
 					<text class="park-p">p</text>
 					<text class="park-text">2小时免费停车</text>
 				</view>
@@ -77,9 +77,9 @@
 					<view class="count-right"><text class="iconfont">&#xe615;</text>10公里</view>
 				</view>
 			</view>
-		</view> -->
+		</view>
 		<!-- 定位 -->
-		<view class="location-box">
+		<view class="location-box" v-else>
 			<view class="location">
 				<view class="location-text">
 					<view class="text-1">
@@ -224,7 +224,7 @@
 			}
 		},
 		onReady() {
-			if(this.carhelp.getPersonInfo().id != null) {
+			if(this.carhelp.getPersonInfo() != null) {
 				this.userId = this.carhelp.getPersonInfo().id;
 			}
 			
@@ -253,7 +253,9 @@
 			scanCode() {
 				if(this.userId != '') {
 					WxJsApi.scanQRCode(1).then(res => {
-						
+						if(res) {
+							this.gotoUrl('pages/searchPile/stationAndPile/stationDetails?id=' + res)
+						}
 					}).catch(error => {
 						
 					})
@@ -265,7 +267,7 @@
 			},
 			fastRecharge() {
 				if(this.userId != '') {
-					this.gotoUrl('pages/user/finance/recharge?id=' + this.userId)
+					this.gotoUrl('pages/user/finance/recharge')
 				} else {
 					uni.redirectTo({
 						url: '/pages/login/login'
@@ -274,7 +276,7 @@
 			},
 			chargingRecord() {
 				if(this.userId != '') {
-					this.gotoUrl('pages/user/finance/rechargeList?id=' + this.userId)
+					this.gotoUrl('pages/user/finance/rechargeList')
 				} else {
 					uni.redirectTo({
 						url: '/pages/login/login'
@@ -283,7 +285,7 @@
 			},
 			rechargeActivity() {
 				if(this.userId != '') {
-					this.gotoUrl('pages/user/finance/recharge?id=' + this.userId)
+					this.gotoUrl('pages/user/finance/recharge')
 				} else {
 					uni.redirectTo({
 						url: '/pages/login/login'
@@ -291,7 +293,22 @@
 				}
 			},
 			getActivityInfoList() {
-				
+				// uni.showLoading({
+				// 	title: "加载中",
+				// 	mask: true,
+				// })
+				// Api.activityInfoList({
+				// 	pageIndex: 1,
+				// 	pageSize: 10
+				// }).then((res) => {	
+				// 	uni.hideLoading();
+				// 	console.log(res)
+				// }).catch(error => {
+				// 	uni.showToast({
+				// 		title: error,
+				// 		icon: "none"
+				// 	})					
+				// })
 			},
 			getPoint() {
 				WxJsApi.getLocation().then((res) => {

+ 5 - 0
pages/user/finance/recharge.vue

@@ -47,6 +47,7 @@
 	export default {
 		data() {
 			return {
+				userId: '',
 				detail:{},
 				moneyActiveClass: 1,
 				moneyList: [
@@ -70,6 +71,10 @@
 			}
 		},
 		onReady() {
+			if(this.carhelp.getPersonInfo() != null) {
+				this.userId = this.carhelp.getPersonInfo().id;
+			}
+			
 			this.init();
 		},
 		methods: {

+ 5 - 0
pages/user/finance/rechargeList.vue

@@ -31,6 +31,7 @@
 	export default {
 		data() {
 			return {
+				userId: '',
 				params: {
 					year: true,
 					month: true,
@@ -48,6 +49,10 @@
 			}
 		},
 		onReady() {
+			if(this.carhelp.getPersonInfo() != null) {
+				this.userId = this.carhelp.getPersonInfo().id;
+			}
+			
 			var date = new Date();
 			this.date.year = date.getFullYear();
 			this.date.month = date.getMonth() + 1;

+ 1 - 1
pages/user/index.vue

@@ -89,7 +89,7 @@
 			}
 		},
 		onReady() {
-			if(this.carhelp.getPersonInfo().id != null) {
+			if(this.carhelp.getPersonInfo() != null) {
 				this.userId = this.carhelp.getPersonInfo().id;
 			}
 		},