Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
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
wangxuelai
wechatapp.shangjiadao.com
Commits
a10263d8
Commit
a10263d8
authored
Apr 02, 2020
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'闯关打卡颗粒度5'
parent
3322b648
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
index.js
business/pages/themeeditor/index.js
+12
-8
index.wxml
business/pages/themeeditor/index.wxml
+1
-1
No files found.
business/pages/themeeditor/index.js
View file @
a10263d8
...
...
@@ -293,7 +293,7 @@ Page({
title
:
'新建闯关打卡'
})
this
.
setData
({
lockSubjectLists
:
this
.
data
.
lockSubjects
.
slice
(
that
.
data
.
currentSortIndex
*
10
,
that
.
data
.
currentSortIndex
*
10
+
10
),
lockSubjectLists
:
this
.
data
.
lockSubjects
.
slice
(
that
.
data
.
currentSortIndex
*
5
,
that
.
data
.
currentSortIndex
*
5
+
5
),
})
this
.
setData
({
classes
:
currentclasses
,
...
...
@@ -358,7 +358,7 @@ Page({
let
smallArr
=
[];
let
subject_count
=
this
.
data
.
lockparams
.
subject_count
;
for
(
let
i
=
1
;
i
<
subject_count
+
1
;
i
++
)
{
if
(
i
%
10
==
0
)
{
if
(
i
%
5
==
0
)
{
smallArr
.
push
(
i
);
bigArr
.
push
(
smallArr
);
smallArr
=
[];
...
...
@@ -1823,7 +1823,7 @@ Page({
title
:
'新建闯关打卡'
})
this
.
setData
({
lockSubjectLists
:
this
.
data
.
lockSubjects
.
slice
(
this
.
data
.
currentSortIndex
*
10
,
this
.
data
.
currentSortIndex
*
10
+
10
),
lockSubjectLists
:
this
.
data
.
lockSubjects
.
slice
(
this
.
data
.
currentSortIndex
*
5
,
this
.
data
.
currentSortIndex
*
5
+
5
),
})
this
.
getSubjectSort
();
}
...
...
@@ -2063,7 +2063,7 @@ Page({
'lockparams.subject_count'
:
this
.
data
.
copySubjectCount
,
copySubjectCount
:
0
,
lockSubjects
:
lockSubjects
,
lockSubjectLists
:
lockSubjects
.
slice
(
this
.
data
.
currentSortIndex
*
10
,
this
.
data
.
currentSortIndex
*
10
+
10
),
lockSubjectLists
:
lockSubjects
.
slice
(
this
.
data
.
currentSortIndex
*
5
,
this
.
data
.
currentSortIndex
*
5
+
5
),
})
this
.
getSubjectSort
();
}
else
{
...
...
@@ -2073,13 +2073,17 @@ Page({
content
:
`您当前设置的关卡数
${
that
.
data
.
copySubjectCount
}
关小于设置前的关卡数
${
that
.
data
.
lockparams
.
subject_count
}
关,会丢失最后
${
that
.
data
.
lockparams
.
subject_count
-
that
.
data
.
copySubjectCount
}
关,您确定吗?`
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
if
(
this
.
data
.
currentSortIndex
>
Math
.
floor
(
that
.
data
.
copySubjectCount
/
5
))
{
that
.
data
.
currentSortIndex
=
Math
.
floor
(
that
.
data
.
copySubjectCount
/
5
)
}
lockSubjects
.
splice
(
that
.
data
.
copySubjectCount
);
that
.
setData
({
changesubjectCountInputShow
:
false
,
'lockparams.subject_count'
:
that
.
data
.
copySubjectCount
,
copySubjectCount
:
0
,
lockSubjects
,
lockSubjectLists
:
lockSubjects
.
slice
(
that
.
data
.
currentSortIndex
*
10
,
that
.
data
.
currentSortIndex
*
10
+
10
),
currentSortIndex
:
that
.
data
.
currentSortIndex
,
lockSubjectLists
:
lockSubjects
.
slice
(
that
.
data
.
currentSortIndex
*
5
,
that
.
data
.
currentSortIndex
*
5
+
5
),
})
that
.
getSubjectSort
();
}
...
...
@@ -2091,13 +2095,13 @@ Page({
const
{
index
,
item
}
=
e
.
currentTarget
.
dataset
;
this
.
setData
({
currentSortIndex
:
index
,
lockSubjectLists
:
this
.
data
.
lockSubjects
.
slice
(
index
*
10
,
index
*
10
+
10
),
lockSubjectLists
:
this
.
data
.
lockSubjects
.
slice
(
index
*
5
,
index
*
5
+
5
),
})
},
// 去编辑关卡内容
goModifyClockSubject
(
e
)
{
const
{
item
,
index
,
}
=
e
.
currentTarget
.
dataset
;
const
sort
=
this
.
data
.
currentSortIndex
*
10
+
index
+
1
;
const
sort
=
this
.
data
.
currentSortIndex
*
5
+
index
+
1
;
let
addSort
=
0
;
// 是否是新增的主题
let
lockSubjectLists
=
this
.
data
.
lockSubjects
;
if
(
sort
>=
2
)
{
...
...
@@ -2446,7 +2450,7 @@ Page({
id
:
(
data
.
land_content
&&
data
.
land_content
.
id
)
||
0
,
title
:
(
data
.
land_content
&&
data
.
land_content
.
title
)
||
''
},
lockSubjectLists
:
lockSubjects
.
slice
(
this
.
data
.
currentSortIndex
*
10
,
this
.
data
.
currentSortIndex
*
10
+
10
)
lockSubjectLists
:
lockSubjects
.
slice
(
this
.
data
.
currentSortIndex
*
5
,
this
.
data
.
currentSortIndex
*
5
+
5
)
})
this
.
getSubjectSort
();
...
...
business/pages/themeeditor/index.wxml
View file @
a10263d8
...
...
@@ -312,7 +312,7 @@
<view class="locksubjectlist">
<view class="locksubjectitem" wx:for="{{lockSubjectLists}}" wx:key="index" data-item="{{item}}" data-index="{{index}}" bindtap="goModifyClockSubject">
<view class="topbox">
<view class="sorttitle">第{{currentSortIndex *
10
+ index + 1}}关</view>
<view class="sorttitle">第{{currentSortIndex *
5
+ index + 1}}关</view>
<view class="editbtn">编辑</view>
</view>
<view class="subjecttitle">{{item.title || '未设置'}}</view>
...
...
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