소스 검색

时间格式化

rkljw 1 주 전
부모
커밋
fa42aacced
3개의 변경된 파일80개의 추가작업 그리고 52개의 파일을 삭제
  1. 73 37
      pages/index_form.vue
  2. 0 0
      plugins/category.js
  3. 7 15
      plugins/element-plus.js

+ 73 - 37
pages/index_form.vue

@@ -1,7 +1,7 @@
 <template>
-    <main class="index_main">
+    <main class="index_main newsDetail">
         <HomePageHead></HomePageHead>
-        <HomePageNavigation1></HomePageNavigation1>
+        <HomePageNavigation></HomePageNavigation>
     
         <!-- 面包屑导航 -->
         <div class="breadcrumb">
@@ -110,7 +110,8 @@
                     value-format="YYYY-MM-DD"
                     format="YYYY-MM-DD"
                     placeholder="选择日期"
-                    style="width: 100%">
+                    style="width: 100%"
+                    :locale="zhCn">
                 </el-date-picker>
                 <!-- 单文件上传 7 (新) -->
                 <el-upload
@@ -466,7 +467,61 @@ section {
 }
 </style>
 <style lang="less" scoped>
-@import url('@/assets/css/detail.less');
+            .breadcrumb {
+                width: 100%;
+                height: 22px;
+                margin-top: 40px;
+                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;
+
+                .el-breadcrumb::v-deep {
+                    display: inline-block;
+                    vertical-align: -4px;
+                }
+
+                :deep(.el-breadcrumb__inner a),
+                :deep(.el-breadcrumb__inner.is-link) {
+                    color: #666666;
+                    font-weight: 400;
+                    text-decoration: none;
+                    transition: var(--el-transition-color);
+                }
+
+                span {
+                    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;
+                }
+
+                span:hover {
+                    color: #666666;
+                }
+
+                .location {
+                    margin-right: 20px;
+                    width: 100px;
+                    height: 22px;
+                    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;
+                }
+            }
 </style>
 <script setup>
 import { ArrowRight } from '@element-plus/icons-vue'
@@ -479,6 +534,9 @@ const captchaId = ref('')
 const dialogVisible = ref(false)
 const title = ref('ceshi')
 const remark = ref('nice')
+const seoTitle = ref('')
+const seoKeywords = ref('')
+const seoDescription = ref('')
 //1.加载页面必备组件 start---------------------------------------->
 import { ref, onMounted, reactive, nextTick, onBeforeUpdate } from 'vue';
 import { useSeoMeta } from '#imports';
@@ -500,31 +558,6 @@ onBeforeUpdate(() => {
   uploadRefs.value = {};
 });
 
-let adImg = ref({}) 
-//广告1               
-let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=tsbb_index_1`
-const responseAd1 = await fetch(url, {
-    headers: {
-        'Content-Type': 'application/json',
-        'Userurl': $CwebUrl,
-        'Origin': $CwebUrl
-    }
-});
-const resultAd1 = await responseAd1.json();
-adImg.value = resultAd1.data[0];
- 
-let adImg_2 = ref({}) 
-//广告_2
-let url_2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=tsbb_index_2`
-const responseAd_2 = await fetch(url_2, {
-    headers: {
-        'Content-Type': 'application/json',
-        'Userurl': $CwebUrl,
-        'Origin': $CwebUrl
-    }
-});
-const resultAd_2 = await responseAd_2.json();
-adImg_2.value = resultAd_2.data[0];
 
 // 动态验证规则
 const rules_js = ref({})
@@ -673,7 +706,13 @@ async function refreshCaptcha() {
         ElMessage.error('刷新验证码失败,请重试');
     }
 }
-
+useSeoMeta({
+            title:  seoTitle,
+            meta: [
+                { name: 'keywords', content: seoKeywords, tagPriority: 10 },
+                { name: 'description', content: seoDescription, tagPriority: 10 }
+            ]
+});
 async function get_from_data_fun() {
     pageLoading.value = true
     try {
@@ -690,13 +729,10 @@ async function get_from_data_fun() {
         console.log("返回数据:",get_from_data,response)
         title.value = get_from_data.data.table.name
         remark.value = get_from_data.data.table.remark
-        useSeoMeta({
-            title: computed(() => response.data.table.name + "_" + response.data.table.website_name + "_" + response.data.table.suffix),
-            meta: [
-                { name: 'keywords', content: computed(() =>response.data.table.keywords+ "_" + response.data.table.website_name + "_" + response.data.table.suffix), tagPriority: 10 },
-                { name: 'description', content: computed(() =>response.data.table.description+ "_" + response.data.table.website_name + "_" + response.data.table.suffix), tagPriority: 100 }
-            ]
-        });
+        seoTitle.value = response.data.table.name + "_" + response.data.table.website_name + "_" + response.data.table.suffix
+        seoKeywords.value = response.data.table.keywords + "_" + response.data.table.website_name + "_" + response.data.table.suffix
+        seoDescription.value = response.data.table.description + "_" + response.data.table.website_name + "_" + response.data.table.suffix
+       
         // 检查是否需要显示验证码(仅在初始化时)
         if (get_from_data.data?.table?.is_code === 1 && get_from_data.data?.code?.img) {
             showCaptcha.value = true

+ 0 - 0
plugins/category.ts → plugins/category.js


+ 7 - 15
plugins/element-plus.js

@@ -1,17 +1,9 @@
-// import { defineNuxtPlugin } from '#app';
-// import ElementPlus from 'element - plus';
-// import 'element - plus/dist/index.css';
-// // 如果安装了图标相关插件,还需导入并注册图标
-// import * as ElementPlusIconsVue from '@element - plus/icons - vue';
+import { defineNuxtPlugin } from '#app'
+import ElementPlus from 'element-plus'
+import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
 
-// export default defineNuxtPlugin((nuxtApp) => {
-//   nuxtApp.vueApp.use(ElementPlus);
-//   // 注册图标
-//   for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
-//     nuxtApp.vueApp.component(key, component);
-//   }
-// });
-
-export default defineNuxtPlugin(() => {
-    
+export default defineNuxtPlugin((nuxtApp) => {
+  nuxtApp.vueApp.use(ElementPlus, {
+    locale: zhCn,
+  })
 })