jonNums.count 是接口返回的数据 是报名总人数
newNumber 新的报名总人数 - 缓存上次的报名总人数 = 新增报名人数
[javascript] view plain copy
print?
onLoad: function (options) {
var that = this;
var activityId = options.activityId;
//报名表人数统计
wx.request({
url: domain + '/activityjoin/selectJoinCount',
data: { activityId: activityId },
method: 'GET',
success: function (res) {
var jonNums = res.data;
var newNumber = jonNums.count - wx.getStorageSync('jonNumsed' + activityId) //获取缓存
wx.setStorageSync('jonNumsed' + activityId, jonNums.count);//设置缓存
if (jonNums.count) {
activityId
}
jonNums.joinCount = jonNums.count;
that.setData({ newNumber: newNumber, jonNums: jonNums })
}
})