Browse Source

侧边栏、顶部、底部展示逻辑

zq-develop
zq 3 months ago
parent
commit
19f23f7a8b
  1. 70
      src/App.vue
  2. 1
      src/assets/header-drop.svg
  3. BIN
      src/assets/header-icon.png
  4. BIN
      src/assets/header-logo.png
  5. 1
      src/assets/menu-close.svg
  6. 1
      src/assets/menu-open.svg
  7. 1
      src/assets/register/register-top-close.svg
  8. 1
      src/assets/register/register-top-left.svg
  9. 1
      src/assets/register/step1_ing.svg
  10. 1
      src/assets/register/step2_ing.svg
  11. 1
      src/assets/register/step2_null.svg
  12. 1
      src/assets/register/step3_ing.svg
  13. 1
      src/assets/register/step3_null.svg
  14. 1
      src/assets/register/step_success.svg
  15. 77
      src/components/Breadcrumb.vue
  16. 45
      src/components/Header.vue
  17. 194
      src/components/SliderMenu.vue
  18. 2
      src/main.js
  19. 41
      src/router/index.js
  20. 30
      src/store/index.js
  21. 3
      src/style/franchise.scss
  22. 21
      src/style/theme/common.scss
  23. 246
      src/views/Register.vue
  24. 2
      src/views/UserPosts.vue
  25. 2
      src/views/elementGroups.vue
  26. 6
      vue.config.js

70
src/App.vue

