Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【方案设计】主题色方案增强 #131

Open
2 tasks
xixiIBN5100 opened this issue Oct 18, 2024 · 0 comments
Open
2 tasks

【方案设计】主题色方案增强 #131

xixiIBN5100 opened this issue Oct 18, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@xixiIBN5100
Copy link
Collaborator

xixiIBN5100 commented Oct 18, 2024

方案介绍

背景

根据用户的需求,微精弘需要实现主题色的高度定制化(icon,背景图等等)

这些资源如果存在本地静态文件,限定主题色的权限管理会十分棘手

同样会导致打包后的体积超过2MB,超出了小程序的打包体积上限

价值

本次改动需要进行前后端联调,主题色相关接口需要改动.计划将主题色控制和主题色配置交给后端处理

影响的模块

  1. 从后端获取主题色配置,用户设置主题色逻辑,代码在src/pages/lab
  2. 储存从后端获取的主题色配置,代码在src/store/service/theme.ts
  3. 对主题色和主题icon的消费

方案设计

对比原主题的改动

  • Icon 有 选中/未选中 两套资源
  • 背景图不再是泡泡图
  • 加入背景色

背景方案

  • 首屏打开没配置时,先展示纯色背景,在后台请求定制主题配置。
  • 背景图配置动态化,background-{position,image,color}
  • 图床流量,http 长时间的强缓存 + 文件名 hash

Icon 方案

  • 选中/未选中 icon 直接请求后端,不再经过 iconfont
  • 和背景一样做兜底展示,展示普通 icon

TODO

@xixiIBN5100 xixiIBN5100 added the documentation Improvements or additions to documentation label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant