zhengkaixin 3 роки тому
батько
коміт
440240439f

+ 4 - 4
.env.dev.js

@@ -1,16 +1,16 @@
 const UNI_APP = {  
 	ProjectName :"51充电联盟",
-//	BASE_URL: 'https://51team.xiaoxinda.com/charging-station-server/',
+	//	BASE_URL: 'https://51team.xiaoxinda.com/charging-station-server/',
 	
-	//BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
-	BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
+	BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
+	//BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
     PARK_URL: 'https://51team.xiaoxinda.com/charging-parking/' ,
 	NODE_ENV :"dev",
 	SIMPLE_RUN:true,// 无视权限控制跳转页面   , 用于样式人员快速访问各种功能 ,快速测试等
 
 	//openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY", 
 	openId:"oK9Wr59rru-i3bm7dtTtxnkR-i4s",
-	//	openId:"test113",
+	//	openId:"test111",
 	//小鹏管家appid
 	//VUE_APP_WXAPPID:"wx7e70eb62a8459869",
 	VUE_APP_WXAPPID:"wx3afdb1b60188c1e5",

+ 1 - 1
.env.js

@@ -1,5 +1,5 @@
 (function() {  
-    const NODE_ENV = 'test'; // dev:开发环境 | test:测试环境  
+    const NODE_ENV = 'dev'; // dev:开发环境 | test:测试环境  
     let ENV_VAR = null;  
 	 
 	var NODE_NAME=  process.env['NODE_NAME']

+ 18 - 0
apis/user.js

@@ -127,3 +127,21 @@ export function perfectPersonInformation(data) {
 	})
 }
 
+
+export function giveCouponDetail(data) {
+	 
+	return request({
+		method: 'post',
+		data:data ,
+		url: '/mobile/chargingCouponApi/giveCouponDetail'
+	})
+}
+
+export function receiveGiveCoupon(data) {
+	 
+	return request({
+		method: 'post',
+		data:data ,
+		url: '/mobile/chargingCouponApi/receiveGiveCoupon'
+	})
+}

+ 4 - 2
main.js

@@ -93,13 +93,15 @@ Vue.mixin({
 				 
 				var list_u_title = document.getElementsByClassName("u-title")
 				var  u_cell_title = document.getElementsByClassName("u-cell_title")
-				
-				style1 ="line-height: 20px;color: rgb(96, 98, 102);  font-size: 16px;    overflow: unset;"
+ 				style1 ="line-height: 20px;color: rgb(96, 98, 102);  font-size: 16px;    overflow: unset;"
 			
 				style2 ="color: rgb(96, 98, 102); font-size: 13px; font-weight: normal;"
 				styleg(g,style1,style2,list_u_title)
 				styleg(g,style1,style2,u_cell_title)
+				style1 ="line-height: 20px;color: rgb(16, 16, 16);  font-size: 16px;    overflow: unset;"
 							
+				var  u_cell__label = document.getElementsByClassName("u-cell__label")	
+				styleg(g,style1,style2,u_cell__label)
 				
 				
 				var list_u_value = document.getElementsByClassName("u-cell__value")

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

@@ -86,7 +86,7 @@
 								let _item = data.prices[i];
 								if(_self.id){
 									
-									if(_item.id==_self.type){
+									if(_item.id==_self.id){
 										_self.current=i;
 									}
 								}else{

+ 5 - 8
pages/searchPile/stationAndPile/stationDetails.vue

@@ -179,12 +179,9 @@
 		v-show="current==1" >
 			<u-cell-group>
 				<u-cell-item
-				 
-				 @click="priceDetail(1)" v-if="stationDetail.fastPrice != null" title="快充" :value="'当前时段:'+stationDetail.fastPrice.startTime+'~'+stationDetail.fastPrice.endTime+'  '+stationDetail.fastPrice.costPrice+'元/度(含电费'+stationDetail.fastPrice.electricityPrice+'元/度+服务费'+stationDetail.fastPrice.servicePrice+'元/度'"></u-cell-item>
-				<u-cell-item 
-				
-				@click="priceDetail(2)" v-if="stationDetail.slowPrice != null" title="慢充" :value="'当前时段:'+stationDetail.slowPrice.startTime+'~'+stationDetail.slowPrice.endTime+'  '+stationDetail.slowPrice.costPrice+'元/度(含电费'+stationDetail.slowPrice.electricityPrice+'元/度+服务费'+stationDetail.slowPrice.servicePrice+'元/度'"></u-cell-item>
-				
+				 v-for="(item,i) in stationDetail.priceList" :key="i"
+				 @click="priceDetail(1,item.deviceId)"  :title="item.deviceName" :label="'当前时段:'+item.startTime+'~'+item.endTime+'  '+item.costPrice+'元/度(含电费'+item.electricityPrice+'元/度+服务费'+item.servicePrice+'元/度'"></u-cell-item>
+			
  					<u-cell-item :arrow="false" v-if="false" title="停车费用" value="充电免停2小时停车费(临牌车不享受免停)"></u-cell-item>
 				</u-cell-group>
 			
@@ -598,9 +595,9 @@
 				 })
 				
 			},
-			priceDetail(t){
+			priceDetail(t,id){
 				uni.navigateTo({
-					url:'chargePriceDetails?stationId='+_self.stationDetail.station.id+"&type="+t
+					url:'chargePriceDetails?stationId='+_self.stationDetail.station.id+"&type="+t+"&id="+id
 				})
 			},
 			map(){

+ 93 - 14
pages/user/receiveCoupon.vue

@@ -1,55 +1,134 @@
 <template>
 	<view>
-		<u-navbar title="优惠券"></u-navbar>
+		<ujp-navbar title="优惠券" :is-back="false" ></ujp-navbar>
 		<view class="main">
 			<view class="content">
 				<view class="img">
 					<img src="../../assets/img/coupons.png" alt="">
 				</view>
-				<p class="title">亲爱的车友</p>
-				<view class="text">
-					     您好!因前天荆鹏快充站在做电力调配测试,对您的充电造成了不好的体验,在此我们深表歉意,为此我们赠送您一张体验券,请点击下方查收,欢迎您再次体验我们的充电服务,并为我们的服务提出宝贵意见,最后,祝您生活愉快!
+				
+				<view v-html="userMessage.content">
+					
 				</view>
-                <view class="sign">
-                	51充电联盟荆鹏快充站
-                </view>
 			</view>
 			<!-- 专享优惠券 -->
 			<view class="exclusive">
 				<p>专享优惠券</p>
-				<view class="img">
+				<view class="img" v-for="(item,i) in  userCouponList" :key="i" >
 					<img src="../../assets/img/Frame915.png" alt="">
 					
 						<view class="num">
-							20
+							{{item.value}}
 						</view>
 						<view class="unit">元</view>
 					<view class="ticket-info">
 						<view class="ticket-name">
-							无门槛充电抵扣券
+							{{item.threshold == 0 ? '无门槛充电抵扣券' : '满'+selectObj.threshold+'元可用'}}
+							
 						</view>
 						<view class="condition">
-							限荆鹏快充站使用
+							限{{item.useScopeText}}使用
 						</view>
 					</view>
 				</view>
+				
+				
 			</view>
 			
 		</view>
-		<button class="btn">领取优惠券</button>
+		<button class="btn"  @click="btnCk()" >{{status=='3'?'领取优惠券':'查看'}}</button>
 		
 	</view>
 </template>
 
 <script>
+	import * as userApi from '@/apis/user.js'
+	
 	export default {
 		data() {
 			return {
-				
+				id:"",
+				userMessage:{},
+				userCouponList:[],
+				status:-1,
 			}
+		},onLoad(op) {
+			this.id=op.id
+			this.getInfo()
+			
 		},
 		methods: {
-			
+			getInfo(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				userApi.giveCouponDetail({
+					messageId:this.id
+				}).then(response => {
+					uni.hideLoading()
+						this.userMessage=response.data.userMessage	
+					this.userCouponList=response.data.userCouponList
+					for(var i in this.userCouponList){
+							var obj=this.userCouponList[i]
+							this.status=obj.status;
+					}
+					
+					console.log(this.userMessage)
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+					
+				})
+			},
+			btnCk(){
+				if(this.status==3){
+					this.submit()
+				}else{
+					uni.navigateTo({
+						url:'/pages/user/coupon/myCoupon'
+					})
+				}
+			},
+			submit(){
+				
+				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				userApi.receiveGiveCoupon({
+					messageId:this.id
+				}).then(response => {
+					uni.hideLoading()
+					uni.showModal({
+						title:"提示",
+						content:"领取成功",
+						confirmText:"前往查看",
+						showCancel:true,
+						success(res) {
+							if (res.confirm) {
+										uni.navigateTo({
+											url:'/pages/user/coupon/myCoupon'
+										})
+									} else if (res.cancel) {
+										console.log('用户点击取消');
+									}
+						}
+					})
+					console.log(this.userMessage)
+					this.getInfo()
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+					
+				})
+			}
 		}
 	}
 </script>