|
@@ -17,18 +17,18 @@
|
|
<view class="content" v-if="tabCurrentIndex === 1">
|
|
<view class="content" v-if="tabCurrentIndex === 1">
|
|
<view class="login-form clearfix">
|
|
<view class="login-form clearfix">
|
|
<view class="login-input">
|
|
<view class="login-input">
|
|
- <input type="number" v-model="bindLinkPhone" maxlength="11" class="input" @blur="onBlurInput" placeholder="请输入手机号"/>
|
|
|
|
|
|
+ <input type="number" v-model="mobile" maxlength="11" class="input" placeholder="请输入手机号"/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="login-form clearfix">
|
|
<view class="login-form clearfix">
|
|
<view class="login-input code">
|
|
<view class="login-input code">
|
|
- <input type="number" v-model="bindGraphiCode" maxlength="4" class="input" placeholder="请输入右侧图形验证码" />
|
|
|
|
|
|
+ <input type="number" v-model="imageCode" maxlength="4" class="input" placeholder="请输入右侧图形验证码" />
|
|
</view>
|
|
</view>
|
|
<view class="login-input img-btn">
|
|
<view class="login-input img-btn">
|
|
<view class="vscodeimg">
|
|
<view class="vscodeimg">
|
|
- <image src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2158189919,2752757953&fm=26&gp=0.jpg" mode=""></image>
|
|
|
|
|
|
+ <image :src="imageCodeUrl" mode=""></image>
|
|
</view>
|
|
</view>
|
|
- <view class="vscod-refresh">
|
|
|
|
|
|
+ <view class="vscod-refresh" @click.stop="getVerificationCode">
|
|
<text class="iconfont icon-shuaxin"></text>
|
|
<text class="iconfont icon-shuaxin"></text>
|
|
<text class="ref-text">刷新</text>
|
|
<text class="ref-text">刷新</text>
|
|
</view>
|
|
</view>
|
|
@@ -38,8 +38,8 @@
|
|
<view class="login-input code">
|
|
<view class="login-input code">
|
|
<input type="number" v-model="bindPhoneCode" maxlength="6" class="input" placeholder="请输入短信验证码"/>
|
|
<input type="number" v-model="bindPhoneCode" maxlength="6" class="input" placeholder="请输入短信验证码"/>
|
|
</view>
|
|
</view>
|
|
- <view class="login-input btn" :class="[isDisabled === true ? 'disabled' : 'none']">
|
|
|
|
- <button type="button" @click.stop="getEmailCode" :disabled="isDisabled" class="input" >获取验证码</button>
|
|
|
|
|
|
+ <view class="login-input btn" :class="[isMobileDisabled ? 'disabled' : '']" @click.stop="getMobileCodeFn">
|
|
|
|
+ <button type="button" :disabled="isMobileDisabled" class="input" >{{ mobileCodeText }}</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="login-form clearfix">
|
|
<view class="login-form clearfix">
|
|
@@ -57,22 +57,22 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="login-form clearfix">
|
|
<view class="login-form clearfix">
|
|
- <view class="login-btn" @click="goLogin">修改密码</view>
|
|
|
|
|
|
+ <view class="login-btn" @click="confirmPassword">修改密码</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 邮箱修改 -->
|
|
<!-- 邮箱修改 -->
|
|
<view class="content" v-else>
|
|
<view class="content" v-else>
|
|
<view class="login-form clearfix">
|
|
<view class="login-form clearfix">
|
|
<view class="login-input">
|
|
<view class="login-input">
|
|
- <input class="input" type="number" v-model="bindLinkPhone" maxlength="30" @blur="onBlurInput" placeholder="请输入邮箱地址"/>
|
|
|
|
|
|
+ <input class="input" type="number" v-model="email" maxlength="30" placeholder="请输入邮箱地址"/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="login-form clearfix">
|
|
<view class="login-form clearfix">
|
|
<view class="login-input code">
|
|
<view class="login-input code">
|
|
- <input class="input" type="number" v-model="bindPhoneCode" maxlength="6" placeholder="请输入邮箱验证码" />
|
|
|
|
|
|
+ <input class="input" type="number" v-model="emailCode" maxlength="6" placeholder="请输入邮箱验证码" />
|
|
</view>
|
|
</view>
|
|
- <view class="login-input btn" :class="[isDisabled === true ? 'disabled' : 'none']">
|
|
|
|
- <button class="input" type="button" @click.stop="getEmailCode" :disabled="isDisabled">获取验证码</button>
|
|
|
|
|
|
+ <view class="login-input btn" :class="[isEmialDisabled ? 'disabled' : '']" @click.stop="getEmailCodeFn">
|
|
|
|
+ <button class="input" type="button" :disabled="isEmialDisabled">{{ emailCodeText }}</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="login-form clearfix">
|
|
<view class="login-form clearfix">
|
|
@@ -93,42 +93,21 @@
|
|
<view class="login-btn" @click="goLogin">修改密码</view>
|
|
<view class="login-btn" @click="goLogin">修改密码</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view v-if="isToast" class="model-warp" >
|
|
|
|
- <view class="model-alert clearfix">
|
|
|
|
- <view class="alert-content">
|
|
|
|
- <view class="t-h1">{{toestText}}</view>
|
|
|
|
- <view class="t-p">请联系客服获取{{alertText}}后再登录,联系电话{{telPhone}}</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="alert-btn">
|
|
|
|
- <view class="btn btn-confirm" @click="hideToast">确定</view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <!-- 授权按钮 -->
|
|
|
|
- <view class="model-warp" :class="[isUserInfo===false ? 'none':'show']">
|
|
|
|
- <view class="model-alert">
|
|
|
|
- <view class="alert-content">
|
|
|
|
- <view class="t-p">采美采购商城需要获取您的微信授权才能正常提供服务</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="alert-btn">
|
|
|
|
- <view class="btn btn-cancel" @click="hideModel">取消</view>
|
|
|
|
- <button type="primary" size="small" open-type="getUserInfo" lang="zh_CN" @getuserinfo="getuserinfo" class="btn btn-confirm">授权</button>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
- import { mapMutations } from 'vuex';
|
|
|
|
import authorize from '@/common/config/authorize.js'
|
|
import authorize from '@/common/config/authorize.js'
|
|
- var self;
|
|
|
|
|
|
+ import { organizationRegister , organizationVerifyRegisterFirst ,organizationVerifyRegisterTwo } from "@/api/use.js"
|
|
|
|
+ import { getImageCode, getEmailCode, getMobileCode, uploadFileImage } from "@/api/utils.js"
|
|
|
|
+
|
|
export default{
|
|
export default{
|
|
data() {
|
|
data() {
|
|
return{
|
|
return{
|
|
tabCurrentIndex: 1,
|
|
tabCurrentIndex: 1,
|
|
- mobile:'', //用户手机号
|
|
|
|
- bindGraphiCode:'', //图形验证
|
|
|
|
|
|
+ mobile:'', //用户手机号
|
|
|
|
+ email:'', //邮箱地址
|
|
|
|
+ emailCode:'', //油箱验证码
|
|
bindPhoneCode:'', //手机验证码
|
|
bindPhoneCode:'', //手机验证码
|
|
password:'', //新密码
|
|
password:'', //新密码
|
|
passwordCheck:'', //二次校验新密码
|
|
passwordCheck:'', //二次校验新密码
|
|
@@ -136,87 +115,97 @@
|
|
isShowEyes:false, //控显
|
|
isShowEyes:false, //控显
|
|
iconEyes:'icon-yanjing_yincang_o',
|
|
iconEyes:'icon-yanjing_yincang_o',
|
|
iconEyen:'icon-yanjing_xianshi_o',
|
|
iconEyen:'icon-yanjing_xianshi_o',
|
|
- isDisabled:true, //获取验证码按钮
|
|
|
|
- isToast:false, //控制显示未输入邀请码提示
|
|
|
|
- isUserInfo:false, //控制显示授权弹窗
|
|
|
|
- nickName:'', //存储用户名
|
|
|
|
- userInfo:'', //存储微信用户授权信息
|
|
|
|
- isSuccess:false,
|
|
|
|
- toestText:'',
|
|
|
|
- telPhone:'',
|
|
|
|
- loginType:'', //跳转类型
|
|
|
|
- alertText:'',
|
|
|
|
- listType: '',
|
|
|
|
- listVal: '',
|
|
|
|
- detilType:'',
|
|
|
|
- id:''//商品ID
|
|
|
|
|
|
+ isEmialDisabled:false,//获取邮箱验证码按钮
|
|
|
|
+ isMobileDisabled:false,//获取手机短信按钮
|
|
|
|
+ imageCode:'', //图形验证码
|
|
|
|
+ imageCodeUrl:'', //图形验证码地址
|
|
|
|
+ imageCodetoken:'', //图形校验token
|
|
|
|
+ count: '', //倒计时
|
|
|
|
+ emailCodeText: '获取验证码',
|
|
|
|
+ mobileCodeText: '获取验证码',
|
|
|
|
+ codeTime: null,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
console.log(option)
|
|
console.log(option)
|
|
|
|
+ this.getVerificationCode()
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
- ...mapMutations(['login']),
|
|
|
|
- goLogin() {
|
|
|
|
- self.$api.get('/login/isEnabled',{userOrganizeID:self.userOrganizeID,invitationCode:self.invitationCode}, res => {
|
|
|
|
- if (res.code == "1") {
|
|
|
|
- //查看此微信用户是否已经授权过
|
|
|
|
- authorize.getSetting().then(res =>{
|
|
|
|
- // console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
|
|
|
|
- if(res == 2){
|
|
|
|
- self.isUserInfo = true
|
|
|
|
- }else{
|
|
|
|
- self.isUserInfo = false
|
|
|
|
- self.wxGetUserInfo()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }else if(res.code =='0'){
|
|
|
|
- self.toestText ='请输入邀请码';
|
|
|
|
- self.alertText ='邀请码';
|
|
|
|
- self.telPhone = res.msg;
|
|
|
|
- self.isToast = true;
|
|
|
|
- }else if(res.code =='-2'){
|
|
|
|
- self.toestText ='邀请码已失效';
|
|
|
|
- self.alertText ='新邀请码';
|
|
|
|
- self.telPhone = res.msg;
|
|
|
|
- self.isToast = true;
|
|
|
|
- }else if(res.code =='-3'){
|
|
|
|
- self.toestText ='邀请码已被使用';
|
|
|
|
- self.alertText ='新邀请码';
|
|
|
|
- self.telPhone = res.msg;
|
|
|
|
- self.isToast = true;
|
|
|
|
- }else{
|
|
|
|
- uni.showToast({icon:'none', title: res.msg, duration: 3000});
|
|
|
|
- self.isUserInfo = false
|
|
|
|
- }
|
|
|
|
|
|
+ confirmPassword(){
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ getVerificationCode(){//图形验证
|
|
|
|
+ getImageCode().then(res => {
|
|
|
|
+ this.imageCodeUrl = res.data.baseImage
|
|
|
|
+ this.imageCodetoken = res.data.token
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- onBlurInput(e){//邮箱输入框失去焦点设置按钮
|
|
|
|
- if(e.detail.value ===''){
|
|
|
|
- this.isDisabled = true
|
|
|
|
- }else{
|
|
|
|
- this.isDisabled = false
|
|
|
|
- }
|
|
|
|
|
|
+ getEmailCodeFn(){
|
|
|
|
+ getEmailCode({email:this.email,status:3}).then(res =>{
|
|
|
|
+ this.$util.msg('验证邮件已发送至邮箱,请登录邮箱查收',2000);
|
|
|
|
+ const TIME_COUNT = 60;
|
|
|
|
+ if (!this.codeTime) {
|
|
|
|
+ this.count = TIME_COUNT;
|
|
|
|
+ this.isEmialDisabled = true;
|
|
|
|
+ this.codeTime = setInterval(() => {
|
|
|
|
+ if (this.count > 1 && this.count <= TIME_COUNT) {
|
|
|
|
+ this.count--
|
|
|
|
+ this.emailCodeText = this.count +'s重新发送'
|
|
|
|
+ } else {
|
|
|
|
+ this.isEmialDisabled = false;
|
|
|
|
+ clearInterval(this.codeTime)
|
|
|
|
+ this.codeTime = null
|
|
|
|
+ this.emailCodeText = '获取验证码'
|
|
|
|
+ }
|
|
|
|
+ },1000)
|
|
|
|
+ }
|
|
|
|
+ }).catch( res =>{
|
|
|
|
+ this.$util.msg(res.msg,2000);
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- getEmailCode(){
|
|
|
|
- this.isDisabled = true
|
|
|
|
|
|
+ getMobileCodeFn(){
|
|
|
|
+ let params = {
|
|
|
|
+ mobile:this.mobile,
|
|
|
|
+ activateCodeType:1,
|
|
|
|
+ platformType:2,
|
|
|
|
+ imgCode:this.imageCode,
|
|
|
|
+ token:this.imageCodetoken,
|
|
|
|
+ }
|
|
|
|
+ getMobileCode(params).then(res =>{
|
|
|
|
+ this.$util.msg('验证短信已发送',2000);
|
|
|
|
+ const TIME_COUNT = 60;
|
|
|
|
+ if (!this.codeTime) {
|
|
|
|
+ this.count = TIME_COUNT;
|
|
|
|
+ this.isMobileDisabled = true;
|
|
|
|
+ this.codeTime = setInterval(() => {
|
|
|
|
+ if (this.count > 1 && this.count <= TIME_COUNT) {
|
|
|
|
+ this.count--
|
|
|
|
+ this.mobileCodeText = this.count +'s重新发送'
|
|
|
|
+ } else {
|
|
|
|
+ this.isMobileDisabled = false;
|
|
|
|
+ clearInterval(this.codeTime)
|
|
|
|
+ this.codeTime = null
|
|
|
|
+ this.mobileCodeText = '获取验证码'
|
|
|
|
+ }
|
|
|
|
+ },1000)
|
|
|
|
+ }
|
|
|
|
+ }).catch( res =>{
|
|
|
|
+ this.$util.msg(res.msg,2000);
|
|
|
|
+ })
|
|
},
|
|
},
|
|
tabClick(index) {//tab切换
|
|
tabClick(index) {//tab切换
|
|
this.tabCurrentIndex = index;
|
|
this.tabCurrentIndex = index;
|
|
|
|
+ this.password = ''
|
|
|
|
+ this.passwordCheck = ''
|
|
|
|
+ if(this.tabCurrentIndex == 1){
|
|
|
|
+ this.getVerificationCode()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
passwordEye() {//密码显隐操作
|
|
passwordEye() {//密码显隐操作
|
|
this.isShowEye = !this.isShowEye;
|
|
this.isShowEye = !this.isShowEye;
|
|
},
|
|
},
|
|
passwordEyes() {//密码显隐操作
|
|
passwordEyes() {//密码显隐操作
|
|
this.isShowEyes = !this.isShowEyes;
|
|
this.isShowEyes = !this.isShowEyes;
|
|
- },
|
|
|
|
- //关闭未填邀请码弹窗
|
|
|
|
- hideToast(){
|
|
|
|
- self.isToast = false;
|
|
|
|
- },
|
|
|
|
- //关闭未授权用户授权提示弹窗
|
|
|
|
- hideModel(){
|
|
|
|
- self.isUserInfo = false;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -226,12 +215,6 @@
|
|
.login{
|
|
.login{
|
|
width: 100%;
|
|
width: 100%;
|
|
height: auto;
|
|
height: auto;
|
|
- .model-warp.none{
|
|
|
|
- display: none;
|
|
|
|
- }
|
|
|
|
- .model-warp.show{
|
|
|
|
- display: block;
|
|
|
|
- }
|
|
|
|
.login-main{
|
|
.login-main{
|
|
width: 100%;
|
|
width: 100%;
|
|
display: flex;
|
|
display: flex;
|
|
@@ -305,15 +288,21 @@
|
|
&.btn{
|
|
&.btn{
|
|
width: 215rpx;
|
|
width: 215rpx;
|
|
float: left;
|
|
float: left;
|
|
- &.none{
|
|
|
|
- background: $color-system;
|
|
|
|
- .input{
|
|
|
|
- color: #FFFFFF;
|
|
|
|
- background: $color-system;
|
|
|
|
|
|
+ background: $btn-confirm;
|
|
|
|
+ .input{
|
|
|
|
+ width: 215rpx;
|
|
|
|
+ padding: 0;
|
|
|
|
+ color: #FFFFFF;
|
|
|
|
+ background: $btn-confirm;
|
|
|
|
+ text-align: center;
|
|
|
|
+ &.none{
|
|
|
|
+ background: #F7F7F7;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
&.disabled{
|
|
&.disabled{
|
|
|
|
+ background: #F7F7F7;
|
|
.input{
|
|
.input{
|
|
|
|
+ background: #F7F7F7;
|
|
color: #999999;
|
|
color: #999999;
|
|
}
|
|
}
|
|
}
|
|
}
|