Commit a8216b1b authored by GuanHua's avatar GuanHua

Merge branch 'dev' into test

parents 7c9300a4 3ed91a61
export default {
'/api': {
'target': 'http://10.0.0.25:8100/',
'target': 'http://10.0.0.10:8100/',
'changeOrigin': true,
'pathRewrite': { '^/api': '' },
}
......
......@@ -182,6 +182,25 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
return '积分兑换商品'
}
const checkSellingPoint = (rule, value, callback) => {
try {
if(Array.isArray(value)){
if(value.length > 3) {
throw new Error('商品卖点不能超过三个');
} else {
value.map(item => {
if(item.length > 8){
throw new Error('标签长度不超过八个字符');
}
})
callback()
}
}
} catch (err) {
callback(err)
}
}
return (<>
<Form
{...layout}
......@@ -295,18 +314,17 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
</Tooltip>
</span>
}
// rules={[
// {
// required: true,
// message: '请添加卖点标签',
// },
// ]}
rules={[
{
validator: checkSellingPoint
},
]}
>
<Select
mode="tags"
placeholder="请输入选择商品卖点"
maxTagCount={3}
maxTagTextLength={8}
placeholder="请输入选择商品卖点"
// maxTagCount={3}
// maxTagTextLength={8}
tagRender={tagRender}
/>
</Form.Item>
......
......@@ -37,6 +37,17 @@ const ProductImageForm: React.FC<{}> = (props) => {
}
}, [])
// 修改图片操作中icon的描述
useEffect(() => {
let parentEle = document.getElementById('uploadBox');
let btns = parentEle.getElementsByClassName('ant-upload-list-item-card-actions-btn');
for(let i = 0; i < btns.length; i++){
if(btns[i].getAttribute('title') === '下载文件'){
btns[i].setAttribute('title', '编辑文件')
}
}
})
useEffect(() => {
// 品类 变动清空数据
// 编辑下 flag为false 不清空;编辑下 flag为true 新建清空
......@@ -257,7 +268,7 @@ const ProductImageForm: React.FC<{}> = (props) => {
</ul>
</Col>
{/* 按属性设置---所有属性共用 */}
<Col span={20} style={{ padding: 24 }}>
<Col span={20} style={{ padding: 24 }} id="uploadBox">
{
!setImageType ?
(priceAttributeParamsByRender?.length>0 && priceAttributeParamsByRender[0]?.attributeAndValueList?.length!=0 ? priceAttributeParamsByRender.map((item, index) =>
......@@ -277,6 +288,7 @@ const ProductImageForm: React.FC<{}> = (props) => {
onDownload={(file)=>handlefileEdit(file, index)}
showUploadList={{showDownloadIcon: true, downloadIcon: <EditOutlined style={{color: '#fff'}} />}}
data={{fileType: UPLOAD_TYPE}}
className="uploadBox"
>
{item.commodityPic.length >= 6 ? null : uploadButton}
</Upload>
......@@ -310,6 +322,7 @@ const ProductImageForm: React.FC<{}> = (props) => {
onDownload={(file)=>handlefileEdit(file, 0)}
showUploadList={{showDownloadIcon: true, downloadIcon: <EditOutlined style={{color: '#fff'}} />}}
data={{fileType: UPLOAD_TYPE}}
className="uploadBox"
>
{commonImageList.length >= 6 ? null : uploadButton}
</Upload>
......
......@@ -5,7 +5,9 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'
import {
QuestionCircleOutlined,
FormOutlined,
UserOutlined
UserOutlined,
CaretDownOutlined,
CaretUpOutlined
} from '@ant-design/icons'
import { ColumnType } from 'antd/lib/table/interface'
import cx from 'classnames'
......@@ -45,6 +47,7 @@ const viewProducts: React.FC<{}> = () => {
const [logisticTemplateName, setLogisticTemplateName] = useState<string>()
const [logisticResourceCompanyName, setLogisticResourceCompanyName] = useState<string>()
const [logisticResourceSendAddress, setLogisticResourceSendAddress] = useState<string>()
const [showMore, setShowMore] = useState<any>({ areaShowMore: false, shopShowMore: false })
useEffect(() => {
const { id } = history.location.query
......@@ -52,7 +55,7 @@ const viewProducts: React.FC<{}> = () => {
PublicApi.getProductCommodityGetCommodity({id: id}).then(res=>{
const { code, data } = res
if(code===1000){
console.log(data, 'data')
// console.log(data, 'data')
setPorductDetail(data)
renderDataByTab(data)
constructTableData(data, data.unitPriceAndPicList)
......@@ -155,7 +158,7 @@ const viewProducts: React.FC<{}> = () => {
let dataByTab = groupBy(archiveByAttributeGroup, 'groupName')
setDataByTab(Object.values(dataByTab))
setDataByTabTitle(Object.keys(dataByTab))
console.log(dataByTab,'dataByData')
// console.log(dataByTab,'dataByData')
}
/* 按属性归类 */
......@@ -207,14 +210,14 @@ const viewProducts: React.FC<{}> = () => {
<Descriptions colon={true} style={{paddingLeft:128}}>
<Descriptions.Item label="商品品牌">{productDetail?.brand?.name}</Descriptions.Item>
<Descriptions.Item label="商品品类">{productDetail?.customerCategory?.fullName}</Descriptions.Item>
{
{/* {
productDetail?.commodityShopList?.length>0 &&
<Descriptions.Item label="上架商城">
{
productDetail.commodityShopList.map((item, index)=><span key={index}><img width="24" height="24" style={{borderRadius: '50%', marginRight: 4}} src={item.logoUrl} title={item.name} alt={item.name}/></span>)
}
</Descriptions.Item>
}
} */}
{renderStatus(productDetail?.status, 1) && <Descriptions.Item label="审核状态">{renderStatus(productDetail?.status, 1)}</Descriptions.Item>}
{renderStatus(productDetail?.status, 2) && <Descriptions.Item label="商品状态">{renderStatus(productDetail?.status, 2)}</Descriptions.Item>}
<Descriptions.Item label="商品类型"><span className="commonStatusValid"></span>{renderCustomerCategoryType(productDetail?.customerCategory?.type)}</Descriptions.Item>
......@@ -242,7 +245,7 @@ const viewProducts: React.FC<{}> = () => {
/* 构建表格数据 */
const constructTableData = (product: any, unitPriceAndPicList: GetProductCommodityGetCommodityResponse["unitPriceAndPicList"]) => {
// 构建列
console.log(product, unitPriceAndPicList, '构建列')
// console.log(product, unitPriceAndPicList, '构建列')
let _col = [];
let col_productName = { title: '商品名称', dataIndex: '商品名称', key: '索引' }
_col.push(col_productName)
......@@ -311,7 +314,7 @@ const viewProducts: React.FC<{}> = () => {
}
return temp
})
console.log(_tableData, _attributeArrByImageRender, '_tableData')
// console.log(_tableData, _attributeArrByImageRender, '_tableData')
setTableRenderDatas(_tableData)
setAttributeArrByImageRender(_attributeArrByImageRender)
setImageArrByImageRender(_imageArrByImageRender)
......@@ -321,6 +324,41 @@ const viewProducts: React.FC<{}> = () => {
history.push(`/memberCenter/commodityAbility/commodity/products/edit?id=${productDetail.id}`)
}
const toogleMore = (str: string) => {
if(str === 'area'){
setShowMore({
shopShowMore: showMore.shopShowMore,
areaShowMore: !showMore.areaShowMore
})
}else{
setShowMore({
shopShowMore: !showMore.shopShowMore,
areaShowMore: showMore.areaShowMore
})
}
}
const renderMoreList = (data, str) => {
const showDataSource = (str === 'area' ? showMore.areaShowMore : showMore.shopShowMore) ? data : [...data].splice(0, 3)
return <>
<p>
{
str === 'area'
?
showDataSource.map((_item, _i) => <p key={_i}>{_item.provinceName+'/'+(_item.cityName||'')}</p>)
:
showDataSource.map((_item, _i) => <p key={_i}>{_item.name}</p>)
}
</p>
{
data.length > 3 &&
<p onClick={()=>toogleMore(str)} style={{ cursor: 'pointer' }} className="commonPickColor">
展开{showMore.areaShowMore ? <CaretDownOutlined /> : <CaretUpOutlined />}
</p>
}
</>
}
return (
<PageHeaderWrapper
title={productDetail?.name}
......@@ -346,7 +384,7 @@ const viewProducts: React.FC<{}> = () => {
<Space direction="vertical" style={{width:'100%'}}>
<Row gutter={[26,0]}>
<Col span={8}>
<Card headStyle={{borderBottom:'none'}} title="基本信息" style={{height:'320px'}}>
<Card headStyle={{borderBottom:'none'}} title="基本信息" style={{height:'100%'}}>
{
productDetail?.slogan && <Row>
<Col span={4}>
......@@ -374,15 +412,30 @@ const viewProducts: React.FC<{}> = () => {
<Col span={20}>
<p>
{
productDetail?.commodityAreaList.length>0 ? productDetail?.commodityAreaList.map(_item => <p>{_item.provinceName+'/'+(_item.cityName||'')}</p>) : '全国'
productDetail?.commodityAreaList.length>0 ? renderMoreList(productDetail?.commodityAreaList, 'area') : '全国'
}
</p>
</Col>
</Row>
{
productDetail?.commodityShopList?.length>0 &&
<Row>
<Col span={4}>
<p>上架商城:</p>
</Col>
<Col span={20}>
<p>
{
renderMoreList(productDetail.commodityShopList, 'shop')
}
</p>
</Col>
</Row>
}
</Card>
</Col>
<Col span={8}>
<Card headStyle={{borderBottom:'none'}} title="物流信息" style={{height:'320px'}}>
<Card headStyle={{borderBottom:'none'}} title="物流信息" style={{height:'100%'}}>
{
renderDeliveryType(productDetail?.logistics?.deliveryType) &&
<Row>
......@@ -452,7 +505,7 @@ const viewProducts: React.FC<{}> = () => {
</Card>
</Col>
<Col span={8}>
<Card headStyle={{borderBottom:'none'}} title="其他信息" style={{height:'320px'}}>
<Card headStyle={{borderBottom:'none'}} title="其他信息" style={{height:'100%'}}>
<Row>
<Col span={4}>
<p>提供发票:</p>
......
......@@ -46,6 +46,7 @@
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
flex: 1;
&>a {
color: #303133;
......
......@@ -3,7 +3,7 @@
* @Author: ghua
* @Date: 2020-08-20 16:23:39
* @Last Modified by: ghua
* @Last Modified time: 2020-08-20 16:38:49
* @Last Modified time: 2020-10-22 18:03:14
*/
import React from 'react'
......
.filter_brand {
margin: 10px 0;
max-height: 320px;
overflow-y: auto;
padding: 10px 0;
&::-webkit-scrollbar {
width: 8px;
}
&::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(48, 49, 51, 0.24);
}
&::-webkit-scrollbar-track {
background: rgba(48, 49, 51, 0.08);
}
.filter_brand_list {
display: flex;
......
......@@ -46,6 +46,7 @@
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
flex: 1;
&>a {
color: #303133;
......
......@@ -3,7 +3,7 @@
* @Author: ghua
* @Date: 2020-08-20 16:23:39
* @Last Modified by: ghua
* @Last Modified time: 2020-09-23 19:49:12
* @Last Modified time: 2020-10-22 17:49:07
*/
import React, { useState, useEffect } from 'react'
......
......@@ -498,8 +498,9 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
let commonLogistics = {}
setConfirmLoading(true)
let purchaseIds = []
for (let item of selectOrderList) {
purchaseIds.push(item.id)
productIds.push(item.commodityUnitPrice.id)
commonLogistics = item.commodityUnitPrice.commodity.logistics
let buyCommodityInfo: any = {
......@@ -525,7 +526,9 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
}
let buyOrderInfo: any = {
purchaseOrder: true,
purchaseOrder: true, // 是否进货单下单
idList: purchaseIds,
productType: (layoutType === LAYOUT_TYPE.channel || layoutType === LAYOUT_TYPE.ichannel) ? 2 : 1,
logistics: commonLogistics,
supplyMembersName: selectItem.shopname,
supplyMembersId: selectItem.memberId,
......
......@@ -28,8 +28,8 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
const [loading, setLoading] = useState<boolean>(true)
const [shopList, setShopList] = useState<GetTemplateShopFindShopListResponseDetail[]>([])
const [totalCount, setTotalCount] = useState<number>(0)
const filterConfig = [FILTER_TYPE.category, FILTER_TYPE.useArea, FILTER_TYPE.activeStores, FILTER_TYPE.newJoin]
//FILTER_TYPE.activeStores,
const filterConfig = [FILTER_TYPE.category, FILTER_TYPE.useArea, FILTER_TYPE.newJoin]
useEffect(() => {
setCurrent(1)
......
......@@ -27,7 +27,7 @@ class SiteStore implements ISiteModule {
//@ts-ignore
const res = await PublicApi.getTemplatePlatformFindUseTemplateBySite({ siteId: this.siteId })
runInAction(() => {
this.mallTemplateInfo = res.data
this.mallTemplateInfo = res.data || {}
this.mallTemplateId = this.mallTemplateInfo.id
sessionStorage.setItem("mallTemplateInfo", JSON.stringify(this.mallTemplateInfo))
})
......
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