Fly лет назад: 2
Родитель
Сommit
ca21bec20c

+ 15 - 2
api/index.js

@@ -9,6 +9,11 @@ export function Api_getEmailCode(data) {
 	return axios.post(`/api/sms_mail` , data )
 }
 
+//  发送手机验证码
+export function Api_getSmsSend(data) {
+	return axios.post(`/api/sms_send` , data)
+}
+
 // 登陆页- 登陆
 export function Api_userLogin(data) {
 	return axios.post(`/api/user/login` , data )
@@ -19,6 +24,12 @@ export function Api_getUserInfo() {
 	return axios.get(`/api/user/info` )
 }
 
+// 提交注册
+export function Api_submitRegister(data) {
+	return axios.post(`/api/user/register` , data)
+}
+
+
 //  轮播图/公告列表/新闻列表
 export function Api_getNewsList(data) {
 	return axios.post(`/api/news/list` , data )
@@ -49,8 +60,8 @@ export function Api_getAccountInfo() {
 }
 
 // 用户帐单
-export function Api_getUserBill() {
-	return axios.post(`/api/wallet/legal_log`)
+export function Api_getUserBill(data) {
+	return axios.post(`/api/wallet/legal_log` , data)
 }
 
 // 账户 - 划转
@@ -103,6 +114,8 @@ export function Api_delAddress(data) {
 
 
 
+
+
 // // 根据手机号登录
 // export function goAuthLogin_Api(data) {
 // 	return axios.post(`/auth/c/doMiniLoginByPhone` , data )

+ 1 - 1
components/headModules/message.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="head-icon" >
-			<text class="iconfont">&#xe658;</text>
+		<text class="iconfont">&#xe658;</text>
 		<!-- <image src="../../static/images/logo.png" mode="aspectFit"></image> -->
 	</view>
 </template>

+ 40 - 0
components/load/load.vue

@@ -0,0 +1,40 @@
+<template>
+	<uni-popup ref="popupRef" :isMaskClick="false" maskBackgroundColor="none">
+
+		<view class="popup-box">
+			<u-loading-icon :size="80" color="#fff"></u-loading-icon>
+		</view>
+	</uni-popup>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			};
+		},
+		mounted() {
+
+
+		},
+		methods: {
+			open() {
+				this.$nextTick(() => {
+					this.$refs.popupRef.open()
+				})
+			},
+			close() {
+				this.$refs.popupRef.close()
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.popup-box {
+		background-color: rgba(0, 0, 0, 0.4);
+		border-radius: 20rpx;
+		padding: 20rpx;
+	}
+</style>

+ 14 - 7
components/slider-verify/slider-verify.vue

@@ -1,11 +1,11 @@
 <template>
-	<uni-popup ref="popupRef">
+	<uni-popup ref="popupRef" @change="change">
 
 		<view class="popup-box">
 			<view class="verifyBox">
 				<view class="verify-title">
 					<text>安全验证</text>
-					<text class="verify-close iconfont">&#xe605;</text>
+					<text @click.stop="$refs.popupRef.close()" class="verify-close iconfont">&#xe605;</text>
 				</view>
 				<view class="verify-hint">
 					滑动下方滑块完成拼图
@@ -75,7 +75,10 @@
 			that.refreshVerify();
 		},
 		methods: {
+			
 			open() {
+				this.sliderErrText = ''
+				this.refreshVerify();
 				this.$nextTick(() => {
 					this.$refs.popupRef.open();
 				})
@@ -126,7 +129,7 @@
 					this.moveTime = 0;
 					this.moveInterval = setInterval(() => {
 						this.moveTime = Math.floor((this.moveTime + 0.1) * 100) / 100;
-						console.log('this.moveTime = ', this.moveTime)
+						// console.log('this.moveTime = ', this.moveTime)
 					}, 100)
 				}
 				if (clear) {
@@ -135,17 +138,20 @@
 							clearInterval(this.moveInterval)
 							this.moveInterval = null;
 						}, 100)
-						console.log('this.moveInterval 1= ', this.moveInterval)
+						// console.log('this.moveInterval 1= ', this.moveInterval)
 
-						console.log('this.moveInterval 2= ', this.moveInterval)
+						// console.log('this.moveInterval 2= ', this.moveInterval)
 					} catch {}
 				}
 
 
 			},
 			clearMoveTime() {
-				this.setMoveTime(true)
-
+				this.setMoveTime(true);
+			},
+			change(e){
+				this.$emit('change' , e.show)
+				console.log('change  = ' ,e.show)
 			},
 			/* 滑动结束 */
 			endTouchMove() {
@@ -161,6 +167,7 @@
 					// });
 					this.moveSuccess = true;
 					setTimeout(() => {
+						this.$refs.popupRef.close();
 						this.$emit('slideImgSuccess')
 					},1000)
 				} else {

+ 28 - 4
pages.json

@@ -58,28 +58,52 @@
             "root" : "pages/login",
             "pages" : [
                 {
-                    "path" : "/index",
+                    "path" : "index",
                     "style" : {
                         "navigationBarTitleText" : "登录"
                     }
                 },
                 {
-                    "path" : "/register",
+                    "path" : "register",
                     "style" : {
                         "navigationBarTitleText" : "注册"
                     }
                 },
                 {
-                    "path" : "/email-verify",
+                    "path" : "email-verify",
                     "style" : {
                         "navigationBarTitleText" : "邮箱验证"
                     }
                 },
                 {
-                    "path" : "/area-code",
+                    "path" : "safety-verification",
+                    "style" : {
+                        "navigationBarTitleText" : "安全验证"
+                    }
+                },
+                {
+                    "path" : "area-code",
                     "style" : {
                         "navigationBarTitleText" : "国家/地区"
                     }
+                },
+                {
+                    "path" : "retrieve-pswd",
+                    "style" : {
+                        "navigationBarTitleText" : "找回密码"
+                    }
+                },
+                {
+                    "path" : "reset-pswd",
+                    "style" : {
+                        "navigationBarTitleText" : "重置密码"
+                    }
+                },
+                {
+                    "path" : "submit-register",
+                    "style" : {
+                        "navigationBarTitleText" : "重置密码"
+                    }
                 }
             ]
         },

