gcz 2 жил өмнө
parent
commit
ac61fde148

+ 6 - 6
center/center.vue

@@ -17,17 +17,17 @@
 			<u-icon @click="$u.route('/center/memberinfo',{type:'redirectTo'})" name="setting-fill" color="#333333" size="38rpx"></u-icon>
 		</view>
 		<view class="property page-wrap u-flex u-row-between">
-			<!-- <view class="property-item" @click="showPayCode = true">
+			<view class="property-item"  @click="$u.route('/center/paycode')">
 				<view class="up">
 					<u-icon :name="staticUrl+'/img/paycode.png'" color="#333333" size="42rpx"></u-icon>
 				</view>
 				<view class="down">付款码</view>
-			</view> -->
-			<view class="property-item"  @click="$u.route('/center/mybalance')">
+			</view>
+			<view class="property-item" @click="$u.route('/center/mybalance')">
 				<view class="up">{{memberInfo.balance}}</view>
 				<view class="down">余额</view>
 			</view>
-			<view class="property-item">
+			<view class="property-item" @click="$u.route('/credits/creditslist')">
 				<view class="up">{{memberInfo.credit}}</view>
 				<view class="down">积分</view>
 			</view>
@@ -62,13 +62,13 @@
 				</view>
 			</view>
 		</view>
-		<u-overlay :show="showPayCode" @click="showPayCode = false">
+		<!-- <u-overlay :show="showPayCode" @click="showPayCode = false">
 			<view class="pay-code-warp u-flex u-row-center">
 				<view class="rect" @tap.stop>
 					<u--image :showLoading="true" :src="payCodeImg" width="180px" height="180px"></u--image>
 				</view>
 			</view>
-		</u-overlay>
+		</u-overlay> -->
 		<tabbar :tabbarIndexProps="3" />
 	</view>
 </template>

+ 97 - 0
center/findpaypass.vue

