Commit 51bc6457 authored by GuanHua's avatar GuanHua

feat:语言修改

parent 062755a5
This diff is collapsed.
......@@ -16,7 +16,7 @@ interface countryItem {
const SelectLang: React.FC = () => {
// 此处暂时无接口, 对接接口后需用枚举类型做补充
const [currentLangKey, setCurrentLangKey] = useState<string>('zh-CN')
const [currentLangKey, setCurrentLangKey] = useState<string>('cn')
useEffect(() => {
console.log(getLocale(), "locale")
......
......@@ -93,8 +93,8 @@ const CityCascader: React.FC<CitySelectPropsType> = (props) => {
onChange(newData)
}
const handleAddNewSelect = (index: number) => {
onAdd({ index, provinceId: 0, cityId: 0 })
const handleAddNewSelect = () => {
onAdd({ index: selectData.length + 1, provinceId: 0, cityId: 0 })
}
const handleReduceSelect = (index: number) => {
if (selectData.length > 1) {
......@@ -128,7 +128,7 @@ const CityCascader: React.FC<CitySelectPropsType> = (props) => {
</Select>
{
index === selectData.length - 1 && (
<div className={cx(styles.opration_btn, styles.add)} onClick={() => handleAddNewSelect(index + 1)}>
<div className={cx(styles.opration_btn, styles.add)} onClick={() => handleAddNewSelect()}>
<PlusOutlined />
</div>
)
......
......@@ -40,7 +40,10 @@ const ShopInfo: React.FC = () => {
const handleReduceCitySelect = (index: number) => {
let temp = JSON.parse(JSON.stringify(selectCityData))
console.log(index, "index")
console.log(temp)
temp = temp.filter((item: any) => item.index !== index)
console.log(temp)
setSelectCityData(temp)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment