Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
华润手术跟台
admin
Commits
7d7037e0
提交
7d7037e0
authored
11月 08, 2022
作者:
袁伟伟
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 商品详情页
上级
f5a19fe9
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
143 行增加
和
11 行删除
+143
-11
new.png
src/assets/images/new.png
+0
-0
index.ts
src/hooks/myhooks/index.ts
+2
-2
index.vue
src/views/product/goods-price/index.vue
+1
-1
modal.vue
src/views/product/goods-price/modal.vue
+1
-1
basicInfo.vue
src/views/product/goods/components/basicInfo.vue
+8
-0
index.vue
src/views/product/goods/index.vue
+1
-1
type.ts
src/views/product/goods/type.ts
+1
-0
pagination.vue
src/views/store/components/pagination.vue
+1
-1
index.vue
src/views/store/goodDetail/index.vue
+105
-3
index.vue
src/views/store/goodsList/index.vue
+18
-1
type.ts
src/views/store/goodsList/type.ts
+1
-0
index.vue
src/views/store/home/index.vue
+4
-1
没有找到文件。
src/assets/images/new.png
0 → 100644
浏览文件 @
7d7037e0
3.1 KB
src/hooks/myhooks/index.ts
浏览文件 @
7d7037e0
...
@@ -33,7 +33,7 @@ export const usePagination = (fun: () => void) => {
...
@@ -33,7 +33,7 @@ export const usePagination = (fun: () => void) => {
return
reactive
(
p
);
return
reactive
(
p
);
};
};
const
getNavTree
=
(
navList
,
init
?:
Function
,
str
)
=>
{
const
getNavTree
=
(
navList
,
init
?:
Function
,
str
?:
string
)
=>
{
goodsCategoryApi
.
dealerTree
({
parentId
:
0
}).
then
((
res
)
=>
{
goodsCategoryApi
.
dealerTree
({
parentId
:
0
}).
then
((
res
)
=>
{
navList
.
value
=
res
;
navList
.
value
=
res
;
userStore
.
setUserNavList
(
navList
.
value
);
userStore
.
setUserNavList
(
navList
.
value
);
...
@@ -47,7 +47,7 @@ const getNavTree = (navList, init?: Function, str) => {
...
@@ -47,7 +47,7 @@ const getNavTree = (navList, init?: Function, str) => {
});
});
};
};
const
navTree
=
(
navList
,
init
?:
Function
,
str
)
=>
{
const
navTree
=
(
navList
,
init
?:
Function
,
str
?:
string
)
=>
{
const
navListStore
=
userStore
.
getNavList
;
const
navListStore
=
userStore
.
getNavList
;
if
(
navListStore
.
length
<=
0
)
{
if
(
navListStore
.
length
<=
0
)
{
getNavTree
(
navList
,
init
,
str
);
getNavTree
(
navList
,
init
,
str
);
...
...
src/views/product/goods-price/index.vue
浏览文件 @
7d7037e0
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
</div>
</div>
<div
class=
"tableWrap"
>
<div
class=
"tableWrap"
>
<div
class=
"titleWrap"
>
<div
class=
"titleWrap"
>
<span
class=
"title"
>
商品
分类
</span>
<span
class=
"title"
>
商品
价格
</span>
<a-button
type=
"primary"
@
click=
"handleAdd"
>
新增
</a-button>
<a-button
type=
"primary"
@
click=
"handleAdd"
>
新增
</a-button>
</div>
</div>
<a-table
:dataSource=
"dataSource"
:columns=
"columns"
:pagination=
"pagination"
:loading=
"tableLoading"
>
<a-table
:dataSource=
"dataSource"
:columns=
"columns"
:pagination=
"pagination"
:loading=
"tableLoading"
>
...
...
src/views/product/goods-price/modal.vue
浏览文件 @
7d7037e0
...
@@ -104,7 +104,7 @@
...
@@ -104,7 +104,7 @@
const
fetchId
=
lastFetchId
;
const
fetchId
=
lastFetchId
;
goodsOptions
.
value
=
[];
goodsOptions
.
value
=
[];
fetching
.
value
=
true
;
fetching
.
value
=
true
;
GoodsApi
.
search
({
pageNum
:
1
,
pageSize
:
20
,
goodsName
:
value
}).
then
((
body
)
=>
{
GoodsApi
.
search
({
pageNum
:
1
,
pageSize
:
20
,
name
:
`%
${
value
}
%`
}).
then
((
body
)
=>
{
if
(
fetchId
!==
lastFetchId
)
{
if
(
fetchId
!==
lastFetchId
)
{
return
;
return
;
}
}
...
...
src/views/product/goods/components/basicInfo.vue
浏览文件 @
7d7037e0
...
@@ -26,6 +26,13 @@
...
@@ -26,6 +26,13 @@
<a-form-item
label=
"商品描述"
name=
"remark"
>
<a-form-item
label=
"商品描述"
name=
"remark"
>
<a-input
v-model:value=
"formData.remark"
/>
<a-input
v-model:value=
"formData.remark"
/>
</a-form-item>
</a-form-item>
<a-form-item
label=
"商品类型"
name=
"status"
>
<a-radio-group
v-model:value=
"formData.goodsType"
>
<a-radio
value=
"KIT"
>
套件
</a-radio>
<a-radio
value=
"PRODUCT"
>
商品
</a-radio>
<a-radio
value=
"SURGICAL_BAG"
>
手术包
</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item
label=
"上架"
name=
"status"
>
<a-form-item
label=
"上架"
name=
"status"
>
<a-radio-group
v-model:value=
"formData.status"
>
<a-radio-group
v-model:value=
"formData.status"
>
<a-radio
value=
"YES"
>
是
</a-radio>
<a-radio
value=
"YES"
>
是
</a-radio>
...
@@ -82,6 +89,7 @@
...
@@ -82,6 +89,7 @@
const
formData
=
reactive
<
BasicData
>
({
const
formData
=
reactive
<
BasicData
>
({
goodsCategoryList
:
[],
goodsCategoryList
:
[],
name
:
''
,
name
:
''
,
goodsType
:
'PRODUCT'
,
status
:
'NO'
,
status
:
'NO'
,
isImport
:
'NO'
,
isImport
:
'NO'
,
isNews
:
'NO'
,
isNews
:
'NO'
,
...
...
src/views/product/goods/index.vue
浏览文件 @
7d7037e0
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
</div>
</div>
<div
class=
"tableWrap"
>
<div
class=
"tableWrap"
>
<div
class=
"titleWrap"
>
<div
class=
"titleWrap"
>
<span
class=
"title"
>
商品
分类
</span>
<span
class=
"title"
>
商品
列表
</span>
<a-button
type=
"primary"
@
click=
"handleAdd(false)"
>
新增
</a-button>
<a-button
type=
"primary"
@
click=
"handleAdd(false)"
>
新增
</a-button>
</div>
</div>
<a-table
:dataSource=
"dataSource"
:columns=
"columns"
:pagination=
"pagination"
:loading=
"tableLoading"
>
<a-table
:dataSource=
"dataSource"
:columns=
"columns"
:pagination=
"pagination"
:loading=
"tableLoading"
>
...
...
src/views/product/goods/type.ts
浏览文件 @
7d7037e0
...
@@ -10,6 +10,7 @@ export interface BasicData {
...
@@ -10,6 +10,7 @@ export interface BasicData {
goodsCategoryList
:
number
[]
|
goodsCategory
[];
goodsCategoryList
:
number
[]
|
goodsCategory
[];
name
:
string
;
name
:
string
;
status
:
string
;
status
:
string
;
goodsType
:
string
;
isImport
:
string
;
isImport
:
string
;
isNews
:
string
;
isNews
:
string
;
isUnconventional
:
string
;
isUnconventional
:
string
;
...
...
src/views/store/components/pagination.vue
浏览文件 @
7d7037e0
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
import
{
emit
}
from
'process'
;
import
{
emit
}
from
'process'
;
import
{
ref
,
defineProps
,
defineEmits
}
from
'vue'
;
import
{
ref
,
defineProps
,
defineEmits
}
from
'vue'
;
const
props
=
defineProps
([
'pageNum'
,
'pageSize'
,
'total'
]);
const
props
=
defineProps
([
'pageNum'
,
'pageSize'
,
'total'
]);
const
emits
=
defineEmits
([
'update:pageNum'
,
'update:pageSize'
]);
const
emits
=
defineEmits
([
'update:pageNum'
,
'update:pageSize'
,
'handleChange'
]);
const
handleChange
=
(
page
,
pageSize
)
=>
{
const
handleChange
=
(
page
,
pageSize
)
=>
{
emits
(
'update:pageNum'
,
page
);
emits
(
'update:pageNum'
,
page
);
};
};
...
...
src/views/store/goodDetail/index.vue
浏览文件 @
7d7037e0
<
template
>
</
template
>
<
template
>
<div
class=
"containe"
>
<Search></Search>
<div
class=
"contentWrap"
>
<div
class=
"top"
>
<div
class=
"title"
>
{{
title
}}
</div>
<div
class=
"wrap"
>
<Nav
v-model:navList=
"navList"
v-model:navActiveKey=
"navActiveKey"
/>
</div>
</div>
<div
class=
"goodsInfo"
>
<div
class=
"imgWrap"
>
<div
class=
"show"
>
<img
src=
"../home/1.jpg"
alt=
""
/>
</div>
<ul>
<li>
<img
src=
"../home/1.jpg"
alt=
""
/>
</li>
<li>
<img
src=
"../home/2.png"
alt=
""
/>
</li>
</ul>
</div>
<div></div>
</div>
</div>
</div>
</
template
>
<
script
lang=
"ts"
setup
></
script
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
onMounted
,
watch
}
from
'vue'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
useNavTree
}
from
'/@/hooks/myhooks/index'
;
import
{
toNumber
}
from
'lodash'
;
import
Search
from
'../components/search.vue'
;
import
Nav
from
'../components/nav.vue'
;
import
{
DataItem
}
from
'/@/views/product/goods-category/type'
;
<
style
scoped
lang=
"less"
></
style
>
const
route
=
useRoute
();
const
navTree
=
useNavTree
();
const
query
=
route
.
query
;
const
navId
=
toNumber
(
query
.
nav
);
// 一级选择id
const
navList
=
ref
<
DataItem
[]
>
([]);
// 菜单树
const
navActiveKey
=
ref
(
navId
);
// 一级标签选择
const
title
=
ref
(
''
);
const
getGrandsonList
=
(
arr
:
DataItem
[])
=>
{
arr
.
some
((
item
)
=>
{
if
(
item
.
id
===
navId
)
{
title
.
value
=
item
.
name
;
return
true
;
}
});
};
onMounted
(()
=>
{
navTree
(
navList
,
getGrandsonList
,
'getGrandsonList'
);
});
</
script
>
<
style
scoped
lang=
"less"
>
.containe {
padding: 30px;
.contentWrap {
padding: 30px;
background: #fff;
border-radius: 10px;
max-width: 1400px;
min-width: 1200px;
margin: 0 auto;
.top {
display: flex;
justify-content: space-between;
.title {
width: 25%;
background: #f7f9fa;
color: #1890ff;
border-radius: 10px;
text-align: center;
height: 50px;
padding: 5px;
line-height: 40px;
font-size: 20px;
}
.wrap {
width: 73%;
margin: 0;
}
}
.goodsInfo {
.imgWrap {
.show {
width: 400px;
height: 400px;
border: 1px solid #eee;
}
}
}
}
}
</
style
>
src/views/store/goodsList/index.vue
浏览文件 @
7d7037e0
...
@@ -41,8 +41,9 @@
...
@@ -41,8 +41,9 @@
</div>
</div>
<div
class=
"goodsWrap"
>
<div
class=
"goodsWrap"
>
<ul
class=
"goodsList"
>
<ul
class=
"goodsList"
>
<li
class=
"goods"
v-for=
"item in goodsList"
:key=
"item.id"
>
<li
class=
"goods"
v-for=
"item in goodsList"
:key=
"item.id"
@
click=
"handleChangeGoods(item)"
>
<div
class=
"img"
>
<div
class=
"img"
>
<img
:src=
"newPng"
alt=
""
class=
"new"
v-if=
"item.isNews === 'YES'"
/>
<img
:src=
"item.pic"
alt=
""
/>
<img
:src=
"item.pic"
alt=
""
/>
</div>
</div>
<p
class=
"title"
>
{{
item
.
name
}}
</p>
<p
class=
"title"
>
{{
item
.
name
}}
</p>
...
@@ -67,6 +68,7 @@
...
@@ -67,6 +68,7 @@
import
{
DataItem
}
from
'/@/views/product/goods-category/type'
;
import
{
DataItem
}
from
'/@/views/product/goods-category/type'
;
import
{
Goods
}
from
'/@/views/store/goodsList/type'
;
import
{
Goods
}
from
'/@/views/store/goodsList/type'
;
import
*
as
GoodsApi
from
'/@/api/product/goodsApi'
;
import
*
as
GoodsApi
from
'/@/api/product/goodsApi'
;
import
newPng
from
'/@/assets/images/new.png'
;
const
go
=
useGo
();
const
go
=
useGo
();
const
route
=
useRoute
();
const
route
=
useRoute
();
...
@@ -147,6 +149,11 @@
...
@@ -147,6 +149,11 @@
});
});
};
};
// 点击商品
const
handleChangeGoods
=
(
goods
:
Goods
)
=>
{
go
(
'/main/store/goodDetail'
+
`?goods=
${
goods
.
id
}
&nav=
${
navId
}
`
);
};
watch
(
watch
(
()
=>
navActiveKey
.
value
,
()
=>
navActiveKey
.
value
,
(
n
)
=>
{
(
n
)
=>
{
...
@@ -176,6 +183,7 @@
...
@@ -176,6 +183,7 @@
background: #fff;
background: #fff;
border-radius: 10px;
border-radius: 10px;
max-width: 1400px;
max-width: 1400px;
min-width: 1200px;
margin: 0 auto;
margin: 0 auto;
.top {
.top {
...
@@ -249,6 +257,7 @@
...
@@ -249,6 +257,7 @@
width: 25%;
width: 25%;
padding: 20px 20px 5px 20px;
padding: 20px 20px 5px 20px;
border: 1px solid rgb(214, 214, 214);
border: 1px solid rgb(214, 214, 214);
position: relative;
&:hover {
&:hover {
background: #eee;
background: #eee;
...
@@ -256,7 +265,15 @@
...
@@ -256,7 +265,15 @@
}
}
.img {
.img {
position: relative;
height: 285px;
height: 285px;
.new {
position: absolute;
right: 10px;
top: 10px;
width: 50px;
height: 50px;
}
}
}
.title {
.title {
...
...
src/views/store/goodsList/type.ts
浏览文件 @
7d7037e0
...
@@ -10,4 +10,5 @@ export interface Goods {
...
@@ -10,4 +10,5 @@ export interface Goods {
id
:
number
;
id
:
number
;
pic
:
string
;
pic
:
string
;
name
:
string
;
name
:
string
;
isNews
:
string
;
}
}
src/views/store/home/index.vue
浏览文件 @
7d7037e0
...
@@ -174,6 +174,9 @@
...
@@ -174,6 +174,9 @@
padding: 30px;
padding: 30px;
background: #fff;
background: #fff;
border-radius: 10px;
border-radius: 10px;
max-width: 1400px;
min-width: 1200px;
margin: 0 auto;
.top {
.top {
display: flex;
display: flex;
...
@@ -319,7 +322,7 @@
...
@@ -319,7 +322,7 @@
justify-content: space-between;
justify-content: space-between;
flex-wrap: wrap;
flex-wrap: wrap;
.goods {
.goods {
width: 3
0
%;
width: 3
2
%;
margin-top: 15px;
margin-top: 15px;
cursor: pointer;
cursor: pointer;
padding: 10px;
padding: 10px;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论