Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shop_mobile_uni
Project
Project
Details
Activity
Releases
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
郑秀明
shop_mobile_uni
Commits
afe547c1
Commit
afe547c1
authored
May 21, 2020
by
王建威
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change countdown
parent
2b0e5ffe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
uni-countdown.vue
components/uni-countdown/uni-countdown.vue
+2
-3
promotion.vue
pages/home/components/promotion.vue
+19
-7
No files found.
components/uni-countdown/uni-countdown.vue
View file @
afe547c1
...
@@ -120,8 +120,8 @@
...
@@ -120,8 +120,8 @@
let
seconds
=
this
.
seconds
let
seconds
=
this
.
seconds
let
[
day
,
hour
,
minute
,
second
]
=
[
0
,
0
,
0
,
0
]
let
[
day
,
hour
,
minute
,
second
]
=
[
0
,
0
,
0
,
0
]
if
(
seconds
>
0
)
{
if
(
seconds
>
0
)
{
//
day = Math.floor(seconds / (60 * 60 * 24))
day
=
Math
.
floor
(
seconds
/
(
60
*
60
*
24
))
hour
=
Math
.
floor
(
seconds
/
(
60
*
60
))
hour
=
Math
.
floor
(
seconds
/
(
60
*
60
))
-
(
day
*
24
)
minute
=
Math
.
floor
(
seconds
/
60
)
-
(
day
*
24
*
60
)
-
(
hour
*
60
)
minute
=
Math
.
floor
(
seconds
/
60
)
-
(
day
*
24
*
60
)
-
(
hour
*
60
)
second
=
Math
.
floor
(
seconds
)
-
(
day
*
24
*
60
*
60
)
-
(
hour
*
60
*
60
)
-
(
minute
*
60
)
second
=
Math
.
floor
(
seconds
)
-
(
day
*
24
*
60
*
60
)
-
(
hour
*
60
*
60
)
-
(
minute
*
60
)
}
else
{
}
else
{
...
@@ -199,7 +199,6 @@
...
@@ -199,7 +199,6 @@
padding
:
0
6
rpx
;
padding
:
0
6
rpx
;
height
:
32
rpx
;
height
:
32
rpx
;
line-height
:
32
rpx
;
line-height
:
32
rpx
;
margin
:
5
rpx
;
text-align
:
center
;
text-align
:
center
;
font-size
:
24
rpx
;
font-size
:
24
rpx
;
border-radius
:
8
rpx
;
border-radius
:
8
rpx
;
...
...
pages/home/components/promotion.vue
View file @
afe547c1
...
@@ -4,12 +4,13 @@
...
@@ -4,12 +4,13 @@
<view>
<view>
<i
v-if=
"style_setting.icon_show"
class=
"promo_icon"
:style=
"
{'background-image': 'url('+style_setting.icon_url+')'}">
</i>
<i
v-if=
"style_setting.icon_show"
class=
"promo_icon"
:style=
"
{'background-image': 'url('+style_setting.icon_url+')'}">
</i>
<text
class=
"promo_title"
:style=
"
{'color': style_setting.title_color, 'font-size': style_setting.title_font*2+'rpx'}">
{{
style_setting
.
title
}}
</text>
<text
class=
"promo_title"
:style=
"
{'color': style_setting.title_color, 'font-size': style_setting.title_font*2+'rpx'}">
{{
style_setting
.
title
}}
</text>
<text
class=
"du_start"
v-if=
"this.style_setting.is_not_start"
>
距开始:
</text>
<text
class=
"countdown"
v-if=
"style_setting.count_down_show"
>
<text
class=
"countdown"
v-if=
"style_setting.count_down_show"
>
<uni-countdown
:
hour=
"hour"
:minute=
"minute"
:second=
"second"
:showDay=
"false
"
backgroundColor=
"#000"
color=
"#fff"
></uni-countdown>
<uni-countdown
:
day=
"day"
:hour=
"hour"
:minute=
"minute"
:second=
"second"
:show-day=
"day > 0
"
backgroundColor=
"#000"
color=
"#fff"
></uni-countdown>
</text>
</text>
</view>
</view>
<text
class=
"check_more"
@
click=
"$jump(style_setting.more_link)"
>
{{
style_setting
.
more_title
}}
<text
class=
"check_more"
@
click=
"$jump(style_setting.more_link)"
>
{{
style_setting
.
more_title
}}
<svg
viewBox=
"64 64 896 896"
class=
""
data-icon=
"right"
width=
"1em"
height=
"1em"
fill=
"currentColor"
aria-hidden=
"true"
focusable=
"false"
><path
d=
"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"
></path></svg>
<svg
viewBox=
"64 64 896 896"
class=
"
svg
"
data-icon=
"right"
width=
"1em"
height=
"1em"
fill=
"currentColor"
aria-hidden=
"true"
focusable=
"false"
><path
d=
"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"
></path></svg>
</text>
</text>
</view>
</view>
<view
class=
"promo_goods_content"
>
<view
class=
"promo_goods_content"
>
...
@@ -43,6 +44,7 @@
...
@@ -43,6 +44,7 @@
return
{
return
{
style_setting
:
this
.
wrapper_props
.
style_setting
,
style_setting
:
this
.
wrapper_props
.
style_setting
,
list
:
this
.
wrapper_props
.
goods_list
,
list
:
this
.
wrapper_props
.
goods_list
,
day
:
0
,
hour
:
0
,
hour
:
0
,
minute
:
0
,
minute
:
0
,
second
:
0
,
second
:
0
,
...
@@ -50,11 +52,12 @@
...
@@ -50,11 +52,12 @@
}
}
},
},
mounted
()
{
mounted
()
{
const
t
=
this
.
style_setting
.
count_down_type
===
1
?
this
.
wrapper_props
.
first_end_time
:
this
.
style_setting
.
count_down_time
;
const
t
=
this
.
style_setting
.
is_not_start
?
this
.
style_setting
.
count_down_time
:
(
this
.
style_setting
.
count_down_type
===
1
?
this
.
wrapper_props
.
first_end_time
:
this
.
style_setting
.
count_down_time
);
const
now
=
moment
(
new
Date
(),
'YYYY-MM-DD HH:mm:ss'
).
format
(
'x'
)
-
0
,
const
now
=
moment
(
new
Date
(),
'YYYY-MM-DD HH:mm:ss'
),
end
=
moment
(
t
,
'YYYY-MM-DD HH:mm:ss'
).
format
(
'x'
)
-
0
,
end
=
moment
(
t
,
'YYYY-MM-DD HH:mm:ss'
),
du
=
moment
.
duration
(
end
-
now
);
du
=
moment
.
duration
(
end
-
now
,
'ms'
);
this
.
hour
=
du
.
days
()
*
24
+
du
.
hours
();
this
.
day
=
end
.
diff
(
now
,
'day'
);
this
.
hour
=
du
.
hours
();
this
.
minute
=
du
.
minutes
();
this
.
minute
=
du
.
minutes
();
this
.
second
=
du
.
seconds
();
this
.
second
=
du
.
seconds
();
const
space
=
4
-
this
.
list
.
length
%
4
;
const
space
=
4
-
this
.
list
.
length
%
4
;
...
@@ -141,4 +144,13 @@
...
@@ -141,4 +144,13 @@
font-size: 20rpx;
font-size: 20rpx;
}
}
}
}
.du_start {
font-size: 20rpx;
vertical-align: middle;
margin-right: 4rpx;
}
.svg {
position: relative;
top: 4rpx;
}
</
style
>
</
style
>
郑秀明
@zhengxiuming
mentioned in commit
e9658908
·
May 21, 2020
mentioned in commit
e9658908
mentioned in commit e965890816706f59bf3e12837dee0d950e52dfc3
Toggle commit list
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