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
a77f0c1d
Commit
a77f0c1d
authored
May 23, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
''
parent
02cbcf6a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
178 additions
and
39 deletions
+178
-39
index.js
business/pages/scorerulesetting/index.js
+141
-2
index.wxml
business/pages/scorerulesetting/index.wxml
+37
-37
No files found.
business/pages/scorerulesetting/index.js
View file @
a77f0c1d
...
...
@@ -13,13 +13,67 @@ Page({
imageRoot
:
app
.
globalData
.
imageRoot
,
imageVersion
:
app
.
globalData
.
imageVersion
,
localImageRoot
:
'../../../images/'
,
sid
:
0
,
params
:
{
'1'
:
{
// 打卡
single
:
1
,
daily_limit
:
1
,
isUnlimit
:
0
// 0 不是无限 1 无限
},
'2'
:
{
// 点赞别人
single
:
2
,
daily_limit
:
2
,
isUnlimit
:
0
// 0 不是无限 1 无限
},
'3'
:
{
// 评论别人
single
:
3
,
daily_limit
:
3
,
isUnlimit
:
0
// 0 不是无限 1 无限
},
'4'
:
{
// 转发打卡
single
:
4
,
daily_limit
:
4
,
isUnlimit
:
0
// 0 不是无限 1 无限
},
'5'
:
{
// 被点赞
single
:
5
,
daily_limit
:
5
,
isUnlimit
:
0
// 0 不是无限 1 无限
},
'6'
:
{
// 被围观
single
:
6
,
daily_limit
:
6
,
isUnlimit
:
0
// 0 不是无限 1 无限
},
'7'
:
{
// 打卡被转发
single
:
7
,
daily_limit
:
7
,
isUnlimit
:
0
// 0 不是无限 1 无限
},
'8'
:
{
// 被评论
single
:
8
,
daily_limit
:
8
,
isUnlimit
:
0
// 0 不是无限 1 无限
},
'9'
:
{
// 被点评
single
:
9
,
daily_limit
:
9
,
isUnlimit
:
0
// 0 不是无限 1 无限
}
},
addOrUpdate
:
'add'
,
submitting
:
false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
const
{
sid
}
=
options
;
this
.
setData
({
sid
})
this
.
integralRulesShow
();
},
/**
...
...
@@ -63,11 +117,96 @@ Page({
onReachBottom
:
function
()
{
},
submit
()
{
this
.
data
.
submitting
=
true
;
if
(
this
.
data
.
submitting
)
{
return
}
wx
.
showLoading
({
title
:
'积分保存中...'
})
const
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
.
params
));
for
(
let
i
in
params
)
{
if
(
params
[
i
].
isUnlimit
==
1
)
{
params
[
i
].
daily_limit
=
-
1
;
}
if
(
params
[
i
].
daily_limit
==
''
)
{
params
[
i
].
daily_limit
=
0
;
}
if
(
params
[
i
].
single
==
''
)
{
params
[
i
].
single
=
0
;
}
params
[
i
].
school_id
=
this
.
data
.
sid
;
delete
params
[
i
].
isUnlimit
;
}
let
ajax
=
null
;
if
(
this
.
data
.
addOrUpdate
==
'add'
)
{
ajax
=
integralRulesAdd
;
}
else
if
(
this
.
data
.
addOrUpdate
==
'update'
)
{
ajax
=
integralRulesUpdate
;
}
ajax
({
data
:
JSON
.
stringify
(
params
)
}).
then
((
res
)
=>
{
const
{
data
,
code
}
=
res
;
wx
.
hideLoading
();
if
(
code
==
200
)
{
wx
.
showToast
({
title
:
'积分规则保存成功'
})
}
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
()
{
},
integralRulesShow
()
{
integralRulesShow
({
school_id
:
this
.
data
.
sid
}).
then
((
res
)
=>
{
const
{
code
,
data
}
=
res
;
if
(
code
==
200
)
{
if
(
data
.
list
.
length
>
0
)
{
this
.
data
.
addOrUpdate
=
'update'
;
data
.
list
.
forEach
((
ele
)
=>
{
if
(
ele
.
daily_limit
==
-
1
)
{
this
.
setData
({
[
`params.
${
ele
.
type
}
`
]:
{
daily_limit
:
0
,
single
:
ele
.
single
,
isUnlimit
:
1
}
})
}
else
{
this
.
setData
({
[
`params.
${
ele
.
type
}
`
]:
{
daily_limit
:
ele
.
daily_limit
,
single
:
ele
.
single
,
isUnlimit
:
0
}
})
}
})
}
else
{
this
.
data
.
addOrUpdate
=
'add'
;
}
}
})
},
selectUnLimit
(
e
)
{
const
{
dataset
}
=
e
.
currentTarget
;
let
isUnlimit
=
`params.
${
dataset
.
type
}
.isUnlimit`
if
(
this
.
data
.
params
[
dataset
.
type
].
isUnlimit
==
0
)
{
this
.
setData
({
[
isUnlimit
]:
1
})
}
else
{
this
.
setData
({
[
isUnlimit
]:
0
})
}
}
})
\ No newline at end of file
business/pages/scorerulesetting/index.wxml
View file @
a77f0c1d
This diff is collapsed.
Click to expand it.
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