Compare commits

...

3 Commits

Author SHA1 Message Date
win
7acbc515aa merge: resolve conflicts from origin/zuncle - shop no token required, cabinet keep both imports 2026-03-24 18:30:02 +08:00
495b46ec8b fix: 允许未登录用户浏览首页和商城,解决微信审核拒绝问题
移除首页和商城页的强制登录拦截,商城API改用公开请求,
用户可先浏览再自行选择登录。
2026-03-24 17:11:03 +08:00
d55be3dbcf feat(fragment): 小程序适配碎片多数量产出展示
- normalizeRewards 传递 drop_quantity 字段
- 抽奖结果弹窗自动合并同类碎片显示 x{N}
- 购买记录仅 count>1 时显示数量角标(当前不展示)
- RewardsPreview/RewardsPopup 保留 drop_quantity 样式(当前不展示)
2026-03-23 22:27:50 +08:00
8 changed files with 38 additions and 25 deletions

View File

@ -255,12 +255,12 @@ export function getStoreItems(kind = 'product', page = 1, page_size = 20, filter
if (filters.category_id !== undefined && filters.category_id !== null && filters.category_id > 0) {
data.category_id = filters.category_id
}
return authRequest({ url: '/api/app/store/items', method: 'GET', data })
return request({ url: '/api/app/store/items', method: 'GET', data })
}
export function getProductCategories() {
return authRequest({ url: '/api/app/product_categories', method: 'GET' })
return request({ url: '/api/app/product_categories', method: 'GET' })
}
export function getTasks(page = 1, page_size = 20) {

View File

@ -19,7 +19,7 @@
<view class="record-info">
<view class="record-title">{{ item.title }}</view>
<view class="record-meta">
<text class="record-count">x1</text>
<text class="record-count" v-if="item.count > 1">x{{ item.count }}</text>
</view>
</view>
</view>

View File

@ -205,6 +205,16 @@ defineEmits(['update:visible'])
flex-shrink: 0;
}
.rewards-qty-tag {
font-size: $font-xxs;
font-weight: 700;
color: #fff;
background: linear-gradient(135deg, #ff6b35, #ff4500);
padding: 2rpx 10rpx;
border-radius: $radius-sm;
flex-shrink: 0;
}
.rewards-percent {
font-size: $font-sm;
color: $text-sub;

View File

@ -242,6 +242,20 @@ const rewardGroups = computed(() => {
}
}
.drop-qty-badge {
position: absolute;
top: 10rpx;
right: 10rpx;
background: linear-gradient(135deg, #ff6b35, #ff4500);
color: #fff;
font-size: 20rpx;
padding: 2rpx 10rpx;
border-radius: 16rpx;
z-index: 10;
font-weight: 700;
box-shadow: 0 2rpx 6rpx rgba(255, 69, 0, 0.3);
}
/* 空状态 */
.empty-state {
display: flex;

View File

@ -31,7 +31,7 @@ export function useRecords() {
id: it.id,
title: it.reward_name || it.title || it.name || '-', // 奖品名称
image: it.reward_image || it.image || '', // 奖品图片
count: 1, // 单个记录数量为1
count: 1,
// 用户信息
user_id: it.user_id,

View File

@ -253,6 +253,7 @@ import { onShow, onReachBottom, onShareAppMessage, onPullDownRefresh } from '@dc
import { getInventory, getProductDetail, redeemInventory, requestShipping, cancelShipping, listAddresses, getShipments, createAddressShare, createShippingFeeOrder } from '@/api/appUser'
import { getSynthesisRecipes, doSynthesis } from '@/api/synthesis.js'
import { vibrateShort } from '@/utils/vibrate.js'
import { checkPhoneBoundSync } from '@/utils/checkPhone.js'
import { executePaymentFlow } from '@/utils/payment.js'
// #ifdef MP-TOUTIAO
import customTabBarToutiao from '@/components/app-tab-bar-toutiao.vue'

View File

@ -538,27 +538,14 @@ function onCategorySelect(id) {
}
onShow(() => {
const token = uni.getStorageSync('token')
if (token) {
//
if (!hasInitialized) {
page.value = 1
hasMore.value = true
allItems.value = []
loadItems()
fetchCategories()
hasInitialized = true
}
} else {
//
if (!hasInitialized) {
page.value = 1
hasMore.value = true
allItems.value = []
loadItems()
fetchCategories()
hasInitialized = true
}
//
if (!hasInitialized) {
page.value = 1
hasMore.value = true
allItems.value = []
loadItems()
fetchCategories()
hasInitialized = true
}
})

View File

@ -110,6 +110,7 @@ export function normalizeRewards(list, cleanUrl = (u) => u) {
weight: Number(i.weight) || 0,
boss: detectBoss(i),
min_score: i.min_score || 0,
drop_quantity: Number(i.drop_quantity) || 1,
level: levelToAlpha(i.prize_level ?? i.level ?? (detectBoss(i) ? 'BOSS' : '赏'))
}))
const total = items.reduce((acc, it) => acc + (it.weight > 0 ? it.weight : 0), 0)