feat: MBTI头像与用户规则链路升级,三端页面与接口同步
Made-with: Cursor
This commit is contained in:
13
miniprogram/utils/partIcons.js
Normal file
13
miniprogram/utils/partIcons.js
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* 与管理端 content/ChapterTree.tsx 的 PART_ICONS、正文篇序规则一致
|
||||
* 后台篇头用 emoji 轮询;小程序目录页与之对齐(无自定义图时)
|
||||
*/
|
||||
const PART_ICONS = ['📖', '📕', '📗', '📘', '📙', '📓', '📔', '📒', '📚', '📖']
|
||||
|
||||
/** 正文篇在列表中的从 0 开始的序号 → emoji(与 ChapterTree bodyPartOrdinal 一致) */
|
||||
function partEmojiForBodyIndex(bodyIndex) {
|
||||
const i = Math.max(0, Number(bodyIndex) || 0)
|
||||
return PART_ICONS[i % PART_ICONS.length]
|
||||
}
|
||||
|
||||
module.exports = { PART_ICONS, partEmojiForBodyIndex }
|
||||
Reference in New Issue
Block a user