地址组件优化

This commit is contained in:
czm 2022-05-12 11:49:25 +08:00
parent 4cfec8308d
commit f3e4b68448
3 changed files with 6 additions and 4 deletions

View File

@ -26,7 +26,7 @@
width: 100px;
height: 2px;
border-radius: 50px;
background-color:$color_font_two;
background-color:$color_main;
position: absolute;
bottom: 0;
left: 0;
@ -48,6 +48,7 @@
}
.address_iconfont{
font-size: 30px !important;
color: $color_main;
}
}
}

View File

@ -5,6 +5,7 @@ import styles from "./index.module.scss"
import classnames from "classnames";
import Taro from "@tarojs/taro";
import { GetAddressListApi } from "@/api/addressList";
import { alert } from "@/common/common";
type DefaultValueParm = {name?: string, id?:string|number}
@ -153,7 +154,7 @@ export default memo(({
addressOnClose?.()
addressOnSelect?.(selectArr)
} else {
Taro.showToast({title:'请选择完整地址',icon:'none'})
alert.error("请选择完整地址");
}
} else {
addressOnClose?.()
@ -208,7 +209,7 @@ export default memo(({
return (
<View onClick={() => selectItem(item)} className={classnames(styles.address_list_item, {[styles.addresst_select]:(selectId == item.id)})}>
<View className={styles.address_list_item_name}>{item.name}</View>
{(selectId == item.id)&&<View className={`iconfont icon-a-tick1 ${styles.address_iconfont}` }></View>}
{(selectArr[selectIndex]?.id == item.id)&&<View className={`iconfont icon-tick ${styles.address_iconfont}` }></View>}
</View>
)
})}

View File

@ -123,7 +123,7 @@ export default ()=>{
<Button style={{"background": hozon?'#007aff':''}} hoverClass="none" className={`add-address-save`} onClick={handleSave}>
</Button>
<Address addressOnSelect={handleSetSite} defaultValue={formData.siteArray} addressOnClose={()=>setShowSiteModal(false)} show={showSiteModal}/>
<Address addressOnSelect={handleSetSite} defaultValue={[ {name: "广东省", id: 193}, {name: "佛山市", id: 202}, {name: "高明区", id: 204}]} addressOnClose={()=>setShowSiteModal(false)} show={showSiteModal}/>
</View>
)
}