Compare commits
3 Commits
58ad9e8be3
...
7acbc515aa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7acbc515aa | ||
| 495b46ec8b | |||
| d55be3dbcf |
@ -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) {
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -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
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user