Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
llewan-weixin-sdk
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
llewan
llewan-weixin-sdk
Commits
249dca19
Commit
249dca19
authored
Oct 25, 2018
by
liuxinjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加视频-分享的自由配置切换解析
parent
38c441fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
5 deletions
+100
-5
sdk.js
assets/llewan-weixin-sdk/sdk.js
+100
-5
No files found.
assets/llewan-weixin-sdk/sdk.js
View file @
249dca19
...
...
@@ -2236,6 +2236,7 @@ var sdk = {
getButtonConfig
(
buttonKey
){
var
c3
=
this
.
getConfig3
();
if
(
c3
.
length
>
0
)
{
...
...
@@ -2253,7 +2254,55 @@ var sdk = {
var
nowTime
=
new
Date
().
getTime
();
if
(
nowTime
>=
d
.
s_time
&&
nowTime
<=
d
.
e_time
)
{
return
d
;
if
(
c
.
type
===
'mix'
)
{
var
countKey
=
"getButtonConfig:"
+
i
+
":count"
;
var
count
=
this
.
getItem
(
countKey
);
console
.
log
(
"getButtonConfig->"
+
countKey
,
count
);
if
(
!
count
)
{
count
=
1
;
}
var
startKey
=
"getButtonConfig:"
+
i
+
":start:"
+
d
.
data
.
start
.
type
+
":"
+
count
;
var
startVal
=
this
.
getItem
(
startKey
);
console
.
log
(
"getButtonConfig->"
+
startKey
,
startVal
);
if
(
!
startVal
)
{
startVal
=
0
;
}
if
(
startVal
>=
d
.
data
.
start
.
count
)
{
return
this
.
nextConfig
(
d
.
data
,
d
.
data
.
start
.
next
,
i
,
count
);
}
else
{
//当前记录的次数小于配置次数
startVal
++
;
this
.
setItem
(
startKey
,
startVal
);
d
.
data
.
start
.
left_count
=
d
.
data
.
start
.
count
-
startVal
;
d
.
data
.
start
.
use_count
=
startVal
;
return
d
.
data
.
start
;
}
}
else
{
return
d
;
}
}
}
...
...
@@ -2268,6 +2317,52 @@ var sdk = {
return
null
;
}
},
nextConfig
(
data
,
nextKey
,
i
,
count
)
{
if
(
nextKey
==
'end'
)
{
return
null
;
}
var
nextCacheKey
=
"getButtonConfig:"
+
i
+
":"
+
nextKey
+
":"
+
data
[
nextKey
].
type
+
":"
+
count
;
var
nextCacheVal
=
this
.
getItem
(
nextCacheKey
);
console
.
log
(
"nextConfig->"
+
nextCacheKey
,
nextCacheVal
);
if
(
!
nextCacheVal
)
{
nextCacheVal
=
1
;
}
else
{
nextCacheVal
=
nextCacheVal
+
1
;
}
this
.
setItem
(
nextCacheKey
,
nextCacheVal
);
if
(
nextCacheVal
>=
data
[
nextKey
].
count
)
{
//当前缓存中的记录当前key的次数已经超过配置次数
if
(
data
[
nextKey
].
next
==
'start'
)
{
var
countKey
=
"getButtonConfig:"
+
i
+
":count"
;
count
=
count
+
1
;
this
.
setItem
(
countKey
,
count
);
}
//往下递归
return
this
.
nextConfig
(
data
,
data
[
nextKey
].
next
,
i
,
count
);
}
else
{
data
[
nextKey
].
left_count
=
data
[
nextKey
].
count
-
nextCacheVal
;
data
[
nextKey
].
use_count
=
nextCacheVal
;
return
data
[
nextKey
];
}
},
/**
* @apiGroup C
...
...
@@ -2285,9 +2380,9 @@ var sdk = {
navigateToMiniProgram
(
config
,
success
,
fail
,
complete
)
{
var
nowTime
=
new
Date
().
getTime
();
if
(
nowTime
>=
config
.
s_time
&&
nowTime
<=
config
.
e_time
)
{
//
var nowTime =new Date().getTime();
//
if(nowTime >=config.s_time && nowTime <=config.e_time)
//
{
wx
.
navigateToMiniProgram
({
appId
:
config
.
app_id
,
// 要打开的小程序appId
path
:
config
.
path
,
// 打开的页面路径,如果为空则打开首页
...
...
@@ -2297,7 +2392,7 @@ var sdk = {
fail
:
fail
,
complete
:
complete
,
});
}
//
}
},
...
...
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