1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-11-13 22:11:42 +08:00

feat: 添加恋爱故事模块功能

1. 新增uhlove图标字体库与相关样式
2. 新增恋爱故事页面与恋爱主页
3. 修复投票组件多选限制逻辑bug
4. 优化导航栏组件自定义样式能力
5. 更新滚动置顶组件黑名单与样式
6. 开启本地开发调试模式
This commit is contained in:
小莫唐尼
2026-09-08 17:38:56 +08:00
parent d8d08f9689
commit 2541f5a75e
10 changed files with 770 additions and 766 deletions
@@ -104,8 +104,10 @@ function handleSelectCheckboxOption(option: IVoteOption) {
return
const checkedList = (spec.options || []).filter(x => x.checked && x.id !== option.id)
if (spec.type === 'multiple' && checkedList.length >= (spec.maxVotes || 0)) {
showToast(`最多选择 ${spec.maxVotes} 项`)
// maxVotes 缺失(0/undefined)时不限制多选数量,避免 0 >= 0 恒真导致无法选择
const maxVotes = spec.maxVotes
if (spec.type === 'multiple' && maxVotes && maxVotes > 0 && checkedList.length >= maxVotes) {
showToast(`最多选择 ${maxVotes} 项`)
return
}
@@ -225,7 +227,7 @@ defineExpose({ refresh: handleGetData })
</view>
<text class="shrink-0 text-[22rpx] text-gray-400" @click="handleToVoteDetail">查看投票详情 ></text>
</view>
<view class="title mt-2 text-[30rpx] font-bold text-gray-900">
<view class="title mt-2 text-[30rpx] text-gray-900 font-bold">
{{ voteData.spec?.title }}
</view>
</view>
@@ -247,8 +249,12 @@ defineExpose({ refresh: handleGetData })
>
<view class="is-voted-item-content relative z-2 box-border min-h-[72rpx] px-6 py-3">
<view class="flex items-center justify-between">
<view class="flex-1 text-left">{{ option.title }}</view>
<view class="shrink-0">{{ handleCalcPercent(option) }}%</view>
<view class="flex-1 text-left">
{{ option.title }}
</view>
<view class="shrink-0">
{{ handleCalcPercent(option) }}%
</view>
</view>
</view>
</view>
@@ -278,8 +284,12 @@ defineExpose({ refresh: handleGetData })
>
<view class="is-voted-item-content relative z-2 box-border min-h-[72rpx] px-6 py-3">
<view class="flex items-center justify-between">
<view class="flex-1 text-left">{{ option.title }}</view>
<view class="shrink-0">{{ handleCalcPercent(option) }}%</view>
<view class="flex-1 text-left">
{{ option.title }}
</view>
<view class="shrink-0">
{{ handleCalcPercent(option) }}%
</view>
</view>
</view>
</view>
@@ -300,7 +310,7 @@ defineExpose({ refresh: handleGetData })
<!-- PK -->
<view v-else-if="voteData.spec?.type === 'pk'" class="flex flex-col gap-2">
<!-- PK 对抗条 -->
<view class="pk-container box-border flex w-full">
<view class="pk-container box-border w-full flex">
<view
v-for="(option, optionIndex) in voteData.spec?.options || []"
:key="optionIndex"
@@ -324,8 +334,12 @@ defineExpose({ refresh: handleGetData })
>
<view class="is-voted-item-content relative z-2 box-border min-h-[72rpx] px-6 py-3">
<view class="flex items-center justify-between">
<view class="flex-1 text-left">选项{{ optionIndex + 1 }}:{{ option.title }}</view>
<view class="shrink-0">{{ handleCalcPercent(option) }}%</view>
<view class="flex-1 text-left">
选项{{ optionIndex + 1 }}:{{ option.title }}
</view>
<view class="shrink-0">
{{ handleCalcPercent(option) }}%
</view>
</view>
</view>
</view>