| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636 |
- <template>
- <!-- 页面头部 -->
- <HomePageHead></HomePageHead>
- <!-- 导航栏 -->
- <HomePageNavigation></HomePageNavigation>
- <!-- 面包屑导航 -->
- <div class="breadcrumb-box">
- <div class="inner">
- <span class="location">当前位置:</span>
- <el-breadcrumb :separator-icon="ArrowRight">
- <el-breadcrumb-item>
- <NuxtLink to="/">首页</NuxtLink>
- </el-breadcrumb-item>
- <el-breadcrumb-item class="phone_breadcrumb_text">地市中心</el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- </div>
- <!--查询结果-->
- <div class="search-result-box">
- <div class="search-result-box-title">
- 本地区暂未开通调研中心,欢迎有意从事法制公益性工作的公民或法人单位申请代理。
- <br/>
- 详情咨询电话:010-56212745、010-53382908、010-56212741。
- </div>
- <div class="search-result-box-qq">
- <div>QQ咨询:</div>
- <div>
- <img src="@/public/search/qq.gif" alt="">
- <img src="@/public/search/qq.gif" alt="">
- </div>
- </div>
- <div class="search-result-box-back">
- <NuxtLink to="/">返回首页>></NuxtLink>
- </div>
- </div>
- <!--查询-->
- <div class="search-box">
- <div class="search-left-box">
- <div>
- <span class="search-left-box-text">地区:</span>
- <el-select v-model="province" placeholder="--" size="large" style="width: 180px" popper-class="custom-select-dropdown">
- <el-option v-for="item in provinceList" :key="item.id" :label="item.name"
- @click="change(item.id)" :value="item.id" />
- </el-select>
- <el-select v-model="city" placeholder="--" no-data-text="请先选择省份" size="large"
- style="width: 180px" popper-class="custom-select-dropdown">
- <el-option v-for="(item, index) in cityList" :key="item.id" :label="item.name"
- @click="change1(item.id)" :value="item.id" />
- </el-select>
- <el-select v-model="region" placeholder="--" no-data-text="请先选择市" size="large"
- style="width: 180px" popper-class="custom-select-dropdown">
- <el-option v-for="item in regionList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </div>
- <button>搜索</button>
- </div>
- <div class="search-right-box">
- <img src="@/public/search/dszx.png" alt="">
- <div>手机扫描查询</div>
- </div>
- </div>
- <div class="search-list-box">
- <div class="search-list-box-title">中心列表</div>
- <div class="search-list-box-main">
- <NuxtLink to="/">京</NuxtLink>
- <NuxtLink to="/">津</NuxtLink>
- <NuxtLink to="/">沪</NuxtLink>
- <NuxtLink to="/">渝</NuxtLink>
- <NuxtLink to="/">冀</NuxtLink>
- <NuxtLink to="/">豫</NuxtLink>
- <NuxtLink to="/">云</NuxtLink>
- <NuxtLink to="/">辽</NuxtLink>
- <NuxtLink to="/">黑</NuxtLink>
- <NuxtLink to="/">湘</NuxtLink>
- <NuxtLink to="/">皖</NuxtLink>
- <NuxtLink to="/">鲁</NuxtLink>
- <NuxtLink to="/">新</NuxtLink>
- <NuxtLink to="/">苏</NuxtLink>
- <NuxtLink to="/">浙</NuxtLink>
- <NuxtLink to="/">赣</NuxtLink>
- <NuxtLink to="/">鄂</NuxtLink>
- <NuxtLink to="/">桂</NuxtLink>
- <NuxtLink to="/">甘</NuxtLink>
- <NuxtLink to="/">晋</NuxtLink>
- <NuxtLink to="/">蒙</NuxtLink>
- <NuxtLink to="/">陕</NuxtLink>
- <NuxtLink to="/">吉</NuxtLink>
- <NuxtLink to="/">闽</NuxtLink>
- <NuxtLink to="/">贵</NuxtLink>
- <NuxtLink to="/">粤</NuxtLink>
- <NuxtLink to="/">青</NuxtLink>
- <NuxtLink to="/">藏</NuxtLink>
- <NuxtLink to="/">川</NuxtLink>
- <NuxtLink to="/">宁</NuxtLink>
- <NuxtLink to="/">琼</NuxtLink>
- <NuxtLink to="/">港</NuxtLink>
- <NuxtLink to="/">澳</NuxtLink>
- <NuxtLink to="/">台</NuxtLink>
- </div>
- <div class="search-list-box-content">
- <div class="cityname">
- <div class="sheng">
- <NuxtLink to="/">北京</NuxtLink>
- </div>
- <div class="shi">
- <NuxtLink to="/">东城区</NuxtLink>
- <NuxtLink to="/">延庆县</NuxtLink>
- <NuxtLink to="/">西城区</NuxtLink>
- <NuxtLink to="/">朝阳区</NuxtLink>
- <NuxtLink to="/">丰台区</NuxtLink>
- <NuxtLink to="/">石景山区</NuxtLink>
- <NuxtLink to="/">海淀区</NuxtLink>
- <NuxtLink to="/">门头沟区</NuxtLink>
- <NuxtLink to="/">房山区</NuxtLink>
- <NuxtLink to="/">通州区</NuxtLink>
- <NuxtLink to="/">顺义区</NuxtLink>
- <NuxtLink to="/">昌平区</NuxtLink>
- <NuxtLink to="/">大兴区</NuxtLink>
- <NuxtLink to="/">怀柔区</NuxtLink>
- <NuxtLink to="/">平谷区</NuxtLink>
- <NuxtLink to="/">密云县</NuxtLink>
- </div>
- </div>
- <div class="cityname">
- <div class="sheng">
- <NuxtLink to="/">四川</NuxtLink>
- </div>
- <div class="shi">
- <NuxtLink to="/">成都市</NuxtLink>
- <NuxtLink to="/">自贡市</NuxtLink>
- <NuxtLink to="/">攀枝花市</NuxtLink>
- <NuxtLink to="/">泸州市</NuxtLink>
- <NuxtLink to="/">德阳市</NuxtLink>
- <NuxtLink to="/">绵阳市</NuxtLink>
- <NuxtLink to="/">广元市</NuxtLink>
- <NuxtLink to="/">遂宁市</NuxtLink>
- <NuxtLink to="/">内江市</NuxtLink>
- <NuxtLink to="/">乐山市</NuxtLink>
- <NuxtLink to="/">南充市</NuxtLink>
- <NuxtLink to="/">眉山市</NuxtLink>
- <NuxtLink to="/">宜宾市</NuxtLink>
- <NuxtLink to="/">广安市</NuxtLink>
- <NuxtLink to="/">达州市</NuxtLink>
- <NuxtLink to="/">雅安市</NuxtLink>
- <NuxtLink to="/">巴中市</NuxtLink>
- <NuxtLink to="/">资阳市</NuxtLink>
- <NuxtLink to="/">阿坝藏族羌族自治州</NuxtLink>
- <NuxtLink to="/">甘孜藏族自治州</NuxtLink>
- <NuxtLink to="/">凉山彝族自治州</NuxtLink>
- </div>
- </div>
- </div>
- </div>
- <!-- 页面底部 -->
- <HomeFoot></HomeFoot>
- </template>
- <script setup>
- //1.页面依赖 start ---------------------------------------->
- import { onMounted } from 'vue'
- import { ElBreadcrumb, ElBreadcrumbItem,ElMessage,ElInput,ElSelect,ElOption } from 'element-plus'
- import { ArrowRight } from '@element-plus/icons-vue'
- const nuxtApp = useNuxtApp();
- const axios = nuxtApp.$axios;
- //1.1 获得跳转过来的id
- const route = useRoute();
- //获得详情id
- const articleId = parseInt(route.params.id); //获得该页面的id
- //获得当前的完整路径
- const fullPath = route.path;
- //拆分,取出来中间这一段,然后提取数字部分
- const segments = fullPath.split('/');
- const targetSegment = segments[1];
- // const numberPart = targetSegment.match(/\d+$/)?.[0];
- // let routeId = 20 //排除路径错误可以打开这个
- // const routeId = numberPart;
- let routeId;
- //通过导航路径反向查询导航id
- const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
- method: 'GET',
- query: {
- 'pinyin': targetSegment,
- },
- });
- if(getRouteId.code == 200){
- routeId = getRouteId.data.category_id
- }else{
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:通过url路径查询导航池id")
- console.log("后端错误反馈:",getRouteId.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- //1.2 获得父级栏目的名称、id
- const parent_name = ref([]);
- const parent_id = ref([]);
- const parent_pinyin = ref("");
- const parent_children_count = ref(0)
- let getParentNav = async () => {
- const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
- method: 'GET',
- query: {
- 'catid': routeId
- },
- });
- console.log("获取父级栏目数据")
- console.log(listData)
- if (listData.code == 200) {
- console.log(listData.data);
- parent_name.value = listData.data.alias;
- parent_id.value = listData.data.parent_id;
- parent_pinyin.value = listData.data.aLIas_pinyin;
- parent_children_count.value = listData.data.children_count;
- } else {
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:获取面包屑导航")
- console.log("后端错误反馈:", listData.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- }
- //获得父级栏目详情
- getParentNav();
- //1.页面依赖 end ---------------------------------------->
- //2.页面数据 start ---------------------------------------->
- //2.1 资讯详情
- const newsDetail = ref({})
- const routeNewsTtitle = ref("");
- //2.2 发布日期
- const time = ref("");
- //2.3 路径
- const routLevelTitle = ref("");
- const routLevelId = ref("");
- //是否展示投票
- const articleChoice = ref(false);
- //2.4获取详情
- async function getPageData() {
- const mkdata = await requestDataPromise('/web/selectWebsiteArticleInfo', {
- method: 'GET',
- query: {
- 'articleid': articleId
- },
- });
- if(mkdata.code==200){
- //判断是否显示投票
- if(mkdata.data.is_survey==1){
- console.log("本篇文章含有投票!")
- articleChoice.value = true;
- getVoteList();
- }
- //获取内容
- newsDetail.value = mkdata.data;
- //获取路径
- routLevelTitle.value = newsDetail.value.cat_name;
- routLevelId.value = newsDetail.value.category_id;
- //获取发布时间
- time.value = newsDetail.value.updated_at.split(' ')[0];
- //修正标题长度
- if (newsDetail.value.title.length >= 30) {
- routeNewsTtitle.value = newsDetail.value.title.substr(0, 30) + "...";
- } else {
- routeNewsTtitle.value = newsDetail.value.title
- }
- }else{
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:获取详情内容")
- console.log("后端错误反馈:",mkdata.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- }
- getPageData();
- //2.5 获得广告
- //广告列表
- let adImg1 = ref([]);
- onMounted(async () => {
- const { $webUrl, $CwebUrl } = useNuxtApp();
- //广告1
- let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_detail_0001`
- const responseAd1 = await fetch(url, {
- headers: {
- 'Content-Type': 'application/json',
- 'Userurl': $CwebUrl,
- 'Origin': $CwebUrl
- }
- });
- const resultAd1 = await responseAd1.json();
- adImg1.value = resultAd1.data[0];
- })
- //2.页面数据 end ---------------------------------------->
- //3.设置seo信息 start---------------------------------------->
- //3.1 设置seo信息
- const setData = await requestDataPromise('/web/selectWebsiteArticleInfo', {
- method: 'GET',
- query: {
- 'articleid': articleId
- },
- });
- if(setData.code==200){
- let seoTitle = setData.data.title;
- let seoDescription = setData.data.introduce;
- let seoKeywords = setData.data.keyword;
- let seoSuffix = setData.data.suffix;
- let seoName = setData.data.website_name;
- useSeoMeta({
- title: seoTitle + "_" + seoName + "_" + seoSuffix,
- meta: [
- { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix , tagPriority: 10 },
- { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix , tagPriority: 10 },
- { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no',tagPriority: 10 }
- ]
- });
- }else{
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:设置详情页面SEO数据")
- console.log("后端错误反馈:",setData.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- //3.设置seo信息 end---------------------------------------->
- //4.展示行政区划 start ---------------------------------------->
- //let areaList = ref("")
- //4.1 省
- let province = ref("")
- let provinceid = ref("")
- let provinceList = ref("")
- //4.2 市
- let city = ref("")
- let cityid = ref("")
- let cityList = ref("")
- //4.3 县
- let region = ref("")
- let regionid = ref("")
- let regionList = ref("")
- //选择市
- let change = async (id) => {
- provinceid.value = id;
- const shengData = await requestDataPromise('/web/selectWebsiteArea', {
- method: 'GET',
- query: {
- 'pid': id,
- },
- });
- cityList.value = shengData.data;
- regionList.value = [];// 清空县
- }
- //选择县
- let change1 = async (id) => {
- cityid.value = id;
- const xianData = await requestDataPromise('/web/selectWebsiteArea', {
- method: 'GET',
- query: {
- 'pid': id,
- },
- });
- regionList.value = xianData.data;
- }
- let change2 = async (id) => {
- regionid.value = id;
- }
- onMounted(async () => {
- //从客户端获取行政区划
- try {
- const { $webUrl, $CwebUrl } = useNuxtApp();
- const response2 = await fetch($webUrl + '/web/selectWebsiteArea', {
- headers: {
- 'Content-Type': 'application/json',
- 'Userurl': $CwebUrl,
- 'Origin': $CwebUrl
- }
- });
- const result2 = await response2.json();
- provinceList.value = result2.data;
- } catch (error) {
- console.error('获取行政区划数据失败:', error);
- }
- const targetElement = document.querySelector('.pc_none li .router-link-exact-active');
- const parentElement = document.querySelector('.nav_in');
- if (targetElement && parentElement) {
- const targetRect = targetElement.getBoundingClientRect();
- const parentRect = parentElement.getBoundingClientRect();
- const distanceToParentLeft = targetRect.left - parentRect.left;
- const navigationElement = document.querySelector('.partOne .navigationOne');
- if (navigationElement) {
- navigationElement.scrollLeft = distanceToParentLeft - 66;
- }
- }
- })
- //4.展示行政区划 end ---------------------------------------->
- //5.表单 start---------------------------------------->
- let input = ref("");
- let value = ref("1");
- const submitForm = () => {
- console.log(input.value)
- console.log(value.value)
- }
- //5.表单 end---------------------------------------->
- </script>
- <style lang="less" scoped>
- //@import url('@/assets/css/article/pc.less');
- //@import url('@/assets/css/article/yd.less');
- //面包屑
- .breadcrumb-box {
- width: 1400px;
- margin: 0 auto;
- .inner {
- width: 100%;
- height: 22px;
- margin-top: 20px;
- margin-bottom: 20px;
- font-family: Microsoft YaHei, Microsoft YaHei;
- font-weight: 400;
- font-size: 20px;
- color: #666666;
- line-height: 23px;
- text-align: left;
- font-style: normal;
- text-transform: none;
- display: flex;
- align-items: center;
- border-bottom: 1px dashed #ccc;
- margin-bottom: 10px;
- padding: 20px 20px 20px 0;
- box-sizing: border-box;
- a {
- font-size: 16px;
- line-height: 20px;
- font-weight: normal!important;
- &:hover {
- color:#333
- }
- }
- span {
- font-size: 16px;
- color: #000;
- line-height: 20px;
- &.location {
- line-height: 20px;
- }
- }
- }
- }
- //搜索
- .search-box {
- width: 1400px;
- margin: 0 auto;
- display: flex;
- align-items: flex-start;
- justify-content: space-between;
- .search-left-box {
- width: 70%;
- display: flex;
- align-items: flex-start;
- justify-content: space-between;
- >div {
- width: 80%;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .search-left-box-text {
- width: 15%;
- text-align: center;
- font-size: 16px;
- font-weight: bold;
- display: block;
- }
- :deep(.el-select__wrapper) {
- margin-left: 10px;
- }
- :deep(.el-select__placeholder) {
- color:#000;
- }
- }
- >button {
- width: 10%;
- display: block;
- color: #fff;
- background-color: #337ab7;
- border-color: #2e6da4;
- font-size: 14px;
- font-weight: 400;
- text-align: center;
- white-space: nowrap;
- user-select: none;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
- height: 35px;
- line-height: 35px;
- }
- }
- .search-right-box {
- margin-right: 50px;
- width: 20%;
- img {
- width: 100%;
- height: auto;
- display: block;
- }
- >div {
- display: block;
- width: 100%;
- height: 30px;
- line-height: 30px;
- font-size: 16px;
- color: #333;
- text-align: center
- }
- }
- }
- .search-list-box {
- width: 1400px;
- margin: 0 auto;
- border: 1px solid #ccc;
- margin: 30px auto;
- position: relative;
- .search-list-box-title {
- width: 150px;
- height: 50px;
- line-height: 50px;
- font-size: 30px;
- color: #000;
- font-weight: bold;
- text-align: center;
- position: absolute;
- top: -25px;
- left: 20px;
- background: #fff;
- }
- .search-list-box-main {
- width: 100%;
- padding: 30px;
- border-bottom: 1px solid #ccc;
- box-sizing: border-box;
- a {
- font-size: 16px;
- padding: 0 10px;
- color: #000;
- }
- }
- .search-list-box-content {
- .cityname {
- display: flex;
- align-items: flex-start;
- justify-content: flex-start;
- border-bottom: 1px solid #ccc;
- &:last-child {
- border-bottom: 0;
- }
- }
- .sheng {
- width: 20%;
- text-align: center;
- font-size: 20px;
- line-height: 200%;
- a {
- color: #337ab7;
- }
- }
- .shi {
- width: 80%;
- height: 100%;
- font-size: 16px;
- color: #000;
- padding: 0 5px;
- display: block;
- border-left: 1px solid #ccc;
- line-height: 40px;
- a {
- font-size: 16px;
- color: #000;
- padding: 0 5px;
- display: block;
- width: auto;
- float: left;
- }
- }
- }
- }
- //返回查询结果
- .search-result-box {
- width: 500px;
- margin: 80px auto;
- height: auto;
- overflow: hidden;
- border: 1px solid #ccc;
- .search-result-box-title {
- line-height: 30px;
- width: 488px;
- height: auto;
- overflow: hidden;
- padding: 6px 6px 0 6px;
- font-size: 15px;
- font-family: serif;
- }
- .search-result-box-qq {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- line-height: 30px;
- width: 488px;
- height: auto;
- overflow: hidden;
- padding: 0 6px 0 6px;
- font-size: 15px;
- font-family: serif;
- div:nth-child(2) {
- display: flex;
- margin-left: 80px;
- img {
- margin-right: 20px;
- }
- }
- }
- .search-result-box-back {
- text-align: right;
- width: 488px;
- height: 40px;
- overflow: hidden;
- line-height: 48px;
- margin: 0;
- a {
- color: red;
- font-weight: bold;
- font-size:10px;
- }
- }
- }
- </style>
|