Commit 5f093ede authored by GuanHua's avatar GuanHua

merge dev

parents 5fb7da00 4d959fac
...@@ -24,7 +24,7 @@ const UserHeader: React.FC<UserHeaderProps> = (props) => { ...@@ -24,7 +24,7 @@ const UserHeader: React.FC<UserHeaderProps> = (props) => {
const getRouteName = () => { const getRouteName = () => {
switch (pathname) { switch (pathname) {
case '/user/login': case '/user/login':
setTitle("欢迎登陆") setTitle("欢登录")
break break
case '/user/register': case '/user/register':
setTitle("欢迎注册") setTitle("欢迎注册")
......
...@@ -221,6 +221,8 @@ const SelectChannel:React.FC<IProps> = (props) => { ...@@ -221,6 +221,8 @@ const SelectChannel:React.FC<IProps> = (props) => {
const roleChange = (value: number, option: IOption) => { const roleChange = (value: number, option: IOption) => {
setSelectedOption(option) setSelectedOption(option)
setSelectedRole(option) setSelectedRole(option)
setMemberTableData([])
setSelectedMemberRowKeys([])
} }
const clickSearchChannel = (value: string) => { const clickSearchChannel = (value: string) => {
...@@ -243,12 +245,6 @@ const SelectChannel:React.FC<IProps> = (props) => { ...@@ -243,12 +245,6 @@ const SelectChannel:React.FC<IProps> = (props) => {
colon={false} colon={false}
initialValues={{childMemberRoleId: memberRoleList[0].roleId}} initialValues={{childMemberRoleId: memberRoleList[0].roleId}}
> >
{/* <Form.Item name="channelMemberRoleId">
<Radio.Group buttonStyle="solid" defaultValue={1} className={styles.customizeRadio}>
<Radio.Button key={1} value={1}>渠道采购商</Radio.Button>
<Radio.Button key={2} value={2}>渠道自有采购商</Radio.Button>
</Radio.Group>
</Form.Item> */}
<Form.Item <Form.Item
label="选择渠道角色" label="选择渠道角色"
name="childMemberRoleId" name="childMemberRoleId"
...@@ -308,6 +304,7 @@ const SelectChannel:React.FC<IProps> = (props) => { ...@@ -308,6 +304,7 @@ const SelectChannel:React.FC<IProps> = (props) => {
columns={columnsSetMember} columns={columnsSetMember}
rowSelection={memberRowSelection} rowSelection={memberRowSelection}
fetchTableData={params => fetchMemberData(params)} fetchTableData={params => fetchMemberData(params)}
forceRender={true}
formilyProps={ formilyProps={
{ {
ctx: { ctx: {
...@@ -329,6 +326,9 @@ const SelectChannel:React.FC<IProps> = (props) => { ...@@ -329,6 +326,9 @@ const SelectChannel:React.FC<IProps> = (props) => {
tableProps={{ tableProps={{
rowKey: 'memberId', rowKey: 'memberId',
}} }}
resetModal={{
destroyOnClose: true
}}
/> />
</>) </>)
} }
......
...@@ -532,6 +532,7 @@ const CommodityDetail = (props) => { ...@@ -532,6 +532,7 @@ const CommodityDetail = (props) => {
name: commodityDetail.name, name: commodityDetail.name,
packing: commodityDetail.packing, packing: commodityDetail.packing,
unitName: commodityDetail.unitName, unitName: commodityDetail.unitName,
attribute: attrAndValList.attributeAndValueList
} }
let sessionKey = `inquiry${selectCommodityId}${new Date().getTime()}` let sessionKey = `inquiry${selectCommodityId}${new Date().getTime()}`
...@@ -635,11 +636,23 @@ const CommodityDetail = (props) => { ...@@ -635,11 +636,23 @@ const CommodityDetail = (props) => {
} }
} }
setCurrentPriceRange(sortUnitPrice(unitPricePicList[0].unitPrice)) setCurrentPriceRange(sortUnitPrice(unitPricePicList[0].unitPrice))
setStockCount(unitPricePicList[0].stockCount) initStockCount(unitPricePicList)
// setStockCount(unitPricePicList[0].stockCount)
setCommodityImgList(tempImgList) setCommodityImgList(tempImgList)
setAttributeList(tempAttrList) setAttributeList(tempAttrList)
} }
const initStockCount = (unitPricePicList: any) => {
if (!unitPricePicList) {
return
}
let total = 0
for (let item of unitPricePicList) {
total += item.stockCount
}
setStockCount(total)
}
/** /**
* 对阶梯价格进行从大到小的排序 * 对阶梯价格进行从大到小的排序
* @param priceObj * @param priceObj
......
...@@ -182,7 +182,7 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => { ...@@ -182,7 +182,7 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
<span className={styles.welcome_text}>Hi, 欢迎来到{name}</span> <span className={styles.welcome_text}>Hi, 欢迎来到{name}</span>
</div> </div>
<div className={styles.btn_group}> <div className={styles.btn_group}>
<div className={cx(styles.btn_item, styles.primary)}><a href={`/user/login?redirect=${btoa(encodeURIComponent(String(window.location)))}`}></a></div> <div className={cx(styles.btn_item, styles.primary)}><a href={`/user/login?redirect=${btoa(encodeURIComponent(String(window.location)))}`}></a></div>
<div className={styles.btn_item}><a href="/user/register">注册</a></div> <div className={styles.btn_item}><a href="/user/register">注册</a></div>
</div> </div>
......
...@@ -13,12 +13,13 @@ interface RecommandPropsType { ...@@ -13,12 +13,13 @@ interface RecommandPropsType {
layoutType: LAYOUT_TYPE, layoutType: LAYOUT_TYPE,
categoryIds: number[], // 商品品类集合 categoryIds: number[], // 商品品类集合
loading: boolean, loading: boolean,
memberId?: number memberId?: number,
shopInfo?: any
} }
const Recommand: React.FC<RecommandPropsType> = (props) => { const Recommand: React.FC<RecommandPropsType> = (props) => {
const { mallTemplateId } = props.SiteStore const { mallTemplateId } = props.SiteStore
const { layoutType, categoryIds, loading, memberId } = props const { layoutType, categoryIds, loading, memberId, shopInfo } = props
const [list, setList] = useState<any>([]) const [list, setList] = useState<any>([])
useEffect(() => { useEffect(() => {
...@@ -100,7 +101,20 @@ const Recommand: React.FC<RecommandPropsType> = (props) => { ...@@ -100,7 +101,20 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
*/ */
const fetchFirstCategory = () => { const fetchFirstCategory = () => {
return new Promise((resolve) => { return new Promise((resolve) => {
PublicApi.getTemplatePlatformFindAllFirstCategory().then(res => { let getFn
let param: any ={}
switch (layoutType) {
case LAYOUT_TYPE.channel:
case LAYOUT_TYPE.ichannel:
param.memberId = memberId
getFn = PublicApi.getTemplateChannelFindAllFirstCategory
break;
default:
getFn = PublicApi.getTemplatePlatformFindAllFirstCategory
break;
}
getFn && getFn(param).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
resolve(res.data) resolve(res.data)
} }
...@@ -113,13 +127,32 @@ const Recommand: React.FC<RecommandPropsType> = (props) => { ...@@ -113,13 +127,32 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
*/ */
const fetchCategoryById = (categoryId) => { const fetchCategoryById = (categoryId) => {
return new Promise((resolve) => { return new Promise((resolve) => {
let param = { let param: any = {
templateId: mallTemplateId,
categoryId categoryId
} }
let templateId
let getFn
switch (layoutType) {
case LAYOUT_TYPE.channel:
param.memberId = memberId
templateId = shopInfo.channelShopTemplateId
getFn = PublicApi.getTemplateChannelFindFirstCategoryDetail
break;
case LAYOUT_TYPE.ichannel:
param.memberId = memberId
templateId = shopInfo.channelOwnShopTemplateId
getFn = PublicApi.getTemplateChannelFindFirstCategoryDetail
break
default:
getFn = PublicApi.getTemplatePlatformFindFirstCategoryDetail
templateId = mallTemplateId
break;
}
param.templateId = templateId
// @ts-ignore // @ts-ignore
PublicApi.getTemplatePlatformFindFirstCategoryDetail(param).then(res => { getFn && getFn(param).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
resolve(res.data) resolve(res.data)
} }
...@@ -129,8 +162,10 @@ const Recommand: React.FC<RecommandPropsType> = (props) => { ...@@ -129,8 +162,10 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
const getCategoryComponents = async () => { const getCategoryComponents = async () => {
let firstCategory: any = await fetchFirstCategory() let firstCategory: any = await fetchFirstCategory()
let categoryDetail: any = await fetchCategoryById(firstCategory[0].id) if (firstCategory[0]) {
setList(changeDataKey(categoryDetail.goodsBOList)) let categoryDetail: any = await fetchCategoryById(firstCategory[0].id)
setList(changeDataKey(categoryDetail.goodsBOList))
}
} }
const getCommodityDetailLink = (item) => { const getCommodityDetailLink = (item) => {
......
...@@ -515,7 +515,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => { ...@@ -515,7 +515,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
priceRange: item.commodityUnitPrice.priceRange, priceRange: item.commodityUnitPrice.priceRange,
category: item.commodityUnitPrice.commodity.customerCategory.name, category: item.commodityUnitPrice.commodity.customerCategory.name,
brand: item.commodityUnitPrice.commodity.brand.name, brand: item.commodityUnitPrice.commodity.brand.name,
commodityPic: item.commodityUnitPrice.commodityPic[0], commodityPic: item.commodityUnitPrice.commodity.mainPic,
attribute: item.commodityUnitPrice.attributeAndValueList, attribute: item.commodityUnitPrice.attributeAndValueList,
stockCount: item.stockCount || 0 stockCount: item.stockCount || 0
} }
...@@ -710,9 +710,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => { ...@@ -710,9 +710,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
</div> </div>
<div className={cx(styles.order_list_item_item, styles.goods_info)}> <div className={cx(styles.order_list_item_item, styles.goods_info)}>
<div className={styles.order_list_item_item_imgbox}> <div className={styles.order_list_item_item_imgbox}>
{ <ImageBox width={80} height={80} imgUrl={childItem.commodityUnitPrice.commodity.mainPic} direction="column" />
childItem.commodityUnitPrice.commodityPic && <ImageBox width={80} height={80} imgUrl={childItem.commodityUnitPrice.commodityPic[0]} direction="column" />
}
</div> </div>
<div> <div>
<div className={styles.order_list_item_item_name}> <div className={styles.order_list_item_item_name}>
......
...@@ -246,7 +246,6 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => { ...@@ -246,7 +246,6 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const shopType = addSchemaAction.getFieldValue('shopType'); const shopType = addSchemaAction.getFieldValue('shopType');
// 当商城类型为 渠道商城、渠道自由商城和渠道积分商城时,需要带上下面两个参数 // 当商城类型为 渠道商城、渠道自由商城和渠道积分商城时,需要带上下面两个参数
const { channelMemberIdList, channelMemberRoleId } = productState; const { channelMemberIdList, channelMemberRoleId } = productState;
const data = { const data = {
...params, ...params,
shopType: shopType, shopType: shopType,
......
...@@ -180,7 +180,7 @@ const Template: React.FC<{}> = () => { ...@@ -180,7 +180,7 @@ const Template: React.FC<{}> = () => {
type: 'string', type: 'string',
'x-component': 'Search', 'x-component': 'Search',
'x-component-props': { 'x-component-props': {
placeholder: '搜索', placeholder: '合同模板名称',
advanced: false, advanced: false,
}, },
}, },
......
...@@ -80,7 +80,7 @@ export const useSelfTable = () => { ...@@ -80,7 +80,7 @@ export const useSelfTable = () => {
width: 200 width: 200
}, },
{ {
title: '供应会员', title: '采购会员',
align: 'left', align: 'left',
dataIndex: 'supplyMembersName', dataIndex: 'supplyMembersName',
key: 'supplyMembersName', key: 'supplyMembersName',
......
...@@ -91,7 +91,7 @@ const User: React.FC = () => { ...@@ -91,7 +91,7 @@ const User: React.FC = () => {
</div> </div>
<Row className={'thirdLogin'} align='middle' justify='center'> <Row className={'thirdLogin'} align='middle' justify='center'>
<Col>其他方式登录 <Col>其他方式登录
<a title="微信登陆"><img src={wechat} alt="微信登录" /></a> <a title="微登录"><img src={wechat} alt="微信登录" /></a>
<a title="QQ登录"><img src={qq} alt="QQ登录" /></a> <a title="QQ登录"><img src={qq} alt="QQ登录" /></a>
<a title="支付宝登录"><img src={alipay} alt="支付宝登录" /></a> <a title="支付宝登录"><img src={alipay} alt="支付宝登录" /></a>
</Col> </Col>
......
...@@ -328,7 +328,7 @@ const UserRegistry = () => { ...@@ -328,7 +328,7 @@ const UserRegistry = () => {
</p> </p>
</div> </div>
} }
<p className={'readyLogin'}>已有平台账号? <Link to="/user/login">去登</Link></p> <p className={'readyLogin'}>已有平台账号? <Link to="/user/login">去登</Link></p>
</div> </div>
</div> </div>
</Fragment> </Fragment>
......
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