Commit 4f1574be authored by GuanHua's avatar GuanHua

fix: 修改店铺和渠道相关接口路径

parent 3ed824e3
......@@ -57,6 +57,7 @@
.wrapperSilder {
background-color: #38414A !important;
min-height: 100vh;
.menuBox {
padding: 0;
......
......@@ -12,7 +12,7 @@ import { MALL_TYPE } from '@/constants'
import copy from 'copy-to-clipboard'
import cx from 'classnames'
import styles from './index.less'
import { GetTemplateChannelFindChannelResponse } from '@/services/TemplateApi'
import { GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse } from '@/services/TemplateApi'
import { isEmpty } from '@formily/antd/esm/shared'
import { GlobalConfig } from '@/global/config'
import { getAuth } from '@/utils/auth'
......@@ -37,7 +37,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const [workshopPics, setWorkshopPics] = useState([]) // 厂房照片
const [honorPics, setHonorPics] = useState([]) // 资质荣誉
const [logo, setLogo] = useState<string>("")
const [shopInfo, setShopInfo] = useState<GetTemplateChannelFindChannelResponse>()
const [shopInfo, setShopInfo] = useState<GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse>()
const [shopId, setShopId] = useState<number>()
useEffect(() => {
......@@ -66,7 +66,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const param: any = {
memberId
}
PublicApi.getTemplateChannelFindChannel(param).then(res => {
PublicApi.getTemplateWebMemberChannelWebFindCurrMemberChannel(param).then(res => {
const data = res.data
if (res.code === 1000) {
setShopInfo(data)
......@@ -156,7 +156,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
value.shopId = shopId
setConfirmLoading(true)
PublicApi.postTemplateChannelSaveChannel(value).then(res => {
PublicApi.postTemplateWebMemberChannelWebSaveCurrMemberChannel(value).then(res => {
if (res.code === 1000) {
fetchShopInfo()
setFormIsHalfFilledOut(false)
......
......@@ -19,11 +19,11 @@ const ShopTemplate: React.FC = () => {
PublicApi.getTemplateWebPageTemplateWebFindAllShelfChannelTemplate().then(res => {
if (res.code === 1000) {
setTemplateList(res.data)
} else if (res.code === 47001) {
} else {
message.destroy()
message.info("您还未创建渠道商城,请先创建渠道商城")
setTimeout(() => {
history.push('/memberCenter/channekAbility/infoManage')
history.push('/memberCenter/channelAbility/infoManage')
}, 2000);
}
})
......
......@@ -53,7 +53,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindAdvertsByType(params).then(res => {
PublicApi.getTemplateAdornWebChannelFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
} else {
......@@ -71,7 +71,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindAdvertsByType(params).then(res => {
PublicApi.getTemplateAdornWebChannelFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
} else {
......@@ -89,7 +89,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const params: any = {
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindAllFirstCategory(params).then(res => {
PublicApi.getTemplateAdornWebChannelFindAllFirstCategory(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......@@ -108,7 +108,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindFirstCategoryDetail(param).then(res => {
PublicApi.getTemplateAdornWebChannelMemberCategoryAdorn(param).then(res => {
resolve(res.data)
})
})
......@@ -123,7 +123,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const params: any = {
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindChannel(params).then(res => {
PublicApi.getTemplateWebMemberChannelWebFindCurrMemberChannel(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......
......@@ -255,9 +255,9 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
}
let postFn;
if (templateType === 'channel') {
postFn = PublicApi.postTemplateChannelSaveAdvert
postFn = PublicApi.postTemplateAdornWebChannelSaveAdvert
} else {
postFn = PublicApi.postTemplateShopSaveAdvert
postFn = PublicApi.postTemplateAdornWebStoreSaveAdvert
}
postFn(param).then(res => {
......
......@@ -88,7 +88,7 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => {
const handleSearch = () => {
setCurrent(1)
let param = filterProps(form.getFieldsValue())
const param = filterProps(form.getFieldsValue())
setFilterParam(param)
}
......@@ -130,13 +130,13 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => {
const saveBrand = () => {
return new Promise((resolve, reject) => {
let param: any = {
const param: any = {
templateId: templateid,
categoryId: categoryid,
}
let ids: number[] = []
const ids: number[] = []
for (let item of selectBrandList) {
for (const item of selectBrandList) {
ids.push(item.brandId)
}
param.brandIds = ids
......@@ -152,8 +152,8 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => {
const handleChangeOprationType = (type: string) => {
setOprationType(type)
let keys: number[] = []
for (let item of selectBrandList) {
const keys: number[] = []
for (const item of selectBrandList) {
keys.push(item.brandId)
}
setBrandIds(keys)
......
......@@ -40,23 +40,23 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
}, [])
const initSelectKeys = () => {
let result: number[] = []
for (let item of categoryList) {
const result: number[] = []
for (const item of categoryList) {
result.push(item.categoryId)
}
setSelectKeys(result)
}
const fetchCategoryList = () => {
let param = {
const param = {
categoryId: categoryid,
templateId: templateid
}
let getFn;
if (templateType === 'channel') {
getFn = PublicApi.getTemplateChannelFindCategoryList
getFn = PublicApi.getTemplateAdornWebChannelFindCategoryList
} else {
getFn = PublicApi.getTemplateShopFindCategoryList
getFn = PublicApi.getTemplateAdornWebStoreFindCategoryList
}
//@ts-ignore
......@@ -68,7 +68,7 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
const handleSecondCategoryChange = (keys: any) => {
setSelectKeys(keys)
let result = categoryResponseList.filter(item => keys.includes(item.categoryId))
const result = categoryResponseList.filter(item => keys.includes(item.categoryId))
changeNewProps('categoryList', result)
}
......@@ -108,7 +108,7 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
message.error('最多推荐4个二级品类')
return
}
let param = {
const param = {
templateId: templateid,
categoryId: categoryid,
categoryAdvertPicUrl,
......@@ -116,9 +116,9 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
}
let postFn;
if (templateType === 'channel') {
postFn = PublicApi.postTemplateChannelSaveCategory
postFn = PublicApi.postTemplateAdornWebChannelSaveCategory
} else {
postFn = PublicApi.postTemplateShopSaveCategory
postFn = PublicApi.postTemplateAdornWebStoreSaveCategory
}
//@ts-ignore
postFn(param).then(res => {
......
......@@ -60,7 +60,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
current: 1,
pageSize: 100
}
PublicApi.getTemplateShopFindCategoryList(param).then(res => {
PublicApi.getTemplateAdornWebStoreFindCategoryList(param).then(res => {
if (res.code === 1000) {
const data = res.data
setCategoryResponseList(data.categoryBOList || [])
......@@ -73,10 +73,8 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
type: 2,
templateId: templateid,
categoryId: categoryid,
current: 1,
pageSize: 100
}
PublicApi.getTemplateShopFindBrandList(param).then((res: any) => {
PublicApi.getTemplateAdornWebStoreFindBrandList(param).then((res: any) => {
if (res.code === 1000) {
const dataInfo = res.data
setNoSelectBrands(dataInfo.data || [])
......@@ -102,9 +100,9 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
}
let getFn;
if (templateType === 'channel') {
getFn = PublicApi.getTemplateChannelFindGoodsList
getFn = PublicApi.getTemplateAdornWebChannelFindGoodsList
} else {
getFn = PublicApi.getTemplateShopFindGoodsList
getFn = PublicApi.getTemplateAdornWebStoreFindGoodsList
}
setSpinLoading(true)
......@@ -235,9 +233,9 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
let postFn;
if (templateType === 'channel') {
postFn = PublicApi.postTemplateChannelSaveGoods
postFn = PublicApi.postTemplateAdornWebChannelSaveGoods
} else {
postFn = PublicApi.postTemplateShopSaveGoods
postFn = PublicApi.postTemplateAdornWebStoreSaveGoods
}
postFn(param).then(res => {
......
......@@ -55,7 +55,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
roleId: memberRoleId
}
PublicApi.getTemplateShopFindAdvertsByType(params).then(res => {
PublicApi.getTemplateAdornWebStoreFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
} else {
......@@ -74,7 +74,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
roleId: memberRoleId
}
PublicApi.getTemplateShopFindAdvertsByType(params).then(res => {
PublicApi.getTemplateAdornWebStoreFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
} else {
......@@ -93,7 +93,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
memberId,
roleId: memberRoleId
}
PublicApi.getTemplateShopFindAllFirstCategory(param).then(res => {
PublicApi.getTemplateAdornWebStoreFindAllFirstCategory(param).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......@@ -113,7 +113,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
roleId: memberRoleId
}
PublicApi.getTemplateShopFindFirstCategoryDetail(param).then(res => {
PublicApi.getTemplateAdornWebStoreMemberCategoryAdorn(param).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......@@ -127,7 +127,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
const fetchShopInfo = () => {
return new Promise((resolve) => {
const param: any = {
memberId,
memberId,
roleId: memberRoleId
}
PublicApi.getTemplateShopFindShop(param).then(res => {
......
......@@ -8,7 +8,7 @@ import AboutUs from '../components/AboutUs'
import { inject, observer } from 'mobx-react'
import { PublicApi } from '@/services/api'
import { LAYOUT_TYPE } from '@/constants'
import { GetTemplatePlatformFindAllFirstCategoryResponse, GetTemplateChannelFindChannelResponse } from '@/services/TemplateApi'
import { GetTemplatePlatformFindAllFirstCategoryResponse, GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse } from '@/services/TemplateApi'
import { GlobalConfig } from '@/global/config'
import styles from './index.less'
......@@ -17,7 +17,7 @@ interface ChannelIndexPropsType {
memberId: number;
shopId: number;
shopUrlParam: string;
shopInfo: GetTemplateChannelFindChannelResponse;
shopInfo: GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse;
layoutType: LAYOUT_TYPE
}
......@@ -59,7 +59,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
memberId
}
PublicApi.getTemplateChannelFindAdvertsByType(params).then(res => {
PublicApi.getTemplateAdornWebChannelFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
setFirstAdvertList(res.data)
}
......@@ -73,7 +73,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
memberId
}
PublicApi.getTemplateChannelFindAdvertsByType(params).then(res => {
PublicApi.getTemplateAdornWebChannelFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
setSecondAdvertList(res.data)
}
......@@ -89,7 +89,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
memberId
}
PublicApi.getTemplateChannelFindAllFirstCategory(params).then(res => {
PublicApi.getTemplateAdornWebChannelFindAllFirstCategory(params).then(res => {
if (res.code === 1000) {
setCategoryList(res.data)
resolve(res.data)
......@@ -109,7 +109,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
memberId
}
PublicApi.getTemplateChannelFindFirstCategoryDetail(param).then(res => {
PublicApi.getTemplateAdornWebChannelMemberCategoryAdorn(param).then(res => {
if(res.code === 1000) {
resolve(res.data)
}
......
......@@ -45,7 +45,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
shopId: shopInfo.id,
status
}
PublicApi.postTemplateShopCollect(param).then(res => {
PublicApi.postTemplateWebMemberShopWebCollect(param).then(res => {
if (res.code === 1000) {
updateShopInfo()
message.destroy()
......
import React, { useState, useEffect } from 'react'
import { history } from 'umi'
import { Input } from 'antd'
import { GetTemplateChannelFindChannelResponse } from '@/services/TemplateApi'
import { GetTemplateWebMemberChannelWebMemberChannelMainResponse } from '@/services/TemplateApi'
import isEmpty from 'lodash/isEmpty'
import styles from './index.less'
import { LAYOUT_TYPE } from '@/constants'
import { GlobalConfig } from '@/global/config'
interface HeaderPropsType {
shopInfo: GetTemplateChannelFindChannelResponse,
shopInfo: GetTemplateWebMemberChannelWebMemberChannelMainResponse,
id: number,
shopUrlParam: string,
type: LAYOUT_TYPE
......@@ -20,7 +20,7 @@ const Header: React.FC<HeaderPropsType> = (props) => {
const { search } = history.location.query
useEffect(() => {
if (!!search) {
if (search) {
setSearchValue(search)
} else {
setSearchValue("")
......
/*
* 最新加入
* @Author: ghua
* @Date: 2020-08-20 16:23:39
* @Author: ghua
* @Date: 2020-08-20 16:23:39
* @Last Modified by: ghua
* @Last Modified time: 2020-10-22 17:49:07
*/
......@@ -24,7 +24,7 @@ const NewJoin: React.FC<NewJoinPropsType> = (props) => {
}, [])
const fetchNewJoinShopList = () => {
PublicApi.getTemplateShopFindNewAddShop().then(res => {
PublicApi.getTemplateWebMemberShopWebNewAddMemberShop().then(res => {
if (res.code === 1000) {
setNewJoinShopList(res.data)
}
......
......@@ -107,7 +107,7 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
case LAYOUT_TYPE.channel:
case LAYOUT_TYPE.ichannel:
param.memberId = memberId
getFn = PublicApi.getTemplateChannelFindAllFirstCategory
getFn = PublicApi.getTemplateAdornWebChannelFindAllFirstCategory
break;
default:
getFn = PublicApi.getTemplatePlatformFindAllFirstCategory
......@@ -137,12 +137,12 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
case LAYOUT_TYPE.channel:
param.memberId = memberId
templateId = shopInfo.channelShopTemplateId
getFn = PublicApi.getTemplateChannelFindFirstCategoryDetail
getFn = PublicApi.getTemplateAdornWebChannelMemberCategoryAdorn
break;
case LAYOUT_TYPE.ichannel:
param.memberId = memberId
templateId = shopInfo.channelOwnShopTemplateId
getFn = PublicApi.getTemplateChannelFindFirstCategoryDetail
getFn = PublicApi.getTemplateAdornWebChannelMemberCategoryAdorn
break
default:
getFn = PublicApi.getTemplatePlatformFindFirstCategoryDetail
......
......@@ -67,7 +67,7 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
shopId: shopInfo.id,
status
}
PublicApi.postTemplateShopCollect(param).then(res => {
PublicApi.postTemplateWebMemberShopWebCollect(param).then(res => {
if (res.code === 1000) {
updateShopInfo()
message.destroy()
......
......@@ -9,7 +9,7 @@ import { LAYOUT_TYPE } from "@/constants"
import { inject, observer } from 'mobx-react'
import TopBar from '../components/TopBar'
import { PublicApi } from '@/services/api'
import { GetTemplateChannelFindChannelResponse } from '@/services/TemplateApi'
import { GetTemplateWebMemberChannelWebMemberChannelMainResponse } from '@/services/TemplateApi'
import SearchShopResult from '../components/SearchShopResult'
import ChannelHeader from '../components/ChannelHeader'
import MainNav from '../components/MainNav'
......@@ -30,7 +30,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
const { children, location } = props
const [templateName] = useState<string>('theme-channel-science')
const { channelId } = location.query
const [shopInfo, setShopInfo] = useState<GetTemplateChannelFindChannelResponse>()
const [shopInfo, setShopInfo] = useState<GetTemplateWebMemberChannelWebMemberChannelMainResponse>()
const [query, setQuery] = useState<any>({})
const [loading, setLoading] = useState<boolean>(true)
......@@ -62,7 +62,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
const fetchShopInfo = (memberId) => {
PublicApi.getTemplateChannelFindChannel({ memberId }).then(res => {
PublicApi.getTemplateWebMemberChannelWebMemberChannelMain({ memberId }).then(res => {
if (res.code === 1000) {
setShopInfo(res.data)
}
......
......@@ -9,7 +9,7 @@ import { LAYOUT_TYPE } from "@/constants"
import { inject, observer } from 'mobx-react'
import TopBar from '../components/TopBar'
import { PublicApi } from '@/services/api'
import { GetTemplateChannelFindChannelResponse } from '@/services/TemplateApi'
import { GetTemplateWebMemberChannelWebMemberChannelMainResponse } from '@/services/TemplateApi'
import SearchShopResult from '../components/SearchShopResult'
import ChannelHeader from '../components/ChannelHeader'
import MainNav from '../components/MainNav'
......@@ -30,7 +30,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
const { children, location } = props
const [templateName] = useState<string>('theme-channel-science')
const { channelId } = location.query
const [shopInfo, setShopInfo] = useState<GetTemplateChannelFindChannelResponse>()
const [shopInfo, setShopInfo] = useState<GetTemplateWebMemberChannelWebMemberChannelMainResponse>()
const [query, setQuery] = useState<any>({})
const [loading, setLoading] = useState<boolean>(true)
......@@ -62,7 +62,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
const fetchShopInfo = (memberId) => {
PublicApi.getTemplateChannelFindChannel({ memberId }).then(res => {
PublicApi.getTemplateWebMemberChannelWebMemberChannelMain({ memberId }).then(res => {
if (res.code === 1000) {
setShopInfo(res.data)
}
......
......@@ -73,7 +73,6 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
param.roleId = roleId
getShopInfoFn = PublicApi.getTemplateWebMemberShopWebFindByMemberIdAndRoleId
}
console.log(param, "param")
getShopInfoFn && getShopInfoFn(param).then(res => {
if (res.code === 1000) {
setShopInfo(res.data)
......
......@@ -13,7 +13,7 @@ import ImageBox from '@/components/ImageBox'
import { store } from '@/store'
import { LAYOUT_TYPE } from '@/constants'
import { GetSearchShopPurchaseGetPurchaseListResponse } from '@/services/SearchApi'
import { GetTemplateChannelFindChannelResponse } from '@/services/TemplateApi'
import { GetTemplateWebMemberChannelWebMemberChannelMainResponse } from '@/services/TemplateApi'
import { isEmpty } from 'lodash'
import { getAuth } from '@/utils/auth'
import { GlobalConfig } from '@/global/config'
......@@ -21,7 +21,7 @@ import useStoreId from '@/hooks/useStoreId'
interface PurchaseOrderPropsType {
layoutType: LAYOUT_TYPE,
shopInfo: GetTemplateChannelFindChannelResponse,
shopInfo: GetTemplateWebMemberChannelWebMemberChannelMainResponse,
shopUrlParam: string,
mallInfo: any,
location: any
......
......@@ -47,7 +47,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
roleId: shopInfo.roleId
}
PublicApi.getTemplateShopFindAdvertsByType(params).then(res => {
PublicApi.getTemplateAdornWebStoreFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
setFirstAdvertList(res.data)
}
......@@ -62,7 +62,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
roleId: shopInfo.roleId
}
PublicApi.getTemplateShopFindAdvertsByType(params).then(res => {
PublicApi.getTemplateAdornWebStoreFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
setSecondAdvertList(res.data)
}
......@@ -78,7 +78,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
memberId,
roleId: shopInfo.roleId
}
PublicApi.getTemplateShopFindAllFirstCategory(param).then(res => {
PublicApi.getTemplateAdornWebStoreFindAllFirstCategory(param).then(res => {
if (res.code === 1000) {
setCategoryList(res.data)
resolve(res.data)
......@@ -99,7 +99,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
roleId: shopInfo.roleId
}
PublicApi.getTemplateShopFindFirstCategoryDetail(param).then(res => {
PublicApi.getTemplateAdornWebStoreMemberCategoryAdorn(param).then(res => {
if(res.code === 1000) {
resolve(res.data)
}
......
......@@ -34,8 +34,8 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
}
const handleNext = () => {
let imgLength = shopInfo?.honorPics.length
let maxDistance = (imgLength - 3) * unitDistance
const imgLength = shopInfo?.honorPics.length
const maxDistance = (imgLength - 3) * unitDistance
if (maxDistance > Math.abs(offSetLeft)) {
setOffSetLeft(offSetLeft - unitDistance)
......@@ -50,7 +50,7 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
content: layoutType === LAYOUT_TYPE.shop ? `是否申请成为该店铺会员?` : '是否申请成为该渠道所属下级渠道会员?',
onOk: () => {
return new Promise((resolve, reject) => {
let param = {
const param = {
memberId: shopInfo.memberId,
roleId: shopInfo.roleId
}
......@@ -61,7 +61,7 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
} else {
reject()
}
setApplyLoading(false)
}).catch(() => {
setApplyLoading(false)
......@@ -76,12 +76,12 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
}
const handleCollect = () => {
let status = !collectState
let param = {
const status = !collectState
const param = {
shopId: shopInfo.id,
status
}
PublicApi.postTemplateShopCollect(param).then(res => {
PublicApi.postTemplateWebMemberShopWebCollect(param).then(res => {
if (res.code === 1000) {
updateShopInfo()
message.destroy()
......
......@@ -12,7 +12,7 @@ import { store } from '@/store'
import isEmpty from 'lodash/isEmpty'
import styles from './index.less'
import { PublicApi } from '@/services/api'
import { GetTemplateShopFindShopListResponseDetail } from '@/services/TemplateApi'
import { GetTemplateWebMemberShopWebMemberShopListResponseDetail } from '@/services/TemplateApi'
interface ShopListPropsType {
location: any
......@@ -26,7 +26,7 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
const [current, setCurrent] = useState<number>(1)
const [pageSize] = useState<number>(10)
const [loading, setLoading] = useState<boolean>(true)
const [shopList, setShopList] = useState<GetTemplateShopFindShopListResponseDetail[]>([])
const [shopList, setShopList] = useState<GetTemplateWebMemberShopWebMemberShopListResponseDetail[]>([])
const [totalCount, setTotalCount] = useState<number>(0)
//FILTER_TYPE.activeStores,
const filterConfig = [FILTER_TYPE.category, FILTER_TYPE.useArea, FILTER_TYPE.activeStores, FILTER_TYPE.newJoin]
......@@ -48,7 +48,7 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
current: currentParam ? currentParam : current,
pageSize
}
if (!!search) {
if (search) {
param.memberName = search
}
......@@ -57,7 +57,7 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
}
setLoading(true)
PublicApi.getTemplateShopFindShopList(param).then(res => {
PublicApi.getTemplateWebMemberShopWebMemberShopList(param).then(res => {
setLoading(false)
if (res.code === 1000) {
setShopList(res.data.data)
......
......@@ -61,7 +61,7 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
</div>
<div className={styles.shop_list_info_about_item}>
<i className={styles.icon}><img src={shop_icon} /></i>
<span className={styles.red}>{item.registerYears}</span>
<span className={styles.red}>{item.registerYears || 0}</span>
<span></span>
</div>
</div>
......
......@@ -52,7 +52,7 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindAdvertsByType(params).then(res => {
PublicApi.getTemplateAdornWebChannelFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
} else {
......@@ -70,7 +70,7 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindAdvertsByType(params).then(res => {
PublicApi.getTemplateAdornWebChannelFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
} else {
......@@ -88,7 +88,7 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
const params: any = {
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindAllFirstCategory(params).then(res => {
PublicApi.getTemplateAdornWebChannelFindAllFirstCategory(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
} else {
......@@ -109,7 +109,7 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindFirstCategoryDetail(param).then(res => {
PublicApi.getTemplateAdornWebChannelMemberCategoryAdorn(param).then(res => {
resolve(res.data)
})
})
......@@ -124,7 +124,7 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
const params: any = {
memberId: userInfo.memberId
}
PublicApi.getTemplateChannelFindChannel(params).then(res => {
PublicApi.getTemplateWebMemberChannelWebFindCurrMemberChannel(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......
This diff is collapsed.
......@@ -19,7 +19,7 @@ const ShopTemplate: React.FC = () => {
PublicApi.getTemplateWebPageTemplateWebFindAllShelfShopTemplate().then(res => {
if (res.code === 1000) {
setTemplateList(res.data)
} else if (res.code === 47001) {
} else {
message.destroy()
message.info("您还未创建店铺,请先创建店铺")
setTimeout(() => {
......
import React, { useEffect, useState } from 'react'
import cx from 'classnames'
import { Rate, Pagination, Modal, message } from 'antd'
import { StarFilled } from '@ant-design/icons'
import shop_icon from '@/assets/imgs/shop_icon.png'
import credit_icon from '@/assets/imgs/credit_icon.png'
import { PublicApi } from '@/services/api'
import moment from 'moment'
import styles from './index.less'
const Shops: React.FC = () => {
const [list, setList] = useState([])
const [current, setCurrent] = useState<number>(1)
const [pageSize, setPageSize] = useState<number>(10)
const [totalCount, setTotalCount] = useState<number>(0)
useEffect(() => {
fetchCollectShopList()
}, [current])
/**
* 获取收藏的店铺列表
*/
const fetchCollectShopList = () => {
let param = {
current,
pageSize
}
//@ts-ignore
PublicApi.getTemplateShopCollectList(param).then(res => {
if (res.code === 1000) {
setList(res.data.data)
setTotalCount(res.data.totalCount)
}
})
}
const handleChange = (page) => {
setCurrent(page)
}
const handleCancelCollect = (detail) => {
Modal.confirm({
centered: true,
className: styles.mallComfirm,
content: `是否要取消收藏?`,
onOk: () => {
return new Promise((resolve, reject) => {
let param = {
shopId: detail.id,
status: false
}
PublicApi.postTemplateShopCollect(param).then(res => {
if (res.code === 1000) {
// fetchPurchaseList()
fetchCollectShopList()
resolve()
} else {
reject()
}
}).catch(() => {
reject()
})
})
}
})
}
const linkToDetail = (detail) => {
if (detail.status === 1) {
let el = document.createElement('a')
el.href = `/shop?shopId=${btoa(JSON.stringify({ shopId: detail.id, memberId: detail.memberId }))}`;
el.target = '_blank';
el.click()
} else {
message.destroy()
message.info("该店铺已冻结")
}
}
return (
<>
<div className={styles.shops_list}>
{
list && list.map((item, index) => (
<div className={styles.shops_list_item} key={`shops_list_item_${index}`}>
<div className={cx(styles.shops_list_item_item, styles.morehalf)}>
<div className={styles.shop_header_info}>
<div className={styles.shop_header_info_logo}>
<img src={item.logo} />
</div>
<div className={styles.shop_header_info_content}>
<div className={styles.shop_header_info_content_name} onClick={() => linkToDetail(item)}>
<span>{item.memberName}</span>
</div>
<div className={styles.shop_header_info_content_about}>
<div className={styles.shop_header_info_content_about_item}>
<i className={styles.icon}><img src={shop_icon} /></i>
<span className={styles.red}>{item.registerYears}</span>
<span></span>
</div>
<div className={styles.shop_header_info_content_about_item}>
<i className={styles.icon}><img src={credit_icon} /></i>
<span>{item.integral}</span>
</div>
</div>
</div>
</div>
</div>
<div className={cx(styles.shops_list_item_item)}>
{/* <i className={cx(styles.level_icon, styles.level3)}></i> */}
<div className={styles.rate_wrap}>
<span>满意度:</span>
<Rate disabled defaultValue={item.satisfied} />
</div>
</div>
<div className={cx(styles.shops_list_item_item)}>
<span className={styles.date}>{moment(item.collectTime).format("YYYY-MM-DD HH:mm")}</span>
</div>
<div className={cx(styles.shops_list_item_item)}>
<div className={cx(styles.collection_state)} onClick={() => handleCancelCollect(item)}>
<StarFilled />
<label>收藏</label>
</div>
</div>
</div>
))
}
</div>
{
totalCount > 0 && (
<div className={styles.pagination_wrap}>
<Pagination showSizeChanger={false} current={current} total={totalCount} pageSize={pageSize} onChange={handleChange} />
</div>
)
}
</>
)
}
export default Shops
import React, { useEffect, useState } from 'react'
import cx from 'classnames'
import { Rate, Pagination, Modal, message } from 'antd'
import { StarFilled } from '@ant-design/icons'
import shop_icon from '@/assets/imgs/shop_icon.png'
import credit_icon from '@/assets/imgs/credit_icon.png'
import { PublicApi } from '@/services/api'
import moment from 'moment'
import styles from './index.less'
const Shops: React.FC = () => {
const [list, setList] = useState([])
const [current, setCurrent] = useState<number>(1)
const [pageSize, setPageSize] = useState<number>(10)
const [totalCount, setTotalCount] = useState<number>(0)
useEffect(() => {
fetchCollectShopList()
}, [current])
/**
* 获取收藏的店铺列表
*/
const fetchCollectShopList = () => {
const param: any = {
current,
pageSize
}
PublicApi.getTemplateWebMemberShopWebCollectList(param).then(res => {
if (res.code === 1000) {
setList(res.data.data)
setTotalCount(res.data.totalCount)
}
})
}
const handleChange = (page) => {
setCurrent(page)
}
const handleCancelCollect = (detail) => {
Modal.confirm({
centered: true,
className: styles.mallComfirm,
content: `是否要取消收藏?`,
onOk: () => {
return new Promise((resolve, reject) => {
const param = {
shopId: detail.id,
status: false
}
PublicApi.postTemplateWebMemberShopWebCollect(param).then(res => {
if (res.code === 1000) {
// fetchPurchaseList()
fetchCollectShopList()
resolve()
} else {
reject()
}
}).catch(() => {
reject()
})
})
}
})
}
const linkToDetail = (detail) => {
if (detail.status === 1) {
const el = document.createElement('a')
el.href = `/shop?shopId=${btoa(JSON.stringify({ shopId: detail.id, memberId: detail.memberId }))}`;
el.target = '_blank';
el.click()
} else {
message.destroy()
message.info("该店铺已冻结")
}
}
return (
<>
<div className={styles.shops_list}>
{
list && list.map((item, index) => (
<div className={styles.shops_list_item} key={`shops_list_item_${index}`}>
<div className={cx(styles.shops_list_item_item, styles.morehalf)}>
<div className={styles.shop_header_info}>
<div className={styles.shop_header_info_logo}>
<img src={item.logo} />
</div>
<div className={styles.shop_header_info_content}>
<div className={styles.shop_header_info_content_name} onClick={() => linkToDetail(item)}>
<span>{item.memberName}</span>
</div>
<div className={styles.shop_header_info_content_about}>
<div className={styles.shop_header_info_content_about_item}>
<i className={styles.icon}><img src={shop_icon} /></i>
<span className={styles.red}>{item.registerYears}</span>
<span></span>
</div>
<div className={styles.shop_header_info_content_about_item}>
<i className={styles.icon}><img src={credit_icon} /></i>
<span>{item.integral}</span>
</div>
</div>
</div>
</div>
</div>
<div className={cx(styles.shops_list_item_item)}>
{/* <i className={cx(styles.level_icon, styles.level3)}></i> */}
<div className={styles.rate_wrap}>
<span>满意度:</span>
<Rate disabled defaultValue={item.satisfied} />
</div>
</div>
<div className={cx(styles.shops_list_item_item)}>
<span className={styles.date}>{moment(item.collectTime).format("YYYY-MM-DD HH:mm")}</span>
</div>
<div className={cx(styles.shops_list_item_item)}>
<div className={cx(styles.collection_state)} onClick={() => handleCancelCollect(item)}>
<StarFilled />
<label>收藏</label>
</div>
</div>
</div>
))
}
</div>
{
totalCount > 0 && (
<div className={styles.pagination_wrap}>
<Pagination showSizeChanger={false} current={current} total={totalCount} pageSize={pageSize} onChange={handleChange} />
</div>
)
}
</>
)
}
export default Shops
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