Browse Source

系统通知样式优化

首页bug修复
pull/97/head
pengda 1 month ago
parent
commit
fa0d829122
  1. 6
      src/components/GuipToolTip.vue
  2. 81
      src/components/SliderMenu.vue

6
src/components/GuipToolTip.vue

@ -1,5 +1,5 @@
<template> <template>
<el-tooltip <el-tooltip :value="isShow" :manual="manual"
v-bind="mergedProps" v-bind="mergedProps"
:disabled="disabled" :disabled="disabled"
:visible="controlledVisible" :visible="controlledVisible"
@ -44,7 +44,9 @@
hideAfterClick: { hideAfterClick: {
type: Boolean, type: Boolean,
default: false default: false
} },
//
isShow: Boolean,
}, },
data() { data() {
return { return {

81
src/components/SliderMenu.vue

@ -14,6 +14,9 @@
<img v-else class="point" src="../assets/menu-open.svg" @click="changeMenuStatus(false)" alt=""> <img v-else class="point" src="../assets/menu-open.svg" @click="changeMenuStatus(false)" alt="">
</GuipToolTip> </GuipToolTip>
</div> </div>
<GuipToolTip v-if="isShowCreateBtn" :content="createNewMsg" placement="right" :isShow="isShowCreateMsg" :manual="true">
<div @click="addSite" class="create-new-site" :class="!isCollapse?'':'create-new-site-short'" >{{!isCollapse ? '创建首个网站' : '建站'}}</div>
</GuipToolTip>
<template v-for="item in menuData" > <template v-for="item in menuData" >
<el-submenu v-if="item.children" :key="item.index" :index="item.index"> <el-submenu v-if="item.children" :key="item.index" :index="item.index">
<template slot="title"> <template slot="title">
@ -64,10 +67,19 @@ export default {
}, },
data() { data() {
return { return {
// AUTH
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTI2NDY1NDUsIm5iZiI6MTc1MjY0NjU0NSwiZXhwIjoxNzU1MjM4NTQ1LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.G-Is-x9qPMiV_urOlDPQVRjfAIozySxL5EK2k82d46k',
isCollapse: false, isCollapse: false,
routerList: [], routerList: [],
currentMenuItem:'', currentMenuItem:'',
currentMenuParent:'' currentMenuParent:'',
isShowCreateBtn: false,
isShowCreateMsg: false,
addNewSiteUrl:'/agent/siteAdd',
createNewMsg: '', //
displayedText: '尽快建网站,售卖服务', //
typingIndex: 0, //
typingTimer: null
}; };
}, },
watch: { watch: {
@ -77,8 +89,58 @@ export default {
}, },
}, },
methods: { methods: {
//
getSiteNo() {
const that = this
that.$http('POST', '/agentnew/ajax_get_site_no', {
},{
headers:{
'Auth': this.token
}
}).then(response => {
if(response.status && response.data){
that.$nextTick(() => {
that.isShowCreateBtn = true
that.createSiteMsg()
})
}
}).catch(error => {
console.error(error, 'error')
})
},
createSiteMsg() {
clearInterval(this.typingTimer);
this.typingTimer = setInterval(() => {
if (this.typingIndex < this.displayedText.length) {
this.createNewMsg += this.displayedText.slice(this.typingIndex,this.typingIndex+1);
this.typingIndex++;
this.isShowCreateMsg = true;
} else {
clearInterval(this.typingTimer);
setTimeout(()=>{
this.isShowCreateMsg = false;
},1500)
setTimeout(()=>{
this.createNewMsg = '';
this.typingIndex = 0;
this.createSiteMsg()
},2000)
}
}, 200);
},
addSite(){
window.open(this.addNewSiteUrl, '_blank');
},
changeMenuStatus(flag) { changeMenuStatus(flag) {
this.isCollapse = flag; this.isCollapse = flag;
this.isShowCreateMsg = false;
this.createNewMsg = '';
this.typingIndex = 0;
clearInterval(this.typingTimer);
setTimeout(()=>{
this.createSiteMsg()
},1000)
}, },
handleOpen(key, keyPath) { handleOpen(key, keyPath) {
console.log(key, keyPath); console.log(key, keyPath);
@ -130,6 +192,7 @@ export default {
// // // //
// this.activeMenu = this.$route.path; // this.activeMenu = this.$route.path;
this.updateCurrentMenu(); this.updateCurrentMenu();
this.getSiteNo()
} }
} }
</script> </script>
@ -215,6 +278,22 @@ export default {
} }
} }
.create-new-site{
display: flex;
align-items: center;
justify-content: center;
padding: 11px 12px;
border-radius: 4px;
background: linear-gradient(290deg, #FF4143 4%, #FF768B 92%);
font-size: 14px;
color: #fff;
font-weight: bold;
margin: 0 20px;
}
.create-new-site-short{
margin: 0 5px;
}
::v-deep .el-submenu { ::v-deep .el-submenu {
// width: 16px; // width: 16px;
font-size: 12px; font-size: 12px;

Loading…
Cancel
Save