...
|
...
|
@@ -18,6 +18,12 @@ function getUrlParam(name) { |
|
|
return window.queryString[name];
|
|
|
}
|
|
|
|
|
|
// 券显示状态
|
|
|
function couponShow($parents, $sons) {
|
|
|
$parents.find('[class^=main-right-]').hide();
|
|
|
$parents.find(`.main-right-${$sons}`).show();
|
|
|
}
|
|
|
|
|
|
// 获取领券状态
|
|
|
setTimeout(function() {
|
|
|
let req = '',
|
...
|
...
|
@@ -43,28 +49,19 @@ setTimeout(function() { |
|
|
if (res.code === 200) {
|
|
|
let cates = res.data || [];
|
|
|
|
|
|
cates.forEach(function(obj) {
|
|
|
let e = document.getElementById(obj.couponID);
|
|
|
|
|
|
if (!e) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let child = e.children;
|
|
|
|
|
|
if (!child.length) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
for (let i = 0; i < child.length; i++) {
|
|
|
if (child[i].className.indexOf('receive') > -1) {
|
|
|
child[i].classList.add('hidden');
|
|
|
}
|
|
|
|
|
|
if ((obj.isGeted && child[i].className.indexOf('use') > -1) ||
|
|
|
(obj.isZero && child[i].className.indexOf('go') > -1)) {
|
|
|
child[i].classList.remove('hidden');
|
|
|
}
|
|
|
cates.forEach((obj) => {
|
|
|
let e = document.getElementById(obj.couponId);
|
|
|
let $e = $(e);
|
|
|
let status = obj.status;
|
|
|
|
|
|
switch (status) {
|
|
|
case 1: couponShow($e, 'receive');
|
|
|
break;
|
|
|
case 2: couponShow($e, 'go');
|
|
|
break;
|
|
|
case 3: couponShow($e, 'use');
|
|
|
break;
|
|
|
default: couponShow($e, 'go');
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
|