完善每日消费

This commit is contained in:
dragon
2024-10-14 17:39:31 +08:00
parent 131bc932c2
commit 8556f6f8de

View File

@@ -123,6 +123,7 @@ function getConfig() {
networkRequest({
type: 'get',
url: urlPrefix + '/activity/h5/dayConsume',
data:{uid:pubInfo.uid},
success(res) {
if (res.code === 200) {
// 分区规则
@@ -136,21 +137,21 @@ function getConfig() {
if (res.data.goldNum < 700000) {
$('.myBox .tetxBox .r strong').text(700000);
$('.myBox .lineBox .box1 span b').text('70K');
$('.myBox .lineBox .box1 span b').css('width', `${(70000 / 700000) * 100}%`);
$('.myBox .lineBox .box1').css('left', `${(70000 / 700000) * 100}%`);
$('.myBox .lineBox .box2 span b').text('350K');
$('.myBox .lineBox .box2 span b').css('width', `${(350000 / 700000) * 100}%`);
$('.myBox .lineBox .box2').css('left', `${(350000 / 700000) * 100}%`);
$('.myBox .lineBox .box3 span b').text('700K');
$('.myBox .lineBox .box3 span b').css('width', `${(700000 / 700000) * 100}%`);
$('.myBox .lineBox .box3').css('right', `0%`);
$('.myBox .lineBox .line').css('width', `${(res.data.goldNum / 700000) * 100}%`);
res.data.goldNum >= 70000 ? $('.myBox .lineBox .box1').addClass('act') : res.data.goldNum >= 350000 ? $('.myBox .lineBox .box2').addClass('act') : res.data.goldNum >= 700000 ? $('.myBox .lineBox .box3').addClass('act') : ''
} else {
$('.myBox .tetxBox .r strong').text(7000000);
$('.myBox .lineBox .box1 span b').text('70K');
$('.myBox .lineBox .box1 span b').css('width', `${(70000 / 7000000) * 100}%`);
$('.myBox .lineBox .box1').css('left', `${(70000 / 7000000) * 100}%`);
$('.myBox .lineBox .box2 span b').text('350K');
$('.myBox .lineBox .box2 span b').css('width', `${(3500000 / 7000000) * 100}%`);
$('.myBox .lineBox .box2').css('left', `${(3500000 / 7000000) * 100}%`);
$('.myBox .lineBox .box3 span b').text('700K');
$('.myBox .lineBox .box3 span b').css('width', `${(210000 / 7000000) * 100}%`);
$('.myBox .lineBox .box3').css('right', `0`);
$('.myBox .lineBox .line').css('width', `${(res.data.goldNum / 7000000) * 100}%`);
res.data.goldNum >= 210000 ? $('.myBox .lineBox .box1').addClass('act') : res.data.goldNum >= 3500000 ? $('.myBox .lineBox .box2').addClass('act') : res.data.goldNum >= 7000000 ? $('.myBox .lineBox .box3').addClass('act') : ''
}