Commit be7d72f8 authored by 前端-许佳敏's avatar 前端-许佳敏
parents 672d774c d6d79798
......@@ -160,7 +160,6 @@ const appMallEdit: React.FC<ShopPreviewPropsType> = (props) => {
temp.recommendList = await getSelectInfo(item)
newRes.push(temp)
}
console.log(newRes, 'newRes')
return newRes
} else {
return []
......@@ -170,7 +169,6 @@ const appMallEdit: React.FC<ShopPreviewPropsType> = (props) => {
const getComponentsConfig = async () => {
try {
const appConfig = await getAppEnterpriseConfig()
console.log(appConfig, "appConfig")
if(appConfig?.topBO) {
// 顶部导航
......@@ -208,7 +206,7 @@ const appMallEdit: React.FC<ShopPreviewPropsType> = (props) => {
pageSize: 100,
idList: appConfig?.storeBO.storeIdList || [],
}
console.log(storeBOParam, "storeBOParam")
const storeBORes = await getRecommendShopList(storeBOParam)
// 推荐店铺
......
......@@ -95,18 +95,22 @@ const Banner: React.FC<BannerPropsType> = (props) => {
}
const handleExpand = async (sort: number, expand: boolean) => {
console.log(sort, expand, "newList")
const newList = [...list]
for(const item of newList) {
if (item.sort === sort) {
item.expand = expand
// 获取当前选择链接的信息
if(item.id && !item.selectInfo) {
item.selectInfo = await getSelectInfo(item)
console.log(item.selectInfo, "item.selectInfo")
}
} else {
item.expand = false
}
}
setList(newList)
}
......@@ -118,20 +122,32 @@ const Banner: React.FC<BannerPropsType> = (props) => {
return new Promise((resolve) => {
let getFn: any = null
const param: any = {}
console.log(data)
switch(data.type) {
case 1:
case 2:
param.commodityId = data.id
getFn = PublicApi.getSearchMobileShopStoreGetCommodityDetail
break
case 3:
param.id = data.id
getFn = PublicApi.getTemplateMobileMemberShopMobileFindById
break
case 4:
param.id = data.id
getFn = PublicApi.getManageContentInformationGet
break
default:
break
}
getFn && getFn(param).then(res => {
resolve(res.data)
})
if(getFn){
getFn(param).then(res => {
resolve(res.data)
})
} else {
resolve({})
}
})
}
const sortUp = (index: number, item: DataItemType) => {
......
......@@ -234,6 +234,24 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
}
/**
* 修改链接地址
* @param value
* @param id
*/
const handleUrlChange = (value: string, id: number) => {
const newList = [...list]
newList.map(item => {
if (item.id === id) {
item.url = value
}
})
setList(newList)
changeProps({
props:Object.assign({ ...props }, { dataList: newList })
})
}
/**
* 添加广告
*/
const handleAddItem = () => {
......@@ -313,6 +331,16 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
</Select>
</div>
</div>
{
item.type === 12 && (
<div className={styles.setting_line_addItem_line}>
<div className={styles.setting_line_addItem_line_label}>链接地址:</div>
<div className={styles.setting_line_addItem_line_brief}>
<Input value={item.url} onChange={(e) => handleUrlChange(e.target.value, item.id)} />
</div>
</div>
)
}
<div className={styles.setting_line_addItem_line}>
<div className={styles.setting_line_addItem_line_label}>图标:</div>
<div className={styles.setting_line_addItem_line_brief}>
......
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