Commit 597c1bae authored by GuanHua's avatar GuanHua

fix:查询渠道商城信息添加用户id

parent 4e2f64ec
......@@ -15,6 +15,7 @@ import styles from './index.less'
import { GetTemplateChannelFindChannelResponse } from '@/services/TemplateApi'
import { isEmpty } from '@formily/antd/esm/shared'
import { GlobalConfig } from '@/global/config'
import { getAuth } from '@/utils/auth'
interface ShopInfoPropsType {
SiteStore: {
......@@ -46,8 +47,11 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
// 根据站点获取商城信息
const fetchAllShop = () => {
//@ts-ignore
PublicApi.getManageShopFindShopsBySiteId({ siteId, type: 2 }).then(res => {
const param: any = {
siteId,
type: 2
}
PublicApi.getManageShopFindShopsBySiteId(param).then(res => {
if (res.code === 1000) {
setAllMallList(res.data)
}
......@@ -58,7 +62,11 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
* 获取渠道信息
*/
const fetchShopInfo = () => {
PublicApi.getTemplateChannelFindChannel().then(res => {
const { memberId } = getAuth() || {}
const param: any = {
memberId
}
PublicApi.getTemplateChannelFindChannel(param).then(res => {
const data = res.data
if (res.code === 1000) {
setShopInfo(data)
......@@ -92,7 +100,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
}
const handleAddNewCitySelect = (item: any) => {
let temp = [...selectCityData]
const temp = [...selectCityData]
temp.push(item)
setSelectCityData(temp)
form.setFieldsValue({
......@@ -136,7 +144,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const handleSave = (e: any) => {
e.preventDefault()
form.validateFields().then(value => {
form.validateFields().then((value: any) => {
if (!checkmemberChannelAreas(value.memberChannelAreas)) {
return
}
......@@ -147,7 +155,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
value.storeUrl = storeUrl || `${siteUrl}/${GlobalConfig.channelRootRoute}`
value.shopId = shopId
setConfirmLoading(true)
//@ts-ignore
PublicApi.postTemplateChannelSaveChannel(value).then(res => {
if (res.code === 1000) {
fetchShopInfo()
......@@ -200,7 +208,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
}
/**
* 添加荣誉图片
* @param url
* @param url
*/
const handleAddhonorPics = (url: string) => {
setHonorPics([...honorPics, url])
......@@ -215,7 +223,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
return
}
if (shopInfo.shopId && shopInfo.memberId) {
let resUrl = getMallItemAndSetUrl(mallId)
const resUrl = getMallItemAndSetUrl(mallId)
setStoreUrl(resUrl)
} else {
setStoreUrl(null)
......@@ -225,7 +233,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const getMallItemAndSetUrl = (mallId) => {
let result = ""
let mallItem = allMallList.filter(item => item.id === mallId)[0]
const mallItem = allMallList.filter(item => item.id === mallId)[0]
if (!mallItem) {
return ""
}
......@@ -261,7 +269,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
return null
}
if (shopId && shopInfo.shopId && shopInfo.memberId) {
let resUrl = getMallItemAndSetUrl(shopId)
const resUrl = getMallItemAndSetUrl(shopId)
return resUrl ? (
<div className={styles.shop_url}>
<span>当前店铺链接:</span>
......
......@@ -5,7 +5,7 @@ import SettingList from '../../../../components/SettingList'
import GoodsItem from './GoodsItem'
import SettingPanel from '../../../../components/SettingPanel'
import { CaretUpOutlined, CaretDownOutlined } from '@ant-design/icons'
import { GetTemplatePlatformFindGoodsListResponseDetail } from '@/services'
import { GetTemplatePlatformFindGoodsListResponseDetail } from '@/services/TemplateApi'
import { PublicApi } from '@/services/api'
import { filterProps } from '../../../../utils'
import styles from './index.less'
......@@ -44,7 +44,6 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const [totalCount, setTotalCount] = useState<number>(0)
const [filterParam, setFilterParam] = useState()
const [spinLoading, setSpinLoading] = useState<boolean>(false)
const [newProps, setNewProps] = useState(props)
const [categoryResponseList, setCategoryResponseList] = useState<any>([])
const [noSelectBrands, setNoSelectBrands] = useState<any[]>([])
......@@ -59,8 +58,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
categoryId: categoryid,
templateId: templateid
}
PublicApi.getTemplatePlatformFindCategoryList(param).then(res => {
PublicApi.getTemplateShopFindCategoryList(param).then(res => {
if (res.code === 1000) {
const data = res.data
setCategoryResponseList(data.categoryBOList || [])
......@@ -283,7 +281,10 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
</Button>
) : (
<Button
onClick={() => setOprationType('list')}
onClick={() => {
setOprationType('list')
setIsHighSearch(false)
}}
>
查看已选择商品({selectGoodsList.length})
</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