update
This commit is contained in:
@ -3,7 +3,9 @@ import Layout from '../layouts/Layout.astro';
|
||||
import { APP_NAME } from '../config/app';
|
||||
import { newsIndex } from '../../utils/rpc';
|
||||
import Breadcrumb from '../components/Breadcrumb.astro';
|
||||
import { getConfig } from '../../utils/config';
|
||||
|
||||
const config = getConfig(Astro)
|
||||
const {code, data} = await newsIndex();
|
||||
|
||||
|
||||
|
@ -4,13 +4,12 @@ import Layout from "../../../layouts/Layout_2.astro";
|
||||
import ImageXiazai from '../../../../public/template_2/xiazai.svg';
|
||||
import { Image } from 'astro:assets';
|
||||
import { getConfig, getExtra } from "../../../../utils/config";
|
||||
import { TP2_COLUMN_ABOUT_US, TP2_COLUMN_INDEX, TP2_COLUMN_INDEX_URL } from "../../../../utils/const";
|
||||
const config = getConfig(Astro)
|
||||
const extra = getExtra('')
|
||||
// swiper 数据
|
||||
const swiper = extra.index.sc3.swiper;
|
||||
const extra = getExtra(config.app_extra_tag)
|
||||
const breadcrumb = [{
|
||||
title: '主页',
|
||||
url: '/'
|
||||
title: TP2_COLUMN_INDEX,
|
||||
url: TP2_COLUMN_INDEX_URL
|
||||
}]
|
||||
---
|
||||
|
||||
|
@ -4,7 +4,7 @@ import { newsIndex } from '../../../../utils/rpc';
|
||||
import { getConfig } from '../../../../utils/config';
|
||||
import { TP2_COLUMN_NEWS, TP2_COLUMN_NEWS_URL } from '../../../../utils/const';
|
||||
const config = getConfig(Astro)
|
||||
const {code, data} = await newsIndex();
|
||||
const {code, data} = await newsIndex(config.id);
|
||||
const breadcrumb = [
|
||||
{
|
||||
title: '主页',
|
||||
@ -21,7 +21,7 @@ const breadcrumb = [
|
||||
<div class="v4 h05-hero-text-only no-margin centered" data-component="h05-hero-text-only" data-video-width="0" data-video-height="0">
|
||||
<div class="container">
|
||||
<div class="wrap">
|
||||
<h1 class="columns-name">新闻</h1>
|
||||
<h1 class="columns-name">新闻专栏</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -51,6 +51,7 @@ const breadcrumb = [
|
||||
</main>
|
||||
</Layout>
|
||||
<style>
|
||||
|
||||
.page-news {
|
||||
background-color: #fff !important;
|
||||
padding-top: 5rem;
|
||||
@ -63,6 +64,14 @@ const breadcrumb = [
|
||||
padding: 3rem;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 767.98px) {
|
||||
.columns-name {
|
||||
font-size: 2rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.result-product__media {
|
||||
-webkit-box-flex: 0;
|
||||
-webkit-flex: 0 0 260px;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { IWebsiteConfig } from "./rpc";
|
||||
import {EXTRA_HONGTIXIANYUE} from './extra.ts'
|
||||
import {EXTRA_DEFAULT, EXTRA_HONGTIXIANYUE} from './extra.ts'
|
||||
|
||||
export function getConfig(Astro: any):IWebsiteConfig
|
||||
{
|
||||
@ -7,7 +7,11 @@ export function getConfig(Astro: any):IWebsiteConfig
|
||||
}
|
||||
|
||||
// 取默认的配置
|
||||
export function getExtra(host: string)
|
||||
export function getExtra(extraTag: string = '')
|
||||
{
|
||||
return EXTRA_HONGTIXIANYUE;
|
||||
if (extraTag == 'HONGTIXIANYUE') {
|
||||
return EXTRA_HONGTIXIANYUE;
|
||||
}
|
||||
|
||||
return EXTRA_DEFAULT;
|
||||
}
|
@ -1,5 +1,9 @@
|
||||
|
||||
// ----- 栏目 -----
|
||||
|
||||
export const TP2_COLUMN_INDEX = '首页'
|
||||
export const TP2_COLUMN_INDEX_URL = '/'
|
||||
|
||||
export const TP2_COLUMN_NEWS = '新闻专栏'
|
||||
export const TP2_COLUMN_NEWS_URL = '/news'
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -31,9 +31,12 @@ export interface InewsIndex {
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
export async function newsIndex():Promise<result<InewsIndex[]>>{
|
||||
export async function newsIndex(websiteId:number = 0):Promise<result<InewsIndex[]>>{
|
||||
console.log(websiteId)
|
||||
const client = getRpcClient()
|
||||
const result = await client.call('news/index', {})
|
||||
const result = await client.call('news/index', {
|
||||
id:websiteId
|
||||
})
|
||||
|
||||
return result
|
||||
}
|
||||
@ -72,6 +75,8 @@ export async function newsDetail(id:string):Promise<result<InewsDetail>>{
|
||||
|
||||
// 网站配置
|
||||
export interface IWebsiteConfig {
|
||||
id: string
|
||||
app_extra_tag: string
|
||||
app_name: string
|
||||
app_description: string
|
||||
app_keywords: string
|
||||
|
Reference in New Issue
Block a user