Browse Source

去掉默认1000

zhengkaixin 1 month ago
parent
commit
bad040e243
2 changed files with 86 additions and 34 deletions
  1. 86 16
      pages/searchPile/chargeProcess/charge.vue
  2. 0 18
      pages/user/finance/recharge.vue

+ 86 - 16
pages/searchPile/chargeProcess/charge.vue

@@ -413,18 +413,36 @@
 					
 
 						<view class="rechargeMain">
-							<view class="recharge-item"
-								:class="{
-									active:otherNum_f==item.rechargeAmount||moneyActiveClass_f == item.id ,
-									'recharge-item-rk':item.amountRemark
-								}"
-								v-for="(item,index) in moneyList_f" :key="item.id" @click="moneyClick_f(item.id,item)">
-								{{item.amountDesc?item.amountDesc:item.rechargeAmount+'元'}}
+							<template  v-for="(item,index) in moneyList_f">
 								
-								<view class="item-rk" v-if="item.amountRemark">送<span class="item-rk-span" >{{item.amountRemarkNum}}</span>折卡</view>
+								<view class="tip-box" v-if="index==4&&userChargingAmountObj.type">
+									<template v-if="userChargingAmountObj.type==1">
+										新用户参与充值送折扣卡活动推荐充值<span>1000元</span>,预计可省 <span> 133元</span>。
 								
-							</view>
-							
+									</template>
+									<template v-else-if="userChargingAmountObj.type==2">
+										按您每月充电花费,半年将超<span>{{userChargingAmountObj.money}}元</span>,参与充值送折扣卡活动推荐充值 <span>{{userChargingAmountMethod(userChargingAmountObj).num1}}元</span>,预计可省 <span>{{userChargingAmountMethod(userChargingAmountObj).num3}}元</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="{
+										active:otherNum_f==item.rechargeAmount||moneyActiveClass_f == item.id ,
+										'recharge-item-rk':item.amountRemark
+									}"
+									 :key="item.id" @click="moneyClick_f(item.id,item)">
+									{{item.amountDesc?item.amountDesc:item.rechargeAmount+'元'}}
+									
+									<view class="item-rk" v-if="item.amountRemark">送<span class="item-rk-span" >{{item.amountRemarkNum}}</span>折卡</view>
+									
+								</view>
+							</template>
 							<p  style="   font-size: 14px;" v-show="selectItem.amountRemark">
 								充值满
 								<span style="color: red;">{{selectItem.amountDesc}}</span>立送服务费<span style="color: red;">{{selectItem.amountRemarkNum}}折半年卡</span>1张(<span style="color: red;">有效期180天,不限充电度数</span>)1<span v-if="selectItem.amountRemarkSf">和{{selectItem.amountRemarkSf}}身份</span>,活动所充金额仅用于支付本平台充电费用(含电费和服务费),不可转赠、提现、退款,
@@ -515,6 +533,9 @@
 		},
 		data() {
 			return {
+				userChargingAmountObj:{
+					
+				},
 				fee: 0,
 				recordId: "",
 				show2: false,
@@ -1052,7 +1073,7 @@
 						}
 						this.moneyActiveClass_n = list[0]
 					}
-
+					this.init1()
 
 				}).catch(error => {
 					uni.showToast({
@@ -1061,6 +1082,18 @@
 					})
 				})
 			},
+			init1() {
+				
+				
+				API_index.userChargingAmount().then((res) => {
+					this.userChargingAmountObj = res.data
+					//this.userChargingAmountObj.type=1
+					
+					
+				}).catch(error => {
+					
+				})
+			},
 			clickBanner(index) {
 				var mod = this.bannerList[index]
 
@@ -1134,12 +1167,12 @@
 					}
 				}
 				var t = Number(text);
-				// if (t < 1) {
-				// 	this.$nextTick(() => {
-				// 		this.otherNum_f = '';
-				// 	})
+				if (t < 1) {
+					this.$nextTick(() => {
+						this.otherNum_f = '';
+					})
 
-				// }
+				}
 				if (t > 500) {
 					this.$nextTick(() => {
 						this.otherNum_f = 500;
@@ -2268,4 +2301,41 @@
 		}
 	}
 	
+	
+	.tip-box {
+	           position: relative;
+	           background-color: #FEF8E9;
+	           border: 1px solid #f5a623;
+	           border-radius: 8px;
+	           padding: 10px 15px;
+	           color: #333;
+	           width: 400px;
+					 margin-bottom: 36rpx;
+	       }
+		
+	      .tip-box::before,
+	      .tip-box::after {
+	           content: "";
+	           position: absolute;
+	           top: 100%;
+	           left: 20px;
+	           border-left: 10px solid transparent;
+	           border-right: 10px solid transparent;
+	       }
+		
+	      .tip-box::before {
+	           border-top: 10px solid #f5a623; /* 与提示框边框颜色一致 */
+	           margin-top: 1px;
+	       }
+		
+	      .tip-box::after {
+	           border-top: 10px solid #FEF8E9; /* 白色填充 */
+	           margin-top: 0;
+	           transform: translateY(-1px);
+	       }
+		
+	      .tip-box span {
+	           color: #ec4530;
+	           font-weight: bold;
+	       }
 </style>

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

@@ -363,25 +363,7 @@
 				
 				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 => {
 					
 				})