123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416 |
- <template>
- <view class="container login">
- <view class="login-main">
- <view class="line"></view>
- <view class="nav-item"
- :class="{ current: tabCurrentIndex === 1 }"
- @click="tabClick(1)">
- 使用手机修改
- </view>
- <view class="nav-item"
- :class="{ current: tabCurrentIndex === 2 }"
- @click="tabClick(2)">
- 使用邮箱修改
- </view>
- </view>
- <!-- 手机修改 -->
- <view class="content" v-if="tabCurrentIndex === 1">
- <view class="login-form clearfix">
- <view class="login-input">
- <input type="number" v-model="bindLinkPhone" maxlength="11" class="input" @blur="onBlurInput" placeholder="请输入手机号"/>
- </view>
- </view>
- <view class="login-form clearfix">
- <view class="login-input code">
- <input type="number" v-model="bindGraphiCode" maxlength="4" class="input" placeholder="请输入右侧图形验证码" />
- </view>
- <view class="login-input img-btn">
- <view class="vscodeimg">
- <image src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2158189919,2752757953&fm=26&gp=0.jpg" mode=""></image>
- </view>
- <view class="vscod-refresh">
- <text class="iconfont icon-shuaxin"></text>
- <text class="ref-text">刷新</text>
- </view>
- </view>
- </view>
- <view class="login-form clearfix">
- <view class="login-input code">
- <input type="number" v-model="bindPhoneCode" maxlength="6" class="input" placeholder="请输入短信验证码"/>
- </view>
- <view class="login-input btn" :class="[isDisabled === true ? 'disabled' : 'none']">
- <button type="button" @click.stop="getEmailCode" :disabled="isDisabled" class="input" >获取验证码</button>
- </view>
- </view>
- <view class="login-form clearfix">
- <view class="login-input pwd">
- <input v-show="isShowEye" type="text" v-model="password" maxlength="18" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password"/>
- <input v-show="!isShowEye" type="password" v-model="password" :password="true" maxlength="18" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password"/>
- <view class="iconfont" :class="isShowEye ? iconEyen : iconEyes" @click="passwordEye"></view>
- </view>
- </view>
- <view class="login-form clearfix">
- <view class="login-input pwd">
- <input v-show="isShowEyes" type="text" v-model="passwordCheck" maxlength="18" class="input" placeholder="请确认密码" autocomplete="new-password"/>
- <input v-show="!isShowEyes" type="password" v-model="passwordCheck" :password="true" maxlength="18" class="input" placeholder="请确认密码" autocomplete="new-password"/>
- <view class="iconfont" :class="isShowEyes ? iconEyen : iconEyes" @click="passwordEyes"></view>
- </view>
- </view>
- <view class="login-form clearfix">
- <view class="login-btn" @click="goLogin">修改密码</view>
- </view>
- </view>
- <!-- 邮箱修改 -->
- <view class="content" v-else>
- <view class="login-form clearfix">
- <view class="login-input">
- <input class="input" type="number" v-model="bindLinkPhone" maxlength="30" @blur="onBlurInput" placeholder="请输入邮箱地址"/>
- </view>
- </view>
- <view class="login-form clearfix">
- <view class="login-input code">
- <input class="input" type="number" v-model="bindPhoneCode" maxlength="6" placeholder="请输入邮箱验证码" />
- </view>
- <view class="login-input btn" :class="[isDisabled === true ? 'disabled' : 'none']">
- <button class="input" type="button" @click.stop="getEmailCode" :disabled="isDisabled">获取验证码</button>
- </view>
- </view>
- <view class="login-form clearfix">
- <view class="login-input pwd">
- <input v-show="isShowEye" type="text" v-model="password" maxlength="18" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password"/>
- <input v-show="!isShowEye" type="password" v-model="password" :password="true" maxlength="18" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password"/>
- <view class="iconfont" :class="isShowEye ? iconEyen : iconEyes" @click="passwordEye"></view>
- </view>
- </view>
- <view class="login-form clearfix">
- <view class="login-input pwd">
- <input v-show="isShowEyes" type="text" v-model="passwordCheck" maxlength="18" class="input" placeholder="请确认密码" autocomplete="new-password"/>
- <input v-show="!isShowEyes" type="password" v-model="passwordCheck" :password="true" maxlength="18" class="input" placeholder="请确认密码" autocomplete="new-password"/>
- <view class="iconfont" :class="isShowEyes ? iconEyen : iconEyes" @click="passwordEyes"></view>
- </view>
- </view>
- <view class="login-form clearfix">
- <view class="login-btn" @click="goLogin">修改密码</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>
- </template>
- <script>
- import { mapMutations } from 'vuex';
- import authorize from '@/common/config/authorize.js'
- var self;
- export default{
- data() {
- return{
- tabCurrentIndex: 1,
- mobile:'', //用户手机号
- bindGraphiCode:'', //图形验证
- bindPhoneCode:'', //手机验证码
- password:'', //新密码
- passwordCheck:'', //二次校验新密码
- isShowEye:false, //控显
- isShowEyes:false, //控显
- iconEyes:'icon-yanjing_yincang_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
- }
- },
- onLoad(option) {
- console.log(option)
- },
- 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
- }
- })
- },
- onBlurInput(e){//邮箱输入框失去焦点设置按钮
- if(e.detail.value ===''){
- this.isDisabled = true
- }else{
- this.isDisabled = false
- }
- },
- getEmailCode(){
- this.isDisabled = true
- },
- tabClick(index) {//tab切换
- this.tabCurrentIndex = index;
- },
- passwordEye() {//密码显隐操作
- this.isShowEye = !this.isShowEye;
- },
- passwordEyes() {//密码显隐操作
- this.isShowEyes = !this.isShowEyes;
- },
- //关闭未填邀请码弹窗
- hideToast(){
- self.isToast = false;
- },
- //关闭未授权用户授权提示弹窗
- hideModel(){
- self.isUserInfo = false;
- }
- }
- }
- </script>
- <style lang="scss">
- .login{
- width: 100%;
- height: auto;
- .model-warp.none{
- display: none;
- }
- .model-warp.show{
- display: block;
- }
- .login-main{
- width: 100%;
- display: flex;
- height: 80rpx;
- border-top: 1px solid #F7F7F7;
- margin-bottom: 112rpx;
- position: relative;
- .line{
- position: absolute;
- top: 0;
- left: 50%;
- margin-left: -80rpx;
- width: 0;
- height: 0;
- border-left: 80rpx solid transparent;
- border-right: 80rpx solid transparent;
- border-bottom: 160rpx solid #FFFFFF;
- }
- .nav-item{
- display: flex;
- flex: 1;
- flex-direction: column;
- align-items: center;
- line-height: 80rpx;
- color: $text-color;
- font-size: $font-size-24;
- background: #F7F7F7;
-
- &.current{
- color:$color-system;
- background: #FFFFFF;
-
- }
- }
- }
- .login-form{
- width: 702rpx;
- height: auto;
- padding: 0 24rpx;
- .login-input{
- width: 654rpx;
- height: 40rpx;
- padding: 24rpx;
- margin-bottom: 20rpx;
- background: #F7F7F7;
- border-radius: 14rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- position: relative;
- &.pwd{
- .iconfont{
- position: absolute;
- right: 0;
- top: 0;
- font-size: 46rpx;
- color: $color-system;
- font-weight: bold;
- z-index: 99;
- width: 96rpx;
- height: 96rpx;
- line-height: 96rpx;
- text-align: center;
- }
- }
- &.code{
- width: 370rpx;
- float: left;
- margin-right: 20rpx;
- }
- &.btn{
- width: 215rpx;
- float: left;
- &.none{
- background: $color-system;
- .input{
- color: #FFFFFF;
- background: $color-system;
- }
- }
- &.disabled{
- .input{
- color: #999999;
- }
- }
- }
- &.img-btn{
- width: 250rpx;
- height: 88rpx;
- padding: 0;
- float: left;
- background: #FFFFFF;
- display: block;
- .vscodeimg{
- width: 180rpx;
- height: 88rpx;
- float: left;
- display: flex;
- flex-direction: column;
- align-items: center;
- border-radius: 14rpx;
- image{
- width: 180rpx;
- height: 88rpx;
- border-radius: 14rpx;
- }
- }
- .vscod-refresh{
- width: 70rpx;
- float: right;
- display: flex;
- flex-direction: column;
- align-items: center;
- .icon-shuaxin{
- font-size: 48rpx;
- color: #333333;
- }
- .ref-text{
- font-size: 24rpx;
- color: #333333;
- }
- }
- }
- .input{
- width: 100%;
- height: 100%;
- background: #F7F7F7;
- font-size: $font-size-28;
- line-height: 40rpx;
- color: #333333;
- border-radius: 14rpx;
- }
- }
- }
- .login-btn{
- width: 702rpx;
- height: 88rpx;
- border-radius: 14rpx;
- font-size: $font-size-28;
- line-height: 88rpx;
- color: #FFFFFF;
- margin: 0 auto;
- text-align: center;
- background: $btn-confirm;
- margin-top: 100rpx;
- }
- .model-authorization{
- width: 100%;
- height: 100%;
- position: fixed;
- top: 0;
- left: 0;
- z-index: 999;
- .authorization{
- width: 518rpx;
- height: 320rpx;
- position: absolute;
- background: rgba(255,255,255,.7);
- left: 0;
- right: 0;
- bottom: 0;
- top: 0;
- margin: auto;
- .to-btn{
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- margin: auto;
- width: 70%;
- height: 88rpx;
- font-size: $font-size-28;
- line-height: 88rpx;
- color: #FFFFFF;
- text-align: center;
- border-radius: 44rpx;
- }
- }
- }
- }
- </style>
|