+ 3 - 0
pages/content/select-currency.vue

@@ -69,6 +69,9 @@
 					case 'address':
 						path = 'pages/content/address';
 						break;
+					case 'recharge':
+						path = 'pages/content/top-up';
+						break;
 
 
 

+ 20 - 4
pages/login/area-code.vue

@@ -20,7 +20,8 @@
 					<view :id="key" v-if="val && val.length > 0">
 						<text class="search-letter">{{ key }}</text>
 						<view class="area-list">
-							<view class="area-item" v-for="item in val">
+							<view class="area-item" v-for="item in val" :key="`area_${index}`"
+								@click.stop="activeArea(item)">
 								<text>{{item.name}}</text>
 								<text>+{{item.area_code}}</text>
 							</view>
@@ -30,7 +31,8 @@
 			</scroll-view>
 			<view class="letter-tag">
 				<block v-for="(val , key , index) in AreaList">
-					<text @click.stop="scrollIntoView = key" :class="['tag-item' , scrollIntoView === key ? 'area-key' : '']"
+					<text @click.stop="scrollIntoView = key"
+						:class="['tag-item' , scrollIntoView === key ? 'area-key' : '']"
 						v-if="val && val.length > 0">{{ key }}</text>
 				</block>
 
@@ -75,6 +77,19 @@
 			this.getAreaCode()
 		},
 		methods: {
+			activeArea(item) {
+				const pages = getCurrentPages()
+				if (pages && pages.length >= 2) {
+					const page = pages[pages.length - 2];
+					page.$vm.setAreaCode(item);
+					uni.navigateBack()
+				} else {
+					uni.reLaunch({
+						url: '/pages/index/index'
+					})
+				}
+
+			},
 			reversBackBtn() {
 				reverseBack()
 			},
@@ -199,9 +214,10 @@
 				padding: 10rpx;
 				font-size: 22rpx;
 				// width: 20rpx;
-				
+
 			}
-			.area-key{
+
+			.area-key {
 				background-color: #c1c1c1;
 				border-radius: 50%;
 			}

+ 40 - 37
pages/login/common.scss

@@ -109,49 +109,52 @@
 				color: #938989;
 			}
 		}
