123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <template>
- <view class="container login" v-if="isWxAuthorize">
- <view class="login-main">
- <image class="logo" src="../../static/login-logo@3x.png" mode=""></image>
- <text class="logo-text">生美/医美采购服务平台</text>
- </view>
- <view class="login-form">
- <view class="login-input">
- <input type="text"
- v-model="accountNumber"
- maxlength="30"
- class="input"
- placeholder="请输入邮箱/手机号"
- />
- </view>
- <view class="login-input">
- <input v-show="isShowEye" type="text" v-model="password" maxlength="18" class="input" placeholder="请输入密码" autocomplete="new-password"/>
- <input v-show="!isShowEye" type="password" v-model="password" :password="true" maxlength="18" class="input" placeholder="请输入密码" autocomplete="new-password"/>
- <view class="iconfont" :class="isShowEye ? iconEyen : iconEyes" @click="passwordClick"></view>
- </view>
- <view class="login-input link">
- <view class="login-reg" @click.stop="this.$api.navigateTo('/pages/login/register')">免费注册</view>
- <view class="login-pwd" @click.stop="this.$api.navigateTo('/pages/login/password')">忘记密码?</view>
- </view>
- </view>
- <view class="login-btn" @click="confirmLogin">登录</view>
- <view class="login-btn-last" @click.stop="this.$api.navigateTo(`/pages/login/login?data=${getOption}`)">邀请码登录</view>
- <view class="login-tel">客服热线:0755-22907771</view>
- </view>
- </template>
- <script>
- import { mapState,mapMutations } from 'vuex';
- import authorize from '@/common/config/authorize.js'
- import wxLogin from "@/common/config/wxLogin.js"
- import { organizationLogin } from '@/api/use.js'
- export default{
- data() {
- return{
- isShowEye:false,
- iconEyes:'icon-yanjing_yincang_o',
- iconEyen:'icon-yanjing_xianshi_o',
- accountNumber:'', //用户登录账号
- password:'', //用户登录密码
- toestText:'',
- telPhone:'',
- loginType:'', //跳转类型
- alertText:'',
- listType: '',
- listVal: '',
- detilType:'',
- id:'', //商品ID
- getOption:'' //页面传递参数
- }
- },
- onLoad(option) {
- this.getOption = JSON.stringify(option)
- },
- computed: {
- ...mapState(['hasLogin','userInfo','isWxAuthorize'])
- },
- methods:{
- ...mapMutations(['login']),
- confirmLogin(){
- if( this.accountNumber == ''){
- this.$util.msg('请输入账户名',2000)
- return
- }
- if( this.password == ''){
- this.$util.msg('请输入密码',2000)
- return
- }
- authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
- if(wxResponse == 1){
- this.OrganizationLogin()
- }else{
- this.$api.navigateTo('/pages/authorization/authorization?type=0')
- }
- })
- },
- OrganizationLogin(){
- organizationLogin({mobileOrEmail:this.accountNumber,password:this.password,source:'www'}).then(response =>{
- if(response.code == '0' ){
- this.storeUpdataeStatus(response.data)
- this.$api.navigateTo(`/pages/login/bindwechat?data=${JSON.stringify(this.getOption)}&codeType=${response.code}`)
- }else if(response.code == '4'){
- this.storeUpdataeStatus(response.data)
- this.$api.navigateTo(`/pages/login/bindemail?data=${JSON.stringify(this.getOption)}&codeType=${response.code}`)
- }else if(response.code == '-3'){
- this.storeUpdataeStatus(response.data)
- this.$util.modal('',response.msg,'前往修改','',false,() =>{
- this.$api.navigateTo('/pages/login/apply')
- })
- }else{
- this.$util.msg(response.msg,2000);
- }
- })
- },
- storeUpdataeStatus(data){
- let user_key = {
- clubID:data.clubID,
- shopID:data.shopID,
- userID:data.userID,
- bindMobile:data.bindMobile,
- }
- uni.setStorageSync('token',data.token)
- this.$store.commit('updateStatus',user_key)
- this.login(data);
- },
- passwordClick() { //密码显隐操作
- this.isShowEye = !this.isShowEye;
- },
- },
- onShow() {
- authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
- if(wxResponse == 1){
- wxLogin.wxLoginAuthorize()
- }else{
- this.$api.navigateTo('/pages/authorization/authorization?type=0')
- }
- })
- }
- }
- </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;
- flex-direction: column;
- align-items: center;
- height: 198rpx;
- padding: 140rpx 0 60rpx 0;
- .logo{
- width: 138rpx;
- height: 118rpx;
- display: block;
- }
- .logo-text{
- font-size: 30rpx;
- line-height: 44rpx;
- color: $color-system;
- font-weight: 600;
- margin-top: 20rpx;
- }
- }
- .login-input{
- width: 654rpx;
- height: 40rpx;
- padding: 24rpx;
- margin: 0 auto;
- margin-bottom: 20rpx;
- background: #F7F7F7;
- border-radius: 14rpx;
- position: relative;
- .input{
- width: 100%;
- height: 100%;
- background: #F7F7F7;
- font-size: $font-size-28;
- line-height: 40rpx;
- color: #333333;
- border-radius: 14rpx;
- }
- .iconfont{
- position: absolute;
- right: 0;
- top: 0;
- font-size: 44rpx;
- color: #999999;
- font-weight: bold;
- z-index: 99;
- width: 96rpx;
- height: 96rpx;
- line-height: 96rpx;
- text-align: center;
- }
- &.link{
- background: #FFFFFF;
- margin-bottom: 40rpx;
- padding: 0 24rpx;
- line-height: 40rpx;
- font-size: $font-size-28;
- .login-reg{
- float: left;
- color: $color-system;
- }
- .login-pwd{
- float: right;
- color: $text-color;
- }
- }
- }
- .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;
- }
- .login-btn-last{
- width: 702rpx;
- height: 86rpx;
- border-radius: 14rpx;
- font-size: $font-size-28;
- line-height: 88rpx;
- color: $color-system;
- margin: 0 auto;
- text-align: center;
- border: 1px solid $color-system;
- margin-top: 20rpx;
- }
- .login-tel{
- width: 702rpx;
- font-size: $font-size-28;
- line-height: 80rpx;
- margin: 0 auto;
- color: $text-color;
- text-align: center;
- margin-top: 150rpx;
- }
- .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>
|