Commit e327a7b1 authored by 前端-许佳敏's avatar 前端-许佳敏

merge: pull code

parents 99ddeacc 288f5871
.shopCredit {
position: relative;
display: inherit;
.shopCreditIcon {
position: absolute;
bottom: 0;
......
......@@ -61,32 +61,6 @@ export const LOGISTICS_CENTER_URL = `${REQUEST_HEADER}logistics.${TOP_DOMAIN}`
*/
export const MANUFACTURE_CENTER_URL = `${REQUEST_HEADER}manufacture.${TOP_DOMAIN}`
/**
* 平台首页域名
*/
export const PLATFORM_DOMAIN = `${REQUEST_HEADER}www.${TOP_DOMAIN}`
/**
* 行情资讯域名
*/
export const INFO_CENTER_URL = `${REQUEST_HEADER}info.${TOP_DOMAIN}`
/**
* 企业采购域名
*/
export const SRM_CENTER_URL = `${REQUEST_HEADER}srm.${TOP_DOMAIN}`
/**
* 物流服务域名
*/
export const LOGISTICS_CENTER_URL = `${REQUEST_HEADER}logistics.${TOP_DOMAIN}`
/**
* 加工服务域名
*/
export const MANUFACTURE_CENTER_URL = `${REQUEST_HEADER}manufacture.${TOP_DOMAIN}`
export const MALL_TYPE = {
1: '企业商城',
......
......@@ -43,7 +43,7 @@ export const mainNavConfig = {
export const horizontalWrap = {
key: "5",
"5": {
"componentName": "div",
"componentName": "View",
"props": {
"style": {
"width": "1200px",
......@@ -69,7 +69,7 @@ export const channelCategoryConfig = {
export const bannerWrap = {
key: "7",
"7": {
"componentName": "div",
"componentName": "View",
"props": {
"style": {
"margin": "0 16px",
......
......@@ -25,7 +25,8 @@ interface ChannelPreviewPropsType {
* 模板名称
*/
template: string;
type: number
type: number,
shopId: number
}
}
}
......@@ -33,7 +34,7 @@ interface ChannelPreviewPropsType {
const TemplateList = ['science']
const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const { query: { id, template, type } } = props.location
const { query: { id, template, type, shopId } } = props.location
const userInfo: any = getAuth() || {}
const [loading, setLoading] = useState<boolean>(true)
const [theme, setTheme] = useState<string>('theme-channel-science')
......@@ -74,7 +75,10 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const params: any = {
memberId: userInfo.memberId
}
PublicApi.getTemplateAdornWebChannelFindAllFirstCategory(params).then(res => {
const headers: any = {
shopId
}
PublicApi.getTemplateAdornWebChannelFindAllFirstCategory(params, { headers }).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......
......@@ -25,6 +25,7 @@ interface ShopEditPropsType {
* 模板名称
*/
template: string;
shopId: number
}
}
}
......@@ -32,7 +33,7 @@ interface ShopEditPropsType {
const TemplateList = ['science']
const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
const { query: { id, template } } = props.location
const { query: { id, template, shopId } } = props.location
const [loading, setLoading] = useState<boolean>(true)
const [theme, setTheme] = useState<string>('theme-shop-science')
const [componentConfigs, setComponentConfigs] = useState({})
......@@ -94,7 +95,10 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
memberId,
roleId: memberRoleId
}
PublicApi.getTemplateAdornWebStoreFindAllFirstCategory(param).then(res => {
const headers: any = {
shopId
}
PublicApi.getTemplateAdornWebStoreFindAllFirstCategory(param, { headers }).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......
......@@ -4,12 +4,12 @@ import { Button, message, Modal } from 'antd'
import { StarFilled } from '@ant-design/icons'
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import credit_icon from '@/assets/imgs/credit_icon.png'
import styles from './index.less'
import ShopCredit from '@/components/ShopCredit'
import { PublicApi } from '@/services/api'
import { numFormat } from '@/utils/numberFomat'
import moment from 'moment'
import { COMMODITY_TYPE, CHANNEL_CENTER_URL, ICHANNEL_CENTER_URL, ENTERPRISE_CENTER_URL } from '@/constants'
import { GlobalConfig } from '@/global/config'
import { COMMODITY_TYPE, CHANNEL_CENTER_URL, ENTERPRISE_CENTER_URL } from '@/constants'
import styles from './index.less'
const Commodity: React.FC = () => {
const [list, setList] = useState([])
......@@ -42,7 +42,7 @@ const Commodity: React.FC = () => {
// })
}
const getShopCommodityCollectList = (): Promise<any[]> => {
const getShopCommodityCollectList = (): Promise<any> => {
return new Promise((resolve) => {
PublicApi.getSearchShopCommodityCollectGetCommodityCollectList().then((res) => {
if (res.code === 1000) {
......@@ -56,10 +56,11 @@ const Commodity: React.FC = () => {
})
}
const getChannelCommodityCollectList = (): Promise<any[]> => {
const getChannelCommodityCollectList = (): Promise<any> => {
return new Promise((resolve) => {
PublicApi.getSearchShopCommodityCollectChannelGetCommodityCollectList().then((res) => {
PublicApi.getSearchShopCommodityCollectChannelGetCommodityCollectList().then((res: any) => {
if (res.code === 1000) {
if (!res.data) return
const result = res.data.map((item) => {
return {
...item,
......@@ -111,50 +112,16 @@ const Commodity: React.FC = () => {
message.destroy()
message.info("该商品已下架")
}
// setBuyLoading(true)
// PublicApi.getSearchShopCommonGetCommodityIsPublish(param).then(res => {
// setBuyLoading(false)
// if(res.code === 1000) {
// if(res.data) {
// const el = document.createElement('a')
// switch (detail.type) {
// case 1:
// case 2:
// el.href = `${ENTERPRISE_CENTER_URL}/shop/commodity/detail/${detail.commodity.id}`;
// break
// case 3:
// el.href = `${CHANNEL_CENTER_URL}/m${detail.channelMemberId}/commodity/detail/${detail.commodity.id}`;
// break
// case 4:
// el.href = `${ICHANNEL_CENTER_URL}/m${detail.channelMemberId}/commodity/detail/${detail.commodity.id}&type=${detail.commodity.priceType}`;
// break
// case 5:
// el.href = `${CHANNEL_CENTER_URL}/m${detail.channelMemberId}/integral/detail/${detail.commodity.id}`;
// break
// }
// el.target = '_blank';
// el.id = detail.commodity.id
// // 防止反复添加
// if(!document.getElementById(detail.commodity.id)) {
// document.body.appendChild(el);
// }
// el.click()
// } else {
// message.destroy()
// message.info("该商品已下架")
// }
// }
// })
}
const renderBtn = (priceType, commodity) => {
switch (priceType) {
case COMMODITY_TYPE.prompt:
return <Button loading={buyLoading} className={styles.collection_state_wrap_btn} type="primary" onClick={() => linkToDetail(commodity)}>再次购买</Button>
return <Button loading={buyLoading} className={styles.collection_state_wrap_btn} type='link' onClick={() => linkToDetail(commodity)}>再次购买</Button>
case COMMODITY_TYPE.integral:
return <Button loading={buyLoading} className={styles.collection_state_wrap_btn} type="primary" onClick={() => linkToDetail(commodity)}>立即兑换</Button>
return <Button loading={buyLoading} className={styles.collection_state_wrap_btn} type='link' onClick={() => linkToDetail(commodity)}>立即兑换</Button>
case COMMODITY_TYPE.inquiry:
return <Button loading={buyLoading} className={styles.collection_state_wrap_btn} type="primary" onClick={() => linkToDetail(commodity)}>立即询价</Button>
return <Button loading={buyLoading} className={styles.collection_state_wrap_btn} type='link' onClick={() => linkToDetail(commodity)}>立即询价</Button>
}
}
......@@ -236,10 +203,7 @@ const Commodity: React.FC = () => {
</div>
</div>
<div className={cx(styles.commodity_list_item_item)}>
<div className={styles.shop_header_info_content_about_item}>
<i className={styles.icon}><img src={credit_icon} /></i>
<span>{item.commodity.creditScore || 0}</span>
</div>
<ShopCredit creditPoint={item.commodity.creditScore || 0} />
<div className={styles.commodity_shopname}>{item.commodity.memberName}</div>
</div>
<div className={cx(styles.commodity_list_item_item)}>
......@@ -250,11 +214,11 @@ const Commodity: React.FC = () => {
</div>
<div className={cx(styles.commodity_list_item_item, styles.float_right)}>
<div className={styles.collection_state_wrap}>
{renderBtn(item.commodity.priceType, item)}
<div className={cx(styles.collection_state)} onClick={() => handleCancelCollect(item)}>
<StarFilled />
<label>收藏</label>
</div>
{renderBtn(item.commodity.priceType, item)}
</div>
</div>
</div>
......@@ -262,7 +226,7 @@ const Commodity: React.FC = () => {
}
</div>
{/* {
totalCount > 0 && (
totalCount > pageSize && (
<div className={styles.pagination_wrap}>
<Pagination showSizeChanger={false} current={current} total={totalCount} pageSize={pageSize} onChange={handleChange} />
</div>
......
......@@ -154,7 +154,10 @@
&_item {
position: relative;
display: flex;
margin-bottom: 16px;
margin-bottom: 8px;
border-radius: 8px;
background-color: #ffffff;
padding: 16px;
&_item {
flex: 1;
......@@ -202,13 +205,13 @@
&_logo {
border-radius: 4px;
overflow: hidden;
width: 72px;
height: 72px;
margin-right: 16px;
width: 40px;
height: 40px;
margin-right: 12px;
&>img {
width: 72px;
height: 72px;
width: 40px;
height: 40px;
}
}
......
import React, { useState, Fragment, useEffect } from "react";
import { Form, Button } from "antd";
import { Form, Button, message } from "antd";
import { history, Prompt } from 'umi';
import moment from 'moment';
import AddedLayout from "@/pages/transaction/components/detailLayout";
......@@ -112,10 +112,23 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
})
}
useEffect(() => {
const getCacheOrderInfoByKey = (key: string) => {
return new Promise((resolve) => {
PublicApi.getOrderCacheGet({ key }).then((res) => {
message.destroy()
if (res.data) {
resolve(JSON.parse(res.data))
} else {
resolve(undefined)
}
})
})
}
const init = async () => {
if (isEdit && spam) {
// const data: any = JSON.parse(sessionStorage.getItem(spam));
const data: any = getCookie(spam)
const data: any = await getCacheOrderInfoByKey(spam)
if (!data) return
const inquiryListProductRequests: any[] = [];
inquiryListProductRequests.push({
......@@ -167,6 +180,10 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
})
})
}
}
useEffect(() => {
init()
}, [isEdit])
return (
......
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