|
@@ -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){
|