zouling 2 hónapja
szülő
commit
8475d52ad9

+ 15 - 1
user_ui/api/system/user.js

@@ -13,7 +13,21 @@ export function updateUserPwd(oldPassword, newPassword) {
     data: data
   })
 }
-
+// 忘记密码发送短信
+export function getappForgetPW(data) {
+  return request({
+    url: '/wuYe/applet/appForgetPW/'+data,
+    method: 'get',
+  })
+}
+// 重置密码
+export function getappCheck(data) {
+  return request({
+    url: '/wuYe/applet/appCheck',
+    method: 'get',
+	'data':data
+  })
+}
 // 查询用户个人信息
 export function getUserProfile() {
   return request({

+ 1 - 1
user_ui/package-lock.json

@@ -1,5 +1,5 @@
 {
-  "name": "property_ui",
+  "name": "user_ui",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {

+ 11 - 0
user_ui/pages.json

@@ -7,6 +7,17 @@
 	      "navigationStyle": "custom"
 	    }
 	  },
+	  {
+	  	  "path": "pages/mine/pwd/forgetpwd",
+	  	  "style": {
+	  	    "navigationBarTitleText": "忘记密码"
+	  	  }
+	  	}, {
+	  	  "path": "pages/mine/pwd/resetpwd",
+	  	  "style": {
+	  	    "navigationBarTitleText": "重置密码"
+	  	  }
+	  },
 	  {
 	    "path": "pages/health/index",
 	    "style": {

+ 1 - 1
user_ui/pages/login.vue

@@ -17,7 +17,7 @@
 				<text class="btn-txt">账号密码登录</text>
 			</button>
 			<view class="line"></view>
-			<view class="rbtn btna" @click="getregister">还没账号?去注册</view>
+			<!-- <view class="rbtn btna" @click="getregister">还没账号?去注册</view> -->
 		</view>
 
 		

+ 121 - 0
user_ui/pages/mine/pwd/forgetpwd.vue

@@ -0,0 +1,121 @@
+<template>
+  <view class="pwd-retrieve-container pwd">
+    <uni-forms ref="form" :value="user" >
+      <uni-forms-item name="phonenumber" label="手机号码">
+        <uni-easyinput :inputBorder="false" type="number"  v-model="phonenumber" placeholder="请输入您的手机号码" />
+      </uni-forms-item>
+      <uni-forms-item name="code" label="验证码">
+        <uni-easyinput :inputBorder="false" v-model="code" placeholder="请输入验证码" />
+		<view class="line flex0"></view>
+		<view v-if="timefalg" class="code act">{{time}}秒</view>
+		<view v-else @click="getCode" class="code">发送验证码</view>
+	  </uni-forms-item>
+      <view class="rbtn" @click="submit">下一步</view>
+    </uni-forms>
+  </view>
+</template>
+
+<script>
+  import { getappForgetPW } from "@/api/system/user"
+
+  export default {
+    data() {
+      return {
+		timefalg:false,
+		time:'',
+		phonenumber:'',
+		code:'',
+		newcode:'',//验证码
+		user:{},
+      }
+    },
+    onReady() {
+    },
+    methods: {
+		getCode(){
+			var that=this;
+			if (!this.phonenumber ) {
+				that.$toast("请输入手机号")
+				return
+			}
+			let regphone = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
+			if (this.phonenumber && !regphone.test(this.phonenumber)) {
+				that.$toast("请输入正确的手机号")
+				return
+			}
+			getappForgetPW(this.phonenumber).then(res=>{
+				if (res.code == 200) {
+					// 发送验证码
+					that.$toast("发送成功")
+					that.newcode=res.msg
+					that.time=60;
+					that.timefalg=true;
+					that.setTimein()
+				} else {
+					that.$toast(res.msg)
+				}
+				// 判断是不是对等的
+				// that.getCodesend(that.phonenumber)
+			})
+		},
+		// 验证码倒计时
+		setTimein(){
+			var that=this;
+			clearInterval(that.timer)
+			that.timer=setInterval(()=>{
+				if(that.time<=1){
+					that.timefalg=false;
+					that.time=60;
+					clearInterval(that.timer)
+				}
+				that.time=that.time-1;
+			},1000)
+		},
+      submit() {
+		var that = this;
+		if (!this.phonenumber ) {
+			that.$toast("请输入手机号")
+			return
+		}
+		if (!this.code ) {
+			that.$toast("请输入验证码")
+			return
+		}
+		// if(this.code!=this.newcode){
+		// 	that.$toast("验证码错误,请重新输入")
+		// 	return
+		// }
+		let regphone = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
+		if (this.phonenumber && !regphone.test(this.phonenumber)) {
+			that.$toast("请输入正确的手机号")
+			return
+		}
+		this.$tab.navigateTo(`/pages/mine/pwd/resetpwd?phone=`+this.phonenumber+'&code='+this.code)
+      }
+    }
+  }
+</script>
+
+<style lang="scss">
+  page {
+    background-color: #f5f5f5;
+  }
+  .line{width: 2rpx;height: 24rpx;background: #CDCDCD;margin: 0 24rpx;}
+	.code{font-size: 30rpx;color: $com-cd3;
+		&.act{color: #666666;}
+	}
+  .pwd-retrieve-container {
+    padding: 10rpx 36rpx;
+  }
+  .pwd .rbtn{width: 100%;height: 98rpx;background: $com-cd3;border-radius: 49rpx;text-align: center;line-height: 98rpx;font-size: 32rpx;font-weight: bold;color: #FFFEFE;margin-top: 68rpx;}
+  .pwd /deep/ .uni-forms-item{height: 126rpx;background: #FFFFFF;border-radius: 18rpx;margin-top: 30rpx;padding: 0 40rpx;box-sizing: border-box;display: flex;align-items: center;margin-bottom: 0;}
+  .pwd /deep/ .uni-forms-item__label{font-size: 32rpx;font-weight: 500;
+color: #161616;flex: 0 0 auto;width: auto !important;}
+  .pwd /deep/ .uni-easyinput{flex: 1;text-align: right;font-size: 32rpx;color: #161616;}
+  .pwd /deep/ .uni-forms-item__content{display: flex;align-items: center;flex-direction: row;}
+  .pwd /deep/ .uni-easyinput__placeholder-class{font-size: 30rpx;}
+  .pwd /deep/ .uni-easyinput__content-input{font-size: 30rpx;}
+   .pwd /deep/ .uni-forms-item__error{margin-top:20rpx;left: auto;right: 0;}
+  
+
+</style>

+ 100 - 0
user_ui/pages/mine/pwd/resetpwd.vue

@@ -0,0 +1,100 @@
+<template>
+  <view class="pwd-retrieve-container pwd">
+    <uni-forms ref="form" :value="user" >
+      <uni-forms-item name="newPassword" label="新密码">
+        <uni-easyinput :inputBorder="false" type="password" v-model="user.newPassword" placeholder="请输入新密码" />
+      </uni-forms-item>
+      <uni-forms-item name="confirmPassword" label="确认密码">
+        <uni-easyinput :inputBorder="false" type="password" v-model="user.confirmPassword" placeholder="请确认新密码" />
+      </uni-forms-item>
+      <view class="rbtn" @click="submit">提交</view>
+    </uni-forms>
+  </view>
+</template>
+
+<script>
+  import { getappCheck } from "@/api/system/user"
+
+  export default {
+    data() {
+      return {
+		  phone:'',
+		  code:'',
+        user: {
+          newPassword: undefined,
+          confirmPassword: undefined
+        },
+        rules: {
+          newPassword: {
+            rules: [{
+                required: true,
+                errorMessage: '新密码不能为空',
+              },
+              {
+                minLength: 6,
+                maxLength: 20,
+                errorMessage: '长度在 6 到 20 个字符'
+              }
+            ]
+          },
+          confirmPassword: {
+            rules: [{
+                required: true,
+                errorMessage: '确认密码不能为空'
+              }, {
+                validateFunction: (rule, value, data) => data.newPassword === value,
+                errorMessage: '两次输入的密码不一致'
+              }
+            ]
+          }
+        }
+      }
+    },
+    onReady() {
+      this.$refs.form.setRules(this.rules)
+    },
+	onLoad(e) {
+		this.phone=e.phone;
+		this.code=e.code;
+	},
+    methods: {
+      submit() {
+		var that = this;
+        this.$refs.form.validate().then(res => {
+			var params={
+				phone:this.phone,
+				code:this.code,
+				password:this.user.newPassword
+			}
+          getappCheck(params).then(response => {
+            that.$toast("重置成功")
+            setTimeout(function(){
+            	that.$tab.reLaunch('/pages/login') 
+            },1500)
+          })
+        })
+      }
+    }
+  }
+</script>
+
+<style lang="scss">
+  page {
+    background-color: #f5f5f5;
+  }
+
+  .pwd-retrieve-container {
+    padding: 10rpx 36rpx;
+  }
+  .pwd .rbtn{width: 100%;height: 98rpx;background: $com-cd3;border-radius: 49rpx;text-align: center;line-height: 98rpx;font-size: 32rpx;font-weight: bold;color: #FFFEFE;margin-top: 68rpx;}
+  .pwd /deep/ .uni-forms-item{height: 126rpx;background: #FFFFFF;border-radius: 18rpx;margin-top: 30rpx;padding: 0 40rpx;box-sizing: border-box;display: flex;align-items: center;margin-bottom: 0;}
+  .pwd /deep/ .uni-forms-item__label{font-size: 32rpx;font-weight: 500;
+color: #161616;flex: 0 0 auto;width: auto !important;}
+  .pwd /deep/ .uni-easyinput{flex: 1;text-align: right;font-size: 32rpx;color: #161616;}
+  .pwd /deep/ .uni-forms-item__content{display: flex;align-items: center;flex-direction: row;}
+  .pwd /deep/ .uni-easyinput__placeholder-class{font-size: 30rpx;}
+  .pwd /deep/ .uni-easyinput__content-input{font-size: 30rpx;}
+   .pwd /deep/ .uni-forms-item__error{margin-top:20rpx;left: auto;right: 0;}
+  
+
+</style>

+ 2 - 2
user_ui/pages/register.vue

@@ -13,7 +13,7 @@
 		  	  <view class="login-form-content">
 		  
 		  	  	<view class="input-item">
-		  	  		<view class="login_tit">手机号码</view>
+		  	  		<view class="login_tit">账号</view>
 		  	  		<view class="login_box">
 		  	  			<!-- <view class="login_boxl">+86</view> -->
 		  	  			 <input  v-model="datainfo.username" class="input" type="text" placeholder="请输入登录账号" maxlength="30" />
@@ -117,7 +117,7 @@
 				'username':this.datainfo.username
 			}
 				// getSMS();
-				return
+				// return
 			sendSmszcOnly(params).then(res=>{
 				if (res.code == 200) {
 					// 发送验证码

+ 2 - 2
user_ui/pages/tlogin.vue

@@ -7,7 +7,7 @@
 		  <view class="head">
 		  	<view class="htit">你好,</view>
 		  	<view class="htit">欢迎登录智慧社区平台</view>
-		  	<view class="htxt" @click="getregister">还没有账号?<text>立即注册</text></view>
+		  	<!-- <view class="htxt" @click="getregister">还没有账号?<text>立即注册</text></view> -->
 		  </view>
 		    <view class="flex1" style="position: relative;">
 		  
@@ -22,7 +22,7 @@
 		  	  <view class="login-form-content" v-if="tabidx!=1">
 		  
 		  	  	<view class="input-item">
-		  	  		<view class="login_tit">手机号码</view>
+		  	  		<view class="login_tit">账号</view>
 		  	  		<view class="login_box">
 		  	  			<!-- <view class="login_boxl">+86</view> -->
 		  	  			 <input  v-model="loginForm.username" class="input" type="text" placeholder="请输入登录账号" maxlength="30" />

+ 1 - 1
user_ui/permission.js

@@ -5,7 +5,7 @@ const loginPage = "/pages/login"
   
 // 页面白名单
 const whiteList = ['/pages/index/index','/pages/agreement',
-  '/pages/login','/pages/tlogin', '/pages/register', '/pages/common/webview/index'
+  '/pages/login','/pages/tlogin', '/pages/register', '/pages/common/webview/index','/pages/mine/pwd/resetpwd','/pages/mine/pwd/forgetpwd',
 ]
 
 // 检查地址白名单

+ 2 - 2
user_ui/work/pages/visitor/vdetail.vue

@@ -67,10 +67,10 @@
 				</view>
 			</view>
 			<!-- #ifdef APP-PLUS -->
-			<view class="rhbtn mt30" @click="getShareFn">分享</view>
+			<!-- <view class="rhbtn mt30" @click="getShareFn">分享</view> -->
 			<!-- #endif -->
 			<!-- #ifdef MP-WEIXIN -->
-			<button open-type="share" class="rhbtn mt30">分享</button>
+			<!-- <button open-type="share" class="rhbtn mt30">分享</button> -->
 			<!-- #endif -->
 			<!-- <button class="rhbtn mt30" @click="getShareFn">分享</button> -->
 			<!-- <view class="rhbtn mt30" @click="getShareFn">分享</view> -->