|
@@ -1,6 +1,7 @@
|
|
|
<script lang="ts">
|
|
|
import { ref, reactive, defineComponent } from 'vue'
|
|
|
import { useStore } from 'vuex'
|
|
|
+import { getParams } from '@/assets/js/conmmon'
|
|
|
import banner from '@/components/layout/banner.vue'
|
|
|
export default defineComponent({
|
|
|
setup(){
|
|
@@ -8,13 +9,9 @@ export default defineComponent({
|
|
|
const requestParams = ref({})//active类型
|
|
|
let paramsData = reactive({})
|
|
|
let oldCategoryId= ref()
|
|
|
-
|
|
|
- console.log(store.state.columnTypes)
|
|
|
- if (store.state.route.query.type) {
|
|
|
+ if (store.state.route.hash) {
|
|
|
setTimeout(()=>{
|
|
|
- var ids = store.state.columnTypes.filter(item => item.title == '联系我们');
|
|
|
- console.log(ids[0].id)
|
|
|
-
|
|
|
+ var ids = store.state.columnTypes.filter((item:any) => item.title == '联系我们');
|
|
|
var ahchorEle = ids[0].id
|
|
|
if(typeof window !== 'undefined' && typeof window.globalThis.addEventListener === 'function') {
|
|
|
document.getElementById(ahchorEle).scrollIntoView({
|
|
@@ -56,21 +53,29 @@ export default defineComponent({
|
|
|
},
|
|
|
asyncData({ store, route } :any){
|
|
|
let params = reactive(route.value) //路由参数
|
|
|
-
|
|
|
store.commit("setRoute",params)
|
|
|
-
|
|
|
//获取菜单列表
|
|
|
return store.dispatch('getMenuList',params).then(()=>{
|
|
|
const data = store.state.menuList
|
|
|
let paramsData:any = reactive({})//页面主题内容请求参数
|
|
|
+ //辅助判断参数
|
|
|
+ let str = ref("")
|
|
|
+ var dup = undefined
|
|
|
+ if(params.path.indexOf("_")>-1){
|
|
|
+ str.value = params.path.split("_")[0]
|
|
|
+ }
|
|
|
+ if (typeof window !== 'undefined'){
|
|
|
+ if(getParams(window.location.href)?.dup){
|
|
|
+ dup = getParams(window.location.href).dup
|
|
|
+ }
|
|
|
+ }
|
|
|
for(let i=0;i<data.length;i++){
|
|
|
- if(!data[i].sname && params.path == data[i].path){
|
|
|
+ if((!data[i].sname && !dup && (params.path == data[i].path || data[i].path == str.value)) ||(data[i].sname && dup && (params.path == data[i].path || data[i].path == str.value))){
|
|
|
paramsData = {
|
|
|
params:{
|
|
|
categoryid: data[i].id,
|
|
|
pageNum:1,
|
|
|
pageSize:100,
|
|
|
- order:"sortindex",
|
|
|
},
|
|
|
index:params.path,
|
|
|
sub:i
|
|
@@ -90,7 +95,6 @@ export default defineComponent({
|
|
|
<banner />
|
|
|
</div>
|
|
|
<section :id="arr.id" class="about-introduce-section course-section pt-40 pb-60 about-sec" v-for="(arr,index) in store.state.columnTypes" :style="{background:(index % 2 == 1?'#F4F8FD':'#fff')}">
|
|
|
- <div class="pointOffset">0</div>
|
|
|
<div class="container">
|
|
|
<div class="row">
|
|
|
<div class="col-md-2 col-sm-12 text-center">
|