小程序配置为后台可配置主题色
随风飘扬 学习 2018年02月13日18:47 5386
在做小程序的时候突然想到如果在节假日让小程序主题色变成红色是不是只能写死CSS?经过试验后发现可以在
在做小程序的时候突然想到如果在节假日让小程序主题色变成红色是不是只能写死CSS?
虎jqzoo泰_py克wee新whk闻_k网xbzx版权所有,请勿未授权转载!!!
经过试验后发现可以在wxml中需要配置颜色的view或者text添加style="background-color:{{config.themeColor}};"
虎_ue泰e克df新yyyx闻n网so版权所有,请勿未授权转载!!!
即可,config.themeColor为从服务器api获取的rgb(a)或者十六进制颜色值
虎lsq泰uo克wcrs新ovszr闻z网f版权所有,请勿未授权转载!!!
因为在标题栏方面设置其颜色只能使用十六进制,因此推荐在系统配置中使用十六进制。
虎xkplf泰tt克jy新asoxb闻b网jw版权所有,请勿未授权转载!!!
后台使用数据库存储键值对并添加配置修改界面,主题设这一块如下。
虎s泰nw_g克mxzf新wsfn闻rkfei网o版权所有,请勿未授权转载!!!
默认配置为蓝色,后台修改主题色配置后小程序显示结果如下
虎jr泰gsy克lavhs新vb闻egelc网bnejz版权所有,请勿未授权转载!!!
虎x泰s克ubqci新m闻gr网_wix版权所有,请勿未授权转载!!!
默认主题色
虎qsy泰nh克srymi新eekw闻epg网_eug版权所有,请勿未授权转载!!!
虎mnou泰he克codl新znf闻ldhe网r版权所有,请勿未授权转载!!!
后台配置模块
虎q泰anj克thu新coypz闻yz网h_zp版权所有,请勿未授权转载!!!
Statement: all articles / drawings reproduced on this website are for the purpose of transmitting more information and facilitating discussion, which does not mean that the website, the host and the organizer agree with their opinions or confirm the authenticity of their contents. The contents of the articles are for reference only. If the rights of the original author are violated, please contact the website administrator.
Comment list
-
No data