wkyy 3 роки тому
батько
коміт
e853f2b04d
6 змінених файлів з 130 додано та 54 видалено
  1. 19 1
      apis/user.js
  2. 33 25
      main.js
  3. 6 8
      pages/index/index.vue
  4. 15 1
      pages/user/coupon/conversion.vue
  5. 50 14
      pages/user/coupon/myCoupon.vue
  6. 7 5
      pages/user/setting.vue

+ 19 - 1
apis/user.js

@@ -86,6 +86,24 @@ export function feedback  (data) {
 	return request({
 		method: 'post',
 		data:data ,
-		url: '/mobile/feedback/submit '
+		url: '/mobile/feedback/submit'
+	})
+}
+
+export function couponList(data) {
+	 
+	return request({
+		method: 'post',
+		data:data ,
+		url: '/mobile/chargingCouponApi/couponList'
+	})
+}
+
+export function couponDetail(data) {
+	 
+	return request({
+		method: 'post',
+		data:data ,
+		url: '/mobile/chargingCouponApi/couponDetail'
 	})
 }

+ 33 - 25
main.js

@@ -33,41 +33,49 @@ const app = new Vue({
 Vue.mixin({
 	updated: function() {
 		this.$nextTick(function() {
-			if (false) {
+			var g=this.carhelp.get("getElderModeClass");
+			
+		
 				//  仅在整个视图都被重新渲染之后才会运行的代码
 				var list = document.getElementsByClassName("oldTextjp")
-				var relist = {
-					oldNum1: "font-size:[num]px !important ;font-weight:bold !important;",
-					oldNum2: "line-height:[num]px ;",
-					oldNum3: "width:[num]px;",
-					oldNum4: "height:[num]px; ",
-				};
+
 
-				for (var i = 0; i < list.length; i++) {
-					var str = list[i].getAttribute("oldstyle");
-					if(str){
-						list[i].style = str+";font-weight:bold !important;"
-					}
+				for (var i = 0; i < list.length; i++) {
+						var edit = list[i].getAttribute("oldstyle-edit");
+						if(!edit){
+											list[i].setAttribute("oldstyle-edit",list[i].style.cssText);			
+						}else{
+							edit=""
+						}
+						if (g) {
+							var str = list[i].getAttribute("oldstyle");
+							if(str){
+								list[i].style = str+";font-weight:bold !important;"
+							}
+						}else{
+								list[i].style=edit
+						}
+					
 				}
 	
-				for (var i = 0; i < list.length; i++) {
-					var str = ""
+				// for (var i = 0; i < list.length; i++) {
+				// 	var str = ""
 
-					for (var j in relist) {
+				// 	for (var j in relist) {
 
-						var num = list[i].getAttribute(j);
+				// 		var num = list[i].getAttribute(j);
 
-						if (num) {
-							var k = relist[j]
-							k = k.replaceAll("[num]", num)
-							str += k + ";";
-						}
-					}
+				// 		if (num) {
+				// 			var k = relist[j]
+				// 			k = k.replaceAll("[num]", num)
+				// 			str += k + ";";
+				// 		}
+				// 	}
 
-					list[i].style = str
+				// 	list[i].style = str
 
-				}
-			}
+				// }
+		
 
 
 

+ 6 - 8
pages/index/index.vue

@@ -50,7 +50,7 @@
 		</view>
         
 		<!-- 模式选择 -->
-		<u-mask :show="show" @click="show = false">
+		<!-- <u-mask :show="show" @click="show = false">
 			<view class="wrap">
 				
 		
@@ -79,7 +79,7 @@
 					</view>
 			</view>
 				</view>
-		</u-mask>
+		</u-mask> -->
 		
 
  
@@ -309,6 +309,10 @@
 			this.timeOut = false;
 			this.pointTimeOut = false;
 		},
+		onHide() {
+			this.timeOut = false;
+			this.pointTimeOut = false;
+		},
 		onReachBottom() {
 			if (this.newsList.length < this.recordsTotal) {
 				this.myLoadmore();
@@ -340,13 +344,7 @@
 				}
 			},
 			getFindChargeData() {
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
-				
 				API.findChargeData().then((res) => {				
-					uni.hideLoading();
 					this.chargeList = res.data.chargingRecordList;
 					
 					var list = res.data.chargingRecordList;

+ 15 - 1
pages/user/coupon/conversion.vue

@@ -5,12 +5,26 @@
 		<view class="input-box">
 			<u-input placeholder="请输入兑换码"></u-input>
 		</view>
-		<u-button class="couversion-btn" type="success" shape="circle" >立即兑换</u-button>
+		<u-button class="couversion-btn" type="success" shape="circle" @click="redeemNow">立即兑换</u-button>
 		
 	</view>
 </template>
 
 <script>
+	export default{
+		data(){
+			return{
+				
+			}
+		},
+		methods:{
+			redeemNow() {
+				uni.navigateBack({
+					
+				})
+			},
+		}
+	}
 </script>
 <style>
 	page{

+ 50 - 14
pages/user/coupon/myCoupon.vue

@@ -1,6 +1,6 @@
 <template>
 	<view >
-		<u-navbar title="我的优惠券"><view class="exchange">兑换</view></u-navbar>
+		<u-navbar title="我的优惠券"><view class="exchange" @click="toConversion">兑换</view></u-navbar>
 		<view class="tab" >
 			<u-tabs :list="tabList" :current="current" @change="change" :show-bar="false" active-color="#333" inactive-color="#c4c0c0"></u-tabs>
 		</view>
@@ -67,15 +67,11 @@
 				
 				<view class="limit">
 					<view class="limit-text">
-							
 							<view class="limit-text1">
-								限用户充电电费+服务费满100元使用。<text class="iconfont arrows">&#xe607;</text>
-								限微信钱包、支付宝生活号APP端使用,
-								不支持找零,
-							</view>
-							
-							<view class="limit-text2">
-								限登录和充电帐号为155****1111使用。
+								<u-read-more ref="uReadMore" :shadow-style="shadowStyle" :show-height="50" text-indent="0" :close-text="closeContent" 
+									:open-text="openContent" color="#999999" :toggle="true">
+									<rich-text :nodes="readContent"></rich-text>
+								</u-read-more>
 							</view>
 					</view>
 					<view class="use-button">
@@ -295,23 +291,63 @@
 </template>
 
 <script>
+	import * as userApi from '@/apis/user.js'
+	
 	export default{
 		data(){
 			return{
 				tabList: [
-					{name: '可使用',type: '1'},
-					{name: '已使用',type: '2'},
-					{name: '已过期',type: '3'},
+					{name: '可使用',type: '0'},
+					{name: '已使用',type: '1'},
+					{name: '已过期',type: '2'},
 				],
 				current: 0,
+				couponType: '0',
+				myCouponList: [],
+				readContent: `限用户充电电费+服务费满100元使用。限微信钱包、支付宝生活号APP端使用,<br />不支持找零,限登录和充电帐号为155****1111使用。`,
+				shadowStyle: {
+					width: "110%",
+					backgroundImage: "none",
+					paddingTop: "0",
+					marginTop: "-10%",
+					justifyContent: "right",
+				},
+				closeContent: '',
+				openContent: ','
 			}
 		},
+		onReady() {
+			this.getCouponList();
+		},
 		methods:{
+			toConversion() {
+				uni.navigateTo({
+					url: '/pages/user/coupon/conversion'
+				})
+			},
+			getCouponList() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})		
+				userApi.couponList({
+					status: this.couponType
+				}).then((res) => {
+					uni.hideLoading();
+					
+					this.myCouponList = res.data.data;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			change(index) {
 				this.current = index;
-				
+				this.couponType = this.tabList[index].type;
+				this.getCouponList();
 			},
-			           
 		}
 	}
 </script>

+ 7 - 5
pages/user/setting.vue

@@ -4,18 +4,17 @@
 		<u-cell-group>
 			<u-cell-item title="修改手机号" v-model="userPhone" @click="gotoUrl('pages/user/phone')"></u-cell-item>
 			<u-cell-item title="注销账号" value="注销后无法恢复,请谨慎操作" :value-style="valueStyle" @click="gotoUrl('pages/user/logout')"></u-cell-item>
-	
 		</u-cell-group>
 		<view class="switcher-mode">
-			<view class="">
+			<view class="oldTextjp" oldstyle="font-size:18px">
 				长辈模式
-				<text>字体更大更清晰</text>
+				<text class=" oldTextjp" oldstyle="font-size:16px;">字体更大更清晰</text>
 			</view>
 			<view class="switch-box" >
-				<u-switch v-model="checked" class="switch" active-color="orange"></u-switch>
+				<u-switch v-model="checked" class="switch" active-color="#00E266" @change="checkedChange"></u-switch>
 			</view>
 		</view>
-		<view class="logout-btn" @click="signOut">
+		<view class="logout-btn oldTextjp" oldstyle="font-size:18px" @click="signOut">
 			退出帐号
 		</view>
 		
@@ -53,6 +52,9 @@
 			}
 		},
 		methods: {
+			checkedChange() {
+				this.carhelp.set("getElderModeClass", this.checked);
+			},
 			signOut() {
 				this.show = true;
 			},