Commit 3f428277 authored by wangxuelai's avatar wangxuelai

Merge remote-tracking branch 'origin/lvtz' into wxl-develop

parents c74e903c 3f1ed544
......@@ -119,10 +119,10 @@ Page({
},
submit () {
console.log(this.data.params)
this.data.submitting = true;
if (this.data.submitting) {
return
}
this.data.submitting = true;
wx.showLoading({
title: '积分保存中...'
})
......
......@@ -14,7 +14,63 @@ Page({
imageVersion: app.globalData.imageVersion,
localImageRoot: "../../../images/",
sid: 0,
pointsData: ''
params: {
'1': { // 每日打卡
single: 1,
daily_limit: 1,
isUnlimit: 0, // 0 不是无限 1 无限
my: 0,//我的打卡进度
},
'2': { // 点赞鼓励
single: 1,
daily_limit: 1,
isUnlimit: 0, // 0 不是无限 1 无限
my: 0,//我的打卡进度
},
'3': { // 评论互动
single: 1,
daily_limit: 1,
isUnlimit: 0, // 0 不是无限 1 无限
my: 0,//我的打卡进度
},
'4': { // 分享打卡
single: 1,
daily_limit: 1,
isUnlimit: 0, // 0 不是无限 1 无限
my: 0,//我的打卡进度
},
'5': { // 打卡内容被点赞
single: 1,
daily_limit: 1,
isUnlimit: 0, // 0 不是无限 1 无限
my: 0,//我的打卡进度
},
'6': { // 打卡内容被围观
single: 1,
daily_limit: 1,
isUnlimit: 0, // 0 不是无限 1 无限
my: 0,//我的打卡进度
},
'7': { // 打卡内容被转发
single: 1,
daily_limit: 1,
isUnlimit: 0, // 0 不是无限 1 无限
my: 0,//我的打卡进度
},
'8': { // 打卡内容被评论
single: 1,
daily_limit: 1,
isUnlimit: 0, // 0 不是无限 1 无限
my: 0,//我的打卡进度
},
'9': { // 打卡内容被老师点评
single: 1,
daily_limit: 1,
isUnlimit: 0, // 0 不是无限 1 无限
my: 0,//我的打卡进度
}
},
isRuleSeted: true
},
/**
......@@ -100,28 +156,65 @@ Page({
}).then((res) => {
const {code,data} = res
if (code == 200) {
if (data.list.length > 0) {
data.list.forEach((ele) => {
if (ele.daily_limit == -1) {
this.setData({
[`params.${ele.type}`]: {
daily_limit: 0,
single: ele.single,
isUnlimit: 1,
my: ele.my,
}
})
} else {
this.setData({
pointsData: data
}, () => {})
[`params.${ele.type}`]: {
daily_limit: ele.daily_limit,
single: ele.single,
isUnlimit: 0,
my: ele.my,
}
})
}
})
} else {
this.setData({
isRuleSeted: false
})
}
console.log(this.data.params)
}
})
},
// 积分规则
toRulePage () {
wx.navigateTo({
url: `/src/pages/pointsrule/index?sid=${this.data.sid}`
})
},
// 积分明细
toPointsInOutPage () {
wx.navigateTo({
url: `/src/pages/pointsInOut/index?sid=${this.data.sid}`
})
},
// 积分商城
toPointsMall () {
wx.navigateTo({
url: `/src/pages/mall/index?sid=${this.data.sid}&from=2`
})
},
// 积分排行榜
toPointsRankList () {
console.log('待跳转积分排行榜')
// wx.navigateTo({
// url: `/src/pages/rankingList/index?sid=${this.data.sid}`
// })
},
// 积分任务
toDoPointsTask () {
console.log('待跳转积分任务列表')
// wx.navigateTo({
// url: `/src/pages/rankingList/index?sid=${this.data.sid}`
// })
......
{
"navigationBarBackgroundColor": "#FFE344",
"navigationBarTitleText": "积分",
"usingComponents": {}
"usingComponents": {
"empty-content": "../../../components/emptycontent"
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -12,7 +12,54 @@ Page({
imageVersion: app.globalData.imageVersion,
localImageRoot: '../../../images/',
sid: 0,
pointsData: ''
params: {
'1': { // 每日打卡
single: 1,
daily_limit: 1,
isUnlimit: 0 // 0 不是无限 1 无限
},
'2': { // 点赞鼓励
single: 1,
daily_limit: 2,
isUnlimit: 0 // 0 不是无限 1 无限
},
'3': { // 评论互动
single: 1,
daily_limit: 3,
isUnlimit: 0 // 0 不是无限 1 无限
},
'4': { // 分享打卡
single: 1,
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 无限
}
},
isRuleSeted: true
},
/**
......@@ -82,9 +129,32 @@ Page({
}).then((res) => {
const {code,data} = res
if (code == 200) {
if (data.list.length > 0) {
data.list.forEach((ele) => {
if (ele.daily_limit == -1) {
this.setData({
pointsData: data
}, () => {})
[`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.setData({
isRuleSeted: false
})
}
console.log(this.data.params)
}
})
}
......
{
"navigationBarTitleText": "积分规则",
"usingComponents": {}
"usingComponents": {
"empty-content": "../../../components/emptycontent"
}
}
\ No newline at end of file
<view class="container">
<block wx:if="{{isRuleSeted}}">
<view class="pointrule-box">
<view class="part-box">
<view class="part-header">
......@@ -9,30 +10,50 @@
<view class="part-item">
<view class="item-left">
<view class="item-title">每日打卡</view>
<view class="item-subtitle"></view>
<view class="item-subtitle" wx:if="{{params[1].daily_limit !=-1}}">每日上限{{params[1].daily_limit}}次</view>
</view>
<view class="item-right">
<text class="item-point-num">+3</text>
<text class="item-point-num">+{{params[1].single}}</text>
<image class="item-point-icon" src="{{localImageRoot}}2c/pointsrule/point_icon.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image>
</view>
</view>
<view class="part-item">
<view class="item-left">
<view class="item-title">打卡获得点赞</view>
<view class="item-subtitle">每日上限50</view>
<view class="item-subtitle" wx:if="{{params[2].daily_limit !=-1}}">每日上限{{params[2].daily_limit}}次</view>
</view>
<view class="item-right">
<text class="item-point-num">+3</text>
<text class="item-point-num">+{{params[2].single}}</text>
<image class="item-point-icon" src="{{localImageRoot}}2c/pointsrule/point_icon.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image>
</view>
</view>
<view class="part-item">
<view class="item-left">
<view class="item-title">打卡获得评论</view>
<view class="item-subtitle">每日上限50</view>
<view class="item-subtitle" wx:if="{{params[3].daily_limit !=-1}}">每日上限{{params[3].daily_limit}}次</view>
</view>
<view class="item-right">
<text class="item-point-num">+3</text>
<text class="item-point-num">+{{params[3].single}}</text>
<image class="item-point-icon" src="{{localImageRoot}}2c/pointsrule/point_icon.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image>
</view>
</view>
<view class="part-item">
<view class="item-left">
<view class="item-title">打卡被转发</view>
<view class="item-subtitle" wx:if="{{params[7].daily_limit !=-1}}">每日上限{{params[7].daily_limit}}次</view>
</view>
<view class="item-right">
<text class="item-point-num">+{{params[7].single}}</text>
<image class="item-point-icon" src="{{localImageRoot}}2c/pointsrule/point_icon.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image>
</view>
</view>
<view class="part-item">
<view class="item-left">
<view class="item-title">打卡被围观</view>
<view class="item-subtitle" wx:if="{{params[6].daily_limit !=-1}}">每日上限{{ params[6].daily_limit}}次</view>
</view>
<view class="item-right">
<text class="item-point-num">+{{params[6].single}}</text>
<image class="item-point-icon" src="{{localImageRoot}}2c/pointsrule/point_icon.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image>
</view>
</view>
......@@ -48,30 +69,30 @@
<view class="part-item">
<view class="item-left">
<view class="item-title">点赞同学</view>
<view class="item-subtitle">每日上限50</view>
<view class="item-subtitle" wx:if="{{params[5].daily_limit !=-1}}">每日上限{{params[5].daily_limit}}次</view>
</view>
<view class="item-right">
<text class="item-point-num">+3</text>
<text class="item-point-num">+{{params[5].single}}</text>
<image class="item-point-icon" src="{{localImageRoot}}2c/pointsrule/point_icon.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image>
</view>
</view>
<view class="part-item">
<view class="item-left">
<view class="item-title">评论同学</view>
<view class="item-subtitle">每日上限50</view>
<view class="item-subtitle" wx:if="{{params[8].daily_limit !=-1}}">每日上限{{params[8].daily_limit}}次</view>
</view>
<view class="item-right">
<text class="item-point-num">+3</text>
<text class="item-point-num">+{{params[8].single}}</text>
<image class="item-point-icon" src="{{localImageRoot}}2c/pointsrule/point_icon.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image>
</view>
</view>
<view class="part-item">
<view class="item-left">
<view class="item-title">分享打卡到朋友圈</view>
<view class="item-subtitle">每日上限50</view>
<view class="item-subtitle" wx:if="{{params[4].daily_limit !=-1}}">每日上限{{params[4].daily_limit}}次</view>
</view>
<view class="item-right">
<text class="item-point-num">+3</text>
<text class="item-point-num">+{{params[4].single}}</text>
<image class="item-point-icon" src="{{localImageRoot}}2c/pointsrule/point_icon.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image>
</view>
</view>
......@@ -87,20 +108,10 @@
<view class="part-item">
<view class="item-left">
<view class="item-title">获得老师点评</view>
<view class="item-subtitle"></view>
</view>
<view class="item-right">
<text class="item-point-num">+3</text>
<image class="item-point-icon" src="{{localImageRoot}}2c/pointsrule/point_icon.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image>
</view>
</view>
<view class="part-item">
<view class="item-left">
<view class="item-title">老师打星评分</view>
<view class="item-subtitle"></view>
<view class="item-subtitle" wx:if="{{params[9].daily_limit !=-1}}">每日上限{{params[9].daily_limit}}次</view>
</view>
<view class="item-right">
<text class="item-point-num">+3</text>
<text class="item-point-num">+{{params[9].single}}</text>
<image class="item-point-icon" src="{{localImageRoot}}2c/pointsrule/point_icon.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image>
</view>
</view>
......@@ -115,4 +126,8 @@
<text>打卡小管家将做冻结积分或清零处理。</text>
</view>
</view>
</block>
<block wx:else>
<empty-content text="暂未设置积分"></empty-content>
</block>
</view>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment