Files
code-bang/frontend/miniapp/pages/message/list/index.wxs
T

18 lines
407 B
XML
Raw Normal View History

2026-09-17 16:25:31 +08:00
function ellipsis(str, len) {
return str.length > len ? str.slice(0, len) + '...' : str;
}
2026-10-08 20:34:08 +08:00
// 消息类型对应的标签主题色:0=系统消息(蓝),1=公告消息(橙),2=需求消息(绿)
function tagTheme(type) {
var map = {
'0': 'primary',
'1': 'warning',
'2': 'success'
};
return map[String(type)] || 'default';
}
2026-09-17 16:25:31 +08:00
module.exports = {
2026-10-08 20:34:08 +08:00
ellipsis: ellipsis,
tagTheme: tagTheme
}