-		.form-agreement{
-			width: 100%;
+
+		
+	}
+	
+	.form-agreement{
+		width: 100%;
+		display: flex;
+		align-items: center;
+		font-size: 26rpx;
+		color: #938989;
+		padding: 26rpx 0;
+		.agreement-confirm{
+			width: 30rpx;
+			height: 30rpx;
+			background-color: $box-bg;
+			margin-right: 10rpx;
+			border-radius: 6rpx;
+			.confirm-icon{
+				width: 100%;
+				height: 100%;
+			background-color: $Theme-Color;
+			color: #fff;
 			display: flex;
+			justify-content: center;
 			align-items: center;
-			font-size: 26rpx;
-			color: #938989;
-			padding: 26rpx 0;
-			.agreement-confirm{
-				width: 30rpx;
-				height: 30rpx;
-				background-color: $box-bg;
-				margin-right: 10rpx;
-				border-radius: 6rpx;
-				.confirm-icon{
-					width: 100%;
-					height: 100%;
-				background-color: $Theme-Color;
-				color: #fff;
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				font-size: 24rpx;
-				}
-			}
-			.agreement-name{
-				color: $Theme-Color;
+			font-size: 24rpx;
 			}
 		}
-		
-		.form-btn{
-			width: 100%;
-			height:90rpx;
-			background-color: $Theme-Color;
-			border-radius: 8rpx;
-			text-align: center;
-			line-height: 90rpx;
-			color: #fff;
-			font-size: 32rpx;
-			font-weight: bold;
+		.agreement-name{
+			color: $Theme-Color;
 		}
-		
 	}
-	
+	.form-btn{
+		width: 100%;
+		height:90rpx;
+		background-color: $Theme-Color;
+		border-radius: 8rpx;
+		text-align: center;
+		line-height: 90rpx;
+		color: #fff;
+		font-size: 32rpx;
+		font-weight: bold;
+	}
+	.invalid-form-btn{
+		background-color: #e3e0e0;
+	}
 	.form-hint{
 		width: 100%;
 		padding: 46rpx 0 0;

+ 77 - 15
pages/login/email-verify.vue

@@ -7,22 +7,25 @@
 		</headContent>
 
 		<view class="page-content">
-			<text class="login-title">注册</text>
-			<text class="login-content">验证码已发送至{{email}}</text>
+			<text class="login-title">{{ title }}</text>
+			<text class="login-content">验证码已发送至{{account}}</text>
 
 			<view class="code-box">
-				<u-code-input v-model="emailCode" :maxlength="6" :focus="true"></u-code-input>
-				<view class="code-hint" @click.stop="resendCode()">重新发送</view>
+				<u-code-input v-model="accountCode" :maxlength="6" :focus="true" :size="70"></u-code-input>
+				<view class=" code-hint" @click.stop="resendCode()">{{ CodeText }} </view>
 			</view>
 
 
 		</view>
+
+		<slider-verify ref="sliderVerifyRef" @slideImgSuccess="slideImgSuccess" />
 	</view>
 </template>
 
 <script>
 	import {
-		Api_getEmailCode
+		Api_getEmailCode,
+		Api_getSmsSend
 	} from "@/api/index.js"
 	import {
 		reverseBack
@@ -34,31 +37,90 @@
 
 		data() {
 			return {
-				email: '',
-				emailCode: ''
+				title: '',
+				type: '',
+				areaCode: '',
+				account: '',
+				invitationCode: '',
+				accountCode: '',
+				CodeText: '重新发送',
+				timeInterval: null
 			};
 		},
 		onLoad(opt) {
-			this.email = opt?.email;
+			this.type = opt?.type;
+			this.areaCode = opt?.areaCode;
+			this.account = opt?.account;
+			this.invitationCode = opt?.invitationCode;
+			this.title = this.type == 1 ? '邮箱验证' : '手机验证'
 			this.getEmailCode()
 		},
+		watch: {
+			accountCode: {
+				handler(newCode) {
+					if (newCode.length >= 6) {
+						uni.navigateTo({
+							url: `/pages/login/submit-register?type=${this.type}&account=${this.account}&invitationCode=${this.invitationCode}&accountCode=${this.accountCode}`
+						})
+					}
+				},
+				immediate: true
+			}
+		},
 		methods: {
 			getEmailCode() {
-				Api_getEmailCode({
-					user_string: this.email
-				}).then(res => {
+				if (this.CodeText !== '重新发送') {
+					return false
+				}
+				let Api_ = '',
+					obj = {};
+				obj.user_string = this.account;
+				switch (this.type) {
+					case '0':
+					case 0:
+						// 手机号 - 获取验证码
+						Api_ = Api_getSmsSend;
+						obj.area_code = this.areaCode;
+						break;
+					case '1':
+					case 1:
+						// 邮箱 - 获取验证码
+						Api_ = Api_getEmailCode;
+						break;
+					default:
+						break;
+				}
+				if (Api_) {
+					Api_(obj).then(res => {
+
+					}).catch(err => {
+
+					})
+					let num = 60
+					this.timeInterval = setInterval(() => {
+						num--;
+						if (num <= 0) {
+							clearInterval(this.timeInterval);
+							this.CodeText = '重新发送';
+							return false
+						};
+						this.CodeText = `${num}秒后重新发送`;
+						123456
+					}, 1000)
+				}
 
-				}).catch(err => {
 
-				})
 			},
 
 			reversBackBtn() {
 				reverseBack()
 			},
-			
-			resendCode(){
+
+			resendCode() {
 				this.getEmailCode()
+			},
+			setPassWord() {
+
 			}
 		}
 	}

+ 61 - 6
pages/login/index.vue

@@ -14,19 +14,23 @@
 			<tabList ref="tabListRef" :tabIndex.sync="tabIndexs" />
 			<!-- <component :is="phoneLogin"/> -->
 
-			<phoneLogin v-show="tabIndexs === 0" />
-
-			<emailLogin v-show="tabIndexs === 1" />
+			<phoneLogin v-show="tabIndexs === 0" :formData="formData" :areaCode="areaCode" />
 
+			<emailLogin v-show="tabIndexs === 1" :formData="formData" />
 
+			<view class="form-btn" style="margin-top: 28rpx;" @click.stop="formSubmit">
+				登录
+			</view>
 			<view class="form-hint">
-				<text>忘记密码?</text>
+				<text @click.stop="retrievePswd()">忘记密码?</text>
 				<text class="form-hint-link"></text>
 				<text @click.stop="register">立即注册</text>
 			</view>
 		</view>
 
 
+		<load ref="loadRef" />
+		<slider-verify ref="sliderVerifyRef" @slideImgSuccess="slideImgSuccess" />
 	</view>
 </template>
 
@@ -34,10 +38,14 @@
 	import {
 		reverseBack
 	} from "@/utils/common.js"
+	import {
+		Api_userLogin
+	} from "@/api/index.js"
 	import phoneLogin from "./modules/phone.vue"
 	import emailLogin from "./modules/email.vue"
 	import mailboxLogin from "./modules/mailbox.vue"
 	import tabList from "./modules/tab.vue"
+
 	export default {
 		name: 'login',
 		components: {
@@ -48,17 +56,64 @@
 		},
 		data() {
 			return {
-				tabIndexs: 1,
+				limina: false,
+				tabIndexs: 0,
+				areaCode: 86,
+				formData: {
+					user_string: '123456',
+					password: 'Aa123456'
+				}
 			};
 		},
 		methods: {
+			setAreaCode(e) {
+				if (e) {
+					this.areaCode = e.area_code;
+				}
+			},
 			reversBackBtn() {
 				reverseBack()
 			},
-			register(){
+			register() {
 				uni.navigateTo({
 					url: '/pages/login/register'
 				})
+			},
+			// 忘记密码
+			retrievePswd() {
+				uni.navigateTo({
+					url: '/pages/login/retrieve-pswd'
+				})
+			},
+			//  提交登录
+			formSubmit() {
+				this.$nextTick(() => {
+					this.$refs.loadRef.open();
+				})
+				setTimeout(() => {
+					this.$refs.loadRef.close();
+					setTimeout(() => {
+						this.$nextTick(() => {
+							this.$refs.sliderVerifyRef.open()
+						})
+					}, 100)
+				}, 1500)
+			},
+			slideImgSuccess() {
+				if (this.limina) {
+					return false
+				};
+				this.limina = true
+				Api_userLogin(this.formData).then(res => {
+					if (res) {
+						this.$store.dispatch("app/setToken", res)
+						reverseBack()
+					}
+				}).catch(err => {
+
+				}).finally(() => {
+					this.limina = false;
+				})
 			}
 		}
 	}

+ 23 - 32
pages/login/modules/email-register.vue

@@ -1,54 +1,45 @@
 <template>
 	<form class="login-form">
 		<view class="form-item">
-			<input class="form-input" v-model="formData.email" type="email" inputmode="email" name="email"
+			<input class="form-input" v-model="accounts.email" type="email" inputmode="email" name="email"
 				placeholder-class="form-input-place" placeholder="请输入您的邮箱地址" />
 		</view>
 		<view class="form-item">
-			<input class="form-input" v-model="formData.code" name="code" placeholder-class="form-input-place"
+			<input class="form-input" v-model="accounts.invitationCode" name="invitationCode" placeholder-class="form-input-place"
 				placeholder="邀请码 (选填)" />
 		</view>
-		<view class="form-agreement">
-			<view class="agreement-confirm">
-				<text class="confirm-icon iconfont">&#xe6c5;</text>
-			</view>
-			<text>我已阅读并同意</text>
-			<text class="agreement-name">《用户协议》</text>
-		</view>
-		<view class="form-btn" @click.stop="formSubmit">
-			下一步
-		</view>
-		<view class="form-hint" >
-			已有账号?<text class="hint-btn"> 立即登录</text>
-		</view>
 
-		<slider-verify ref="sliderVerifyRef" @slideImgSuccess="slideImgSuccess"/>
 	</form>
 </template>
 
 <script>
 	export default {
+		props: {
+			accounts: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			}
+		},
 		data() {
 			return {
-				formData: {
-					email: 'biking2023@163.com',
-					code: ''
-				}
+				 
 			};
 		},
 		methods: {
-			formSubmit(e) {
-				console.log('formSubmit = ', this.formData)
-				this.$refs.sliderVerifyRef.open();
-			},
-			slideImgSuccess(){
-				uni.navigateTo({
-					url: `/pages/login/email-verify?email=${this.formData.email}`
-				})
-			},
-			formReset() {
-			
-			}
+			// formSubmit(e) {
+			// 	console.log('formSubmit = ', this.formData)
+			// 	this.$refs.sliderVerifyRef.open();
+			// },
+			// slideImgSuccess() {
+			// 	uni.navigateTo({
+			// 		url: `/pages/login/email-verify?email=${this.formData.email}`
+			// 	})
+			// },
+			// formReset() {
+
+			// }
 		}
 	}
 </script>

+ 13 - 14
pages/login/modules/email.vue

@@ -8,16 +8,6 @@
 			<input type="password" class="form-input" v-model="formData.password" name="password"
 				placeholder-class="form-input-place" placeholder="请输入您的登录密码" />
 		</view>
-		<!-- <view class="form-agreement">
-			<view class="agreement-confirm">
-				<text class="confirm-icon iconfont">&#xe6c5;</text>
-			</view>
-			<text>我已阅读并同意</text>
-			<text class="agreement-name">《用户协议》</text>
-		</view> -->
-		<view class="form-btn" style="margin-top: 28rpx;" @click.stop="formSubmit">
-			登录
-		</view>
 
 		<slider-verify ref="sliderVerifyRef" />
 	</form>
@@ -32,12 +22,21 @@
 	} from "@/api/index.js"
 
 	export default {
+		props: {
+			formData: {
+				type: Object,
+				default: () => {
+					return {
+						user_string: '',
+						password: ''
+					}
+				}
+			},
+		
+		},
 		data() {
 			return {
-				formData: {
-					// user_string: '14100000001',
-					// password: '123456'
-				}
+
 			};
 		},
 		methods: {

+ 19 - 27
pages/login/modules/phone-register.vue

@@ -1,43 +1,35 @@
 <template>
 	<form class="login-form" @submit="formSubmit" @reset="formReset">
 		<view class="form-item">
-			<view class="form-lable"><text>+86</text><text class="form-lable-icon iconfont">&#xe601;</text></view>
-			<input class="form-input" name="input" placeholder-class="form-input-place" placeholder="请输入您的手机号" />
+			<view class="form-lable"><text @click.stop="selectAreaCode()">+{{ accounts.areaCode  }}</text><text
+					class="form-lable-icon iconfont">&#xe601;</text></view>
+			<input class="form-input" v-model="accounts.phone" name="phone" placeholder-class="form-input-place"
+				placeholder="请输入您的手机号" />
 		</view>
 		<view class="form-item">
-			<input class="form-input" name="input" placeholder-class="form-input-place" placeholder="邀请码 (选填)" />
+			<input class="form-input" v-model="accounts.invitationCode" name="input"
+				placeholder-class="form-input-place" placeholder="邀请码 (选填)" />
 		</view>
-		<view class="form-agreement">
-			<view class="agreement-confirm">
-				<text class="confirm-icon iconfont">&#xe6c5;</text>
-			</view>
-			<text>我已阅读并同意</text>
-			<text class="agreement-name">《用户协议》</text>
-		</view>
-		<view class="form-btn">
-			下一步
-		</view>
-		<view class="form-hint">
-			已有账号?<text class="hint-btn"> 立即登录</text>
-		</view>
-		
-		<slider-verify ref="sliderVerifyRef"/>
 	</form>
 </template>
 
 <script>
 	export default {
-		data() {
-			return {
-
-			};
+		props: {
+			// :account.sync="account" :invitationCode.sync="invitationCode"
+		
+			accounts: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			}
 		},
 		methods: {
-			formSubmit() {
-
-			},
-			formReset() {
-
+			selectAreaCode() {
+				uni.navigateTo({
+					url: '/pages/login/area-code'
+				})
 			}
 		}
 	}

+ 28 - 29
pages/login/modules/phone.vue

@@ -1,7 +1,8 @@
 <template>
 	<form class="login-form">
 		<view class="form-item">
-			<view class="form-lable" @click.stop="selectAreaCode()"><text>+86</text><text class="form-lable-icon iconfont">&#xe601;</text></view>
+			<view class="form-lable" @click.stop="selectAreaCode()"><text>+{{ areaCode }}</text><text
+					class="form-lable-icon iconfont">&#xe601;</text></view>
 			<input class="form-input" v-model="formData.user_string" name="user_string"
 				placeholder-class="form-input-place" placeholder="请输入您的手机号" />
 		</view>
@@ -16,14 +17,10 @@
 			<text>我已阅读并同意</text>
 			<text class="agreement-name">《用户协议》</text>
 		</view> -->
-		<view class="form-btn" style="margin-top: 28rpx;" @click.stop="formSubmit">
-			登录
-		</view>
-		<view class="form-hint">
-			已有账号?<text class="hint-btn"> 立即登录</text>
-		</view>
+		<!-- 		<view class="form-hint">
+			已有账号?<text class="hint-btn">立即登录</text>
+		</view> -->
 
-		<slider-verify ref="sliderVerifyRef" />
 	</form>
 </template>
 
@@ -36,35 +33,37 @@
 	} from "@/api/index.js"
 
 	export default {
+		props: {
+			areaCode: {
+				type: Number,
+				default: 86
+			},
+			formData: {
+				type: Object,
+				default: () => {
+					return {
+						user_string: '',
+						password: ''
+					}
+				}
+			},
+		},
 		data() {
 			return {
-				formData: {
-					user_string: '123456',
-					password: 'Aa123456'
-				}
+	 
+				// formData: {
+				// 	user_string: '123456',
+				// 	password: 'Aa123456'
+				// }
 			};
 		},
 		methods: {
-			selectAreaCode(){
+			selectAreaCode() {
 				uni.navigateTo({
-					url:'/pages/login/area-code'
+					url: '/pages/login/area-code'
 				})
 			},
-			formSubmit() {
-				Api_userLogin(this.formData).then(res => {
-					if (res) {
-						this.$store.dispatch("app/setToken", res)
-						uni.showToast({
-							title: '登录成功',
-							icon: 'none'
-						});
-						setTimeout(() => {
-							reverseBack()
-						}, 1500)
-					}
-
-				})
-			}
+			
 		}
 	}
 </script>

+ 184 - 0
pages/login/modules/set-pswd.vue

@@ -0,0 +1,184 @@
+<template>
+	<view>
+		<text class="login-content">密码长度为8-20位字符,必须同时包含大写字母、小写字母和数字</text>
+
+		<form class="login-form">
+			<view class="form-item">
+				<input class="form-input" v-model="formData.newPassword" placeholder-class="form-input-place"
+					placeholder="请输入您的新密码" />
+			</view>
+			<view class="form-error">
+				{{ formError.newPsdErr }}
+			</view>
+			<view class="form-item">
+				<input class="form-input" v-model="formData.confirmPassword" placeholder-class="form-input-place"
+					placeholder="请确认密码" />
+			</view>
+
+			<view class="form-error">
+				{{ formError.confirmPsdErr }}
+			</view>
+
+			<view :class="['form-btn' , deblockingSubmitBtn() ? '' : 'active-form-btn' ]"
+				@click.stop="SubmitPassWord()">
+				确定
+			</view>
+		</form>
+	</view>
+</template>
+
+<script>
+	import {
+		validPassword
+	} from "@/utils/validate.js"
+	import {
+		reverseBack
+	} from "@/utils/common.js"
+	export default {
+		name: 'login',
+		data() {
+			return {
+				formData: {
+					newPassword: '',
+					confirmPassword: ''
+				},
+				formError: {
+					newPsdErr: '',
+					confirmPsdErr: ''
+				}
+			};
+		},
+
+		watch: {
+
+			'formData.newPassword'(newPsd, oldPsd) {
+				this.validateField('newPassword')
+			},
+			'formData.confirmPassword'(newPsd, oldPsd) {
+				this.validateField('confirmPassword')
+			}
+		},
+		mounted() {
+
+		},
+		methods: {
+			validateField(key) {
+				let validateStatus = false
+				switch (key) {
+					case 'newPassword':
+						if (!this.formData[key].trim()) {
+							this.formError.newPsdErr = '请输入新密码'
+							validateStatus = false;
+						} else if (!validPassword(this.formData[key])) {
+							this.formError.newPsdErr = '密码长度为8-20位字符,必须同时包含大写字母、小写字母和数字';
+							validateStatus = false;
+						} else {
+							this.formError.newPsdErr = '';
+							validateStatus = true;
+						};
+						break;
+					case 'confirmPassword':
+						if (!this.formData[key].trim()) {
+							this.formError.confirmPsdErr = '请再次输入新密码';
+							validateStatus = false;
+						} else if (this.formData[key] !== this.formData.newPassword) {
+							this.formError.confirmPsdErr = '确认密码和新密码输入不一致';
+							validateStatus = false;
+						} else {
+							this.formError.confirmPsdErr = '';
+							validateStatus = true;
+						}
+						break;
+					default:
+						validateStatus = false
+
+				};
+				return validateStatus;
+			},
+			confirmValidateField() {
+				return new Promise((resolve, reject) => {
+					let validateStatus = true;
+					for (let key in this.formData) {
+						if (validateStatus) {
+							validateStatus = this.validateField(key)
+						} else {
+							this.validateField(key)
+						}
+					}
+					if (validateStatus) {
+						resolve()
+					} else {
+						reject()
+					};
+				})
+
+			},
+
+			deblockingSubmitBtn() {
+				for (let key in this.formData) {
+					if (this.formData[key] === '') {
+						return false
+						break;
+					}
+				};
+				return true
+			},
+			SubmitPassWord() {
+			
+				this.confirmValidateField().then(res => {
+				 
+				this.$emit("submitPswd" , this.formData)
+					// this.$nextTick(() => {
+					// 	this.$refs.loadRef.open()
+					// });
+					// const obj = {
+					// 	account: this.account,
+					// 	code: this.code || -1,
+					// 	password: this.formData.newPassword,
+					// 	repassword: this.formData.newPassword
+					// }
+					// Api_setPassword(obj).then(res => {
+					// 	setTimeout(() => {
+					// 		uni.redirectTo({
+					// 			url: '/pages/login/index'
+					// 		});
+					// 	}, 501)
+					// }).catch(err => {}).finally(() => {
+					// 	this.$refs.loadRef.close()
+					// })
+
+
+				}).catch(err => {})
+
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import "~../common.scss";
+
+	.form-item {
+		margin-top: 0 !important;
+
+		&:first-child {
+			margin-top: 40rpx !important;
+		}
+	}
+
+	.form-error {
+		width: 100%;
+		min-height: 80rpx;
+		font-size: 24rpx;
+		display: flex;
+		align-items: center;
+		padding: 10rpx 0;
+		color: red;
+	}
+
+	.active-form-btn {
+		background-color: #ccc;
+
+	}
+</style>

+ 68 - 5
pages/login/register.vue

@@ -9,13 +9,28 @@
 		<view class="page-content">
 			<text class="login-title">注册</text>
 			<text class="login-content">立即注册属于您的币王账号</text>
-			<tabList ref="tabListRef" :tabIndex.sync="tabIndexs"/>
+			<tabList ref="tabListRef" :tabIndex.sync="tabIndexs" />
 
-			<phoneRegister v-show="tabIndexs === 0" />
+			<phoneRegister v-show="tabIndexs === 0" :accounts="accounts"/>
 
-			<email-register v-show="tabIndexs === 1" />
+			<email-register v-show="tabIndexs === 1" :accounts="accounts" />
 
+			<view class="form-agreement" @click.stop="readAgreement = !readAgreement">
+				<view class="agreement-confirm">
+					<text class="confirm-icon iconfont" v-show="readAgreement">&#xe6c5;</text>
+				</view>
+				<text>我已阅读并同意</text>
+				<text class="agreement-name">《用户协议》</text>
+			</view>
+			<view class="form-btn" @click.stop="formSubmit">
+				下一步
+			</view>
+			<view class="form-hint">
+				已有账号?<text class="hint-btn"> 立即登录</text>
+			</view>
 		</view>
+
+		<slider-verify ref="sliderVerifyRef" @slideImgSuccess="slideImgSuccess" />
 	</view>
 </template>
 
@@ -36,13 +51,61 @@
 		},
 		data() {
 			return {
-				tabIndexs: 1
+				readAgreement: false,
+				tabIndexs: 0,
+				accounts: {
+					areaCode:86,
+					phone: '',
+					email: '',
+					invitationCode: '',
+				}
+
+
 			};
 		},
 		methods: {
+			setAreaCode(e) {
+				if (e) {
+					this.accounts.areaCode = e.area_code;
+				}
+			},
 			reversBackBtn() {
 				reverseBack()
-			}
+			},
+			formSubmit(e) {
+				if(!this.readAgreement){
+					return false
+				}
+				this.$nextTick(() => {
+					this.$refs.sliderVerifyRef.open();
+				})
+			},
+			slideImgSuccess() {
+				// tabIndexs: 1,
+				// accounts: {
+				// 	phone: '13133111133',
+				// 	email:'biking2023@163.com',
+				// 	invitationCode: '',
+				// }
+				let data = ''
+				switch (this.tabIndexs) {
+					case 0:
+						data =
+							`type=${this.tabIndexs}&areaCode=${this.accounts.areaCode}&account=${this.accounts.phone}&invitationCode=${this.accounts.invitationCode}`;
+						break;
+					case 1:
+						data =
+							`type=${this.tabIndexs}&account=${this.accounts.email}&invitationCode=${this.accounts.invitationCode}`;
+						break;
+
+				}
+				uni.navigateTo({
+					url: `/pages/login/email-verify?${data}`
+				})
+			},
+			// formReset() {
+
+			// }
 		}
 	}
 </script>

+ 87 - 0
pages/login/reset-pswd.vue

@@ -0,0 +1,87 @@
+<template>
+	<view>
+		<!-- 头部 -->
+		<headContent>
+			<template #left>
+				<view class="head-revers-back iconfont" @click.stop="reversBackBtn()">&#xe604;</view>
+			</template>
+		</headContent>
+
+		<view class="page-content">
+			<text class="login-title">重置密码</text>
+			<setPswd @submitPswd="submitPswd" />
+		</view>
+
+		<load ref="loadRef" />
+	</view>
+</template>
+
+<script>
+	import setPswd from "./modules/set-pswd.vue"
+	import {
+		reverseBack
+	} from "@/utils/common.js"
+	import {
+		Api_setPassword
+	} from "@/api/index.js"
+	export default {
+		name: 'reset-pswd',
+		components: {
+			setPswd
+		},
+		data() {
+			return {
+				account: '',
+				code: '',
+
+			};
+		},
+
+		onLoad(opt) {
+			this.account = opt?.account;
+			this.code = opt?.code;
+		},
+		mounted() {
+
+		},
+		methods: {
+			reversBackBtn() {
+				reverseBack()
+			},
+
+			submitPswd(e) {
+				uni.showLoading({
+					title: ''
+				})
+				const obj = {
+					account: this.account,
+					code: this.code || -1,
+					password: e.newPassword,
+					repassword: e.confirmPassword
+				}
+				Api_setPassword(obj).then(res => {
+					setTimeout(() => {
+						uni.showToast({
+							title: '重置成功',
+							icon: 'none'
+						})
+						setTimeout(() => {
+							uni.redirectTo({
+								url: '/pages/login/index'
+							});
+						}, 300)
+					}, 200)
+				}).catch(err => {}).finally(() => {
+					uni.hideLoading()
+				})
+
+
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import "~./common.scss";
+</style>

+ 59 - 0
pages/login/retrieve-pswd.vue

@@ -0,0 +1,59 @@
+<template>
+	<view>
+		<!-- 头部 -->
+		<headContent>
+			<template #left>
+				<view class="head-revers-back iconfont" @click.stop="reversBackBtn()">&#xe604;</view>
+			</template>
+		</headContent>
+
+		<view class="page-content">
+			<text class="login-title">找回密码</text>
+			<text class="login-content">找回您的币王账号</text>
+
+			<form class="login-form">
+				<view class="form-item">
+					<input class="form-input" v-model="account" placeholder-class="form-input-place" placeholder="请输入您的手机号码或邮箱" />
+				</view>
+				<view class="form-btn" style="margin-top: 28rpx;" @click.stop="formSubmit">
+					下一步
+				</view>
+			</form>
+		</view>
+
+
+	</view>
+</template>
+
+<script>
+	import {
+		reverseBack
+	} from "@/utils/common.js"
+
+	export default {
+		name: 'retrieve-pswd', 
+		data() {
+			return {
+			account:''
+			};
+		},
+		methods: {
+			reversBackBtn() {
+				reverseBack()
+			},
+			formSubmit(){
+				// 安全验证
+				uni.navigateTo({
+					url:`/pages/login/safety-verification?type=1&account=${this.account}`
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import "~./common.scss";
+	.form-item{
+		margin-top: 40rpx !important;
+	}
+</style>

+ 182 - 0
pages/login/safety-verification.vue

@@ -0,0 +1,182 @@
+<template>
+	<view>
+		<!-- 头部 -->
+		<headContent>
+			<template #left>
+				<view class="head-revers-back iconfont" @click.stop="reversBackBtn()">&#xe604;</view>
+			</template>
+			<template #content>
+				<view class="haed-title">安全验证</view>
+			</template>
+		</headContent>
+		<view class="page-content">
+			<text class="login-title">{{ title }}验证</text>
+			<text class="login-content">验证码已发送至{{account}}</text>
+			<view class="form-item">
+				<input class="form-input" v-model="code" placeholder-class="form-input-place"
+					:placeholder="`请输入您的${title}`" />
+				<view class="form-code" @click.stop="getCode()">{{ codeText }}</view>
+			</view>
+			<view :class="['form-btn' , code ? '' : 'invalid-form-btn']" style="margin-top: 28rpx;"
+				@click.stop="formSubmit">
+				下一步
+			</view>
+			<!-- 	<form class="login-form">
+				<view class="form-item">
+					<input class="form-input" placeholder-class="form-input-place" placeholder="请输入您的邮箱地址" />
+				</view>
+				<view class="form-btn" style="margin-top: 28rpx;" @click.stop="formSubmit">
+					下一步
+				</view>
+			</form> -->
+
+		</view>
+
+
+
+	</view>
+</template>
+
+<script>
+	import {
+		reverseBack
+	} from "@/utils/common.js"
+	import {
+		Api_getEmailCode,
+		Api_getSmsSend
+	} from "@/api/index.js"
+	export default {
+		name: 'safety-verification',
+		data() {
+			return {
+				title: '',
+				type: 0,
+				account: '',
+				code: '',
+				codeText: '获取验证码',
+				timeInterval: null
+			};
+		},
+		onLoad(opt) {
+			this.type = opt?.type;
+			this.account = opt?.account;
+		},
+		watch: {
+			account: {
+				handler(newAccount) {
+					if (['@'].includes(newAccount)) {
+						// 邮箱
+						this.title = '邮箱';
+					} else {
+						// 手机号
+						this.title = '手机号';
+					}
+
+				}
+			}
+		},
+		methods: {
+			reversBackBtn() {
+				reverseBack()
+			},
+			getCode() {
+				if(this.codeText !=='获取验证码' ){
+					return false
+				}
+				let Api_ = '',
+					obj = {
+						user_string: this.account
+					}
+				if (this.title === '邮箱') {
+					Api_ = Api_getEmailCode;
+				}
+				if (this.title === '手机号') {
+					Api_ = Api_getSmsSend;
+				}
+				if (Api_) {
+					Api_(obj).then(res => {
+
+					}).catch(err => {
+
+					})
+					let num = 60
+					this.timeInterval = setInterval(() => {
+						num--;
+						if (num <= 0) {
+							clearInterval(this.timeInterval);
+							this.codeText = '获取验证码';
+							return false
+						};
+						this.codeText = `${num}秒后重新发送`;
+						123456
+					}, 1000)
+				}
+			},
+			formSubmit() {
+				// 安全验证
+				if (this.code) {
+					let path = ''
+					switch (this.type) {
+						case '1':
+							path = `/pages/login/reset-pswd?account=${this.account}&code=${this.code}`;
+							break
+
+					}
+					if (path) {
+						uni.navigateTo({
+							url: path
+						})
+					}
+				}
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import "~./common.scss";
+
+	// <view class="form-item">
+	// 	<input class="form-input" placeholder-class="form-input-place" placeholder="请输入您的邮箱地址" />
+	// 	<view class="form-code">52秒后重新发送</view>
+	// </view>
+	.login-title {
+		font-size: 34rpx !important;
+	}
+
+	.login-content {
+		padding-bottom: 0 !important;
+	}
+
+	.form-item {
+		width: 100%;
+		min-height: 100rpx;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		border-bottom: 1rpx solid $border-color4;
+
+		.form-input {
+			flex: 1;
+			font-size: 26rpx;
+		}
+
+		.form-input-place {
+			font-size: 26rpx;
+			font-weight: 800;
+		}
+
+		.form-code {
+			flex-shrink: 0;
+			padding-left: 10rpx;
+			font-size: 26rpx;
+			color: $Theme-Color;
+		}
+	}
+
+
+	.form-btn {
+		margin-top: 80rpx !important;
+	}
+</style>

+ 94 - 0
pages/login/submit-register.vue

@@ -0,0 +1,94 @@
+<template>
+	<view>
+		<!-- 头部 -->
+		<headContent>
+			<template #left>
+				<view class="head-revers-back iconfont" @click.stop="reversBackBtn()">&#xe604;</view>
+			</template>
+		</headContent>
+
+		<view class="page-content">
+			<text class="login-title">设置密码</text>
+			<setPswd @submitPswd="submitPswd" />
+		</view>
+
+		<load ref="loadRef" />
+	</view>
+</template>
+
+<script>
+	import setPswd from "./modules/set-pswd.vue"
+
+	import {
+		reverseBack
+	} from "@/utils/common.js"
+	import {
+		Api_setPassword,
+		Api_submitRegister
+	} from "@/api/index.js"
+	export default {
+		name: 'submit-register',
+		components: {
+			setPswd
+		},
+		data() {
+			return {
+				type: '',
+				account: '',
+				accountCode: '',
+				invitationCode: ''
+
+			};
+		},
+		onLoad(opt) {
+			// type=0&account=13133111133&invitationCode=1&accountCode=123456
+			this.type = opt?.type;
+			this.account = opt?.account;
+			this.accountCode = opt?.accountCode;
+			this.invitationCode = opt?.invitationCode;
+		},
+		mounted() {
+
+		},
+		methods: {
+			reversBackBtn() {
+				reverseBack()
+			},
+
+			submitPswd(e) {
+
+				uni.showLoading({
+					title: ''
+				})
+				const obj = {
+					type: this.type == 1 ? 'email' : 'mogile',
+					user_string: this.account,
+					invitationCode: this.invitationCode,
+					password: e.newPassword,
+					re_password: e.confirmPassword
+				}
+				Api_submitRegister(obj).then(res => {
+					setTimeout(() => {
+						uni.showToast({
+							title: '注册成功',
+							icon: 'none'
+						})
+						setTimeout(() => {
+							uni.redirectTo({
+								url: '/pages/login/index'
+							});
+						}, 300)
+					}, 200)
+				}).catch(err => {}).finally(() => {
+					uni.hideLoading()
+				})
+
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import "~./common.scss";
+</style>

+ 2 - 0
pages/property/bill.vue

@@ -162,6 +162,8 @@
 				// moreStatus: 'more-loading', // 上拉的状态:more-loading前;loading-loading中;noMore-没有更多了
 				this.moreStatus = 'loading';
 				Api_getUserBill({
+					page:1,
+					limit:15,
 					currency:3,
 					type:this.pageType - 0 + 1,
 				}).then(res => {

+ 1 - 0
pages/property/index.vue

@@ -126,6 +126,7 @@
 	}
 
 	.navigation-box {
+		padding: 0 $pages-padding;
 		width: 100%;
 		height: 100%;
 		padding-bottom: 11rpx;