Browse Source

优化

master
陈裕财 2 years ago
parent
commit
a7c4a7d68f
  1. 8
      src/components/mdp-ui/mdp-dialog/Index.vue
  2. 22
      src/views/login/components/login.vue

8
src/components/mdp-ui/mdp-dialog/Index.vue

@ -1,10 +1,10 @@
<template>
<el-dialog :title="myTitle" append-to-body modal-append-to-body :visible.sync="visible" :fullscreen="fullscreen" :width="width?width:'70%'" :close-on-click-modal="closeOnClickModal">
<slot :visible="visible" :title="myTitle" :data="this.data?this.data:{}" :dialog="that">
<el-dialog :title="myTitle||title" append-to-body modal-append-to-body :visible.sync="visible" :fullscreen="fullscreen" :width="width?width:'70%'" :close-on-click-modal="closeOnClickModal">
<slot :visible="visible" :title="myTitle||title" :data="this.data?this.data:{}" :dialog="that">
</slot>
<template slot="footer" >
<slot name="footer" :visible="visible" :title="myTitle" :data="this.data?this.data:{}" :dialog="that" >
<slot name="footer" :visible="visible" :title="myTitle||title" :data="this.data?this.data:{}" :dialog="that" >
</slot>
</template>
@ -54,6 +54,8 @@
this.data=data
if(data && data.title){
this.myTitle=data.title
}else{
this.myTitle=this.title
}
},
close(){

22
src/views/login/components/login.vue

@ -31,7 +31,7 @@
<div class="oper">
<a @click="isRestPwd = true">忘记密码</a>
<a @click="loginByShowAccount">演示账户登录</a>
<a @click="$refs['starDialog'].open({action:loginByShowAccount})">演示账户登录</a>
<a v-if="loginForm.authType == 'password_display_userid' " @click="loginForm.authType = 'sms'">手机号登录</a>
<a v-if="loginForm.authType == 'sms' " @click="loginForm.authType = 'password_display_userid' ">密码登录</a>
</div>
@ -40,7 +40,7 @@
<el-divider content-position="center">第三方登录方式</el-divider>
<div class="other">
<el-popover trigger="manual" v-model="wxLoginCodeVisible" placement="top-start"> <div id="login_container"></div>
<img slot="reference" src="@/assets/image/module/weixin.png" @click="weixinLogin">
<img slot="reference" src="@/assets/image/module/weixin.png" @click="$refs['starDialog'].open({action:weixinLogin})">
<el-button type="text" @click="wxLoginCodeVisible=false" icon="el-icon-close">关闭</el-button><el-button type="text" @click="weixinLogin" icon="el-icon-refresh"></el-button>
</el-popover>
</div>
@ -76,7 +76,16 @@
</el-button>
</div>
</div>
<mdp-dialog ref="starDialog" width="600px" title="hi~同学,来支持一下【唛盟开源项目】吧,为项目点个Star!">
<el-row>
<el-link href="https://gitee.com/qingqinkj218/collections/375320" target="_blank" type="primary" icon="el-icon-star-off">唛盟项目</el-link>
</el-row>
<template #footer="{visible,data,dialog}">
<el-row slot="footer">
<el-button @click="dialog.close()">取消</el-button><el-button type="primary" @click="doLoginByAction(data.action)">已点赞继续登陆</el-button>
</el-row>
</template>
</mdp-dialog>
</div>
</template>
@ -275,7 +284,6 @@ export default {
loginParams.branchId=params.branchId
}
this.$store.dispatch("LoginByUserloginid",loginParams).then(res => {
this.loading = false
if(res.data.tips.isOk==true){
this.loading = true;
@ -363,7 +371,10 @@ export default {
})
},
doLoginByAction(action){
this.$refs['starDialog'].close();
action();
},
afterQRScan() {
// const hash = window.location.hash.slice(1)
// const hashObj = getQueryObject(hash)
@ -383,6 +394,7 @@ export default {
// }
},
loginByShowAccount(){
this.loading = true
var loginParams={ }
loginParams.userloginid="demo-branch-01"

Loading…
Cancel
Save