/** 技能模块假数据，接口就绪后替换 */

export const SKILL_CATEGORIES = [
	{ id: '1', name: '上门按摩' },
	{ id: '2', name: '台球' },
	{ id: '3', name: '爬山' },
	{ id: '4', name: '电影' },
	{ id: '5', name: '健身运动' },
	{ id: '6', name: '读书学习' },
]

/** status: opened | pending | rejected */
export const MOCK_MY_SKILLS = [
	{
		id: 's1',
		categoryId: '1',
		title: '中式推拿-培元疏通',
		cover: '',
		price: 200,
		priceMin: null,
		priceMax: null,
		unit: '次',
		soldCount: 200,
		status: 'opened',
		applyDate: '2025年12月1日申请开通服务',
		rejectReason: '',
		billingType: '按分钟计费',
		platformPrice: 368,
		priceRangeMin: 288,
		priceRangeMax: 368,
		canEdit: true,
	},
	{
		id: 's2',
		categoryId: '1',
		title: '中式推拿-培元疏通',
		cover: '',
		price: 200,
		priceMin: 200,
		priceMax: 260,
		unit: '次',
		soldCount: 0,
		status: 'rejected',
		applyDate: '',
		rejectReason: '申请上架审核驳回：当前时段该服务不支持申请开通，请稍后再试或联系客服了解详情。',
		billingType: '按分钟计费',
		platformPrice: 368,
		priceRangeMin: 288,
		priceRangeMax: 368,
		canEdit: false,
	},
	{
		id: 's3',
		categoryId: '1',
		title: '中式推拿-培元疏通',
		cover: '',
		price: 200,
		priceMin: 200,
		priceMax: 260,
		unit: '次',
		soldCount: 0,
		status: 'pending',
		applyDate: '',
		rejectReason: '',
		billingType: '按分钟计费',
		platformPrice: 368,
		priceRangeMin: 288,
		priceRangeMax: 368,
		canEdit: false,
	},
]

/** 可开通的服务（未开通） */
export const MOCK_AVAILABLE_SKILLS = [
	{
		id: 'a1',
		categoryId: '1',
		title: '中式推拿-培元疏通',
		cover: '',
		price: 200,
		unit: '次',
	},
	{
		id: 'a2',
		categoryId: '1',
		title: '泰式SPA-舒缓放松',
		cover: '',
		price: 268,
		unit: '次',
	},
	{
		id: 'a3',
		categoryId: '2',
		title: '中式8球教学',
		cover: '',
		price: 128,
		unit: '小时',
	},
	{
		id: 'a4',
		categoryId: '3',
		title: '户外徒步向导',
		cover: '',
		price: 150,
		unit: '次',
	},
]

export const STATUS_TABS = [
	{ key: 'opened', label: '已开通' },
	{ key: 'pending', label: '申请中' },
	{ key: 'rejected', label: '申请驳回' },
]

export function formatPrice(item) {
	if (item.priceMin != null && item.priceMax != null) {
		return `¥${item.priceMin} 至 ${item.priceMax}/${item.unit || '次'}`
	}
	return `¥${item.price}/${item.unit || '次'}`
}

export function formatPriceRange(min, max) {
	return `¥${min} 至 ${max}`
}
