zhengkaixin 1 месяц назад
Родитель
Сommit
583b4eecae

+ 9 - 0
apis/index.js

@@ -71,6 +71,15 @@ export function activityInfoList(data) {
 	})
 }
 
+
+export function userChargingAmount(data) {
+	return requestWhite({
+		method: 'post',
+		data: data,
+		url: '/mobile/regUser/userChargingAmount'
+	})
+}
+
 export function test(data) {
 	return request({
 		method: 'post',

+ 36 - 0
main.js

@@ -202,6 +202,42 @@ Vue.mixin({
 	},
 	
 	methods: {
+		userChargingAmountMethod(obj){
+			var m=obj.money
+			//m=2760
+			
+			var sz=[
+				{
+					num1:3000,
+					num2:999999999,
+					num3:800,
+				},
+				{
+					num1:2000,
+					num2:2500,
+					num3:427,
+				},
+				{
+					num1:1000,
+					num2:1500,
+					num3:133,
+				},
+				{
+					num1:500,
+					num2:750,
+					num3:40,
+				},
+				
+			]
+			var obj={}
+			for(var i in sz){
+				var item=sz[i]
+				if(m<item.num2){
+					obj=item
+				}
+			}
+			return obj
+		},
 		tagNameBy(tagName,i){
 			var str=""
 			

+ 36 - 8
pages/searchPile/stationAndPile/charging/chargingPileDetails.vue

@@ -360,10 +360,19 @@
 					<img @click="gotoLogin" src="@/assets/img/gologin/img.png">
 			</view>
 			
-			<view  class="class20250501" v-else-if="!userCardBool">
-				<view class="body1">
-					<view class="text1">近半年您已花费<span>560</span>元用于充电</view>
-					<view class="text2">如参与充值送折扣卡活动,预计可省 <span>42.8</span> 元</view>
+			<view  class="class20250501" @click="gotoUrl('pages/temporary/activity20250501?source=99')"
+			 v-else-if="!userCardBool&&userChargingAmountObj.type">
+				<view class="body1" v-if="userChargingAmountObj.type==3">
+					<view class="text1">近半年您已花费<span>{{userChargingAmountObj.money}}</span>元用于充电</view>
+					<view class="text2">如参与充值送折扣卡活动,预计可省 <span style="font-size: 56rpx;">{{userChargingAmountMethod(userChargingAmountObj).num3}}</span> 元</view>
+				</view>
+				<view class="body1" v-if="userChargingAmountObj.type==2">
+					<view class="text1">按您每月充电花费,半年将超<span>{{userChargingAmountObj.money}}</span>元</view>
+					<view class="text2">推荐充值<span>{{userChargingAmountMethod(userChargingAmountObj).num1}}元</span>,预计可省 <span style="font-size: 56rpx;">{{userChargingAmountMethod(userChargingAmountObj).num3}}</span> 元</view>
+				</view>
+				<view class="body1" v-if="userChargingAmountObj.type==1">
+					<view class="text1">新用户参与充值送折扣卡活动推荐充值<span>1000</span>元,预计可省 <span> 133元</span>。</view>
+					
 				</view>
 				<view class="body2">
 					<view class="botton">查看活动详情</view>
@@ -911,6 +920,9 @@
 		},
 		data() {
 			return {
+				userChargingAmountObj:{
+					
+				},
 				pageTitle:"充电枪详情",
 				show1: false,
 				show2: false,
@@ -1115,6 +1127,17 @@
 					})
 				}
 			},
+			userChargingAmount(){
+				API_index.userChargingAmount().then((res) => {
+					this.userChargingAmountObj = res.data
+					//this.userChargingAmountObj.type=3
+					
+				}).catch(error => {
+					
+				})
+			},
+			
+			
 			findNoLTextConfigure(){
 							
 							 
@@ -1595,6 +1618,7 @@
 						if (this.personInfo && this.personInfo.userType == "2") {
 							 try{
 								//this.getChargeList()
+								this.userChargingAmount()
 								
 							}catch(e){
 								//TODO handle the exception
@@ -3104,8 +3128,8 @@
 	
 	.class20250501{
 		width: 670rpx;
-		height: 200rpx;
-		background: url(@/assets/img/20250501/char-index-1.png) ;
+		//height: 200rpx;
+		background: url(@/assets/img/20250501/char-index-1.png) round;
 		    background-size: 100%;
 			margin: 0 40rpx;
 			//background: linear-gradient(32.4deg, rgba(59,182,254,1) 20.49%,rgba(0,185,98,1) 118.87%);
@@ -3118,16 +3142,20 @@
 					color: #fff;
 					font-size: 32rpx;
 					span{
-						
+						color:#FDE94E;
+						font-weight: bold;
 					}
 					.text1{
 						font-weight: bold;
 					}
 					.text2{
-						
+						    margin-top: -20rpx;
+						font-size: 28rpx;
 					}
 				}
 				.body2{
+					    display: flex;
+						margin-top: 16rpx;
 					.botton{
 						    padding: 2px 6px;
 						line-height: 20px;

+ 2 - 2
pages/temporary/activity20250501.vue

@@ -63,10 +63,10 @@
 				</table>
 			</view>
 
-			<view class="title">活动时间:</view>
+		<!-- 	<view class="title">活动时间:</view>
 			<view class="textlist">
 				2025年5月10日至2025年6月30日
-			</view>
+			</view> -->
 			<view class="title">活动说明:</view>
 			<view class="textlist">
 					<p>1、本次充值活动所充金额仅用于支付本平台充电费用(包含电费和服务费),不可转赠、提现、退款。</p>

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

@@ -18,8 +18,20 @@
 				<template v-for="(item,index) in moneyList">
 					
 				
-				<view class="tip-box" v-if="index==4">
-				近半年您已花费<span>560元</span>充电,参与充值送折扣卡活动推荐充值<span>500元</span>,预计可省<span>24.8元</span>。
+				<view class="tip-box" v-if="index==4&&userChargingAmountObj.type">
+					<template v-if="userChargingAmountObj.type==1">
+						新用户参与充值送折扣卡活动推荐充值<span>1000元</span>,预计可省 <span> 133元</span>。
+
+					</template>
+					<template v-else-if="userChargingAmountObj.type==2">
+						按您每月充电花费,半年将超<span>{{userChargingAmountObj.money}}元</span>,参与充值送折扣卡活动推荐充值 <span>500元</span>,预计可省 <span>42.8元</span>。
+
+					</template>
+					<template v-else>
+						近半年您已花费<span>{{userChargingAmountObj.money}}元</span>充电,参与充值送折扣卡活动推荐充值 <span> {{userChargingAmountMethod(userChargingAmountObj).num1}}元</span>,预计可省 <span> {{userChargingAmountMethod(userChargingAmountObj).num3}}元</span>。
+
+					</template>
+				
 				</view>
 				
 				<view class="recharge-item"   :class="{
@@ -142,6 +154,8 @@
 		wxPayJs
 	} from '@/utils/wxpay'
 	import * as API from '@/apis/finance.js'
+	import * as API_index from '@/apis/index.js'
+	
 	export default {
 		data() {
 			return {
@@ -182,6 +196,9 @@
 				checked: true,
 				projectName:"",
 				recordId:"",
+				userChargingAmountObj:{
+					
+				}
 			}
 		},
 		onLoad(op) {
@@ -197,6 +214,7 @@
 
 			this.init();
 			this.getBannerInfo("userinfo")
+			
 		},
 		methods: {
 			clickBanner(index, bl, modout) {
@@ -342,6 +360,31 @@
 						title: error
 					})
 				})
+				
+				API_index.userChargingAmount().then((res) => {
+					this.userChargingAmountObj = res.data
+					//this.userChargingAmountObj.type=3
+					if(this.userChargingAmountObj.type==1){
+						
+						
+						for(var i in this.moneyList){
+							var item =this.moneyList[i]
+						
+							if(item.rechargeAmount==1000){
+								// this.selectItem = this.moneyList[i];
+								// this.moneyActiveClass = this.moneyList[i].id
+								this.moneyClick(item.id,item)
+							}
+							
+							
+						}
+					}
+					
+					
+
+				}).catch(error => {
+					
+				})
 			},
 			init() {
 
@@ -720,7 +763,7 @@
 	
 	 .tip-box {
 	            position: relative;
-	            background-color: #fff;
+	            background-color: #FEF8E9;
 	            border: 1px solid #f5a623;
 	            border-radius: 8px;
 	            padding: 10px 15px;
@@ -745,13 +788,13 @@
 	        }
 	
 	       .tip-box::after {
-	            border-top: 10px solid white; /* 白色填充 */
+	            border-top: 10px solid #FEF8E9; /* 白色填充 */
 	            margin-top: 0;
 	            transform: translateY(-1px);
 	        }
 	
 	       .tip-box span {
-	            color: #f5a623;
+	            color: #ec4530;
 	            font-weight: bold;
 	        }