@@ -0,0 +1,97 @@
+<template>
+	<view class="page-wrap">
+		<u-navbar
+			title="忘记密码"
+			:autoBack="true"
+			 :safeAreaInsetTop="true"
+		>
+		</u-navbar>
+		<view class="title">手机验证身份</view>
+		<view class="phone">
+			<text v-if="leftTime>0">验证码已发送</text>
+			<text v-else>手机号:</text>
+			{{vuex_member_info.mobile|hidePhoneNumber}}</view>
+		<u-code-input 
+			v-model="value" 
+			mode="line" 
+			:maxlength="4"
+			@finish="finish">
+		</u-code-input>
+		<u-button class="button" type="primary" :disabled="leftTime>0" @click="sendSMS" :text="btnStatus"></u-button>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				value:'',
+				leftTime: 0, // 剩余时间
+				btnStatus: '发送验证码', // 按钮状态
+				params:{
+				}
+				
+			}
+		},
+		onShow() {
+			
+		},
+		onLoad() {
+
+		},
+		methods: {
+			sendSMS() {
+			  // console.log('发送短信验证码到:', 手机号码);
+			  this.$u.api.getCode({mobile:this.vuex_member_info.mobile}).then(res=>{
+			  	console.log('res',res.data);
+			  }).catch(err=>{
+			  	console.log('getCode',err);
+			  });
+			  this.leftTime = 60;
+			  this.btnStatus = `${this.leftTime}秒后重试`;
+			  const timer = setInterval(() => {
+				this.leftTime--;
+				this.btnStatus = `${this.leftTime}秒后重试`;
+				if (this.leftTime <= 0) {
+				  clearInterval(timer);
+				  this.btnStatus = '重新发送验证码';
+				}
+			  }, 1000);
+			},
+			finish(){
+				console.log('value',this.value);
+				uni.$u.route('/center/setPaypass', {
+					fromPage: 'forget',
+					code:this.value
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+.page-wrap{
+	text-align: center;
+	.title{
+		font-size: 32rpx;
+		font-weight: 600;
+		color: #333333;
+		line-height: 45rpx;
+		margin: 40rpx auto 30rpx;
+	}
+	.phone{
+		font-size: 26rpx;
+		font-weight: 400;
+		color: #999999;
+		line-height: 37rpx;
+		margin-bottom: 130rpx;
+	}
+}
+/deep/ .u-code-input__item{
+	flex-grow: 1;
+}
+/deep/ .u-button{
+	margin-top: 80rpx;
+	width: 80%!important;
+}
+</style>

+ 54 - 8
center/mybalance.vue

@@ -9,13 +9,20 @@
 		</u-navbar>
 		<view class="panel">
 			<view class="title">个人余额(元)</view>
-			<view class="number">{{memberInfo.balance}}</view>
-			<u-button text="立即充值" @click="$u.route('/center/recharge')"></u-button>
+			<view class="number-wrap">
+				¥ <text class="number">{{memberInfo.balance}}</text> 
+			</view>
+			<view class="btn-wrap">
+				<text class="btn" @click="$u.route('/center/recharge')">充值</text>
+			</view>
+			<view class="shape shape1"></view>
+			<view class="shape shape2"></view>
 		</view>
 		
 		<u-cell-group>
 			<u-cell @click="$u.route('/center/dealList')" icon="order" title="交易明细" :isLink="true"></u-cell>
-			<u-cell @click="$u.route('/center/setPaypass',{fromPage:'reset'})" icon="setting-fill" title="支付设置" :isLink="true"></u-cell>
+			<u-cell @click="$u.route('/center/setPaypass',{fromPage:'reset'})" icon="setting-fill" title="支付密码" :isLink="true"></u-cell>
+			<u-cell @click="$u.route('/center/findpaypass')" icon="fingerprint" title="找回支付密码" :isLink="true"></u-cell>
 		</u-cell-group>
 			
 	</view>
@@ -58,16 +65,55 @@
 
 <style lang="scss" scoped>
 .panel{
-	text-align: center;
+	// min-height: 284rpx;
+	position: relative;
+	overflow: hidden;
+	box-sizing: border-box;
 	background-color: #ddd;
-	padding: 20rpx;
+	padding: 40rpx;
 	border-radius: 8rpx;
 	margin-bottom: 40rpx;
+	color: #FFFFFF;
+	background: linear-gradient(147deg, #00D35A 0%, #01A447 100%);
 	.title{
-		
+		font-size: 26rpx;
+		font-weight: 400;
+		line-height: 37rpx;
 	}
-	.number{
-		
+	.number-wrap{
+		font-size: 24rpx;
+		.number{
+			font-size: 58rpx;
+			font-weight: 600;
+			line-height: 81rpx;
+			margin-bottom: 50rpx;
+		}
+	}
+	.btn-wrap{
+		position: relative;
+		z-index: 99;
+		text-align: right;
+		.btn{
+			display: inline-block;
+			padding: 7rpx 20rpx;
+			border-radius: 30rpx;
+			background: rgba(255,255,255,0.16);
+		}
+	}
+	.shape{
+		width: 326rpx;
+		height: 372rpx;
+		position: absolute;
+		border-radius: 50% 50%;
+		top: -50rpx;
+	}
+	.shape1{
+		background: rgba(255,255,255,0.1);
+		right: -50rpx;
+	}
+	.shape2{
+		background: rgba(255,255,255,0.2);
+		right: -170rpx;
 	}
 }
 </style>

+ 100 - 0
center/paycode.vue

@@ -0,0 +1,100 @@
+<template>
+	<view class="pages">
+		<u-navbar
+			title="会员码"
+			:autoBack="true"
+			 :safeAreaInsetTop="true"
+		>
+		</u-navbar>
+		<img class="bg" :src="staticUrl+'/img/paycode-bg.png'" alt="">
+		<view class="content">
+			<view class="avatar-wrap">
+				<u-avatar :src="vuex_member_info.avatar||staticUrl+'/img/avatar.png'" size="138rpx"></u-avatar>
+			</view>
+			<view class="name">{{vuex_member_info.name}}</view>
+			<img class="qrcode-bg" :src="staticUrl+'/img/qrcode-bg.png'" alt="">
+			<!-- <img class="qrcode" :src="staticUrl+'/img/paycode-bg.png'" alt=""> -->
+			<view class="tip u-flex u-row-center">
+				<img class="refresh-ico" :src="staticUrl+'/img/refresh.png'" alt="">
+				<text>会员码每30秒自动更新,请在店内消费使用</text>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				staticUrl:this.$commonConfig.staticUrl,
+				params:{
+					
+				}
+				
+			}
+		},
+		onShow() {
+		},
+		onLoad() {
+
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+.bg{
+	position: fixed;
+	width: 100%;
+	height: 100vh;
+	height: -webkit-fill-available;
+	left: 0;
+	bottom: 0;
+	z-index: -1;
+}
+.content{
+	position: relative;
+	text-align: center;
+	background-color: #fff;
+	border-radius: 8rpx;
+	margin: 150rpx 20rpx 0;
+	padding: 90rpx 50rpx 80rpx;
+}
+.avatar-wrap{
+	position: absolute;
+	left: 50%;
+	top: -69rpx;
+	transform: translateX(-69rpx);
+	background-color: #fff;
+	padding: 11rpx;
+	border-radius: 50%;
+}
+.name{
+	font-size: 32rpx;
+	font-weight: 600;
+	color: #333333;
+	line-height: 45rpx;
+	margin-bottom: 40rpx;
+}
+.qrcode{
+	position: absolute;
+	top: 211rpx;
+	left: 102rpx;
+	width: 506rpx;
+	height: 506rpx;
+}
+.tip{
+	margin-top: 40rpx;
+	font-size: 24rpx;
+	font-weight: 400;
+	color: #999999;
+	line-height: 33rpx;
+	.refresh-ico{
+		width: 27rpx;
+		height: 27rpx;
+		margin-right: 10rpx;
+	}
+}
+</style>

+ 44 - 4
center/setPaypass.vue

@@ -1,5 +1,12 @@
 <template>
 	<view class="page-wrap">
+		<u-navbar
+			v-if="fromPage=='reset'"
+			title="密码设置"
+			:autoBack="true"
+			 :safeAreaInsetTop="true"
+		>
+		</u-navbar>
 		<view class="step-reset" v-if="step=='reset'">
 			<view class="title">请输入原始密码</view>
 			<u-code-input v-model="paypass0" 
@@ -54,18 +61,21 @@
 				paypass1:'',
 				paypass2:'',
 				codeInput:{
-					space:0,
+					space:20,
 					size:45,
 					maxlength:6,
 					adjustPosition:false,
 					dot:true,
 					disabledKeyboard:false
-				}
+				},
+				code:'',
 			}
 		},
 		onShow() {	
 		},
 		onLoad(page) {
+			this.fromPage = page.fromPage;
+			this.code = page.code;
 			if(page.fromPage=='reset'){
 				this.step = 'reset'
 			}
@@ -97,7 +107,11 @@
 				let that = this;
 				if(this.paypass1==this.paypass2){
 					console.log('两次密码一样');
-					this.updatePayPassword();
+					if(this.fromPage == 'forget'){
+						this.resetPayPassword();
+					}else{
+						this.updatePayPassword();
+					}
 				}else{
 					uni.showModal({
 						showCancel:false,
@@ -121,11 +135,37 @@
 						title:res.msg,
 						icon:'success',
 						complete() {
-							uni.reLaunch({url: '/center/center'});
+							setTimeout(()=>{
+								uni.reLaunch({url: '/center/center'});
+							},2000)
+						}
+					})
+					console.log('res',res.data);
+				}).catch(err=>{
+					console.log('setPaypass',err);
+				})
+			},
+			resetPayPassword(){
+				let params = {
+					payPassword:this.paypass2,
+					code:this.code,
+					mobile:this.vuex_member_info.mobile
+				}
+				this.$u.api.resetPayPassword(params).then(res=>{
+					uni.showToast({
+						title:res.msg,
+						icon:'success',
+						complete() {
+							setTimeout(()=>{
+								uni.reLaunch({url: '/center/center'});
+							},2000)
 						}
 					})
 					console.log('res',res.data);
 				}).catch(err=>{
+					setTimeout(()=>{
+						uni.reLaunch({url: '/center/findpaypass'});
+					},2000)
 					console.log('setPaypass',err);
 				})
 			}

+ 10 - 0
common/apiurl.js

@@ -264,11 +264,21 @@ const apiurl = {
 		url: '/memberInfo/updatePayPassword',
 		type: 'put'
 	},
+	// 忘记密码更改
+	resetPayPassword: {
+		url: '/memberInfo/resetPayPassword',
+		type: 'put'
+	},
 	// 校验支付密码
 	checkPayPassword: {
 		url: '/memberInfo/checkPayPassword',
 		type: 'post'
 	},
+	// 获取短信验证码
+	getCode: {
+		url: '/memberInfo/getCode',
+		type: 'post'
+	},
 	// 交易明细
 	selectBalanceLogList: {
 		url: '/memberInfo/selectBalanceLogList',

+ 3 - 1
common/request.js

@@ -36,6 +36,8 @@ module.exports = (vm) => {
 			let pages = getCurrentPages();
 			// console.log('pages',pages);
 			let backUrl = pages[pages.length - 1].route;
+			let options =uni.$u.queryParams( pages[pages.length - 1].options);
+			let fullBackUrl = backUrl+options;
 			const loginUrl = 'login'
 			if (backUrl.indexOf(loginUrl) > 0) {
 				uni.removeStorage({
@@ -52,7 +54,7 @@ module.exports = (vm) => {
 				// });
 				uni.setStorage({
 					key: 'backUrl',
-					data: backUrl,
+					data: fullBackUrl,
 					success: function () {
 						// console.log('setStorage success');
 					}

+ 14 - 0
pages.json

@@ -88,6 +88,20 @@
 						"navigationBarTitleText": "交易明细",
 						"navigationStyle": "custom"
 					}
+				},
+				{
+					"path": "findpaypass",
+					"style": {
+						"navigationBarTitleText": "找回支付密码",
+						"navigationStyle": "custom"
+					}
+				},
+				{
+					"path": "paycode",
+					"style": {
+						"navigationBarTitleText": "支付码",
+						"navigationStyle": "custom"
+					}
 				}
 			]
 		}, 

+ 1 - 1
pages/index/index.vue

@@ -38,7 +38,7 @@
 			</view>
 			
 			<view class="icon-nav u-flex u-row-around">
-				<view class="nav-item" @click="$u.route('/shopping/pay')">
+				<view class="nav-item" @click="$u.route('/center/mybalance')">
 					<u--image class="image" :src="staticUrl+'/img/index-nav-4.png'" width="101rpx" height="101rpx"></u--image>
 					需要删除
 				</view>

+ 46 - 6
shopping/pay.vue

@@ -31,13 +31,22 @@
 			<view class="full-btn" @click="payRoute">去支付<text>¥ {{params.payAmount}}</text></view>
 			<u-popup :show="checkPassShow" @close="checkPassClose" mode="center">
 				<view class="check-pass">
-					<view class="title">请在再次输入</view>
+					<view class="title">请输入支付密码</view>
+					<view class="name">旭烁商城</view>
+					<view class="number">¥{{params.payAmount}}</view>
+					<view class="the-way u-flex u-row-between">
+						<view class="left">支付方式</view>
+						<view class="right u-flex">
+							<u--image class="image" :src="staticUrl+'/img/qian.png'" width="32rpx" height="32rpx"></u--image>
+							<text style="margin-left: 10px;">零钱</text>
+						</view>
+					</view>
 					<u-code-input v-model="paypass" 
 						:space="0"
 						:size="40" 
 						@finish="checkPayPassword" 
 						:maxlength="6" 
-						:adjustPosition="false"
+						:adjustPosition="true"
 						:dot="true"
 						:focus="true"
 						:disabled-keyboard="false" >
@@ -56,6 +65,7 @@
 	export default {
 		data() {
 			return {
+				staticUrl:this.$commonConfig.staticUrl,
 				fromPage:'',
 				customBalance:'',
 				credit:'',
@@ -210,12 +220,42 @@
 .full-btn{
 	margin-top: 100rpx;
 }
-.check-pass{
+/deep/ .u-popup__content{
 	overflow: hidden;
-	padding: 24rpx 40rpx 40rpx;
 	border-radius: 8rpx;
-	.title{
-		margin-bottom: 20rpx;
+}
+.check-pass{
+	padding: 24rpx 40rpx 40rpx;
+ 	.title{
+		margin-bottom: 30rpx;
+		font-size: 36rpx;
+		font-weight: 600;
+		color: #333333;
+		line-height: 50rpx;
+		text-align: center;
+	}
+	.name{
+		text-align: center;
+		font-size: 30rpx;
+		font-weight: 400;
+		color: #666666;
+		line-height: 42rpx;
+		margin-bottom: 10rpx;
+	}
+	.number{
+		text-align: center;
+		font-size: 58rpx;
+		font-weight: 600;
+		color: #FF3538;
+		line-height: 81rpx;
+		margin-bottom: 30rpx;
+	}
+	.the-way{
+		font-size: 30rpx;
+		font-weight: 400;
+		color: #333333;
+		line-height: 42rpx;
+		margin-bottom: 25rpx;
 	}
 	.btn-wrap{
 		

+ 6 - 0
utils/filter.js

@@ -66,4 +66,10 @@ Vue.filter("rateText", function(val) {
 	return rateList[val-1]
 });
 
+// js手机号码中间4位变星星
+Vue.filter("hidePhoneNumber", function(val) {	
+	return val.replace(/^(\d{3})\d{4}(\d{4})$/, "$1****$2");
+});
+
+
 

+ 1 - 5
xushuo/xushuo.vue

@@ -6,7 +6,7 @@
 				indicator
 				keyName="sliderImg"
 				indicatorMode="dot"
-				@click="bannerClick"
+				@click="bannerClick()"
 			></u-swiper>
 			
 			<view class="icon-nav u-flex u-row-around">
@@ -111,7 +111,6 @@
 				})
 			},
 			bannerClick(e){
-				// console.log('e',e);
 				// console.log('bannerClick',this.bannerList[e]);
 				let item = this.bannerList[e];
 				uni.$u.route('/xushuo/dynamicdetails', {
@@ -144,9 +143,6 @@
 					console.log('shopNewsType',err.data);
 				})
 			},
-			bannerClick(e){
-				console.log('bannerClick',e);
-			},
 			tabsClick(item){
 				let typeId = item.id;
 				this.shopNewsList(typeId);