PageSourceSearch

https://www.yrlighting.com/src/renderInfo.js

js yrlighting.com collected 2026-10-04 07:49:18 UTC 4,672 bytes, 110 lines download raw bytes

1class RenderInfo {
2  constructor(ctx) {
3    /** 过滤出需要同构渲染的组件 --------------------------------------*/
4    let packageList = ctx.state.template.searchPackageByType({ type: 'content-list' }, ['main']);
5    let packages = {}
6    packageList.forEach(item => {
7      packages[item.attr_id] = {...item, style: {}}
8    })
9    this.windowCtxState = {
10      site_config: ctx.state.site_config,
11      packages
12    }
13    /** ------------------------------------------------------------ */
14    this.site = {
15      watermark_config: ctx.state.site.watermark_config,
16      // 站点-通用-client_id
17      client_id: ctx.state.site.client_id,
18      // 站点-通用-id
19      site_id: ctx.state.site.site_id,
20      // 站点-通用-type
21      site_type: ctx.state.site.site_type,
22      // 站点-通用-域名
23      site_domain: ctx.state.site.domain,
24      // 站点-通用-域名模式
25      domain_mode: ctx.state.site.domain_mode,
26      // 站点-通用-原始域名
27      original_domain: ctx.state.site.original_domain,
28      // 站点-通用-前缀域名
29      prefix_domain: ctx.state.site.prefix_domain,
30      // 站点-通用-语种类型
31      language_code: ctx.state.site.language_code,
32      tencent_verify_id: ctx.state.site.tencent_verify_id || '',
33      show_language_code: ctx.state.site.show_language_code,
34      // 站点-通用-是否临时域名
35      is_init_domain: ctx.state.site.is_init_domain,
36      // 站点-通用-是否商城
37      is_shop: ctx.state.site.is_shop,
38      // 站点-通用-是否有证书
39      is_ssl: ctx.state.site.is_ssl,
40      // 站点-通用-是否替换域名
41      is_replace_domain: ctx.state.site.is_replace_domain,
42      // 站点-通用-语种网址前缀
43      lang_prefix: ctx.state.site.lang_prefix,
44      // 站点-通用-品牌名称
45      company_brand_name: ctx.state.site.company_brand_name,
46      // 站点-通用-企业简称
47      company_name_short: ctx.state.site.company_name_short,
48      // 站点-通用-企业名称
49      company_name: ctx.state.site.company_name,
50      // 站点-通用-网站名称
51      site_name: ctx.state.site.site_name,
52      // 站点-通用-动画类型
53      animate_name: ctx.state.site.style[":root"]?.["default"]?.["--animate__name"],
54      // 站点-通用-开启图片格式转换
55      img__convert_dst: ctx.state.site.style[":root"]?.["default"]?.["--img__convert_dst"] || '',
56      // 站点-banner-开启图片格式转换
57      img__convert_banner_dst: ctx.state.site.style[":root"]?.["default"]?.["--img__convert_banner_dst"] || '',
58      // 站点-通用-开启图片质量压缩
59      img__convert_quality: ctx.state.site.style[":root"]?.["default"]?.["--img__convert_quality"] || '',
60      // 站点-通用-压缩比例
61      compress__ratio: ctx.state.site.style[":root"]?.["default"]?.["--compress__ratio"] || '',
62      // 站点-banner-压缩比例
63      compress_banner__ratio: ctx.state.site.style[":root"]?.["default"]?.["--compress_banner__ratio"] || '',
64      // 站点-通用-图片适应分辨率
65      img__dpi: ctx.state.site.style[":root"]?.["default"]?.["--img__dpi"] || '',
66      // 发版版本
67      publish_version: ctx.state.site.publish_version
68    }
69    this.page = {
70      // 页面-通用-id
71      page_id: ctx.state.page.page_id,
72      // 页面-通用-类型
73      page_type: ctx.state.page.page_type,
74      // 页面-通用-code
75      page_code: ctx.state.page.page_code,
76      // 页面-通用-路径
77      page_url: ctx.state.page.page_url,
78      // 页面-通用-流量来源
79      page_source: ctx.state.page.page_source,
80      // 页面-通用-是否允许动画
81      allowAnimat: ctx.state.page.allowAnimat,
82      // 页面-通用-栏目id
83      page_category_id: ctx.state.page.page_category_id,
84      // 页面-详情-id
85      content_id: ctx.state.page.content_id,
86      // 页面-详情-类型
87      content_type: ctx.state.page.content_type,
88      // 页面-详情-主图
89      detail_thumb: ctx.state.page.detail_thumb,
90      // 页面-详情-标题
91      detail_title: ctx.state.page.detail_title.replace(/\"/g, """),
92      // 页面-详情-款式价格
93      // pattern: ctx.state.page.pattern,
94      //dd
95      // 页面-详情-编辑器类型
96      detail_detail_css_mode: ctx.state.page.detailCssMode,
97      detail_css_name: ctx.state.page.detail_css_name,
98      moq: ctx.state.page.moq || 1
99    }
100    // 前端前台翻译库
101    // this.translateList = ctx.state.$T ? ctx.state.$T.getWebTranslateData(ctx.state.site.language_code) : {}
102  }
103  /** 单例模式 */
104  static ins() {
105    if (!this.instance) return this.instance = new Info()
106    return this.instance
107  }
108}
109
110export default RenderInfo

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.