Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
group-buy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
group-buy-ui
Commits
f824ec8c
Commit
f824ec8c
authored
Sep 09, 2021
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 倒计时组件进行二次封装
parent
6d9a94bc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
1 deletion
+98
-1
info-bg.png
src/assets/images/info-bg.png
+0
-0
countDown.vue
src/components/countDown.vue
+57
-0
index.less
src/views/goodsDetail/index.less
+27
-0
index.vue
src/views/goodsDetail/index.vue
+14
-1
No files found.
src/assets/images/info-bg.png
0 → 100644
View file @
f824ec8c
40.8 KB
src/components/countDown.vue
0 → 100644
View file @
f824ec8c
<
template
>
<cr-count-down
:time=
"time"
>
<template
#default
="
timeData
"
>
<template
v-if=
"timeData.d != 0"
>
<span
class=
"block"
>
{{
timeData
.
d
}}
</span>
<span
class=
"colon"
>
:
</span>
</
template
>
<span
class=
"block"
>
{{ fillZero(timeData.h) }}
</span>
<span
class=
"colon"
>
:
</span>
<span
class=
"block"
>
{{ fillZero(timeData.m) }}
</span>
<span
class=
"colon"
>
:
</span>
<span
class=
"block"
>
{{ fillZero(timeData.s) }}
</span>
</template>
</cr-count-down>
</template>
<
script
>
export
default
{
props
:
{
endTime
:
{
type
:
Number
,
default
:
0
}
},
computed
:
{
time
()
{
return
this
.
endTime
-
new
Date
().
getTime
();
}
},
methods
:
{
fillZero
(
t
)
{
t
=
t
.
toString
();
if
(
t
.
length
==
1
)
{
return
`0
${
t
}
`
;
}
return
t
;
}
}
};
</
script
>
<
style
lang=
"less"
scoped
>
.colon {
display: inline-block;
margin: 0 @padding-unit;
color: @red-dark;
}
.block {
display: inline-block;
width: 18px;
// height: 22px;
color: #fff;
.text-11();
text-align: center;
background-color: @red-dark;
border-radius: @padding-unit;
line-height: 18px;
}
</
style
>
src/views/goodsDetail/index.less
View file @
f824ec8c
...
@@ -143,6 +143,33 @@
...
@@ -143,6 +143,33 @@
padding-bottom: @padding-x;
padding-bottom: @padding-x;
}
}
}
}
&-group-buy-info{
display: flex;
background-image: url("../../assets/images/info-bg.png");
background-color: #FFE8E8;
background-size: cover;
width: 100%;
height: 51px;
&-price{
width: 253px;
flex-shrink: 0;
display: flex;
align-items: center;
}
&-time{
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
&-desc{
.text-12();
// margin-bottom: @padding-unit;
color: @font-color-dark;
text-align: center;
}
}
}
&-sale {
&-sale {
padding: 5px 10px;
padding: 5px 10px;
background: @white;
background: @white;
...
...
src/views/goodsDetail/index.vue
View file @
f824ec8c
...
@@ -14,6 +14,13 @@
...
@@ -14,6 +14,13 @@
</cr-swipe>
</cr-swipe>
<swipe-customer-info
v-model=
"showInfo"
/>
<swipe-customer-info
v-model=
"showInfo"
/>
</div>
</div>
<div
class=
"goods-group-buy-info"
>
<div
class=
"goods-group-buy-info-price"
/>
<div
class=
"goods-group-buy-info-time"
>
<p
class=
"goods-group-buy-info-time-desc"
>
距成团结束
</p>
<count-down
:end-time=
"endTime"
/>
</div>
</div>
<!-- 商品名称/价格 -->
<!-- 商品名称/价格 -->
<div
class=
"goods-info"
>
<div
class=
"goods-info"
>
<div
class=
"goods-info-price"
>
<div
class=
"goods-info-price"
>
...
@@ -162,6 +169,8 @@ import detailInfoArea from './components/detailInfo.vue';
...
@@ -162,6 +169,8 @@ import detailInfoArea from './components/detailInfo.vue';
import
Img2Thumb
from
'
@/filters/img2Thumb.filter
'
;
import
Img2Thumb
from
'
@/filters/img2Thumb.filter
'
;
import
bottomNav
from
'
./components/bottomNav
'
;
import
bottomNav
from
'
./components/bottomNav
'
;
import
swipeCustomerInfo
from
'
@/components/swipeCustomerInfo
'
;
import
swipeCustomerInfo
from
'
@/components/swipeCustomerInfo
'
;
import
countDown
from
'
@/components/countDown
'
;
import
CountDown
from
'
@/components/countDown.vue
'
;
export
default
{
export
default
{
// eslint-disable-next-line vue/name-property-casing
// eslint-disable-next-line vue/name-property-casing
name
:
'
goodDetail
'
,
name
:
'
goodDetail
'
,
...
@@ -169,14 +178,18 @@ export default {
...
@@ -169,14 +178,18 @@ export default {
detailInfoArea
,
detailInfoArea
,
goodsCell
,
goodsCell
,
bottomNav
,
bottomNav
,
swipeCustomerInfo
swipeCustomerInfo
,
countDown
,
// tipModal
// tipModal
CountDown
},
},
filters
:
{
filters
:
{
Img2Thumb
Img2Thumb
},
},
data
()
{
data
()
{
return
{
return
{
endTime
:
1631203200000
,
// 以下是原有的data
flag
:
false
,
flag
:
false
,
showInfo
:
false
,
showInfo
:
false
,
detailParam
:
{
detailParam
:
{
...
...
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