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