Commit ad6bd32a authored by GuanHua's avatar GuanHua

feat:对接商城首页和店铺列表活跃店铺和人气店铺的接口

parent 57a54c8f
...@@ -3,10 +3,13 @@ ...@@ -3,10 +3,13 @@
* @Author: ghua * @Author: ghua
* @Date: 2020-08-20 16:23:39 * @Date: 2020-08-20 16:23:39
* @Last Modified by: ghua * @Last Modified by: ghua
* @Last Modified time: 2020-10-22 18:03:14 * @Last Modified time: 2020-11-04 10:23:59
*/ */
import React from 'react' import React, { useEffect, useState } from 'react'
import { PublicApi } from '@/services/api'
import ImageBox from '@/components/ImageBox'
import { GetReportMallGetActiveMerchantListResponse } from '@/services/ReportApi'
import styles from './index.less' import styles from './index.less'
interface ActiveStoresPropsType { interface ActiveStoresPropsType {
...@@ -14,6 +17,20 @@ interface ActiveStoresPropsType { ...@@ -14,6 +17,20 @@ interface ActiveStoresPropsType {
} }
const ActiveStores: React.FC<ActiveStoresPropsType> = (props) => { const ActiveStores: React.FC<ActiveStoresPropsType> = (props) => {
const [shopList, setShopList] = useState<GetReportMallGetActiveMerchantListResponse>([])
useEffect(() => {
fetchData()
}, [])
const fetchData = () => {
PublicApi.getReportMallGetActiveMerchantList().then(res => {
if(res.code === 1000) {
setShopList(res.data)
}
})
}
return ( return (
<div className={styles.active_stores}> <div className={styles.active_stores}>
...@@ -21,43 +38,19 @@ const ActiveStores: React.FC<ActiveStoresPropsType> = (props) => { ...@@ -21,43 +38,19 @@ const ActiveStores: React.FC<ActiveStoresPropsType> = (props) => {
<label>活跃店铺</label> <label>活跃店铺</label>
</div> </div>
<div className={styles.active_stores_list}> <div className={styles.active_stores_list}>
{
<div className={styles.active_stores_list_item}> shopList && shopList.map((item, index) => (
<div className={styles.active_stores_rank}>01</div> <div className={styles.active_stores_list_item}>
<div className={styles.active_stores_logo}> <div className={styles.active_stores_rank}>0{index+1}</div>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" /> <div className={styles.active_stores_logo}>
</div> <ImageBox width={36} height={36} imgUrl={item.memberLogo} />
<div className={styles.active_stores_name}> <a href="/">无锡市群明钢业有限公司</a></div> </div>
</div> <div className={styles.active_stores_name}>
<a href={`/shop?shopId=${btoa(JSON.stringify({ shopId: item.memberShopId, memberId: item.memberId }))}`}>{item.memberName}</a>
<div className={styles.active_stores_list_item}> </div>
<div className={styles.active_stores_rank}>02</div> </div>
<div className={styles.active_stores_logo}> ))
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" /> }
</div>
<div className={styles.active_stores_name}>无锡市群明钢业有限公司</div>
</div>
<div className={styles.active_stores_list_item}>
<div className={styles.active_stores_rank}>03</div>
<div className={styles.active_stores_logo}>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" />
</div>
<div className={styles.active_stores_name}>无锡市群明钢业有限公司</div>
</div>
<div className={styles.active_stores_list_item}>
<div className={styles.active_stores_rank}>04</div>
<div className={styles.active_stores_logo}>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" />
</div>
<div className={styles.active_stores_name}>无锡市群明钢业有限公司</div>
</div>
<div className={styles.active_stores_list_item}>
<div className={styles.active_stores_rank}>05</div>
<div className={styles.active_stores_logo}>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" />
</div>
<div className={styles.active_stores_name}>无锡市群明钢业有限公司</div>
</div>
</div> </div>
</div> </div>
) )
......
import React from 'react' import React, { useEffect, useState } from 'react'
import { PublicApi } from '@/services/api'
import { GetReportMallGetPopularShopListResponse } from '@/services/ReportApi'
import ImageBox from '@/components/ImageBox'
import styles from '../../index.less' import styles from '../../index.less'
interface PopularShopsPropsType { interface PopularShopsPropsType {}
}
const PopularShops: React.FC<PopularShopsPropsType> = (props) => { const PopularShops: React.FC<PopularShopsPropsType> = (props) => {
const [shopList, setShopList] = useState<GetReportMallGetPopularShopListResponse>([])
useEffect(() => {
fetchData()
}, [])
const fetchData = () => {
PublicApi.getReportMallGetPopularShopList().then(res => {
if(res.code === 1000) {
setShopList(res.data)
}
})
}
return ( return (
<div className={styles.popular_shops}> <div className={styles.popular_shops}>
...@@ -14,43 +28,19 @@ const PopularShops: React.FC<PopularShopsPropsType> = (props) => { ...@@ -14,43 +28,19 @@ const PopularShops: React.FC<PopularShopsPropsType> = (props) => {
<span>排名每天凌晨更新</span> <span>排名每天凌晨更新</span>
</div> </div>
<div className={styles.popular_shops_list}> <div className={styles.popular_shops_list}>
{
<div className={styles.popular_shops_list_item}> shopList && shopList.map((item, index) => index <=5 && (
<div className={styles.popular_shops_rank}>01</div> <div className={styles.popular_shops_list_item}>
<div className={styles.popular_shops_logo}> <div className={styles.popular_shops_rank}>0{index+1}</div>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" /> <div className={styles.popular_shops_logo}>
</div> <ImageBox width={36} height={36} imgUrl={item.memberLogo} />
<div className={styles.popular_shops_name}> <a href="/">无锡市群明钢业有限公司</a></div> </div>
</div> <div className={styles.popular_shops_name}>
<a href={`/shop?shopId=${btoa(JSON.stringify({ shopId: item.memberShopId, memberId: item.memberId }))}`}>{item.memberName}</a>
<div className={styles.popular_shops_list_item}> </div>
<div className={styles.popular_shops_rank}>02</div> </div>
<div className={styles.popular_shops_logo}> ))
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" /> }
</div>
<div className={styles.popular_shops_name}>无锡市群明钢业有限公司</div>
</div>
<div className={styles.popular_shops_list_item}>
<div className={styles.popular_shops_rank}>03</div>
<div className={styles.popular_shops_logo}>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" />
</div>
<div className={styles.popular_shops_name}>无锡市群明钢业有限公司</div>
</div>
<div className={styles.popular_shops_list_item}>
<div className={styles.popular_shops_rank}>04</div>
<div className={styles.popular_shops_logo}>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" />
</div>
<div className={styles.popular_shops_name}>无锡市群明钢业有限公司</div>
</div>
<div className={styles.popular_shops_list_item}>
<div className={styles.popular_shops_rank}>05</div>
<div className={styles.popular_shops_logo}>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" />
</div>
<div className={styles.popular_shops_name}>无锡市群明钢业有限公司</div>
</div>
</div> </div>
</div> </div>
) )
......
...@@ -8,45 +8,6 @@ import { PublicApi } from '@/services/api' ...@@ -8,45 +8,6 @@ import { PublicApi } from '@/services/api'
import moment from 'moment' import moment from 'moment'
import styles from '../../index.less' import styles from '../../index.less'
const buy_dynamic_list = [
{
title: '黑色头层牛皮自然摔纹',
state: 0,
content: '2000平方英尺',
date: '09/09 09:00'
},
{
title: '黑色头层牛皮自然摔纹',
state: 0,
content: '2000平方英尺',
date: '09/09 09:00'
},
{
title: '黑色头层牛皮自然摔纹',
state: 0,
content: '2000平方英尺',
date: '09/09 09:00'
},
{
title: '黑色头层牛皮自然摔纹',
state: 1,
content: '2000平方英尺',
date: '09/09 09:00'
},
{
title: '黑色头层牛皮自然摔纹',
state: 1,
content: '2000平方英尺',
date: '09/09 09:00'
},
{
title: '黑色头层牛皮自然摔纹',
state: 1,
content: '2000平方英尺',
date: '09/09 09:00'
},
]
const ShoppingNews: React.FC = () => { const ShoppingNews: React.FC = () => {
const [list, setList] = useState<any>([]) const [list, setList] = useState<any>([])
const actionRef = useRef<any>() const actionRef = useRef<any>()
......
...@@ -10,6 +10,7 @@ import * as OrderApi from './OrderApi' ...@@ -10,6 +10,7 @@ import * as OrderApi from './OrderApi'
import * as SettleApi from './SettleApi' import * as SettleApi from './SettleApi'
import * as AfterService from './AfterServiceApi' import * as AfterService from './AfterServiceApi'
import * as EnhanceApi from './EnhanceApi'; import * as EnhanceApi from './EnhanceApi';
import * as ReportApi from './ReportApi';
/** /**
* 可在这里写入自定义的接口 * 可在这里写入自定义的接口
...@@ -31,5 +32,6 @@ export const PublicApi = { ...@@ -31,5 +32,6 @@ export const PublicApi = {
...OrderApi, ...OrderApi,
...SettleApi, ...SettleApi,
...AfterService, ...AfterService,
...EnhanceApi ...EnhanceApi,
...ReportApi
} }
...@@ -11,7 +11,8 @@ const tokenList = [ ...@@ -11,7 +11,8 @@ const tokenList = [
{ name: 'Settle', token: 'fffbeeaaa198c285955997c606bc279fc6950fea118580c786f2c73eecccaa6a' }, //结算服务 { name: 'Settle', token: 'fffbeeaaa198c285955997c606bc279fc6950fea118580c786f2c73eecccaa6a' }, //结算服务
{ name: 'AfterService', token: '39db719680bf1b3db21bc1deda933cde16d17559e9676bf848ec96c1320e68df' }, // '售后服务' { name: 'AfterService', token: '39db719680bf1b3db21bc1deda933cde16d17559e9676bf848ec96c1320e68df' }, // '售后服务'
// { name: '', token: 'c0e920f071595a73ba234b6fa6cfe42192d3d740d59f030caa2c7f0f08777d78' } // 商户会员管理服务 // { name: '', token: 'c0e920f071595a73ba234b6fa6cfe42192d3d740d59f030caa2c7f0f08777d78' } // 商户会员管理服务
{ name: 'Enhance', token: '594a7e7ff17f6f40fb9fb726c1da9a3f282a926a8d386eb6cbfd668a3f75f251'} // 加工服务 { name: 'Enhance', token: '594a7e7ff17f6f40fb9fb726c1da9a3f282a926a8d386eb6cbfd668a3f75f251'}, // 加工服务
{ name: 'Report', token: '69ee5a79363c763ded1a2eb42952a5181ffcdfc5ffb93b6e1e22ac92a25b38bf'}, // 报表服务
] ]
const getConfigMap = (tokens) => tokens.map(v => ({ const getConfigMap = (tokens) => tokens.map(v => ({
......
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