浏览代码

手机号登录

lilei 4 年之前
父节点
当前提交
a20e7ffae5
共有 3 个文件被更改,包括 6 次插入51 次删除
  1. 1 1
      pages/login/login.scss
  2. 1 1
      pages/login/login.vue
  3. 4 49
      pages/login/phoneLogin.vue

+ 1 - 1
pages/login/login.scss

@@ -52,7 +52,7 @@
 				display: block;
 				line-height: 84upx;
 				margin: 0 auto;
-				background-color: #298bf2;
+				background-color: #01c9b2;
 				color: #fff;
 			}
 			uni-button.form-btn:after{

+ 1 - 1
pages/login/login.vue

@@ -107,7 +107,7 @@
 			},
 			// 手机号登录
 			phoneLogin () {
-			  wx.reLaunch({
+			  wx.navigateTo({
 			    url: '/pages/login/phoneLogin'
 			  })
 			}

+ 4 - 49
pages/login/phoneLogin.vue

@@ -12,7 +12,7 @@
 				<button class="getcode-btn" :disabled="isDisable" @click="getCodeValidate">{{nowVal}}</button>
 			</view>
 			<view class="form-btn-con">
-				<button class="form-btn" @click="goStep">登录</button>
+				<button class="form-btn" @click="submitFn">登录</button>
 			</view>
 		</form>
 		<!-- 图文验证码 -->
@@ -26,7 +26,7 @@
 	import { isvalidPhone } from '@/libs/validate.js'
 	import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	import popupCon from '@/components/uni-popup/popup-con.vue'
-	import { memberVerifyCode, memberChangePwd, memberValidateVerifyCode, memberGetByMobile } from '@/api/user.js'
+	import { memberVerifyCode, memberValidateVerifyCode, memberGetByMobile } from '@/api/user.js'
 	export default{
 		components: {
 			uniPopup,
@@ -56,8 +56,8 @@
 			}
 		},
 		methods: {
-			//  下一步
-			goStep(){
+			//   登录
+			submitFn(){
 				const _this = this
 				//  表单校验
 				if(this.form.phone == ''){
@@ -85,51 +85,6 @@
 				  }
 				})
 			},
-			//  表单提交
-			formSubmit(){
-				const _this = this
-				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.form.passwords == ''){
-					uni.showToast({icon: 'none',title: '请再次输入新密码'})
-					return
-				}
-				if(this.form.password != this.form.passwords){
-					uni.showToast({icon: 'none',title: '两次密码输入不一致'})
-					return
-				}
-				const obj = {}
-				obj.phone = _this.form.phone,
-				obj.random = _this.randomCode,  // 当前随机码
-				obj.verifyCode = _this.form.verifyCode,
-				obj.password = _this.form.password
-				memberChangePwd(obj).then(res => {
-					if(res.status == 200){
-						//  将修改后的账号密码  重新存储
-						_this.$u.vuex('vuex_user.account', _this.form.phone)
-						_this.$u.vuex('vuex_user.password', '')
-						clzConfirm({
-						    title: '提示',
-						    content: '修改成功',
-							confirmText: '去登录',
-							showCancel: false,
-							success: function (ret) {
-						        if (ret.confirm||ret.index==0) {
-									uni.reLaunch({
-										url: '/pages/login/login'
-									})
-						        }
-						    }
-						})
-					}
-				})
-			},
 			//  获取验证码
 			getCodeValidate(){
 				if(this.form.phone){