feat(theme): 实现主题切换系统并优化经销商相关页面

- 新增主题切换系统,支持智能主题和手动选择
- 更新经销商首页、团队、订单、提现等页面样式
- 添加主题相关的Hook和样式工具函数
- 优化部分组件样式以适配新主题
This commit is contained in:
2025-08-19 00:08:26 +08:00
parent 8efeb9a5bd
commit 9d9762ef17
23 changed files with 739 additions and 264 deletions

View File

@@ -31,6 +31,7 @@ const StoreVerification: React.FC = () => {
const json = JSON.parse(res.result)
console.log(json, 'json')
if (json.businessType === 'gift') {
// 调用解密接口
handleDecryptAndVerify(json.token, json.data).then()
}
}
@@ -48,20 +49,35 @@ const StoreVerification: React.FC = () => {
// 调用解密接口
const handleDecryptAndVerify = async (token: string, encryptedData: string) => {
const decryptedData = await decryptQrData({token, encryptedData})
console.log('解密成功:', decryptedData)
setScanResult(`${decryptedData}`)
setVerificationCode(`${decryptedData}`)
await handleVerification(`${decryptedData}`)
setLoading(false)
decryptQrData({token, encryptedData}).then(res => {
const decryptedData = res;
console.log('解密结果:', decryptedData)
console.log('解密成功:', decryptedData)
setScanResult(`${decryptedData}`)
setVerificationCode(`${decryptedData}`)
handleVerification(`${decryptedData}`)
}).catch(() => {
console.error('解密失败:')
Taro.showToast({
title: `token失效请刷新二维码重试`,
icon: 'none'
})
}).finally(() => {
setLoading(false)
})
}
// 验证商品信息
const handleVerification = async (code?: string) => {
setGiftInfo(null)
setVerificationCode(`${code}`)
// 这里应该调用后端API验证核销码
const gift = await getShopGiftByCode(`${code}`)
// 设置礼品信息用于显示
setGiftInfo(gift)
if(gift){
// 设置礼品信息用于显示
setGiftInfo(gift)
}
}
// 手动输入核销码验证
@@ -264,10 +280,8 @@ const StoreVerification: React.FC = () => {
{giftInfo.description && (
<>
<View className="text-sm text-gray-600 mb-2" style={{
display: '-webkit-box',
WebkitLineClamp: 2,
WebkitBoxOrient: 'vertical',
overflow: 'hidden'
// 注意:小程序不支持 WebKit 文本截断属性
}}>
{giftInfo.description}
</View>