docs: 更新优惠券相关文档- 新增优惠券API集成文档

- 新增优惠券卡片对齐修复文档
- 新增优惠券状态显示调试文档
- 新增优惠券组件警告修复文档- 更新用ShopInfo Hook字段迁移文档
- 更新Arguments关键字修复文档
This commit is contained in:
2025-08-15 01:52:36 +08:00
parent dc87f644c9
commit 1b24a611a8
50 changed files with 6530 additions and 595 deletions

View File

@@ -1,4 +1,4 @@
import {useEffect, useState} from 'react'
import {SetStateAction, useEffect, useState} from 'react'
import {useRouter} from '@tarojs/taro'
import Taro from '@tarojs/taro'
import {View} from '@tarojs/components'
@@ -46,7 +46,7 @@ const SearchPage = () => {
try {
let history = Taro.getStorageSync('search_history') || []
// 去重并添加到开头
history = history.filter(item => item !== keyword)
history = history.filter((item: string) => item !== keyword)
history.unshift(keyword)
// 只保留最近10条
history = history.slice(0, 10)
@@ -57,9 +57,9 @@ const SearchPage = () => {
}
}
const handleKeywords = (keywords) => {
const handleKeywords = (keywords: SetStateAction<string>) => {
setKeywords(keywords)
handleSearch(keywords).then()
handleSearch(typeof keywords === "string" ? keywords : '').then()
}
// 搜索商品