@ -7,18 +7,20 @@
</nav> --> </nav> -->
<!-- <router-view/> --> <!-- <router-view/> -->
<el-container> <el-container>
<el-header> <el-header style="height: 62px;" v-if="showHeader">
<Header></Header> <Header ></Header>
</el-header> </el-header>
<el-container> <el-container :class="(showHeader ? 'short-container': '')">
<SliderMenu v-if="showSidebar"></SliderMenu> <SliderMenu v-if="showSidebar"></SliderMenu>
<el-container> <el-container>
<!-- 面包屑导航 -->
<Breadcrumb />
<el-main> <el-main>
<router-view/> <router-view/>
</el-main> </el-main>
<el-footer v-if="showFooter"> <!-- <el-footer v-if="showFooter">
<Footer></Footer> <Footer></Footer>
</el-footer> </el-footer> -->
</el-container> </el-container>
</el-container> </el-container>
@ -27,22 +29,44 @@
</template> </template>
<script> <script>
import SliderMenu from '@/components/SliderMenu.vue'; import SliderMenu from '@/components/SliderMenu.vue';
import Footer from '@/components/Footer.vue'; // import Footer from '@/components/Footer.vue';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import Header from './components/Header.vue'; import Header from './components/Header.vue';
import Breadcrumb from './components/Breadcrumb.vue';
export default { export default {
data() { data() {
return { return {
isCollapse: true isCollapse: true,
menuData: [
{
index: '1',
title: '父级菜单1',
icon: 'el-icon-location',
children: [
{ index: '1-1', title: '子级菜单1-1', path: '/' },
{ index: '1-2', title: 'ui页面', path: '/ui' }
]
},
{
index: '2',
title: '父级菜单2',
icon: 'el-icon-menu',
children: [
{ index: '2-1', title: '子级菜单2-1', path: '/about' },
{ index: '2-2', title: '加盟耶main', path: '/franchise' }
]
}
]
}; };
}, },
components: { components: {
SliderMenu, SliderMenu,
Footer, // Footer,
Header Header,
Breadcrumb
}, },
computed: { computed: {
...mapState(['showSidebar,showFooter']) // VuexshowSidebar ...mapState(['showSidebar','showFooter','showHeader']) // VuexshowSidebar
}, },
methods: { methods: {
handleOpen(key, keyPath) { handleOpen(key, keyPath) {
@ -54,18 +78,8 @@ export default {
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
body{
font-family: Microsoft YaHei UI;
font-size: 14px;
margin: 0;
width: 100vw;
height: 100vh;
p{
margin: 0;
padding: 0;
}
}
#app { #app {
font-family: Avenir, Helvetica, Arial, sans-serif; font-family: Avenir, Helvetica, Arial, sans-serif;
font-family: Microsoft YaHei UI; font-family: Microsoft YaHei UI;
@ -74,6 +88,18 @@ body{
text-align: center; text-align: center;
color: #2c3e50; color: #2c3e50;
height: 100%; height: 100%;
background: #F5F7FA;
}
.short-container{
height: calc(100vh - 62px);
}
::v-deep .el-container .el-main{
// padding: 12px;
}
::v-deep .el-header{
height:62px;
padding: 8px 32px;
background: linear-gradient(270deg, #4EA4F3 0%, #3D85EA 100%);
} }
nav { nav {

1
src/assets/header-drop.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><g><g><path d="M2.41612,5.500656L8,10.15389L13.5838,5.500686L13.5839,5.500656Q13.6715,5.427647,13.7787,5.388823Q13.886,5.35,14,5.35Q14.064,5.35,14.1268,5.36249Q14.1896,5.374979,14.2487,5.399478Q14.3079,5.423978,14.3611,5.459545Q14.4143,5.495112,14.4596,5.540381Q14.5049,5.585649,14.5405,5.638879Q14.576,5.69211,14.6005,5.751256Q14.625,5.810402,14.6375,5.873191Q14.65,5.9359806,14.65,6Q14.65,6.14468,14.5886,6.275701Q14.5273,6.406721,14.4161,6.499343L8.41612,11.49934Q8.37265,11.53557,8.32357,11.56374Q8.27449,11.59191,8.22128,11.611180000000001Q8.16807,11.63044,8.11233,11.64022Q8.05659,11.65,8,11.65Q7.94341,11.65,7.88767,11.64022Q7.83193,11.63044,7.77872,11.611180000000001Q7.72551,11.59191,7.67643,11.56374Q7.62735,11.53557,7.58388,11.49934L1.58388,6.499344Q1.472734,6.406722,1.411367,6.275701Q1.35,6.14468,1.35,6Q1.35,5.9359806,1.36249,5.873191Q1.374979,5.810402,1.399478,5.751256Q1.423978,5.69211,1.4595449999999999,5.638879Q1.495112,5.585649,1.540381,5.540381Q1.585649,5.495112,1.638879,5.459545Q1.69211,5.423978,1.751256,5.399478Q1.810402,5.374979,1.873191,5.36249Q1.9359806,5.35,2,5.35Q2.114044,5.35,2.221276,5.388824Q2.328509,5.427647,2.41612,5.500656Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
src/assets/header-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
src/assets/header-logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

1
src/assets/menu-close.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_140_48517/143_52355"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_140_48517/143_52355)"><g><path d="M12.867188,1.546875Q13.51563,1.546875,13.51563,2.195313L13.51563,13.867175Q13.51563,14.515675,12.867188,14.515675Q12.21875,14.515675,12.21875,13.867175L12.21875,2.195313Q12.21875,1.546875,12.867188,1.546875Z" fill="#BABDC2" fill-opacity="1"/></g><g><path d="M9.4297275,13.4191853515625L3.8264475,8.0312653515625L9.4297275,2.6432953515625C9.5537475,2.5251003515625,9.6242675,2.3614863515625,9.625037500000001,2.1901673515624998C9.625037500000001,1.6186050515625,8.906287500000001,1.3323553515625,8.4862875,1.7370423515625L2.8830075,7.1240753515625C2.3619145,7.6251653515625,2.3619145,8.4373553515625,2.8830075,8.9384453515625L8.4862875,14.3263853515625C8.906447499999999,14.7306853515625,9.625037500000001,14.4443853515625,9.625037500000001,13.8732853515625C9.6245275,13.7016853515625,9.5539775,13.5376853515625,9.4297275,13.4191853515625Z" fill="#BABDC2" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

1
src/assets/menu-open.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="20" height="20" viewBox="0 0 20 20"><defs><clipPath id="master_svg0_143_53104/143_53064"><rect x="20" y="0" width="20" height="20" rx="0"/></clipPath></defs><g transform="matrix(-1,0,0,1,40,0)" clip-path="url(#master_svg0_143_53104/143_53064)"><g><path d="M36.0839845,1.93359375Q36.8945275,1.93359375,36.8945275,2.74414075L36.8945275,17.333993749999998Q36.8945275,18.14449375,36.0839845,18.14449375Q35.2734375,18.14449375,35.2734375,17.333993749999998L35.2734375,2.74414075Q35.2734375,1.93359375,36.0839845,1.93359375Z" fill="#626573" fill-opacity="1"/></g><g><path d="M31.787154375,16.7742703125L24.783054375,10.0392903125L31.787154375,3.3043303125000003C31.942184375,3.1565903125,32.030334375,2.9520703125,32.031294375,2.7379233125C32.031294375,2.0234699125,31.132864375,1.6656573125,30.607864375,2.1715163125L23.603759375,8.9053103125C22.952392375,9.531670312500001,22.952392375,10.5469103125,23.603759375,11.1732703125L30.607864375,17.9082703125C31.133054375,18.4134703125,32.031294375,18.0556703125,32.031294375,17.3418703125C32.030654375,17.127270312500002,31.942474375,16.9222703125,31.787154375,16.7742703125Z" fill="#626573" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

1
src/assets/register/register-top-close.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_127_41158/19_33087"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_127_41158/19_33087)"><g><path d="M11.937545073699951,3.359494684814453C11.937545073699951,3.359494684814453,8.000045073699951,7.296995684814453,8.000045073699951,7.296995684814453C8.000045073699951,7.296995684814453,4.062544073699951,3.359494684814453,4.062544073699951,3.359494684814453C3.9582100736999513,3.265827684814453,3.841044073699951,3.218994484814453,3.7110440736999513,3.218994484814453C3.5810440736999514,3.218994484814453,3.466377073699951,3.268494484814453,3.367044073699951,3.367494684814453C3.2677104736999514,3.466494684814453,3.218210273699951,3.5811606848144533,3.2185436736999513,3.711494684814453C3.218876973699951,3.841827684814453,3.2657103736999513,3.9589946848144533,3.359044073699951,4.062994684814453C3.359044073699951,4.062994684814453,7.296545073699951,8.000495684814453,7.296545073699951,8.000495684814453C7.296545073699951,8.000495684814453,3.359044073699951,11.937995684814453,3.359044073699951,11.937995684814453C3.223710373699951,12.073325684814453,3.179377173699951,12.234825684814453,3.226043773699951,12.422495684814454C3.2727104736999513,12.610165684814453,3.3873770736999513,12.727325684814453,3.5700440736999512,12.773995684814453C3.752710073699951,12.820665684814454,3.916710073699951,12.776325684814454,4.062043073699951,12.640995684814452C4.062043073699951,12.640995684814452,7.999545073699951,8.703495684814452,7.999545073699951,8.703495684814452C7.999545073699951,8.703495684814452,11.93704507369995,12.640995684814452,11.93704507369995,12.640995684814452C12.041375073699951,12.734665684814454,12.158545073699951,12.781495684814454,12.288545073699952,12.781495684814454C12.418545073699951,12.781495684814454,12.533205073699952,12.731995684814454,12.632545073699951,12.632995684814453C12.731875073699952,12.533995684814453,12.781375073699952,12.419325684814453,12.781045073699952,12.288995684814454C12.78070507369995,12.158665684814453,12.73387507369995,12.041495684814453,12.64054507369995,11.937495684814452C12.64054507369995,11.937495684814452,8.70304507369995,7.999995684814453,8.70304507369995,7.999995684814453C8.70304507369995,7.999995684814453,12.64054507369995,4.062494684814453,12.64054507369995,4.062494684814453C12.775875073699952,3.927160684814453,12.82020507369995,3.765660684814453,12.773545073699951,3.577994684814453C12.72687507369995,3.3903276848144532,12.609705073699951,3.2731610848144532,12.422045073699952,3.226494384814453C12.234375073699951,3.179827784814453,12.07287507369995,3.224160984814453,11.937545073699951,3.359494684814453C11.937545073699951,3.359494684814453,11.937545073699951,3.359494684814453,11.937545073699951,3.359494684814453C11.937545073699951,3.359494684814453,11.937545073699951,3.359494684814453,11.937545073699951,3.359494684814453Z" fill="#626573" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

1
src/assets/register/register-top-left.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 32 KiB

1
src/assets/register/step1_ing.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><rect x="0" y="0" width="24" height="24" rx="12" fill="#006AFF" fill-opacity="1"/><rect x="1" y="1" width="22" height="22" rx="11" fill-opacity="0" stroke-opacity="1" stroke="#006AFF" fill="none" stroke-width="2"/><g><path d="M11.7915,17L11.7915,7.94238Q11.47705,8.25684,10.72852,8.64648Q9.97998,9.03613,9.34424,9.19336L9.34424,7.88086Q10.18506,7.64844,11.14209,7.13916Q12.09912,6.62988,12.61182,6.178710000000001L13.11768,6.178710000000001L13.11768,17L11.7915,17Z" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 668 B

1
src/assets/register/step2_ing.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><rect x="0" y="0" width="24" height="24" rx="12" fill="#006AFF" fill-opacity="1"/><rect x="1" y="1" width="22" height="22" rx="11" fill-opacity="0" stroke-opacity="1" stroke="#006AFF" fill="none" stroke-width="2"/><g><path d="M13.72607,9.18652Q13.72607,8.33203,13.18604,7.84326Q12.646,7.35449,11.71631,7.35449Q11.06006,7.35449,10.39014,7.68945Q9.72021,8.02441,9.13916,8.64648L9.13916,7.34766Q9.65869,6.80762,10.31836,6.52051Q10.97803,6.2334,11.8667,6.2334Q13.30225,6.2334,14.17725,7.00244Q15.05225,7.77148,15.05225,9.08398Q15.05225,10.25293,14.51562,11.10742Q13.979,11.96191,12.68018,12.85742Q11.354,13.7734,10.90625,14.1699Q10.4585,14.5664,10.28076,14.9287Q10.10303,15.291,10.10303,15.8105L15.3667,15.8105L15.3667,17L8.7085,17L8.7085,16.473599999999998Q8.7085,15.5576,8.95801,14.9185Q9.20752,14.2793,9.78174,13.6743Q10.35596,13.0693,11.57275,12.22168Q12.81689,11.34668,13.27148,10.68701Q13.72607,10.027339999999999,13.72607,9.18652Z" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

1
src/assets/register/step2_null.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><rect x="0" y="0" width="24" height="24" rx="12" fill="#FFFFFF" fill-opacity="1"/><rect x="1" y="1" width="22" height="22" rx="11" fill-opacity="0" stroke-opacity="1" stroke="#BABDC2" fill="none" stroke-width="2"/><g><path d="M13.72607,9.18652Q13.72607,8.33203,13.18604,7.84326Q12.646,7.35449,11.71631,7.35449Q11.06006,7.35449,10.39014,7.68945Q9.72021,8.02441,9.13916,8.64648L9.13916,7.34766Q9.65869,6.80762,10.31836,6.52051Q10.97803,6.2334,11.8667,6.2334Q13.30225,6.2334,14.17725,7.00244Q15.05225,7.77148,15.05225,9.08398Q15.05225,10.25293,14.51562,11.10742Q13.979,11.96191,12.68018,12.85742Q11.354,13.7734,10.90625,14.1699Q10.4585,14.5664,10.28076,14.9287Q10.10303,15.291,10.10303,15.8105L15.3667,15.8105L15.3667,17L8.7085,17L8.7085,16.473599999999998Q8.7085,15.5576,8.95801,14.9185Q9.20752,14.2793,9.78174,13.6743Q10.35596,13.0693,11.57275,12.22168Q12.81689,11.34668,13.27148,10.68701Q13.72607,10.027339999999999,13.72607,9.18652Z" fill="#626573" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

1
src/assets/register/step3_ing.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><rect x="0" y="0" width="24" height="24" rx="12" fill="#006AFF" fill-opacity="1"/><rect x="1" y="1" width="22" height="22" rx="11" fill-opacity="0" stroke-opacity="1" stroke="#006AFF" fill="none" stroke-width="2"/><g><path d="M8.87256,15.2295Q9.95947,16.0703,11.32666,16.0703Q12.42041,16.0703,13.05957,15.5337Q13.698730000000001,14.9971,13.698730000000001,14.0947Q13.698730000000001,12.08496,10.8208,12.08496L9.93896,12.08496L9.93896,10.977540000000001L10.77979,10.977540000000001Q13.32959,10.977540000000001,13.32959,9.09082Q13.32959,7.34766,11.38135,7.34766Q10.26709,7.34766,9.28271,8.09961L9.28271,6.834960000000001Q10.32178,6.2334,11.70947,6.2334Q13.06299,6.2334,13.8833,6.94092Q14.703610000000001,7.64844,14.703610000000001,8.77637Q14.703610000000001,10.85449,12.58447,11.44922L12.58447,11.47656Q13.73291,11.59961,14.39941,12.28662Q15.06592,12.97363,15.06592,13.999Q15.06592,15.4277,14.03711,16.3027Q13.0083,17.1777,11.29932,17.1777Q9.79541,17.1777,8.87256,16.6172L8.87256,15.2295Z" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

1
src/assets/register/step3_null.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><rect x="0" y="0" width="24" height="24" rx="12" fill="#FFFFFF" fill-opacity="1"/><rect x="1" y="1" width="22" height="22" rx="11" fill-opacity="0" stroke-opacity="1" stroke="#BABDC2" fill="none" stroke-width="2"/><g><path d="M8.87256,15.2295Q9.95947,16.0703,11.32666,16.0703Q12.42041,16.0703,13.05957,15.5337Q13.698730000000001,14.9971,13.698730000000001,14.0947Q13.698730000000001,12.08496,10.8208,12.08496L9.93896,12.08496L9.93896,10.977540000000001L10.77979,10.977540000000001Q13.32959,10.977540000000001,13.32959,9.09082Q13.32959,7.34766,11.38135,7.34766Q10.26709,7.34766,9.28271,8.09961L9.28271,6.834960000000001Q10.32178,6.2334,11.70947,6.2334Q13.06299,6.2334,13.8833,6.94092Q14.703610000000001,7.64844,14.703610000000001,8.77637Q14.703610000000001,10.85449,12.58447,11.44922L12.58447,11.47656Q13.73291,11.59961,14.39941,12.28662Q15.06592,12.97363,15.06592,13.999Q15.06592,15.4277,14.03711,16.3027Q13.0083,17.1777,11.29932,17.1777Q9.79541,17.1777,8.87256,16.6172L8.87256,15.2295Z" fill="#626573" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

1
src/assets/register/step_success.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><g><rect x="0" y="0" width="24" height="24" rx="12" fill="#F2F7FF" fill-opacity="1"/><rect x="1" y="1" width="22" height="22" rx="11" fill-opacity="0" stroke-opacity="0.6000000238418579" stroke="#006AFF" fill="none" stroke-width="2"/></g><g><g><path d="M16.432885521697997,8.953701397705078L15.865675521697998,8.477755397705078C15.552345521697998,8.215102697705078,15.085405521697998,8.255890497705078,14.822365521697998,8.568890397705077L10.828715521697998,13.325701397705078L9.025695521697997,11.773851397705078C8.720645521697998,11.511291397705078,8.261738521697998,11.540481397705078,7.992420521697998,11.839591397705078L7.495612521697998,12.391351397705078C7.492442521697998,12.394871397705078,7.489306521697998,12.398421397705079,7.486204521697998,12.402001397705078C7.218457821697998,12.711101397705079,7.251976021697998,13.178721397705079,7.561069521697998,13.446471397705078L10.506635521697998,15.998011397705078C10.510445521697998,16.001311397705077,10.514295521697997,16.004581397705078,10.518175521697998,16.00780139770508C10.832675521697999,16.26917139770508,11.299515521697998,16.22611139770508,11.560885521697998,15.911611397705078L11.835815521697999,15.580801397705077L16.523985521698,9.996721397705079L16.524275521697998,9.996701397705078C16.787125521697998,9.683441397705078,16.746275521697996,9.216408397705077,16.432885521697997,8.953701397705078Z" fill-rule="evenodd" fill="#006AFF" fill-opacity="0.699999988079071"/></g></g></g></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

77
src/components/Breadcrumb.vue

@ -0,0 +1,77 @@
<template>
<el-breadcrumb v-if="showBreadcrumb" separator="/">
<el-breadcrumb-item
v-for="(item, index) in breadcrumbList"
:key="index"
>
<i v-if="item.icon" :class="item.icon"></i>
<span>{{ item.title }}</span>
</el-breadcrumb-item>
</el-breadcrumb>
</template>
<script>
export default {
data() {
return {
breadcrumbList: [],
showBreadcrumb: false //
};
},
watch: {
$route() {
this.updateBreadcrumb();
}
},
mounted() {
this.updateBreadcrumb();
},
methods: {
updateBreadcrumb() {
const currentPath = this.$route.path;
//
if(!this.$parent.menuData)return
const isSubPage = this.isSubPage(currentPath);
this.showBreadcrumb = isSubPage;
if (isSubPage) {
this.breadcrumbList = this.getBreadcrumbList(currentPath);
} else {
this.breadcrumbList = [];
}
},
isSubPage(path) {
console.log(this.$parent.menuData,'this.$parent.menuData==');
//
for (const menu of this.$parent.menuData) {
for (const subMenu of menu.children) {
if (subMenu.path === path) {
return true;
}
}
}
return false;
},
getBreadcrumbList(path) {
const breadcrumbList = [];
//
for (const menu of this.$parent.menuData) {
for (const subMenu of menu.children) {
if (subMenu.path === path) {
breadcrumbList.push({ title: menu.title, icon: menu.icon });
breadcrumbList.push({ title: subMenu.title });
break;
}
}
}
return breadcrumbList;
}
}
};
</script>
<style scoped>
.el-breadcrumb {
margin-bottom: 20px;
}
</style>

45
src/components/Header.vue

@ -1,10 +1,47 @@
<template> <template>
<div class="header-wrap"> <div class="header-wrap min-width">
<div class="header-logo"> <div class="header-logo">
<img src="../assets/franchise1/logo.png" alt=""> <img src="../assets/header-logo.png" alt="">
</div> </div>
<div class="header-right"> <div class="header-right flex">
<div class="right-item">权限设置</div>
<div class="right-item">岗位设置</div>
<div class="right-item flex">
<img class="right-item-icon" src="../assets/header-icon.png" alt="">
<span>学术论文出版</span>
<img src="../assets/header-drop.svg" alt="">
</div>
</div> </div>
</div> </div>
</template> </template>
<style lang="scss" scoped>
.flex{
display: flex;
}
.header-wrap{
color: #FFFFFF;
display: flex;
justify-content: space-between;
width: 100%;
height: 100%;
.header-logo{
img{
height: 46px;
}
}
.header-right{
width: 362px;
justify-content: space-between;
.right-item-icon{
width: 36px;
height: 36px;
}
.right-item-icon +span{
display: inline-block;
margin: 0 6px 0 12px;
}
}
}
</style>

194
src/components/SliderMenu.vue

@ -1,59 +1,153 @@
<template> <template>
<el-menu default-active="1-4-1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" <el-menu :default-active="activeMenu" class="el-menu-vertical-demo" @select="handleSelect" :collapse="isCollapse"
:collapse="isCollapse"> :default-openeds="['1', '2']">
<el-submenu index="1"> <div class="menu-top">
<template slot="title"> <span v-show="!isCollapse">
<i class="el-icon-location"></i> 导航
<span slot="title">导航一</span> </span>
</template> <img v-if="!isCollapse" src="../assets/menu-close.svg" @click="changeMenuStatus(true)" alt="">
<el-menu-item-group> <img v-else src="../assets/menu-open.svg" @click="changeMenuStatus(false)" alt="">
<span slot="title">分组一</span> </div>
<el-menu-item index="1-1">选项1</el-menu-item> <el-submenu v-for="item in menuData" :key="item.index" :index="item.index">
<el-menu-item index="1-2">选项2</el-menu-item> <template slot="title">
</el-menu-item-group> <i :class="item.icon"></i>
<el-menu-item-group title="分组2"> <span>{{ item.title }}</span>
<el-menu-item index="1-3">选项3</el-menu-item> </template>
</el-menu-item-group> <el-menu-item style="padding: 0 22px;" v-for="subItem in item.children" :key="subItem.index"
<el-submenu index="1-4"> :index="subItem.index" @click="handleMenuItemClick(subItem)">
<span slot="title">选项4</span> {{ subItem.title }}
<el-menu-item index="1-4-1">选项1</el-menu-item> </el-menu-item>
</el-submenu> </el-submenu>
</el-submenu> </el-menu>
<el-menu-item index="2">
<i class="el-icon-menu"></i>
<span slot="title">导航二</span>
</el-menu-item>
<el-menu-item index="3" disabled>
<i class="el-icon-document"></i>
<span slot="title">导航三</span>
</el-menu-item>
<el-menu-item index="4">
<i class="el-icon-setting"></i>
<span slot="title">导航四</span>
</el-menu-item>
</el-menu>
</template> </template>
<script> <script>
export default { export default {
name:'SliderMenu', name: 'SliderMenu',
data() { data() {
return { return {
isCollapse: true isCollapse: false,
}; activeMenu: '',
routerList: [],
menuData: [
{
index: '1',
title: '父级菜单1',
icon: 'el-icon-location',
children: [
{ index: '1-1', title: '子级菜单1-1', path: '/' },
{ index: '1-2', title: 'ui页面', path: '/ui' }
]
},
{
index: '2',
title: '父级菜单2',
icon: 'el-icon-menu',
children: [
{ index: '2-1', title: '子级菜单2-1', path: '/about' },
{ index: '2-2', title: '加盟耶main', path: '/franchise' }
]
}
]
};
},
methods: {
changeMenuStatus(flag) {
this.isCollapse = flag;
}, },
methods: { handleSelect(index) {
handleOpen(key, keyPath) { this.activeMenu = index;
console.log(key, keyPath); },
}, handleMenuItemClick(item) {
handleClose(key, keyPath) { this.$router.push(item.path);
console.log(key, keyPath); this.activeMenu = item.index;
}
} }
},
mounted() {
this.routerList = this.$router.options.router;//
console.log(this.$route.path, this.$router.options.router, 'this.$route.path===');
//
this.activeMenu = this.$route.path;
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) { .el-menu-vertical-demo:not(.el-menu--collapse) {
width: 200px; width: 158px;
min-height: 400px; min-width: 158px;
} min-height: calc(100vh - 62px);
}
.el-menu-item {
padding: 0 22px;
}
.menu-top {
background: #FFFFFF;
box-sizing: border-box;
/* middle/middle_line_1 */
border-width: 0px 0px 1px 0px;
border-style: solid;
border-color: #DFE2E6;
padding: 15px 0px;
margin: 0 22px;
display: flex;
font-size: 16px;
color: #1E2226;
font-weight: bold;
line-height: normal;
letter-spacing: 0.08em;
justify-content: space-between;
align-items: center;
}
::v-deep .el-submenu {
width: 16px;
font-size: 16px;
}
::v-deep .el-submenu .el-menu-item {
min-width: 138px;
width: 100%;
}
::v-deep .el-submenu__title {
display: flex;
align-items: center;
justify-content: flex-start;
}
::v-deep .el-submenu__title:hover {
background-color: transparent;
cursor: not-allowed;
}
::v-deep .el-submenu__title .el-submenu__icon-arrow.el-icon-arrow-down {
display: none;
}
::v-deep .el-submenu .el-menu-item {
padding: 0 22px;
display: flex;
justify-content: flex-start;
}
::v-deep .el-submenu .el-menu-item {
height: 36px;
}
::v-deep.el-submenu .el-menu-item {
height: 36px;
line-height: 36px;
color: #8A9099;
letter-spacing: 0.08em;
}
::v-deep .el-menu-item:hover {
background: #F6F7FA;
}
::v-deep .el-menu-item.is-active {
color: #006AFF;
font-weight: bold;
}
</style> </style>

2
src/main.js

@ -1,7 +1,7 @@
import Vue from 'vue' import Vue from 'vue'
import App from './App.vue'
import router from './router' import router from './router'
import store from './store' import store from './store'
import App from './App.vue'
import ElementUI from 'element-ui'; import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
import './style/theme/index.css' import './style/theme/index.css'

41
src/router/index.js

@ -2,39 +2,53 @@ import Vue from 'vue';
import VueRouter from 'vue-router'; import VueRouter from 'vue-router';
import store from '../store'; import store from '../store';
import HomeView from '../views/HomeView.vue'; import HomeView from '../views/HomeView.vue';
// import UserPosts from '../views/UserPosts.vue';
// import Franchise from '../views/Franchise.vue' // import Franchise from '../views/Franchise.vue'
Vue.use(VueRouter) Vue.use(VueRouter)
const whiteSlideList = ['/','/franchise'];//侧边导航白名单 const whiteSlideList = ['/','/ui'];//侧边导航白名单
const whiteFooterList = ['/','/franchise'];//侧边导航白名单 const whiteHeaderList = ['/','/ui','/register'];//头部导航白名单
const whiteFooterList = ['/','/ui'];//底部白名单
const routes = [ const routes = [
{ {
path: '/', path: '/',
name: 'home', name: '首页',
component: HomeView component: HomeView,
// component: Franchise // component: Franchise
}, },
{ {
path: '/about', path: '/register',
name: 'about', name: 'register',
// route level code-splitting // route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route // this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited. // which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue') component: () => import(/* webpackChunkName: "register" */ '../views/Register.vue'),
children: [ // 这是子路由的定义开始
// {
// path: '', // 当访问 /user 时,默认加载 UserProfile 组件
// name: 'register',
// component: Register
// },
// {
// path: 'posts', // 当访问 /user/posts 时,加载 UserPosts 组件
// name: 'UserPosts',
// component: UserPosts,
// }
]
}, },
{ {
path: '/ui', path: '/ui',
name: 'ui', name: 'ui组件',
// route level code-splitting // route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route // this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited. // which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/elementGroups.vue') component: () => import(/* webpackChunkName: "ui" */ '../views/elementGroups.vue')
}, },
{ {
path: '/franchise', path: '/franchise',
name: '加盟', name: '加盟',
component: () => import(/* webpackChunkName: "about" */ '../views/Franchise.vue') component: () => import(/* webpackChunkName: "franchise" */ '../views/Franchise.vue')
} },
] ]
const router = new VueRouter({ const router = new VueRouter({
@ -54,6 +68,11 @@ router.beforeEach((to, from, next) => {
} else { } else {
store.commit('SET_FOOTER', false); // 其他页面显示侧边栏 store.commit('SET_FOOTER', false); // 其他页面显示侧边栏
} }
if (whiteHeaderList.includes(to.path)) {
store.commit('SET_HEADER', true); // 登录页面不显示侧边栏
} else {
store.commit('SET_HEADER', false); // 其他页面显示侧边栏
}
next(); next();
}); });

30
src/store/index.js

@ -1,5 +1,5 @@
import Vue from 'vue' import Vue from 'vue';
import Vuex from 'vuex' import Vuex from 'vuex';
Vue.use(Vuex) Vue.use(Vuex)
@ -7,6 +7,23 @@ export default new Vuex.Store({
state: { state: {
showSidebar: false, showSidebar: false,
showFooter:false, showFooter:false,
showHeader:false,
menuList:[],//目录菜单
showBreadcrumb:false,//是否展示面包屑
},
actions: {
SET_HEADER({ commit }) {
commit('SET_HEADER');
},
SET_SIDEBAR({ commit }) {
commit('SET_SIDEBAR');
},
SET_FOOTER({ commit }) {
commit('SET_FOOTER');
},
SHOW_BREAD({ commit }) {
commit('SHOW_BREAD');
},
}, },
mutations: { mutations: {
SET_SIDEBAR(state, show) { SET_SIDEBAR(state, show) {
@ -14,12 +31,17 @@ export default new Vuex.Store({
}, },
SET_FOOTER(state, show) { SET_FOOTER(state, show) {
state.showFooter = show; state.showFooter = show;
},
SET_HEADER(state, show) {
state.showHeader = show;
},
SHOW_BREAD(state, show) {
state.showBreadcrumb = show;
} }
}, },
getters: { getters: {
}, },
actions: {
},
modules: { modules: {
} }
}) })

3
src/style/franchise.scss

@ -1409,6 +1409,9 @@ input,p {
} }
@media (max-width: 568px) { @media (max-width: 568px) {
.passport-layout-web-reg .web-reg-right{
min-width: 500px;
}
.passport-layout-web-ug-reg.web-v3-layout-box { .passport-layout-web-ug-reg.web-v3-layout-box {
width:100%; width:100%;
height: 100%; height: 100%;

21
src/style/theme/common.scss

@ -1,5 +1,24 @@
body{
font-family: Microsoft YaHei UI;
font-size: 14px;
margin: 0;
width: 100vw;
height: 100vh;
p{
margin: 0;
padding: 0;
}
}
.el-container{
height: 100%;
.el-main{
padding: 0;
}
}
.min-width{
min-width: 1200px;
}
/* button==== start */ /* button==== start */
.el-button{ .el-button{

246
src/views/Register.vue

@ -0,0 +1,246 @@
<template>
<div class="register-wrap min-width">
<!-- 顶部提示语 -->
<div class="register-top">
<div class="register-top-left">
<img src="@/assets/register/register-top-left.svg" alt="">
<span>设置完这些信息就可以正式售卖啦也可以选择跳过先进入后台看看哦 </span>
</div>
<div class="register-top-right">
<img src="@/assets/register/register-top-close.svg" alt="">
</div>
</div>
<!-- 步骤条 -->
<el-steps :active="activeStep" finish-status="success">
<el-step title="步骤 1">
<template #icon>
<img src="@/assets/register/step1_ing.svg" alt="icon1" class="custom-icon" />
<!-- <img src="@/assets/register/step_success.svg" alt="icon1" class="custom-icon" /> -->
</template>
<div>
<span>基础信息</span>
<span>填写站点信息选择模板样式</span>
</div>
</el-step>
<el-step title="步骤 2">
<template #icon>
<!-- <img src="@/assets/register/step2_ing.svg" alt="icon1" class="custom-icon" /> -->
<img src="@/assets/register/step2_null.svg" alt="icon2" class="custom-icon" />
<!-- <img src="@/assets/register/step_success.svg" alt="icon1" class="custom-icon" /> -->
</template>
<div>
<span>基础信息</span>
<span>填写站点信息选择模板样式</span>
</div>
</el-step>
<el-step title="步骤 3">
<template #icon>
<!-- <img src="@/assets/register/step3_ing.svg" alt="icon1" class="custom-icon" /> -->
<img src="@/assets/register/step3_null.svg" alt="icon3" class="custom-icon" />
<!-- <img src="@/assets/register/step_success.svg" alt="icon1" class="custom-icon" /> -->
</template>
<div>
<span>基础信息</span>
<span>填写站点信息选择模板样式</span>
</div>
</el-step>
</el-steps>
<el-steps :active="activeStep" finish-status="success">
<el-step v-for="(step, index) in steps" :key="index" :status="getStepStatus(index)">
<!-- 自定义图标插槽 -->
<template #icon>
<div class="custom-icon">
<!-- 填写完毕状态 -->
<img v-if="isStepFinished(index)" src="@/assets/register/step1_ing.svg" alt="checked"
style="width: 24px; height: 24px" />
<!-- 填写中状态 -->
<img v-else-if="isStepActive(index)" :src="step.checked" alt="editing"
style="width: 24px; height: 24px" />
<!-- 未填写状态 -->
<img v-else :src="step.wait" alt="waiting" style="width: 24px; height: 24px" />
</div>
</template>
<!-- 自定义文案插槽 -->
<template #title>
<div class="step-title">
<span>{{ step.title }}</span>
<div class="step-status">
{{ getStepStatusText(index) }}
</div>
</div>
</template>
</el-step>
</el-steps>
<p class="pageDesc">搭建售卖渠道</p>
<div class="step3-wrap">
<div class="step3-top">
<h3>服务列表</h3>
<div class="btngroup">
<GuipButton type="mild" size="mmedium">添加查重服务</GuipButton>
<GuipButton type="mild" size="mmedium">添加写作辅助</GuipButton>
<GuipButton type="mild" size="mmedium">添加AIGC</GuipButton>
</div>
</div>
</div>
</div>
</template>
<script>
import GuipButton from '@/components/GuipButton.vue';
export default {
data() {
return {
activeStep: 0,
steps: [
{ title: "步骤 1", 'desc': '', 'wait': '@/assets/register/step1_ing.svg', 'checked': '@/assets/register/step1_ing.svg', 'finish': '@/assets/register/step_success.svg' },
{ title: "步骤 2", 'desc': '', 'wait': '@/assets/register/step2_null.svg', 'checked': '@/assets/register/step2_ing.svg', 'finish': '@/assets/register/step_success.svg' },
{ title: "步骤 3", 'desc': '', 'wait': '@/assets/register/step3_null.svg', 'checked': '@/assets/register/step3_ing.svg', 'finish': '@/assets/register/step_success.svg' }
]
};
},
components:{
GuipButton,
},
methods: {
// nextStep() {
// if (this.activeStep < 2) {
// this.activeStep++;
// }
// },
//
prevStep() {
if (this.activeStep > 0) {
this.activeStep--;
}
},
//
nextStep() {
if (this.activeStep < this.steps.length - 1) {
this.activeStep++;
}
},
//
isStepFinished(index) {
return index < this.activeStep;
},
//
isStepActive(index) {
return index === this.activeStep;
},
//
getStepStatus(index) {
if (this.isStepFinished(index)) {
return "success"; //
} else if (this.isStepActive(index)) {
return "process"; //
} else {
return "wait"; //
}
},
//
getStepStatusText(index) {
if (this.isStepFinished(index)) {
return "已完成";
} else if (this.isStepActive(index)) {
return "填写中";
} else {
return "未开始";
}
}
}
};
</script>
<style lang="scss" scoped>
.width-box{
width: 1220px;
}
@media (min-width: 1441px) {
.width-box{
width: 1220px;
}
}
@media (max-width:1200px) {
.width-box{
width: 1100px;
}
}
.custom-icon {
display: flex;
align-items: center;
justify-content: center;
}
.step-title {
display: flex;
flex-direction: column;
align-items: center;
}
.step-status {
font-size: 12px;
color: #909399;
margin-top: 4px;
}
.register-wrap {
.custom-icon {
width: 24px;
height: 24px;
}
.register-top {
display: flex;
justify-content: space-between;
// height: 72px;
align-items: center;
padding: 20px 40px 20px 110px;
background: linear-gradient(270deg, #F6EEF7 3%, #EDE9FB 97%);
color: #23242B;
letter-spacing: 0.08em;
line-height: 32px;
.register-top-left {
display: flex;
align-items: center;
.register-top-left img {
margin-right: 12px;
}
}
}
.pageDesc {
/* 自动布局 */
display: flex;
flex-direction: column;
padding: 24px 110px;
line-height: 32px;
font-size: 18px;
font-weight: bold;
line-height: 24px;
letter-spacing: 0.06em;
color: #1E2226;
text-align: left;
}
.step3-wrap{
.step3-top{
display: flex;
justify-content: space-between;
.btngroup{
display: flex;
button{
margin-left: 12px;
}
}
}
}
}
</style>

2
src/views/AboutView.vue → src/views/UserPosts.vue

@ -1,5 +1,5 @@
<template> <template>
<div class="about"> <div class="about">
<h1>This is an about page</h1> <h1>This is an UserPosts page</h1>
</div> </div>
</template> </template>

2
src/views/elementGroups.vue

@ -648,7 +648,7 @@ export default {
.elementWrap { .elementWrap {
/* width: 100%; */ /* width: 100%; */
padding: 30px 40px; padding: 30px 40px;
background: #fff;
.ele-item { .ele-item {
display: flex; display: flex;
align-items: center; align-items: center;

6
vue.config.js

@ -1,3 +1,4 @@
const path = require('path');
module.exports = { module.exports = {
configureWebpack: { configureWebpack: {
module: { module: {
@ -11,5 +12,10 @@ module.exports = {
}, },
], ],
}, },
resolve:{
alias:{
'@':path.resolve(__dirname, 'src/')
}
}
}, },
}; };
Loading…
Cancel
Save