🎈 perf(购物页面): 添加节流
This commit is contained in:
parent
6a1cd2b2ed
commit
ba4f0e68ce
@ -1,10 +1,8 @@
|
||||
{
|
||||
"miniprogramRoot": "./",
|
||||
"projectname": "Mall-lymarket",
|
||||
"miniprogramRoot": "",
|
||||
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||
"appid": "wx64fe67f111d52457",
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
"urlCheck": true,
|
||||
"es6": false,
|
||||
"postcss": true,
|
||||
"minified": true,
|
||||
@ -23,7 +21,7 @@
|
||||
"useStaticServer": true,
|
||||
"showES6CompileOption": false,
|
||||
"checkInvalidKey": true,
|
||||
"compileHotReLoad": true,
|
||||
"compileHotReLoad": false,
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
@ -31,18 +29,20 @@
|
||||
},
|
||||
"disableUseStrict": false,
|
||||
"useCompilerPlugins": false,
|
||||
"minifyWXML": true
|
||||
"minifyWXML": true,
|
||||
"ignoreUploadUnusedFiles": true
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "2.24.5",
|
||||
"srcMiniprogramRoot": "dist/",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"condition": {},
|
||||
"editorSetting": {
|
||||
"tabIndent": "insertSpaces",
|
||||
"tabSize": 2
|
||||
}
|
||||
},
|
||||
"libVersion": "2.27.3",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"appid": "wx64fe67f111d52457"
|
||||
}
|
||||
56
package.json
56
package.json
@ -39,49 +39,49 @@
|
||||
"ios >= 8"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.7.7",
|
||||
"@tarojs/components": "3.5.5",
|
||||
"@tarojs/helper": "^3.5.5",
|
||||
"@tarojs/plugin-framework-react": "^3.5.5",
|
||||
"@tarojs/react": "3.5.5",
|
||||
"@tarojs/router": "^3.5.5",
|
||||
"@tarojs/runtime": "^3.5.5",
|
||||
"@tarojs/shared": "^3.5.5",
|
||||
"@tarojs/taro": "3.5.5",
|
||||
"@tarojs/taro-h5": "^3.5.5",
|
||||
"@babel/runtime": "^7.20.6",
|
||||
"@tarojs/components": "3.5.8",
|
||||
"@tarojs/helper": "^3.5.8",
|
||||
"@tarojs/plugin-framework-react": "^3.5.8",
|
||||
"@tarojs/react": "3.5.8",
|
||||
"@tarojs/router": "^3.5.8",
|
||||
"@tarojs/runtime": "^3.5.8",
|
||||
"@tarojs/shared": "^3.5.8",
|
||||
"@tarojs/taro": "3.5.8",
|
||||
"@tarojs/taro-h5": "^3.5.8",
|
||||
"big.js": "^6.2.1",
|
||||
"dayjs": "^1.11.3",
|
||||
"dayjs": "^1.11.6",
|
||||
"immer": "^9.0.16",
|
||||
"qs": "^6.10.3",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-redux": "^8.0.1",
|
||||
"react-redux": "^8.0.5",
|
||||
"redux": "^4.2.0",
|
||||
"redux-logger": "^3.0.6",
|
||||
"redux-thunk": "^2.4.1"
|
||||
"redux-thunk": "^2.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@aaronghx/eslint-config-react": "^0.1.11",
|
||||
"@babel/core": "^7.8.0",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "0.5.4",
|
||||
"@tarojs/cli": "^3.5.5",
|
||||
"@tarojs/plugin-platform-weapp": "^3.5.5",
|
||||
"@tarojs/plugin-react-devtools": "^3.4.13",
|
||||
"@tarojs/webpack5-runner": "^3.5.5",
|
||||
"@types/node": "^18.7.18",
|
||||
"@babel/core": "^7.20.5",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
|
||||
"@tarojs/cli": "^3.5.8",
|
||||
"@tarojs/plugin-platform-weapp": "^3.5.8",
|
||||
"@tarojs/plugin-react-devtools": "^3.5.8",
|
||||
"@tarojs/webpack5-runner": "^3.5.8",
|
||||
"@types/node": "^18.11.10",
|
||||
"@types/qs": "^6.9.7",
|
||||
"@types/react": "^18.0.17",
|
||||
"@types/react": "^18.0.25",
|
||||
"@types/webpack-env": "^1.13.6",
|
||||
"babel-preset-taro": "3.3.10",
|
||||
"babel-preset-taro": "3.5.8",
|
||||
"classnames": "^2.3.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^8.28.0",
|
||||
"eslint-config-taro": "3.5.7",
|
||||
"react-refresh": "0.11.0",
|
||||
"stylelint": "9.3.0",
|
||||
"taro-iconfont-svg": "^1.0.17",
|
||||
"eslint-config-taro": "3.5.8",
|
||||
"react-refresh": "0.14.0",
|
||||
"stylelint": "14.15.0",
|
||||
"taro-iconfont-svg": "^1.0.19",
|
||||
"terser-webpack-plugin": "^5.3.6",
|
||||
"typescript": "^4.1.0",
|
||||
"webpack": "^5.74.0"
|
||||
"typescript": "^4.9.3",
|
||||
"webpack": "^5.75.0"
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,10 +62,10 @@ const ShoppingCartContainer: FC = () => {
|
||||
}, [searchOptions])
|
||||
|
||||
// 输入了搜索关键字
|
||||
const getSearchData = useCallback((e) => {
|
||||
const getSearchData = useCallback(debounce((e) => {
|
||||
console.log('getSearchData===>', e)
|
||||
setSearchOptions({ short_name_or_phone: e })
|
||||
}, [])
|
||||
}, 300), [])
|
||||
|
||||
const [shoppingCartData, setShoppingCartData] = useState<{
|
||||
list: ShoppingCartData[]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user