Browse Source

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

zhupeng 3 years ago
parent
commit
27cb1e7950
4 changed files with 38 additions and 7 deletions
  1. 7 0
      apis/index.js
  2. 1 1
      pages/article/newsNotice.vue
  3. 21 5
      pages/index/index.vue
  4. 9 1
      pages/user/index.vue

+ 7 - 0
apis/index.js

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

+ 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>

+ 21 - 5
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,6 +207,7 @@
 		},
 		data() {
 			return {
+				activityList: [],
 				userId: '',
 				newsList: [],
 				pageIndex: 1,
@@ -232,6 +235,7 @@
 			
 			this.getPoint();
 			this.getNewsList();
+			this.getActivityInfoList();
 		},
 		methods: {
 			toLogin() {
@@ -246,7 +250,7 @@
 			},
 			//微信扫二维码
 			scanCode() {
-				if(this.userId != null) {
+				if(this.userId != '') {
 					WxJsApi.scanQRCode(1).then(res => {
 						
 					}).catch(error => {
@@ -259,7 +263,7 @@
 				}
 			},
 			fastRecharge() {
-				if(this.userId != null) {
+				if(this.userId != '') {
 					this.gotoUrl('pages/user/finance/recharge?id=' + this.userId)
 				} else {
 					uni.redirectTo({
@@ -268,13 +272,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) => {

+ 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({