Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
115ab284
ShopXO
项目概览
jamesyang1999
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
115ab284
编写于
7月 05, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xcx
上级
6bf8b2c2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
127 addition
and
16 deletion
+127
-16
public/appmini/old/weixin/components/limitedtimediscount/limitedtimediscount.js
...xin/components/limitedtimediscount/limitedtimediscount.js
+49
-0
public/appmini/old/weixin/components/limitedtimediscount/limitedtimediscount.wxml
...n/components/limitedtimediscount/limitedtimediscount.wxml
+29
-14
public/appmini/old/weixin/components/limitedtimediscount/limitedtimediscount.wxss
...n/components/limitedtimediscount/limitedtimediscount.wxss
+49
-2
未找到文件。
public/appmini/old/weixin/components/limitedtimediscount/limitedtimediscount.js
浏览文件 @
115ab284
...
...
@@ -11,13 +11,62 @@ Component({
* 组件的初始数据
*/
data
:
{
hours
:
0
,
minutes
:
0
,
seconds
:
30
,
timer_title
:
'
距离结束
'
,
is_show_time
:
true
,
},
ready
:
function
()
{
this
.
countdown
();
},
/**
* 组件的方法列表
*/
methods
:
{
// 倒计时
countdown
()
{
if
(
this
.
data
.
hours
>
0
||
this
.
data
.
minutes
>
0
||
this
.
data
.
seconds
>
0
)
{
var
hours
=
this
.
data
.
hours
;
var
minutes
=
this
.
data
.
minutes
;
var
seconds
=
this
.
data
.
seconds
;
// 秒
var
self
=
this
;
var
timer
=
setInterval
(
function
()
{
if
(
seconds
<=
0
)
{
if
(
minutes
>
0
)
{
minutes
--
;
seconds
=
59
;
}
else
if
(
hours
>
0
)
{
hours
--
;
minutes
=
59
;
seconds
=
59
;
}
}
else
{
seconds
--
;
}
self
.
setData
({
hours
:
(
hours
<
10
)
?
0
+
hours
:
hours
,
minutes
:
(
minutes
<
10
)
?
0
+
minutes
:
minutes
,
seconds
:
(
seconds
<
10
)
?
0
+
seconds
:
seconds
,
});
if
(
hours
<=
0
&&
minutes
<=
0
&&
seconds
<=
0
)
{
// 停止时间
clearInterval
(
timer
);
// 活动已结束
self
.
setData
({
timer_title
:
'
活动已结束
'
,
is_show_time
:
false
,
});
}
},
1000
);
}
}
}
})
public/appmini/old/weixin/components/limitedtimediscount/limitedtimediscount.wxml
浏览文件 @
115ab284
<view class="data-list">
<scroll-view scroll-x>
<view class="item">
<view class='inner'>1</view>
<view class="limitedtimediscount">
<view class="spacing-nav-title">
<text class="text-wrapper">限时秒杀</text>
<view class="countdown">
<block wx:if="{{is_show_time}}">
<view class="timer-hours seconds">{{seconds}}</view>
<view class="ds">:</view>
<view class="timer-hours minutes">{{minutes}}</view>
<view class="ds">:</view>
<view class="timer-hours hours">{{hours}}</view>
</block>
<view class="timer-title">{{timer_title}}</view>
</view>
<view class="item">
<view class='inner'>2</view>
</view>
<view class="item">
<view class='inner'>3</view>
</view>
<view class="item">
<view class='inner'>4</view>
</view>
</scroll-view>
</view>
<view class="data-list">
<scroll-view scroll-x>
<view class="item">
<view class='inner'>1</view>
</view>
<view class="item">
<view class='inner'>2</view>
</view>
<view class="item">
<view class='inner'>3</view>
</view>
<view class="item">
<view class='inner'>4</view>
</view>
</scroll-view>
</view>
</view>
\ No newline at end of file
public/appmini/old/weixin/components/limitedtimediscount/limitedtimediscount.wxss
浏览文件 @
115ab284
.
data-lis
t {
.
limitedtimediscoun
t {
background: #fff;
padding: 20rpx 10rpx;
padding: 5rpx 10rpx 20rpx 10rpx;
margin-bottom: 20rpx;
}
/*
定时器
*/
.spacing-nav-title {
overflow: hidden;
padding: 10rpx 0;
}
.text-wrapper {
color: #d2364c;
font-size: 36rpx;
font-weight: bold;
}
.countdown {
line-height: 50rpx;
float: right;
}
.countdown view {
margin-right: 0;
float: right;
}
.countdown .timer-title {
color: #666;
margin-right: 10rpx;
}
.countdown .timer-hours {
padding: 0 12rpx;
-moz-border-radius: 8rpx;
border-radius: 8rpx;
background-color: #3A4145;
color: #fff;
min-width: 35rpx;
text-align: center;
}
.countdown .ds {
color: #4B5459;
padding: 0 8rpx;
font-weight: 700;
}
/*
商品
*/
.data-list {
width: 100%;
white-space: nowrap;
box-sizing: border-box;
margin-top: 5rpx;
}
/*设置行内块*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录