feat(listing): 增加押金说明配置与悬浮提示
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { mergeListingPublishOptions } from './listingOptions'
|
||||
|
||||
describe('mergeListingPublishOptions', () => {
|
||||
it('读取后台配置的押金说明', () => {
|
||||
const options = mergeListingPublishOptions({
|
||||
price_config: {
|
||||
deposit_placeholder: '',
|
||||
deposit_hint: '',
|
||||
deposit_tooltip: '自定义押金说明',
|
||||
price_placeholder: '',
|
||||
ratio_description: '',
|
||||
},
|
||||
})
|
||||
|
||||
expect(options.price_config.deposit_tooltip).toBe('自定义押金说明')
|
||||
})
|
||||
})
|
||||
@@ -32,6 +32,7 @@ export interface PublishScreenshotSlot {
|
||||
export interface PublishPriceConfig {
|
||||
deposit_placeholder: string
|
||||
deposit_hint: string
|
||||
deposit_tooltip: string
|
||||
price_placeholder: string
|
||||
ratio_description: string
|
||||
}
|
||||
@@ -122,6 +123,29 @@ export interface ListingPublishOptions {
|
||||
ratio_config: PublishRatioConfig
|
||||
}
|
||||
|
||||
const defaultDepositTooltip = `1. 系统推荐押金(基础覆盖)
|
||||
|
||||
系统将根据您填写的出租皮肤、特勤处等级等信息,自动计算并生成一个推荐押金额度。该额度已覆盖上述主要资产的合理市场价值,可作为押金设置的基础参考。
|
||||
|
||||
2. 系统推荐押金未覆盖项目(需自行评估)
|
||||
|
||||
请注意,系统推荐押金暂不包含以下资产类型,您需要根据实际情况额外评估其价值:
|
||||
|
||||
- 收藏室内的稀有物品
|
||||
- 其他具有个人纪念意义或情怀价值的虚拟资产(如限定称号、绝版道具等)
|
||||
|
||||
3. 未出租价值折算规则(重点)
|
||||
|
||||
请在「收藏室及不出租部分哈弗币价值」中填写收藏室等不出租资产折合的哈弗币。系统按 1元=50万 计算参考值,并自动更新推荐押金:低于参考值时覆盖为参考值,否则追加参考值的 50%。
|
||||
|
||||
示例:基础推荐押金 200 元、收藏室价值 200M → 参考值 400 元,200<400,推荐押金更新为 400 元。
|
||||
|
||||
目的:该举能够有效覆盖租客可能出现的洗号、违规操作导致账号封禁等风险带来的损失,为您提供充分的风险缓冲。
|
||||
|
||||
4. 额外保障选项
|
||||
|
||||
若您在设置足额押金后仍感不放心,可选择购买平台提供的《全额包赔服务》。一旦发生封号损失,将获得账号市场价值的全额赔付,让您的出租过程后顾无忧。`
|
||||
|
||||
export const emptyListingPublishOptions: ListingPublishOptions = {
|
||||
unlock_demulan_enabled: false,
|
||||
next_season_pass_enabled: false,
|
||||
@@ -141,6 +165,7 @@ export const emptyListingPublishOptions: ListingPublishOptions = {
|
||||
price_config: {
|
||||
deposit_placeholder: '',
|
||||
deposit_hint: '租客缴纳,封号必赔付',
|
||||
deposit_tooltip: defaultDepositTooltip,
|
||||
price_placeholder: '',
|
||||
ratio_description: '',
|
||||
},
|
||||
@@ -325,6 +350,10 @@ function normalizePriceConfig(value?: unknown): PublishPriceConfig {
|
||||
typeof row.deposit_hint === 'string' && row.deposit_hint.trim()
|
||||
? row.deposit_hint.trim()
|
||||
: emptyListingPublishOptions.price_config.deposit_hint,
|
||||
deposit_tooltip:
|
||||
typeof row.deposit_tooltip === 'string' && row.deposit_tooltip.trim()
|
||||
? row.deposit_tooltip.trim()
|
||||
: emptyListingPublishOptions.price_config.deposit_tooltip,
|
||||
price_placeholder:
|
||||
typeof row.price_placeholder === 'string' ? row.price_placeholder.trim() : '',
|
||||
ratio_description:
|
||||
|
||||
Reference in New Issue
Block a user