如何调整奖励排序
<p>Q:礼包购买类模板如何调整奖励排序,让已领取的排序到最后面
A 修改以下代码</p>
<pre><code class="language-lua">function VIEW:getShowList()
local showList = {}
for _, _info in ipairs(self.vecBaseCfg or {}) do
if ssrCheckLimitCondition(_info.parseLimit,true,self.openServerDay) then
table.insert(showList,_info)
end
end
return showList
end
-----------------------替换为------------------------
function VIEW:getShowList()
local showList = {}
for _, _info in ipairs(self.vecBaseCfg or {}) do
if ssrCheckLimitCondition(_info.parseLimit,true,self.openServerDay) then
local curNum = ssrGetGrowLvWithKey(_info.key) or 0
_info.state = not (_info.parsePay.limitType ~= 0 and _info.parsePay.num == curNum)
table.insert(showList,_info)
end
end
table.sort(showList,function(a,b)
if a.state == b.state then
return a.index &lt; b.index
end
return a.state
end)
return showList
end
</code></pre>
<pre><code class="language-lua">VIEW:updateLiBao(idx)
替换为
VIEW:initUI()</code></pre>