Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
a34bc454
Commit
a34bc454
authored
Jan 14, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 模板类型错误的问题
parent
e49f4c74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
68 deletions
+68
-68
index.tsx
src/pages/shop/components/templateItem/index.tsx
+68
-68
No files found.
src/pages/shop/components/templateItem/index.tsx
View file @
a34bc454
import
React
from
'react'
import
{
PlayCircleOutlined
}
from
'@ant-design/icons'
import
cx
from
'classnames'
import
{
Link
}
from
'umi'
import
default_img
from
'@/assets/imgs/template_default_img.png'
import
styles
from
'./index.less'
interface
TemplateItemPropsType
{
templateInfo
:
any
;
type
:
string
;
}
const
Environment_Status
=
{
0
:
{
name
:
"
所有"
},
1
:
{
name
:
"
PC "
},
2
:
{
name
:
"
H5 "
},
3
:
{
name
:
"APP
"
}
}
const
TemplateItem
:
React
.
FC
<
TemplateItemPropsType
>
=
(
props
)
=>
{
const
{
templateInfo
,
type
}
=
props
return
(
<
div
className=
{
styles
.
template_item
}
>
<
div
className=
{
styles
.
img_box
}
style=
{
{
backgroundImage
:
`url(${templateInfo.templatePicUrl})`
}
}
>
<
div
className=
{
styles
.
img_box_mask
}
>
<
Link
to=
{
`/memberCenter/shopAbility/template/detail?type=${type}&id=${templateInfo.id}`
}
className=
{
styles
.
detail_btn
}
>
查看详情
</
Link
>
</
div
>
<
div
className=
{
cx
(
styles
.
type_tag
,
templateInfo
.
environment
===
2
?
styles
.
h5
:
''
)
}
>
{
Environment_Status
[
templateInfo
.
environment
].
name
}
</
div
>
</
div
>
<
div
className=
{
styles
.
template_info
}
>
<
div
className=
{
styles
.
template_info_name
}
>
<
span
>
{
templateInfo
.
templateName
}
</
span
>
{
templateInfo
.
isDefault
&&
<
div
className=
{
styles
.
tag
}
>
默认模板
</
div
>
}
</
div
>
<
div
className=
{
cx
(
styles
.
template_info_content
,
type
===
'goods'
?
styles
.
goods
:
''
)
}
>
<
div
className=
{
styles
.
template_info_content_text_wrap
}
>
<
div
className=
{
styles
.
template_info_content_text_line
}
>
<
label
>
使用站点:
</
label
>
<
span
>
{
templateInfo
.
siteName
}
</
span
>
</
div
>
<
div
className=
{
styles
.
template_info_content_text_line
}
>
<
label
>
使用商城:
</
label
>
<
span
>
{
templateInfo
.
shopName
}
</
span
>
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
template_item_btn
,
templateInfo
.
use
===
1
?
styles
.
active
:
''
)
}
>
<
PlayCircleOutlined
/>
<
label
>
{
templateInfo
.
use
===
1
?
'启用中'
:
'启用'
}
</
label
>
</
div
>
</
div
>
</
div
>
</
div
>
)
}
export
default
TemplateItem
import
React
from
'react'
import
{
PlayCircleOutlined
}
from
'@ant-design/icons'
import
cx
from
'classnames'
import
{
Link
}
from
'umi'
import
default_img
from
'@/assets/imgs/template_default_img.png'
import
styles
from
'./index.less'
interface
TemplateItemPropsType
{
templateInfo
:
any
;
type
:
string
;
}
const
Environment_Status
=
{
1
:
{
name
:
"
web"
},
2
:
{
name
:
"
H5"
},
3
:
{
name
:
"
小程序"
},
4
:
{
name
:
"APP
"
}
}
const
TemplateItem
:
React
.
FC
<
TemplateItemPropsType
>
=
(
props
)
=>
{
const
{
templateInfo
,
type
}
=
props
return
(
<
div
className=
{
styles
.
template_item
}
>
<
div
className=
{
styles
.
img_box
}
style=
{
{
backgroundImage
:
`url(${templateInfo.templatePicUrl})`
}
}
>
<
div
className=
{
styles
.
img_box_mask
}
>
<
Link
to=
{
`/memberCenter/shopAbility/template/detail?type=${type}&id=${templateInfo.id}`
}
className=
{
styles
.
detail_btn
}
>
查看详情
</
Link
>
</
div
>
<
div
className=
{
cx
(
styles
.
type_tag
,
templateInfo
.
environment
===
2
?
styles
.
h5
:
''
)
}
>
{
Environment_Status
[
templateInfo
.
environment
].
name
}
</
div
>
</
div
>
<
div
className=
{
styles
.
template_info
}
>
<
div
className=
{
styles
.
template_info_name
}
>
<
span
>
{
templateInfo
.
templateName
}
</
span
>
{
templateInfo
.
isDefault
&&
<
div
className=
{
styles
.
tag
}
>
默认模板
</
div
>
}
</
div
>
<
div
className=
{
cx
(
styles
.
template_info_content
,
type
===
'goods'
?
styles
.
goods
:
''
)
}
>
<
div
className=
{
styles
.
template_info_content_text_wrap
}
>
<
div
className=
{
styles
.
template_info_content_text_line
}
>
<
label
>
使用站点:
</
label
>
<
span
>
{
templateInfo
.
siteName
}
</
span
>
</
div
>
<
div
className=
{
styles
.
template_info_content_text_line
}
>
<
label
>
使用商城:
</
label
>
<
span
>
{
templateInfo
.
shopName
}
</
span
>
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
template_item_btn
,
templateInfo
.
use
===
1
?
styles
.
active
:
''
)
}
>
<
PlayCircleOutlined
/>
<
label
>
{
templateInfo
.
use
===
1
?
'启用中'
:
'启用'
}
</
label
>
</
div
>
</
div
>
</
div
>
</
div
>
)
}
export
default
TemplateItem
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment