Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
250d8fa2
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
250d8fa2
编写于
10月 11, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复小程序定时错乱
上级
5d33d37d
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
129 addition
and
38 deletion
+129
-38
public/appmini/old/alipay/pages/goods-detail/goods-detail.js
public/appmini/old/alipay/pages/goods-detail/goods-detail.js
+23
-6
public/appmini/old/alipay/pages/index/index.js
public/appmini/old/alipay/pages/index/index.js
+18
-6
public/appmini/old/baidu/pages/goods-detail/goods-detail.js
public/appmini/old/baidu/pages/goods-detail/goods-detail.js
+24
-7
public/appmini/old/baidu/pages/index/index.js
public/appmini/old/baidu/pages/index/index.js
+19
-7
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
+23
-6
public/appmini/old/weixin/pages/index/index.js
public/appmini/old/weixin/pages/index/index.js
+22
-6
未找到文件。
public/appmini/old/alipay/pages/goods-detail/goods-detail.js
浏览文件 @
250d8fa2
...
@@ -38,6 +38,8 @@ Page({
...
@@ -38,6 +38,8 @@ Page({
plugins_limitedtimediscount_data
:
null
,
plugins_limitedtimediscount_data
:
null
,
plugins_limitedtimediscount_is_show_time
:
true
,
plugins_limitedtimediscount_is_show_time
:
true
,
plugins_limitedtimediscount_time_millisecond
:
0
,
plugins_limitedtimediscount_time_millisecond
:
0
,
plugins_limitedtimediscount_timer
:
null
,
plugins_limitedtimediscount_timers
:
null
,
},
},
onLoad
(
params
)
{
onLoad
(
params
)
{
...
@@ -635,11 +637,16 @@ Page({
...
@@ -635,11 +637,16 @@ Page({
// 显示秒杀插件-倒计时
// 显示秒杀插件-倒计时
plugins_limitedtimediscount_countdown
()
{
plugins_limitedtimediscount_countdown
()
{
// 销毁之前的任务
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timer
);
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timers
);
// 定时参数
var
status
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
status
||
0
;
var
status
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
status
||
0
;
var
msg
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
msg
||
''
;
var
msg
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
msg
||
''
;
var
hours
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
hours
||
0
;
var
hours
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
hours
)
||
0
;
var
minutes
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
minutes
||
0
;
var
minutes
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
minutes
)
||
0
;
var
seconds
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
seconds
||
0
;
var
seconds
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
seconds
)
||
0
;
var
self
=
this
;
var
self
=
this
;
if
(
status
==
1
)
{
if
(
status
==
1
)
{
// 秒
// 秒
...
@@ -658,9 +665,10 @@ Page({
...
@@ -658,9 +665,10 @@ Page({
}
}
self
.
setData
({
self
.
setData
({
'
plugins_limitedtimediscount_data.time.hours
'
:
(
hours
<
10
&&
hours
.
length
==
1
)
?
'
0
'
+
hours
:
hours
,
'
plugins_limitedtimediscount_data.time.hours
'
:
(
hours
<
10
)
?
'
0
'
+
hours
:
hours
,
'
plugins_limitedtimediscount_data.time.minutes
'
:
(
minutes
<
10
&&
minutes
.
length
==
1
)
?
'
0
'
+
minutes
:
minutes
,
'
plugins_limitedtimediscount_data.time.minutes
'
:
(
minutes
<
10
)
?
'
0
'
+
minutes
:
minutes
,
'
plugins_limitedtimediscount_data.time.seconds
'
:
(
seconds
<
10
&&
seconds
.
length
==
1
)
?
'
0
'
+
seconds
:
seconds
,
'
plugins_limitedtimediscount_data.time.seconds
'
:
(
seconds
<
10
)
?
'
0
'
+
seconds
:
seconds
,
plugins_limitedtimediscount_timer
:
timer
,
});
});
if
(
hours
<=
0
&&
minutes
<=
0
&&
seconds
<=
0
)
{
if
(
hours
<=
0
&&
minutes
<=
0
&&
seconds
<=
0
)
{
...
@@ -687,6 +695,9 @@ Page({
...
@@ -687,6 +695,9 @@ Page({
clearInterval
(
timers
);
clearInterval
(
timers
);
}
}
},
100
);
},
100
);
self
.
setData
({
plugins_limitedtimediscount_timers
:
timers
,
});
}
else
{
}
else
{
// 活动已结束
// 活动已结束
self
.
setData
({
self
.
setData
({
...
@@ -696,6 +707,12 @@ Page({
...
@@ -696,6 +707,12 @@ Page({
}
}
},
},
// 页面销毁时执行
onUnload
:
function
()
{
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timer
);
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timers
);
},
// 自定义分享
// 自定义分享
onShareAppMessage
()
{
onShareAppMessage
()
{
var
user
=
app
.
get_user_info
(
this
,
'
onShareAppMessage
'
)
||
null
;
var
user
=
app
.
get_user_info
(
this
,
'
onShareAppMessage
'
)
||
null
;
...
...
public/appmini/old/alipay/pages/index/index.js
浏览文件 @
250d8fa2
...
@@ -17,6 +17,7 @@ Page({
...
@@ -17,6 +17,7 @@ Page({
plugins_limitedtimediscount_data
:
null
,
plugins_limitedtimediscount_data
:
null
,
plugins_limitedtimediscount_timer_title
:
'
距离结束
'
,
plugins_limitedtimediscount_timer_title
:
'
距离结束
'
,
plugins_limitedtimediscount_is_show_time
:
true
,
plugins_limitedtimediscount_is_show_time
:
true
,
plugins_limitedtimediscount_timer
:
null
,
},
},
onShow
()
{
onShow
()
{
...
@@ -107,9 +108,9 @@ Page({
...
@@ -107,9 +108,9 @@ Page({
plugins_limitedtimediscount_countdown
()
{
plugins_limitedtimediscount_countdown
()
{
var
status
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
status
||
0
;
var
status
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
status
||
0
;
var
msg
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
msg
||
''
;
var
msg
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
msg
||
''
;
var
hours
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
hours
||
0
;
var
hours
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
hours
)
||
0
;
var
minutes
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
minutes
||
0
;
var
minutes
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
minutes
)
||
0
;
var
seconds
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
seconds
||
0
;
var
seconds
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
seconds
)
||
0
;
var
self
=
this
;
var
self
=
this
;
if
(
status
==
1
)
{
if
(
status
==
1
)
{
// 秒
// 秒
...
@@ -128,9 +129,10 @@ Page({
...
@@ -128,9 +129,10 @@ Page({
}
}
self
.
setData
({
self
.
setData
({
'
plugins_limitedtimediscount_data.time.hours
'
:
(
hours
<
10
&&
hours
.
length
==
1
)
?
0
+
hours
:
hours
,
'
plugins_limitedtimediscount_data.time.hours
'
:
(
hours
<
10
)
?
'
0
'
+
hours
:
hours
,
'
plugins_limitedtimediscount_data.time.minutes
'
:
(
minutes
<
10
&&
minutes
.
length
==
1
)
?
0
+
minutes
:
minutes
,
'
plugins_limitedtimediscount_data.time.minutes
'
:
(
minutes
<
10
)
?
'
0
'
+
minutes
:
minutes
,
'
plugins_limitedtimediscount_data.time.seconds
'
:
(
seconds
<
10
&&
seconds
.
length
==
1
)
?
0
+
seconds
:
seconds
,
'
plugins_limitedtimediscount_data.time.seconds
'
:
(
seconds
<
10
)
?
'
0
'
+
seconds
:
seconds
,
plugins_limitedtimediscount_timer
:
timer
,
});
});
if
(
hours
<=
0
&&
minutes
<=
0
&&
seconds
<=
0
)
{
if
(
hours
<=
0
&&
minutes
<=
0
&&
seconds
<=
0
)
{
...
@@ -153,6 +155,16 @@ Page({
...
@@ -153,6 +155,16 @@ Page({
}
}
},
},
// 页面从前台变为后台时执行
onHide
:
function
()
{
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timer
);
},
// 页面销毁时执行
onUnload
:
function
()
{
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timer
);
},
// 自定义分享
// 自定义分享
onShareAppMessage
()
{
onShareAppMessage
()
{
return
{
return
{
...
...
public/appmini/old/baidu/pages/goods-detail/goods-detail.js
浏览文件 @
250d8fa2
...
@@ -38,7 +38,9 @@ Page({
...
@@ -38,7 +38,9 @@ Page({
common_app_is_limitedtimediscount
:
0
,
common_app_is_limitedtimediscount
:
0
,
plugins_limitedtimediscount_data
:
null
,
plugins_limitedtimediscount_data
:
null
,
plugins_limitedtimediscount_is_show_time
:
true
,
plugins_limitedtimediscount_is_show_time
:
true
,
plugins_limitedtimediscount_time_millisecond
:
0
plugins_limitedtimediscount_time_millisecond
:
0
,
plugins_limitedtimediscount_timer
:
null
,
plugins_limitedtimediscount_timers
:
null
,
},
},
onLoad
(
params
)
{
onLoad
(
params
)
{
...
@@ -584,11 +586,16 @@ Page({
...
@@ -584,11 +586,16 @@ Page({
// 显示秒杀插件-倒计时
// 显示秒杀插件-倒计时
plugins_limitedtimediscount_countdown
()
{
plugins_limitedtimediscount_countdown
()
{
// 销毁之前的任务
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timer
);
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timers
);
// 定时参数
var
status
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
status
||
0
;
var
status
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
status
||
0
;
var
msg
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
msg
||
''
;
var
msg
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
msg
||
''
;
var
hours
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
hours
||
0
;
var
hours
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
hours
)
||
0
;
var
minutes
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
minutes
||
0
;
var
minutes
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
minutes
)
||
0
;
var
seconds
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
seconds
||
0
;
var
seconds
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
seconds
)
||
0
;
var
self
=
this
;
var
self
=
this
;
if
(
status
==
1
)
{
if
(
status
==
1
)
{
// 秒
// 秒
...
@@ -607,9 +614,10 @@ Page({
...
@@ -607,9 +614,10 @@ Page({
}
}
self
.
setData
({
self
.
setData
({
'
plugins_limitedtimediscount_data.time.hours
'
:
hours
<
10
&&
hours
.
length
==
1
?
'
0
'
+
hours
:
hours
,
'
plugins_limitedtimediscount_data.time.hours
'
:
(
hours
<
10
)
?
'
0
'
+
hours
:
hours
,
'
plugins_limitedtimediscount_data.time.minutes
'
:
minutes
<
10
&&
minutes
.
length
==
1
?
'
0
'
+
minutes
:
minutes
,
'
plugins_limitedtimediscount_data.time.minutes
'
:
(
minutes
<
10
)
?
'
0
'
+
minutes
:
minutes
,
'
plugins_limitedtimediscount_data.time.seconds
'
:
seconds
<
10
&&
seconds
.
length
==
1
?
'
0
'
+
seconds
:
seconds
'
plugins_limitedtimediscount_data.time.seconds
'
:
(
seconds
<
10
)
?
'
0
'
+
seconds
:
seconds
,
plugins_limitedtimediscount_timer
:
timer
,
});
});
if
(
hours
<=
0
&&
minutes
<=
0
&&
seconds
<=
0
)
{
if
(
hours
<=
0
&&
minutes
<=
0
&&
seconds
<=
0
)
{
...
@@ -636,6 +644,9 @@ Page({
...
@@ -636,6 +644,9 @@ Page({
clearInterval
(
timers
);
clearInterval
(
timers
);
}
}
},
100
);
},
100
);
self
.
setData
({
plugins_limitedtimediscount_timers
:
timers
,
});
}
else
{
}
else
{
// 活动已结束
// 活动已结束
self
.
setData
({
self
.
setData
({
...
@@ -645,6 +656,12 @@ Page({
...
@@ -645,6 +656,12 @@ Page({
}
}
},
},
// 页面销毁时执行
onUnload
:
function
()
{
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timer
);
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timers
);
},
// 自定义分享
// 自定义分享
onShareAppMessage
()
{
onShareAppMessage
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
'
onShareAppMessage
'
)
||
null
;
var
user
=
app
.
get_user_cache_info
(
this
,
'
onShareAppMessage
'
)
||
null
;
...
...
public/appmini/old/baidu/pages/index/index.js
浏览文件 @
250d8fa2
...
@@ -16,7 +16,8 @@ Page({
...
@@ -16,7 +16,8 @@ Page({
common_app_is_limitedtimediscount
:
0
,
common_app_is_limitedtimediscount
:
0
,
plugins_limitedtimediscount_data
:
null
,
plugins_limitedtimediscount_data
:
null
,
plugins_limitedtimediscount_timer_title
:
'
距离结束
'
,
plugins_limitedtimediscount_timer_title
:
'
距离结束
'
,
plugins_limitedtimediscount_is_show_time
:
true
plugins_limitedtimediscount_is_show_time
:
true
,
plugins_limitedtimediscount_timer
:
null
,
},
},
onShow
()
{
onShow
()
{
...
@@ -110,9 +111,9 @@ Page({
...
@@ -110,9 +111,9 @@ Page({
plugins_limitedtimediscount_countdown
()
{
plugins_limitedtimediscount_countdown
()
{
var
status
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
status
||
0
;
var
status
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
status
||
0
;
var
msg
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
msg
||
''
;
var
msg
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
msg
||
''
;
var
hours
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
hours
||
0
;
var
hours
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
hours
)
||
0
;
var
minutes
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
minutes
||
0
;
var
minutes
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
minutes
)
||
0
;
var
seconds
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
seconds
||
0
;
var
seconds
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
seconds
)
||
0
;
var
self
=
this
;
var
self
=
this
;
if
(
status
==
1
)
{
if
(
status
==
1
)
{
// 秒
// 秒
...
@@ -131,9 +132,10 @@ Page({
...
@@ -131,9 +132,10 @@ Page({
}
}
self
.
setData
({
self
.
setData
({
'
plugins_limitedtimediscount_data.time.hours
'
:
hours
<
10
&&
hours
.
length
==
1
?
0
+
hours
:
hours
,
'
plugins_limitedtimediscount_data.time.hours
'
:
(
hours
<
10
)
?
'
0
'
+
hours
:
hours
,
'
plugins_limitedtimediscount_data.time.minutes
'
:
minutes
<
10
&&
minutes
.
length
==
1
?
0
+
minutes
:
minutes
,
'
plugins_limitedtimediscount_data.time.minutes
'
:
(
minutes
<
10
)
?
'
0
'
+
minutes
:
minutes
,
'
plugins_limitedtimediscount_data.time.seconds
'
:
seconds
<
10
&&
seconds
.
length
==
1
?
0
+
seconds
:
seconds
'
plugins_limitedtimediscount_data.time.seconds
'
:
(
seconds
<
10
)
?
'
0
'
+
seconds
:
seconds
,
plugins_limitedtimediscount_timer
:
timer
,
});
});
if
(
hours
<=
0
&&
minutes
<=
0
&&
seconds
<=
0
)
{
if
(
hours
<=
0
&&
minutes
<=
0
&&
seconds
<=
0
)
{
...
@@ -156,6 +158,16 @@ Page({
...
@@ -156,6 +158,16 @@ Page({
}
}
},
},
// 页面从前台变为后台时执行
onHide
:
function
()
{
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timer
);
},
// 页面销毁时执行
onUnload
:
function
()
{
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timer
);
},
// 自定义分享
// 自定义分享
onShareAppMessage
()
{
onShareAppMessage
()
{
return
{
return
{
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
浏览文件 @
250d8fa2
...
@@ -42,6 +42,8 @@ Page({
...
@@ -42,6 +42,8 @@ Page({
plugins_limitedtimediscount_data
:
null
,
plugins_limitedtimediscount_data
:
null
,
plugins_limitedtimediscount_is_show_time
:
true
,
plugins_limitedtimediscount_is_show_time
:
true
,
plugins_limitedtimediscount_time_millisecond
:
0
,
plugins_limitedtimediscount_time_millisecond
:
0
,
plugins_limitedtimediscount_timer
:
null
,
plugins_limitedtimediscount_timers
:
null
,
// 好物圈分享信息
// 好物圈分享信息
common_app_is_good_thing
:
0
,
common_app_is_good_thing
:
0
,
...
@@ -673,11 +675,16 @@ Page({
...
@@ -673,11 +675,16 @@ Page({
// 显示秒杀插件-倒计时
// 显示秒杀插件-倒计时
plugins_limitedtimediscount_countdown
()
{
plugins_limitedtimediscount_countdown
()
{
// 销毁之前的任务
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timer
);
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timers
);
// 定时参数
var
status
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
status
||
0
;
var
status
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
status
||
0
;
var
msg
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
msg
||
''
;
var
msg
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
msg
||
''
;
var
hours
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
hours
||
0
;
var
hours
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
hours
)
||
0
;
var
minutes
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
minutes
||
0
;
var
minutes
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
minutes
)
||
0
;
var
seconds
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
seconds
||
0
;
var
seconds
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
seconds
)
||
0
;
var
self
=
this
;
var
self
=
this
;
if
(
status
==
1
)
{
if
(
status
==
1
)
{
// 秒
// 秒
...
@@ -696,9 +703,10 @@ Page({
...
@@ -696,9 +703,10 @@ Page({
}
}
self
.
setData
({
self
.
setData
({
'
plugins_limitedtimediscount_data.time.hours
'
:
(
hours
<
10
&&
hours
.
length
==
1
)
?
'
0
'
+
hours
:
hours
,
'
plugins_limitedtimediscount_data.time.hours
'
:
(
hours
<
10
)
?
'
0
'
+
hours
:
hours
,
'
plugins_limitedtimediscount_data.time.minutes
'
:
(
minutes
<
10
&&
minutes
.
length
==
1
)
?
'
0
'
+
minutes
:
minutes
,
'
plugins_limitedtimediscount_data.time.minutes
'
:
(
minutes
<
10
)
?
'
0
'
+
minutes
:
minutes
,
'
plugins_limitedtimediscount_data.time.seconds
'
:
(
seconds
<
10
&&
seconds
.
length
==
1
)
?
'
0
'
+
seconds
:
seconds
,
'
plugins_limitedtimediscount_data.time.seconds
'
:
(
seconds
<
10
)
?
'
0
'
+
seconds
:
seconds
,
plugins_limitedtimediscount_timer
:
timer
,
});
});
if
(
hours
<=
0
&&
minutes
<=
0
&&
seconds
<=
0
)
{
if
(
hours
<=
0
&&
minutes
<=
0
&&
seconds
<=
0
)
{
...
@@ -725,6 +733,9 @@ Page({
...
@@ -725,6 +733,9 @@ Page({
clearInterval
(
timers
);
clearInterval
(
timers
);
}
}
},
100
);
},
100
);
self
.
setData
({
plugins_limitedtimediscount_timers
:
timers
,
});
}
else
{
}
else
{
// 活动已结束
// 活动已结束
self
.
setData
({
self
.
setData
({
...
@@ -734,6 +745,12 @@ Page({
...
@@ -734,6 +745,12 @@ Page({
}
}
},
},
// 页面销毁时执行
onUnload
:
function
()
{
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timer
);
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timers
);
},
// 商品海报分享
// 商品海报分享
poster_event
()
{
poster_event
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
'
poster_event
'
);
var
user
=
app
.
get_user_cache_info
(
this
,
'
poster_event
'
);
...
...
public/appmini/old/weixin/pages/index/index.js
浏览文件 @
250d8fa2
...
@@ -18,6 +18,7 @@ Page({
...
@@ -18,6 +18,7 @@ Page({
plugins_limitedtimediscount_data
:
null
,
plugins_limitedtimediscount_data
:
null
,
plugins_limitedtimediscount_timer_title
:
'
距离结束
'
,
plugins_limitedtimediscount_timer_title
:
'
距离结束
'
,
plugins_limitedtimediscount_is_show_time
:
true
,
plugins_limitedtimediscount_is_show_time
:
true
,
plugins_limitedtimediscount_timer
:
null
,
},
},
onShow
()
{
onShow
()
{
...
@@ -108,11 +109,15 @@ Page({
...
@@ -108,11 +109,15 @@ Page({
// 显示秒杀插件-倒计时
// 显示秒杀插件-倒计时
plugins_limitedtimediscount_countdown
()
{
plugins_limitedtimediscount_countdown
()
{
// 销毁之前的任务
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timer
);
// 定时参数
var
status
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
status
||
0
;
var
status
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
status
||
0
;
var
msg
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
msg
||
''
;
var
msg
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
msg
||
''
;
var
hours
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
hours
||
0
;
var
hours
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
hours
)
||
0
;
var
minutes
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
minutes
||
0
;
var
minutes
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
minutes
)
||
0
;
var
seconds
=
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
seconds
||
0
;
var
seconds
=
parseInt
(
this
.
data
.
plugins_limitedtimediscount_data
.
time
.
seconds
)
||
0
;
var
self
=
this
;
var
self
=
this
;
if
(
status
==
1
)
{
if
(
status
==
1
)
{
// 秒
// 秒
...
@@ -131,9 +136,10 @@ Page({
...
@@ -131,9 +136,10 @@ Page({
}
}
self
.
setData
({
self
.
setData
({
'
plugins_limitedtimediscount_data.time.hours
'
:
(
hours
<
10
&&
hours
.
length
==
1
)
?
0
+
hours
:
hours
,
'
plugins_limitedtimediscount_data.time.hours
'
:
(
hours
<
10
)
?
'
0
'
+
hours
:
hours
,
'
plugins_limitedtimediscount_data.time.minutes
'
:
(
minutes
<
10
&&
minutes
.
length
==
1
)
?
0
+
minutes
:
minutes
,
'
plugins_limitedtimediscount_data.time.minutes
'
:
(
minutes
<
10
)
?
'
0
'
+
minutes
:
minutes
,
'
plugins_limitedtimediscount_data.time.seconds
'
:
(
seconds
<
10
&&
seconds
.
length
==
1
)
?
0
+
seconds
:
seconds
,
'
plugins_limitedtimediscount_data.time.seconds
'
:
(
seconds
<
10
)
?
'
0
'
+
seconds
:
seconds
,
plugins_limitedtimediscount_timer
:
timer
,
});
});
if
(
hours
<=
0
&&
minutes
<=
0
&&
seconds
<=
0
)
{
if
(
hours
<=
0
&&
minutes
<=
0
&&
seconds
<=
0
)
{
...
@@ -156,6 +162,16 @@ Page({
...
@@ -156,6 +162,16 @@ Page({
}
}
},
},
// 页面从前台变为后台时执行
onHide
:
function
()
{
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timer
);
},
// 页面销毁时执行
onUnload
:
function
()
{
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timer
);
},
// 自定义分享
// 自定义分享
onShareAppMessage
()
{
onShareAppMessage
()
{
return
{
return
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录