Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
f41263a9
提交
f41263a9
authored
12月 05, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:ssr测试
上级
aaa6e234
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
28 行增加
和
52 行删除
+28
-52
home.ts
src/api/interface/home.ts
+1
-42
mall.ts
src/api/interface/mall.ts
+12
-0
index.tsx
src/components/categorySelect/index.tsx
+1
-1
index.tsx
src/components/productItem/index.tsx
+2
-2
index.tsx
src/pages/mall/index.tsx
+12
-7
没有找到文件。
src/api/interface/home.ts
浏览文件 @
f41263a9
...
...
@@ -4,6 +4,7 @@ import {
InterItemFunction
,
InterListFunction
,
}
from
'@/api/interface'
;
import
{
QueryGoodsInfoByCategorySub
}
from
'@/api/interface/mall'
;
// 获取图片-小程序
export
type
ListBannerImgType
=
InterFunction
<
...
...
@@ -51,48 +52,6 @@ export type AppCategoryInfoType = InterFunction<
sort
?:
number
;
}[]
>
;
// 分类下的商品数据
export
type
QueryGoodsInfoByCategorySub
=
InterFunction
<
number
[],
{
categoryPrimaryId
:
number
;
categorySubId
:
number
;
createTime
:
string
;
description
:
string
;
goodsDetails
:
string
;
goodsLabel
:
string
;
goodsSpecList
:
Array
<
{
chooseType
:
number
;
goodsSpecValuesList
:
Array
<
{
channelPrice
:
number
;
goodsSpecId
:
number
;
id
:
number
;
partNo
:
string
;
salePrice
:
number
;
showPrice
:
number
;
specValueImage
:
string
;
specValueName
:
string
;
stock
:
number
;
}
>
;
id
:
number
;
mallGoodsId
:
number
;
must
:
number
;
skuUnitId
:
number
;
specName
:
string
;
}
>
;
id
:
number
;
labelShow
:
number
;
resourcesList
:
Array
<
{
id
:
number
;
type
:
number
;
url
:
string
;
}
>
;
shelfStatus
:
number
;
tradeName
:
string
;
userAccountId
:
number
;
recommend
:
number
;
}[]
>
;
// 一级行业列表
export
type
IndustryListPagesType
=
InterListFunction
<
{
...
...
src/api/interface/mall.ts
浏览文件 @
f41263a9
...
...
@@ -61,5 +61,17 @@ export type QueryGoodsInfoByCategorySub = InterFunction<
tradeName
:
string
;
userAccountId
:
number
;
recommend
:
number
;
priceShow
:
number
;
specAttrList
:
null
;
priceStock
:
Array
<
{
id
:
number
;
productSpec
:
string
;
salePrice
:
number
;
skuImage
:
null
;
channelPrice
:
null
;
stock
:
null
;
skuNo
:
null
;
}
>
;
companyName
:
string
;
}[]
>
;
src/components/categorySelect/index.tsx
浏览文件 @
f41263a9
...
...
@@ -11,7 +11,7 @@ const CategorySelectWrap = styled.div`
.category-select {
position: relative;
width: 100%;
height: 2rem;
min-
height: 2rem;
flex-wrap: wrap;
border-bottom: 1px solid #ebebeb;
.select-item {
...
...
src/components/productItem/index.tsx
浏览文件 @
f41263a9
...
...
@@ -2,7 +2,7 @@ import React from 'react';
import
{
PropertySafetyFilled
,
ShoppingCartOutlined
}
from
'@ant-design/icons'
;
import
styled
from
'styled-components'
;
import
{
InterDataType
}
from
'@/api/interface'
;
import
{
QueryGoodsInfoByCategorySub
}
from
'@/api/interface/
home
'
;
import
{
QueryGoodsInfoByCategorySub
}
from
'@/api/interface/
mall
'
;
const
ProductItemWrap
=
styled
.
div
`
position: relative;
...
...
@@ -110,7 +110,7 @@ const ProductItemView: React.FC<{
</
div
>
<
div
className=
"product-store flex-start"
>
<
PropertySafetyFilled
style=
{
{
color
:
'#FF552D'
}
}
/>
<
div
className=
"title text-ellipsis"
>
{
detail
?.
trade
Name
}
</
div
>
<
div
className=
"title text-ellipsis"
>
{
detail
?.
company
Name
}
</
div
>
</
div
>
<
div
className=
"product-cart"
>
<
ShoppingCartOutlined
style=
{
{
color
:
'#ffffff'
,
fontSize
:
'16px'
}
}
/>
...
...
src/pages/mall/index.tsx
浏览文件 @
f41263a9
...
...
@@ -20,15 +20,20 @@ type GoodsInfoListType = InterDataType<QueryGoodsInfoByCategorySub>;
// 每次加载页面都会执行
export
async
function
getServerSideProps
()
{
// 分类数据
le
t
categoryList
:
CategoryListType
=
[];
cons
t
categoryList
:
CategoryListType
=
[];
// 获取各个目录及分类信息
// const getAppCategoryInfo = async () => {
// const res = await MallAPI.getAppCategoryInfo({
// type: 4,
// });
// if (res && res.code === '200') {
// categoryList = res?.result || [];
// }
// };
// fetch测试
const
getAppCategoryInfo
=
async
()
=>
{
const
res
=
await
MallAPI
.
getAppCategoryInfo
({
type
:
4
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
categoryList
=
res
?.
result
||
[];
}
const
res
=
await
fetch
(
'https://www.baidu.com'
);
console
.
log
(
'fetch测试 res --->'
,
res
);
};
// 依次获取接口数据
await
(
async
()
=>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论