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

Merge branch 'dev' into test

parents 4e7a4584 c88c0b06
......@@ -3,7 +3,7 @@
* @Author: ghua
* @Date: 2020-10-09 14:26:12
* @Last Modified by: ghua
* @Last Modified time: 2020-10-12 16:23:41
* @Last Modified time: 2020-10-13 14:00:35
*/
const AfterServiceRoute = {
......@@ -23,7 +23,7 @@ const AfterServiceRoute = {
component: '@/pages/afterService/exchangeGoods/orderList'
},
{
// 换货申请单查询
// 换货申请单详情
path: '/memberCenter/afterService/exchange/orderPreview',
name: 'orderList',
hideInMenu: true,
......@@ -37,6 +37,14 @@ const AfterServiceRoute = {
component: '@/pages/afterService/exchangeGoods/waitSubmitOrderList'
},
{
// 待提交换货申请单新增或修改
path: '/memberCenter/afterService/exchange/waitSubmitOrderList/:type',
name: 'waitSubmitOrderList',
hideInMenu: true,
noMargin: true,
component: '@/pages/afterService/exchangeGoods/waitSubmitOrderList/detail'
},
{
// 待新增退货发货单
path: '/memberCenter/afterService/exchange/waitAddReturnOrder',
name: 'waitAddReturnOrder',
......
......@@ -12,7 +12,7 @@ const ReutrnEle: React.FC<IProps> = (props) => {
const { description, logoSrc } = props
return <>
<span style={{ fontSize: 15, color: '#909399FF' }}><ArrowLeftOutlined /> {logoSrc ? <img src={logoSrc} style={{ width: 48, height: 48, margin: '0 0 0 14px' }} /> : description}</span>
<span style={{ fontSize: 12, color: '#909399FF' }}><ArrowLeftOutlined /> {logoSrc ? <img src={logoSrc} style={{ width: 48, height: 48, margin: '0 0 0 14px' }} /> : description}</span>
</>
}
......
.info_list {
position: relative;
&_line {
display: flex;
align-items: center;
margin-bottom: 24px;
&_label {
width: 176px;
color: #909399;
&>.required {
color: #FF4D4F;
margin-left: 2px;
}
}
}
}
\ No newline at end of file
import React from 'react'
import styles from './index.less'
interface dataListType {
label: string,
value: string | React.ReactNode,
required?: boolean
}
interface InfoListProps {
data: dataListType[]
}
const InfoList: React.FC<InfoListProps> = (props) => {
const { data = [] } = props
return (
<div className={styles.info_list}>
{
data && data.map((item, index) => (
<div className={styles.info_list_line} key={`info_list_line_${index}`}>
<div className={styles.info_list_line_label}>{item.label}{item.required && <i className={styles.required}>*</i>}</div>
<div className={styles.info_list_line_value}>{item.value}</div>
</div>
))
}
</div>
)
}
export default InfoList
import React from 'react'
import { Input } from 'antd'
import InfoList from '../../../../components/InfoList'
interface BasicInfoProps {
}
const BasicInfo: React.FC<BasicInfoProps> = (props) => {
let detailList = [
{
label: '申请单摘要',
value: <Input style={{ width: 572 }} placeholder="请输入申请单摘要" />,
required: true,
},
{
label: '申请单号',
value: 'SPTY12'
},
{
label: '供应会员',
value: '温州龙昌手袋有限公司'
},
{
label: '单据时间',
value: '2020-08-20 12:56:25'
},
{
label: '外部状态',
value: '待提交申请单'
},
{
label: '内部状态',
value: '待提交'
}
]
return (
<div>
<InfoList data={detailList} />
</div>
)
}
export default BasicInfo
.add_btn {
background: #FAFBFC;
border: 1px dashed #DCDFE6;
height: 32px;
line-height: 32px;
text-align: center;
color: #606266;
cursor: pointer;
&:hover {
opacity: .8;
}
&>span {
margin-right: 4px;
}
}
.tb_wrap {
margin-top: 24px;
}
\ No newline at end of file
import React from 'react'
import { PlusOutlined } from '@ant-design/icons'
import { exchangeGoodsTableColumn } from './model/exchangeGoodsTable'
import styles from './index.less'
import { Table } from 'antd'
interface ExchangeGoodsProps {
}
const ExchangeGoods: React.FC<ExchangeGoodsProps> = (props) => {
const data = [
{
id: 1,
orderNo: 'SPTY12',
productId: '1110',
productName: '进口头层黄牛皮荔枝纹/红色/XXL',
category: 'category',
unit: '',
purchaseCount: 2000,
purchasePrice: 20,
purchaseAmount: 40000,
replaceCount: 2000,
replaceReason: '质量检查不合格',
}
]
return (
<div>
<div className={styles.add_btn}>
<PlusOutlined />
<span>选择换货商品</span>
</div>
<div className={styles.tb_wrap}>
<Table dataSource={data} columns={exchangeGoodsTableColumn} />
</div>
</div>
)
}
export default ExchangeGoods
import React from 'react'
import EyePreview from '@/components/EyePreview'
export const exchangeGoodsTableColumn: any[] = [
{
title: '订单号',
dataIndex: 'orderNo',
key: 'orderNo',
render: (text, record) => {
// 查看订单, 需根据状态显示不同schema
return <EyePreview url={`/`}>
{text}
</EyePreview>
},
ellipsis: true,
},
{
title: 'ID',
dataIndex: 'productId',
ellipsis: true,
},
{
title: '商品名称',
dataIndex: 'productName',
ellipsis: true,
},
{
title: '品类',
dataIndex: 'category',
ellipsis: true,
},
{
title: '单位',
dataIndex: 'unit',
ellipsis: true,
},
{
title: '采购数量',
dataIndex: 'purchaseCount',
ellipsis: true,
},
{
title: '采购单价',
dataIndex: 'purchasePrice',
ellipsis: true,
},
{
title: '采购金额',
dataIndex: 'purchaseAmount',
ellipsis: true,
},
{
title: '换货数量',
dataIndex: 'replaceCount',
ellipsis: true,
},
{
title: '换货原因',
dataIndex: 'replaceReason',
ellipsis: true,
},
{
title: '操作',
dataIndex: 'opration',
ellipsis: true,
},
]
\ No newline at end of file
.detail_wrap {
position: relative;
background: #ffffff;
border-radius: 8px;
padding: 24px;
min-height: calc(100vh - 200px);
.detail_tabs {
position: relative;
:global {
.ant-tabs-nav {
margin-bottom: 24px;
}
.ant-tabs-tab {
border: 1px solid #FFFFFF;
border-bottom: 1px solid #f0f0f0;
&-active {
border: 1px solid #DCDFE6;
}
}
}
}
}
\ No newline at end of file
import React, { useState } from 'react'
import { SaveOutlined } from '@ant-design/icons'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { history, Helmet } from 'umi'
import { Button, Tabs } from 'antd'
import ReutrnEle from '@/components/ReturnEle'
import BasicInfo from './components/basicInfo'
import ExchangeGoods from './components/exchangeGoods'
import styles from './detail.less'
interface OrderDetailProps {
location: any,
match: any
}
const { TabPane } = Tabs
const OrderDetail: React.FC<OrderDetailProps> = (props) => {
const { type } = props.match.params
const [btnLoading, setBtnLoading] = useState<boolean>(false)
const getPageTitle = () => {
switch (type) {
case 'add':
return '提交换货申请单'
case 'edit':
return '编辑换货申请单'
default:
return ''
}
}
return (
<>
<Helmet>
<title>{getPageTitle()}</title>
</Helmet>
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title={getPageTitle()}
extra={[
<Button key="1" onClick={() => { }} loading={btnLoading} type="primary" icon={<SaveOutlined />}>
保存
</Button>,
]}
>
<div className={styles.detail_wrap}>
<Tabs type="card" defaultActiveKey="exchangeGoods" className={styles.detail_tabs}>
<TabPane tab="基本信息" key="basicInfo">
<BasicInfo />
</TabPane>
<TabPane tab="换货商品" key="exchangeGoods">
<ExchangeGoods />
</TabPane>
<TabPane tab="举证附件" key="proofFile">
Content of Tab Pane 3
</TabPane>
<TabPane tab="换货收货地址" key="address">
Content of Tab Pane 3
</TabPane>
<TabPane tab="流转记录" key="log">
Content of Tab Pane 3
</TabPane>
</Tabs>
</div>
</PageHeaderWrapper>
</>
)
}
export default OrderDetail
......@@ -3,11 +3,12 @@
* @Author: ghua
* @Date: 2020-10-12 15:03:51
* @Last Modified by: ghua
* @Last Modified time: 2020-10-12 15:04:52
* @Last Modified time: 2020-10-13 14:02:30
*/
import React, { useRef } from 'react'
import { Card, Select, message, Space, Button } from 'antd'
import { StandardTable } from 'god'
import { history } from 'umi'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api'
import { useSelfTable } from './model/useSelfTable'
......@@ -89,7 +90,7 @@ const WaitSubmitOrderList: React.FC<WaitSubmitOrderListProps> = (props) => {
}}
formilyChilds={{
children: <Space>
<Button onClick={handleSubmitBatch} type="primary" icon={<PlusOutlined />} style={{ width: 112 }}>新建</Button>
<Button onClick={() => history.push('/memberCenter/afterService/exchange/waitSubmitOrderList/add')} type="primary" icon={<PlusOutlined />} style={{ width: 112 }}>新建</Button>
</Space>,
layouts: {
span: 8
......
......@@ -120,6 +120,15 @@
text-align: center;
cursor: pointer;
&.active {
background-color: var(--mall_main_color);
color: #FFFFFF;
&:hover {
background-color: var(--mall_main_color);
}
}
&>a {
display: block;
color: #303133;
......
import React, { useState } from 'react'
import { Rate, Button } from 'antd'
import React, { useState, useEffect } from 'react'
import { Rate, Button, message } from 'antd'
import { Link } from 'umi'
import { PublicApi } from '@/services/api'
import shop_icon from '@/assets/imgs/shop_icon.png'
import credit_icon from '@/assets/imgs/credit_icon.png'
import cx from 'classnames'
import styles from './index.less'
interface ShopInfoPropsType {
shopInfo: any;
shopUrlParam: string;
updateShopInfo: Function
}
const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const { shopInfo, shopUrlParam } = props
const { shopInfo, shopUrlParam, updateShopInfo } = props
const [applyLoading, setApplyLoading] = useState<boolean>(false)
const [collectState, setCollectState] = useState<boolean>(false)
useEffect(() => {
if (shopInfo) {
setCollectState(shopInfo.collectStatus)
}
}, [shopInfo])
const applyFroVip = () => {
if (shopInfo) {
......@@ -32,13 +41,22 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
}
const handleCollect = () => {
let status = !collectState
let param = {
shopId: shopInfo.shopId,
status: true
shopId: shopInfo.id,
status
}
PublicApi.postTemplateShopCollect(param).then(res => {
if (res.code === 1000) {
updateShopInfo()
message.destroy()
if (status) {
message.success("收藏成功")
setCollectState(true)
} else {
message.success("取消收藏成功")
setCollectState(false)
}
}
})
}
......@@ -83,7 +101,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
<div className={styles.dashed_split}></div>
<div className={styles.shop_info_btn_group}>
<div className={styles.shop_info_btn}><Link to={`/shop?shopId=${shopUrlParam}`}>进入店铺</Link></div>
<div className={styles.shop_info_btn} onClick={() => handleCollect()}>收藏本店</div>
<div className={cx(styles.shop_info_btn, collectState ? styles.active : '')} onClick={() => handleCollect()}>{collectState ? '已收藏本店' : '收藏本店'}</div>
</div>
<Button loading={applyLoading} className={styles.apply_member_btn} onClick={() => applyFroVip()}>申请成为本店会员</Button>
</div>
......
......@@ -810,7 +810,9 @@ const CommodityDetail = (props) => {
</div>
<div className={styles.commodity_detail_body}>
<div className={styles.commodity_detail_body_left}>
<ShopInfo {...props} />
{
layoutType === LAYOUT_TYPE.shop && <ShopInfo {...props} />
}
<Interested priceType={commodityDetail?.priceType} />
</div>
<div className={styles.commodity_detail_body_right}>
......
......@@ -245,6 +245,15 @@
text-align: center;
cursor: pointer;
&.active {
background-color: var(--mall_main_color);
color: #FFFFFF;
&:hover {
background-color: var(--mall_main_color);
}
}
&:hover {
background-color: #F4F5F7;
}
......
import React, { useState, useEffect } from 'react'
import { CaretDownOutlined } from '@ant-design/icons'
import { Rate, Input, Button } from 'antd'
import { Rate, Input, Button, message } from 'antd'
import { history, Link } from 'umi'
import isEmpty from 'lodash/isEmpty'
import shop_icon from '@/assets/imgs/shop_icon.png'
import credit_icon from '@/assets/imgs/credit_icon.png'
import styles from './index.less'
import cx from 'classnames'
import { PublicApi } from '@/services/api'
interface ShopHeaderPropsType {
......@@ -13,12 +14,14 @@ interface ShopHeaderPropsType {
shopUrlParam: string;
shopInfo: any;
logo: string;
updateShopInfo: Function
}
const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
const { shopId, shopUrlParam, shopInfo, logo } = props
const { updateShopInfo, shopUrlParam, shopInfo, logo } = props
const [searchValue, setSearchValue] = useState<string>("")
const [applyLoading, setApplyLoading] = useState<boolean>(false)
const [collectState, setCollectState] = useState<boolean>(false)
const { search } = history.location.query
useEffect(() => {
......@@ -29,6 +32,12 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
}
}, [search])
useEffect(() => {
if (shopInfo) {
setCollectState(shopInfo.collectStatus)
}
}, [shopInfo])
const handleSearchCommodity = () => {
if (!isEmpty(searchValue)) {
history.push(`/shop/commodity/search?shopId=${shopUrlParam}&search=${encodeURIComponent(searchValue)}`)
......@@ -53,7 +62,26 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
}
}
const handleCollect = () => {
let status = !collectState
let param = {
shopId: shopInfo.id,
status
}
PublicApi.postTemplateShopCollect(param).then(res => {
if (res.code === 1000) {
updateShopInfo()
message.destroy()
if (status) {
message.success("收藏成功")
setCollectState(true)
} else {
message.success("取消收藏成功")
setCollectState(false)
}
}
})
}
return (
<div className={styles.shop_header}>
......@@ -110,7 +138,7 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
<div className={styles.dashed_split}></div>
<div className={styles.shop_info_btn_group}>
<div className={styles.shop_info_btn}><Link to={`/shop?shopId=${shopUrlParam}`}>进入店铺</Link></div>
<div className={styles.shop_info_btn}>收藏本店</div>
<div className={cx(styles.shop_info_btn, collectState ? styles.active : '')} onClick={() => handleCollect()}>{collectState ? '已收藏本店' : '收藏本店'}</div>
</div>
<Button loading={applyLoading} className={styles.apply_member_btn} onClick={() => applyFroVip()}>申请成为本店会员</Button>
</div>
......
......@@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react'
import cx from 'classnames'
import { Pagination } from 'antd'
import { ClockCircleOutlined, EyeOutlined } from '@ant-design/icons'
import informationImg2 from '@/assets/imgs/information_2.png'
import ImageBox from '@/components/ImageBox'
import BreadCrumbs from './components/breadCrumbs'
import InformationRight from './components/informationRight'
......@@ -194,7 +193,7 @@ const InformationSearch: React.FC<InformationPropsType> = (props) => {
{
newsList && newsList.map(item => (
<div className={styles.information_latest_release_list_item} key={`information_latest_release_list_item_${item.id}`}>
<ImageBox width={285} height={190} imgUrl={informationImg2} />
<ImageBox width={285} height={190} imgUrl={item.imageUrl} />
<div className={styles.information_latest_release_list_item_main}>
<p><a href={toDetailLink(item.id)}>{item.title}</a></p>
<div className={styles.information_common_view}>
......
......@@ -80,6 +80,10 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const basicInfo = getMenuData(props.route.routes, { locale: true }, formatMessage)
const menuData = basicInfo.menuData ? basicInfo.menuData.filter(item => !item.redirect) : []
const handleUpdate = () => {
fetchShopInfo(query.memberId)
}
return (
<Fragment>
<Helmet>
......@@ -90,7 +94,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
<div className={styles.lxmall_page}>
<TopBar langComponent={<SelectLang />} name={mallInfo.name} type={LAYOUT_TYPE.shop} />
<div className={styles.content}>
<ShopHeader logo={mallInfo.logoUrl} shopId={query.shopId} shopUrlParam={shopId} shopInfo={shopInfo} />
<ShopHeader logo={mallInfo.logoUrl} shopId={query.shopId} shopUrlParam={shopId} shopInfo={shopInfo} updateShopInfo={() => handleUpdate()} />
<MainNav menuData={menuData} pathname={location.pathname} type={LAYOUT_TYPE.shop} shopId={query.shopId} shopUrlParam={shopId} />
{
children && React.Children.map(children, (child: any) => {
......@@ -100,7 +104,8 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
shopId: query.shopId,
memberId: query.memberId,
shopUrlParam: shopId,
shopInfo
shopInfo,
updateShopInfo: () => handleUpdate()
},
);
})
......
......@@ -24,7 +24,7 @@
padding-right: 60px;
}
.shop_about_btn {
.shop_about_btn {
padding: 0 15px;
height: 32px;
......@@ -34,6 +34,15 @@
border: 1px solid #EEF0F3;
cursor: pointer;
&.active {
background-color: var(--mall_main_color);
color: #FFFFFF;
&:hover {
background-color: var(--mall_main_color);
}
}
&:hover {
opacity: .9;
}
......
import React, { useState } from 'react'
import { Rate, Button } from 'antd'
import React, { useState, useEffect } from 'react'
import { Rate, Button, message } from 'antd'
import { LeftOutlined, RightOutlined } from '@ant-design/icons'
import cx from 'classnames'
import shop_icon from '@/assets/imgs/shop_icon.png'
import credit_icon from '@/assets/imgs/credit_icon.png'
import { PublicApi } from '@/services/api'
import styles from './index.less'
import { LAYOUT_TYPE } from '@/constants'
interface ShopAboutPropType {
shopInfo: any
shopInfo: any,
layoutType: LAYOUT_TYPE,
updateShopInfo: Function
}
const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
const { shopInfo } = props
const { shopInfo, layoutType, updateShopInfo } = props
const [offSetLeft, setOffSetLeft] = useState<number>(0)
const [applyLoading, setApplyLoading] = useState<boolean>(false)
const [collectState, setCollectState] = useState<boolean>(false)
const unitDistance = 406
useEffect(() => {
if (shopInfo) {
setCollectState(shopInfo.collectStatus)
}
}, [shopInfo])
const handlePrev = () => {
if (offSetLeft < 0) {
setOffSetLeft(offSetLeft + unitDistance)
......@@ -48,6 +58,27 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
}
}
const handleCollect = () => {
let status = !collectState
let param = {
shopId: shopInfo.id,
status
}
PublicApi.postTemplateShopCollect(param).then(res => {
if (res.code === 1000) {
updateShopInfo()
message.destroy()
if (status) {
message.success("收藏成功")
setCollectState(true)
} else {
message.success("取消收藏成功")
setCollectState(false)
}
}
})
}
return (
<div className={styles.shop_about}>
<div className={styles.shop_about_container}>
......@@ -72,81 +103,17 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
</div>
<div className={cx(styles.shop_about_info_item)}>
<div className={styles.shop_about_btn_group}>
<div className={styles.shop_about_btn}>收藏本店</div>
{
layoutType === LAYOUT_TYPE.shop && <div className={cx(styles.shop_about_btn, collectState ? styles.active : "")} onClick={() => handleCollect()}>{collectState ? '已收藏本店' : '收藏本店'}</div>
}
<Button loading={applyLoading} className={cx(styles.shop_about_btn, styles.primary)} onClick={() => applyFroVip()}>申请成为本店会员</Button>
</div>
</div>
<div className={cx(styles.shop_about_info_item, styles.auto_width)}>
<i className={styles.shop_about_info_item_character}></i>
<p>{shopInfo?.describe}</p>
</div>
</div>
{/* <div className={styles.channel_info_about}>
<div className={styles.channel_info_about_container}>
<div className={styles.channel_info_about_img}>
<Carousel className={styles.channel_info_about_img_list} pauseOnDotsHover>
<div className={styles.channel_info_about_img_item} >
<div className={styles.channel_info_about_img_item_body}>
<a href="">
<div className={styles.channel_info_about_img_item_img} style={{ backgroundImage: `url(${companyImg})` }}></div>
</a>
</div>
</div>
<div className={styles.channel_info_about_img_item} >
<div className={styles.channel_info_about_img_item_body}>
<a href="">
<div className={styles.channel_info_about_img_item_img} style={{ backgroundImage: `url(${companyImg})` }}></div>
</a>
</div>
</div>
</Carousel>
</div>
<div className={styles.channel_info_about_info}>
<div className={styles.channel_info_about_info_title}>温州市龙昌皮具有限公司</div>
<p className={styles.channel_info_about_info_brief}>
公司位于温州,多年行业经验,专业经营各种成品真皮,包括全粒面牛皮,修面皮,漆色皮,打腊皮,水腊皮……二层皮胚,硅胶二层等,产品主要用于时尚女鞋、男鞋、箱包、皮带、服装、汽车内饰等高端皮具制品行业。
本着质量保证,品种多样,现货充足,款式新颖的经营特色和薄利多销的原则,为客户提供长期优质的服务!
</p>
<p>
同时公司长期寻找各皮厂合作,要求皮厂有自已的生产线及高性价比特色产品,可作为普通供应商合作,也可作为其核心经销商战略合作。欢迎来人来样,当面洽谈。
</p>
</div>
</div>
</div> */}
{/* <div className={styles.shop_about_card_list}>
<div className={styles.shop_about_card_list_item}>
<div className={styles.shop_about_card_list_item_title}>店铺年龄</div>
<div className={styles.shop_about_card_list_item_content}>
<label>2</label>
<span>年</span>
</div>
</div>
<div className={styles.shop_about_card_list_item}>
<div className={styles.shop_about_card_list_item_title}>本店信用</div>
<div className={styles.shop_about_card_list_item_content}>
<label>1288</label>
<span>分</span>
</div>
</div>
<div className={styles.shop_about_card_list_item}>
<div className={styles.shop_about_card_list_item_title}>本店满意率</div>
<div className={styles.shop_about_card_list_item_content}>
<label>94</label>
<span>%</span>
</div>
</div>
<div className={styles.shop_about_card_list_item}>
<div className={styles.shop_about_card_list_item_title}>注册资本</div>
<div className={styles.shop_about_card_list_item_content}>
<label>5000</label>
<span>万元</span>
</div>
</div>
</div> */}
<div className={styles.shop_about_split}>
<div className={styles.shop_about_split_line}></div>
<div className={styles.shop_about_split_text}>资质荣誉</div>
......
......@@ -63,6 +63,7 @@
font-size: 12px;
color: #303133;
font-weight: 500;
cursor: pointer;
}
&_about {
......
import React, { useEffect, useState } from 'react'
import cx from 'classnames'
import { Rate, Pagination } from 'antd'
import { Rate, Pagination, Modal } 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 = () => {
......@@ -38,6 +39,40 @@ const Shops: React.FC = () => {
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) => {
let el = document.createElement('a')
el.href = `/shop?shopId=${btoa(JSON.stringify({ shopId: detail.id, memberId: detail.memberId }))}`;
el.target = '_blank';
el.click()
}
return (
<>
<div className={styles.shops_list}>
......@@ -47,21 +82,21 @@ const Shops: React.FC = () => {
<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="https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/69f3f329d5a848119dc89029a10acb081600332395671.jpg" />
<img src={item.logo} />
</div>
<div className={styles.shop_header_info_content}>
<div className={styles.shop_header_info_content_name}>
<span>温州市龙昌皮业有限公司</span>
<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}>2</span>
<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>1288</span>
<span>{item.integral}</span>
</div>
</div>
......@@ -69,17 +104,17 @@ const Shops: React.FC = () => {
</div>
</div>
<div className={cx(styles.shops_list_item_item)}>
<i className={cx(styles.level_icon, styles.level3)}></i>
{/* <i className={cx(styles.level_icon, styles.level3)}></i> */}
<div className={styles.rate_wrap}>
<span>满意度:</span>
<Rate disabled defaultValue={2} />
<Rate disabled defaultValue={item.satisfied} />
</div>
</div>
<div className={cx(styles.shops_list_item_item)}>
<span className={styles.date}>2020-10-25 10:58</span>
<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)}>
<div className={cx(styles.collection_state)} onClick={() => handleCancelCollect(item)}>
<StarFilled />
<label>收藏</label>
</div>
......
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