Commit e2319326 authored by GuanHua's avatar GuanHua

fix: 进货单推荐商品询价商品样式修改

parent 4dcd02a3
......@@ -74,7 +74,7 @@ const UploadImage: React.FC<UploadImagePorpsType> = forwardRef((props, ref) => {
switch(listType) {
case "picture-card":
return (
<div className={styles.upload_image_wrap}>
<div className={styles.upload_image_wrap} style={large ? { height: '120px' } : {}}>
<div className={cx(styles.upload_wrap, large ? styles.large : '')}>
<Upload {...uploadProps}>
{<div className={cx(styles.upload_btn, !imgUrl ? styles.isAdd : "", large ? styles.large : '')}>
......
......@@ -51,4 +51,15 @@
}
}
}
}
\ No newline at end of file
}
.inquiry_price {
color: #FFF;
background-color: var(--mall_main_color);
font-size: 14px;
height: 18px;
line-height: 14px;
padding: 2px 8px;
margin-top: 10px;
display: inline-block;
}
......@@ -197,6 +197,28 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
return link
}
const renderPriceByType = (commodityItem) => {
switch (commodityItem.priceType) {
// 现货价格
case 1:
return (
<div className={styles.recommand_list_item_price}>
<span></span>
{priceFormat(commodityItem.min)}
</div>
)
// 价格需要询价
case 2:
return (
<div className={styles.inquiry_price}>
<label>在线询价</label>
</div>
)
default:
break
}
}
return( list && list.length > 0) ? (
<div className={styles.recommand}>
<div className={styles.recommand_title}>买家还在看</div>
......@@ -208,10 +230,7 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
<div className={styles.recommand_list_item_img}>
<ImageBox width={224} height={224} imgUrl={item.mainPic} direction="column" />
</div>
<div className={styles.recommand_list_item_price}>
<span></span>
{priceFormat(item.min)}
</div>
{ renderPriceByType(item) }
<div className={styles.recommand_list_item_name}>{item.name}</div>
</div>
</a>
......
......@@ -32,6 +32,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const [selectCityData, setSelectCityData] = useState<any>([defaultCityData])
const [workshopPics, setWorkshopPics] = useState([]) // 厂房照片
const [honorPics, setHonorPics] = useState([]) // 资质荣誉
const [promotionPic, setPromotionPic] = useState<string>('')
const [logo, setLogo] = useState<string>("")
const [shopInfo, setShopInfo] = useState<any>()
const [shopId, setShopId] = useState<number>()
......@@ -66,7 +67,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
}
PublicApi.getTemplateWebMemberShopWebFindCurrMemberShop(param).then(res => {
const data = res.data
const data:any = res.data
if (res.code === 1000) {
setShopInfo(data)
setSelectCityData(initMemberShopArea(data.memberShopAreas))
......@@ -74,6 +75,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
setShopId(data.shopId)
setWorkshopPics(data.workshopPics || [])
setHonorPics(data.honorPics || [])
setPromotionPic(data.promotionPic || "")
if (data.shopId && data.memberId) {
setStoreUrl(data.storeUrl || "")
}
......@@ -83,7 +85,11 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
logo: data.logo,
memberShopAreas: initMemberShopArea(data.memberShopAreas),
workshopPics: data.workshopPics || [],
honorPics: data.honorPics || []
honorPics: data.honorPics || [],
phone: data.phone || "",
address: data.address || "",
lng: data.lng || "",
lat: data.lat || "",
})
}
})
......@@ -206,6 +212,18 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
workshopPics: [...workshopPics, url]
})
}
/**
* 添加推广页
* @param url
*/
const handleAddPromotionPic = (url: string) => {
setPromotionPic(url)
form.setFieldsValue({
promotionPic: url
})
}
/**
* 添加荣誉图片
* @param url
......@@ -383,6 +401,31 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
</Form.Item>
<Form.Item
labelAlign="left"
name="promotionPic"
label={<RequireItem label="推广页" />}
>
<div className={styles.form_item_wrap}>
<div className={styles.img_list}>
{
promotionPic && (
<div className={cx(styles.upload_btn, styles.large, styles.upload)}>
<div className={styles.delete_btn} onClick={() => setPromotionPic("")}><DeleteOutlined /></div>
<img className={styles.upload_img} src={promotionPic} />
</div>
)
}
<UploadImage
imgUrl={""}
large={true}
fileMaxSize={500}
size="106x107"
onChange={(url) => handleAddPromotionPic(url)}
/>
</div>
</div>
</Form.Item>
<Form.Item
labelAlign="left"
name="shopId"
label={<RequireItem label="店铺链接" />}
// rules={[{ required: true, message: "请输入客服链接" }]}
......@@ -407,6 +450,34 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
<Input allowClear autoComplete="off" className={styles.form_item} />
</Form.Item>
<Form.Item
labelAlign="left"
name="phone"
label={<RequireItem label="联系电话" />}
>
<Input allowClear autoComplete="off" className={styles.form_item} />
</Form.Item>
<Form.Item
labelAlign="left"
name="address"
label={<RequireItem label="详细地址" />}
>
<Input allowClear autoComplete="off" className={styles.form_item} />
</Form.Item>
<Form.Item
labelAlign="left"
name="lng"
label={<RequireItem label="经度" />}
>
<Input allowClear autoComplete="off" className={styles.form_item} />
</Form.Item>
<Form.Item
labelAlign="left"
name="lat"
label={<RequireItem label="纬度" />}
>
<Input allowClear autoComplete="off" className={styles.form_item} />
</Form.Item>
<Form.Item
label={<RequireItem label="" />}
>
<Button loading={confirmLoading} type="primary" style={{ marginRight: 16 }} onClick={handleSave}>保存</Button>
......
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