Files
code-bang/frontend/miniapp/pages/message/list/index.wxs
T
2026-10-19 15:46:10 +08:00

18 lines
404 B
XML

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