优化代码

This commit is contained in:
wuxw 2025-07-03 23:40:40 +08:00
parent 0a41b92eb0
commit 0f149ba158

View File

@ -17,8 +17,9 @@
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="c" v-for="(c,index) in communitys" :key="index">{{ c.name }}</el-dropdown-item>
<el-dropdown-item command="moreCommunity" class="moreCommunity">{{ $t('layout.moreCommunity') }}</el-dropdown-item>
<el-dropdown-item :command="c" v-for="(c, index) in communitys" :key="index">{{ c.name }}</el-dropdown-item>
<el-dropdown-item command="moreCommunity" class="moreCommunity">{{ $t('layout.moreCommunity')
}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dropdown @command="handleCommand">
@ -69,15 +70,15 @@
<router-view />
</el-main>
</el-container>
<more-community ref="moreCommunity"/>
<more-community ref="moreCommunity" />
</el-container>
</template>
<script>
import { _getMenuCatalog, getMenuTree } from '@/api/user/menuApi'
import { getStoreInfo } from "@/api/user/indexApi"
import { deepCopy,setCurrentCommunity } from "@/utils/vc"
import {getCommunityName,_loadCommunityInfo} from '@/api/community/communityApi'
import { deepCopy, setCurrentCommunity } from "@/utils/vc"
import { getCommunityName, _loadCommunityInfo } from '@/api/community/communityApi'
import moreCommunity from '@/components/community/moreCommunity.vue'
export default {
@ -94,8 +95,8 @@ export default {
activeSubMenu: 'communityList',
searchText: '',
username: '',
curCommunityName:'',
communitys:[],
curCommunityName: '',
communitys: [],
storeInfo: {
storeTypeCd: '',
storeId: ''
@ -111,12 +112,12 @@ export default {
this.curCommunityName = getCommunityName()
this.loadCommunity()
},
components:{
components: {
moreCommunity
},
methods: {
async loadCommunity(){
const {communitys} = await _loadCommunityInfo()
async loadCommunity() {
const { communitys } = await _loadCommunityInfo()
this.communitys = communitys
},
async _loadStoreInfo() {
@ -152,17 +153,23 @@ export default {
_changeMenuCatalog(_catalog) {
this.activeMenu = _catalog.caId;
// if (_catalog.caId === '1') {
// vc.jumpToPage('/#/pages/mall/product');
// }
// if (vm._showModelDiv(_catalog)) {
// return;
// }
// if (_catalog.url != '#') {
// //vc.jumpToPage(_catalog.url);
// window.open(_catalog.url);
// //return;
// }
if (_catalog.caId === '1') {
this.$router.push('/#/pages/mall/product');
}
if (_catalog.url == 'IOT') {
this._navJumpToIot();
return;
}
if (_catalog.url == 'MALL') {
//
this.jumpToMall('/');
return;
}
console.log(_catalog)
if (_catalog.url != '#') {
this._gotoPage(_catalog.url, _catalog.name)
//return;
}
this.loadMenuTree(_catalog)
},
handleCommand(command) {
@ -178,8 +185,8 @@ export default {
localStorage.setItem('language', command)
}
},
changeCommunity(community){
if(community == 'moreCommunity'){
changeCommunity(community) {
if (community == 'moreCommunity') {
this.$refs.moreCommunity.open()
return
}
@ -334,7 +341,7 @@ export default {
.app-main {
background-color: #f5f7fa;
height: calc(100vh - 60px) ;
height: calc(100vh - 60px);
padding: 0px;
}
@ -421,11 +428,12 @@ export default {
}
}
.moreCommunity{
.moreCommunity {
font-weight: 600;
color: #212529;
font-size: 12px;
}
.vc-menu-main ul li {
height: 45px;
line-height: 45px;
@ -507,4 +515,4 @@ export default {
bottom: 0;
width: 100px;
}
</style>
</style>