zhangdan před 4 roky
rodič
revize
2d9251b0eb
4 změnil soubory, kde provedl 0 přidání a 471 odebrání
  1. 0 12
      pages.json
  2. 0 79
      pages/login/loginPw.scss
  3. 0 166
      pages/login/phoneLogin.vue
  4. 0 214
      pages/userCenter/changePwd.vue

+ 0 - 12
pages.json

@@ -22,12 +22,6 @@
 				"navigationBarTitleText": "授权登录"
 			}
 		},
-		{
-			"path": "pages/login/phoneLogin",
-			"style": {
-				"navigationBarTitleText": "手机号登录"
-			}
-		},
 		{
 			"path": "pages/userCenter/index",
 			"style": {
@@ -47,12 +41,6 @@
 			"style": {
 				"navigationBarTitleText": "用户协议及隐私政策"
 			}
-		},
-		{
-			"path": "pages/userCenter/changePwd",		//  我的>修改密码
-			"style": {
-				"navigationBarTitleText": "修改密码"
-			}
 		}
     ],
 	"globalStyle": {

+ 0 - 79
pages/login/loginPw.scss

@@ -1,79 +0,0 @@
-.login-wrap, .forget-wrap, .apply-wrap{
-	background-color: #FFFFFF;
-	width: 100%;
-	height: 100vh;
-	box-sizing: border-box;
-	padding: 0 40upx;
-	.logo{
-		display: block;
-		margin: 0 auto;
-		padding: 200upx 256upx 60upx;
-	}
-	.login-form{
-		display: block;
-		.form-item{
-			margin-bottom: 20upx;
-			position: relative;
-			display: flex;
-			align-items: center;
-			border-bottom: 1upx solid #e5e5e5;
-			.require-tip{
-				position: absolute;
-				left: 0;
-				top: 26upx;
-				color: red;
-			}
-			.item-inp{
-				flex-grow: 1;
-			}
-			.item-inp, .item-picker{
-				font-size: 30upx;
-				padding: 20upx 20upx;
-			}
-			.getcode-btn{
-				position: absolute;
-				right: 20upx;
-				top: 0;
-				font-size: 24upx;
-				margin-top: 14upx;
-			}
-		}
-		.flex-box{
-			display: flex;
-			justify-content: space-between;
-			font-size: 26upx;
-		}
-		.form-btn-con{
-			margin-top: 100upx;
-			.form-btn{
-				font-size: 32upx;
-				display: block;
-				height: 80upx;
-				line-height: 80upx;
-				margin: 0 auto;
-				background-color: #0DC55F;
-				color: #fff;
-				border-radius: 50upx;
-			}
-			uni-button.form-btn:after{
-				border: none;
-			}
-			.apply-btn{
-				display: block;
-				text-align: center;
-				margin-top: 50upx;
-			}
-		}
-	}
-	
-	.authUserYs{
-		text-align: center;
-		position: absolute;
-		bottom: 5%;
-		width: 100%;
-		font-size: 24upx;
-		text{
-			color: #ff0000;
-		}
-	}
-}

+ 0 - 166
pages/login/phoneLogin.vue

@@ -1,166 +0,0 @@
-<template>
-	<view class="login-wrap">
-		<!-- <view v-if="!buildType" style="text-align: center;color: #999999;padding-top: 40px;">{{ envTips }}</view> -->
-		<u-image src="/static/login_icon.png" width="160" height="160" class="logo"></u-image>
-		<form class="login-form" @submit="formSubmit">
-			<view class="form-item">
-				<u-image src="/static/user_icon_number.png" width="44" height="44" class="logo_user_icon"></u-image>
-				<input v-model="form.loginName" class="item-inp" name="loginName" type="text" maxlength="30" placeholder="请输入用户名" />
-			</view>
-			<view class="form-item">
-				<u-image src="/static/user_icon_password.png" width="44" height="44" class="logo_pwd_icon"></u-image>
-				<input v-model="form.password" class="item-inp" name="password" password type="text" maxlength="12" placeholder="请输入密码" />
-			</view>
-			<view class="flex-box" style="margin-top: 40upx;">
-				<view class="remember-pass">
-					<u-checkbox shape="circle" v-model="isRemember" value="true" :size="30" :label-size="26" active-color="#0DC55F" class="login-form-checkbox" @change="rememberChange">记住密码</u-checkbox>
-				</view>
-			</view>
-			<view class="form-btn-con">
-				<button class="form-btn" form-type="submit">登录</button>
-			</view>
-		</form>
-		<!-- <view class="authUserYs">
-			<u-checkbox v-model="isAuthuserYs" value="true" :size="30" :label-size="26" active-color="#2ab4e5" class="login-form-checkbox" @change="authuserChange">登录代表同意</u-checkbox>
-			<text @click="toYsPage()" style="vertical-align: text-top;font-size: 26rpx;text-decoration: underline;">乐色助手用户协议及隐私保护政策</text>
-		</view> -->
-	</view>
-</template>
-
-<script>
-import { checkVersionToLoadUpdate, setStorageForAppVersion,clzConfirm } from '@/libs/tools'
-import { isvalidPhone } from '@/libs/validate.js';
-import { loginPhone } from '@/api/login.js';
-import { getSysVersion } from '@/api/data.js'
-export default {
-	data() {
-		return {
-			form: {
-				loginName: this.$store.state.vuex_user.account,
-				password: this.$store.state.vuex_user.password
-			},
-			isRemember: true, //  是否记住密码
-			isAuthuserYs: true, // 是否同意隐私政策
-			envTips: '',
-			buildType: '',
-		};
-	},
-	mounted() {
-		this.isRemember = this.$store.state.vuex_isRemember || true;
-		this.isAuthuserYs = this.$store.state.vuex_isUsrAuthYs || true;
-		this.envTips = getApp().globalData.envTips;
-		this.buildType = getApp().globalData.buildType;
-	},
-	onShow() {
-	},
-	methods: {
-		//  获取微信login  code
-		getWechatCode(){
-			const _this = this
-			wx.login({
-			  success (res) {
-			    if (res.code) {
-					//发起网络请求
-					let formData = JSON.parse(JSON.stringify(_this.form))
-					formData.code = res.code
-					_this.submitForm(formData)
-			    } else {
-					console.log('登录失败,点击“登录”重试!' + res.errMsg)
-			    }
-			  }
-			})
-		},
-		//  表单提交
-		formSubmit() {
-			const _this = this;
-			//  表单校验
-			if (_this.form.loginName == '') {
-				uni.showToast({ icon: 'none', title: '请输入用户名' });
-				return;
-			}
-			if (!isvalidPhone(_this.form.loginName)) {
-				uni.showToast({ icon: 'none', title: '请输入正确的手机号码' });
-				return;
-			}
-			if (_this.form.password == '') {
-				uni.showToast({ icon: 'none', title: '请输入密码' });
-				return;
-			}
-			if (_this.form.password.length < 6 || _this.form.password.length > 12) {
-				uni.showToast({ icon: 'none', title: '请输入6-12位密码' });
-				return;
-			}
-			if (!_this.isAuthuserYs) {
-				uni.showToast({ icon: 'none', title: '请同意并阅读用户隐私政策' });
-				return;
-			}
-			uni.showLoading({
-				title: '正在登录...'
-			});
-			// #ifdef MP-WEIXIN
-				//  获取微信login   code
-				this.getWechatCode()
-			// #endif
-			// #ifndef MP-WEIXIN
-				this.submitForm(_this.form)
-			// #endif
-		},
-		submitForm(formData){
-			const _this = this;
-			//  登录
-			loginPhone(formData).then(res => {
-				uni.hideLoading();
-				if (res.status == 200) {
-					_this.$u.vuex('vuex_token', res.data);
-					getApp().globalData.token = res.data;
-					//登录成功将用户名密码存储到用户本地
-					if (_this.isRemember) {
-						//用户勾选“记住密码”
-						_this.$u.vuex('vuex_user.account', _this.form.loginName);
-						_this.$u.vuex('vuex_user.password', _this.form.password);
-					} else {
-						//用户没有勾选“记住密码”
-						_this.$u.vuex('vuex_user.account', '');
-						_this.$u.vuex('vuex_user.password', '');
-						_this.form.loginName = '';
-						_this.form.password = '';
-					}
-					uni.setStorageSync('loginTimeOut', 'NO');
-					_this.toMain();
-				} else {
-					uni.showToast({ icon: 'none', title: res.message });
-				}
-			});
-		},
-		toMain() {
-			// 跳转到首页
-			uni.switchTab({
-				url: '/pages/index/index'
-			});
-		},
-		//  忘记密码
-		forgetPass() {
-			uni.navigateTo({
-				url: '/pages/login/forget-pass?username=' + this.form.loginName
-			});
-		},
-		//  判断是否记住密码
-		rememberChange(e) {
-			this.isRemember = e.value;
-		},
-		// 隐私
-		authuserChange(e) {
-			this.isAuthuserYs = e.value;
-			this.$u.vuex('vuex_isUsrAuthYs', this.isAuthuserYs);
-		},
-		toYsPage() {
-			uni.navigateTo({
-				url: '/pages/agreement/agreement'
-			});
-		}
-	}
-};
-</script>
-<style scoped lang="scss">
-@import './loginPw.scss';
-</style>

+ 0 - 214
pages/userCenter/changePwd.vue

@@ -1,214 +0,0 @@
-<template>
-	<view class="changePwd-container">
-		<view class="content">
-			<view class="tishi">请先输入原密码,按步骤操作</view>
-			<view class="input-group">
-				<view class="input-row border">
-					<text class="title">原密码:</text>
-					<m-input class="m-input" :maxlength="12" @input="getOldPwd" type="password"  displayable v-model="formCustom.oldPwd" placeholder="请输入原密码"></m-input>
-				</view>
-				<view class="input-row">
-					<text class="title">新密码:</text>
-					<m-input class="m-input" :maxlength="12" @input="getPasswd" type="password" displayable v-model="formCustom.passwd" placeholder="请输入6-12位新密码"></m-input>
-				</view>
-				<view class="input-row">
-					<text class="title">再次输入:</text>
-					<m-input class="m-input" :maxlength="12" @input="getPasswdCheck" type="password" displayable v-model="formCustom.passwdCheck" placeholder="请输入6-12位新密码"></m-input>
-				</view>
-			</view>
-		</view>
-		<!-- 按钮 -->
-		<view class="form-footer-btn">
-			<u-button size="medium" hover-class="none" shape="circle" @click="handleReset">重置</u-button>
-			<u-button size="medium" hover-class="none" shape="circle" :loading="loading" :custom-style="customBtnStyle" @click="handleSubmit">保存</u-button>
-		</view>
-	</view>
-</template>
-
-<script>
-	import mInput from '../../components/m-input.vue'
-	import { changePwd } from '@/api/user.js'
-	import { logout } from '@/api/login.js'
-	export default{
-		name:'changePwd',
-		components: {
-			mInput
-		},
-		data(){
-			return{
-				formCustom: {
-				  passwd: '',
-				  passwdCheck: '',
-				  oldPwd: ''
-				},
-				loading: false,
-				customBtnStyle: {  //  自定义按钮样式
-					borderColor: '#0DC55F',
-					backgroundColor: '#0DC55F',
-					color: '#fff'
-				},
-			}
-		},
-		methods:{
-			messageInfo(info){
-				uni.showToast({
-					icon:'none',
-					title: info
-				})
-			},
-			// 不能输入汉字
-			getOldPwd(val) {
-				console.log(val,'vvvvvvv')
-				 if (/[\u4E00-\u9FA5]/g.test(val)) {
-					this.$nextTick(() => {
-						this.formCustom.oldPwd = ''
-					})
-				}
-			},
-			getPasswd(val) {
-				console.log(val,'vvvvvvv')
-				 if (/[\u4E00-\u9FA5]/g.test(val)) {
-					this.$nextTick(() => {
-						this.formCustom.passwd = ''
-					})
-				}
-			},
-			getPasswdCheck(val) {
-				console.log(val,'vvvvvvv')
-				 if (/[\u4E00-\u9FA5]/g.test(val)) {
-					this.$nextTick(() => {
-						this.formCustom.passwdCheck = ''
-					})
-				}
-			},
-			handleSubmit(){
-				let _this = this
-				//非空判断密码长度判断
-				if (this.formCustom.oldPwd === '') {
-				   this.messageInfo("请输入原密码")
-				   return 
-				}  
-				if (this.formCustom.passwd === '') {
-				   this.messageInfo("请输入新密码")
-				   return 
-				}
-				if (this.formCustom.passwd.length < 6) {
-				   this.messageInfo("新密码最少6位")
-				   return 
-				}
-				if (this.formCustom.passwdCheck === '') {
-				   this.messageInfo("请再次输入新密码")
-				   return 
-				}
-				if (this.formCustom.passwdCheck.length < 6) {
-				   this.messageInfo("再次输入新密码最少6位")
-				   return 
-				}
-				if (this.formCustom.passwdCheck !== this.formCustom.passwd) {
-				   this.messageInfo("再次输入的密码和新密码不一样")
-				   return 
-				}
-				// 保存
-				this.loading = true
-				changePwd({
-				  oldPassword: this.formCustom.oldPwd,
-				  password: this.formCustom.passwd
-				}).then(res => {
-				  if (res.status == '200') {
-				    this.messageInfo('修改成功, 请重新登录')
-				    setTimeout(function(){
-						_this.logout()
-					},800)
-				  } else {
-				    this.messageInfo(res.message)
-					this.loading = false
-				  }
-				})
-			},
-			logout(){
-				logout().then(res => {
-					console.log(res)
-					this.messageInfo(res.message)
-					if(res.status == 200){
-						// this.$store.commit("$closeWebsocket")
-						this.$store.state.vuex_token = ''
-						this.$store.state.vuex_userData = ''
-						uni.setStorageSync('setStatusIndexFunc', 0)
-						uni.reLaunch({
-							url: "/pages/login/login"
-						})
-					}
-					this.loading = false
-				})
-			},
-			handleReset (name) {
-				this.formCustom = {
-				  passwd: '',
-				  passwdCheck: '',
-				  oldPwd: ''
-				}
-			}
-		}
-	}
-	
-</script>
-
-<style lang="less">
-	page{
-		background: #FFFFFF;
-	}
-	.changePwd-container{
-		width: 100%;
-		font-size: 28rpx;
-		padding: 20rpx 40rpx ;
-		.content{
-			.tishi{
-				text-align: center;
-				line-height: 130rpx;
-				font-size: 30rpx;
-				color: #999;
-			}
-			.input-group{
-				margin-top:20rpx;
-			}
-			.input-row{
-				padding: 10rpx 20rpx;
-				background-color: #F8F8F8;
-				margin-bottom: 20rpx;
-				border-radius: 10rpx;
-				line-height: 32px;
-				display: flex;
-				align-items: center;
-				justify-content: space-between;
-				.title{
-					color:#808080;
-				}
-			}
-			.uni-input-placeholder{
-				font-size: 26rpx;
-				color:#989898;
-			}
-		}
-		.u-size-default[data-v-1f520a08]{
-			height: 92rpx;
-		}
-		.m-input-input[data-v-5a85b703]{
-			position: relative;
-			bottom: 4rpx;
-		}
-		.m-input-icon[data-v-5a85b703]{
-			position: relative;
-			bottom: 10rpx;
-		}
-		.form-footer-btn{
-			margin: 140upx 50upx 0;
-			display: flex;
-			justify-content: space-between;
-		}
-		.form-footer-btn uni-button{
-			width: 50%;
-			margin: 0 50upx;
-			font-size: 30upx;
-		}
-	}
-</style>