66 lines
3.2 KiB
JavaScript
66 lines
3.2 KiB
JavaScript
import { memberCountDown } from '../public/commonFun.js';
|
|
import { fetchApi,onError} from '../public/api/fetch.js';
|
|
import { layerPopup} from '../public/commonFun.js';
|
|
import { apiPayPackage } from '../public/api/index.js';
|
|
import { getLoginStatus }from '../public/localstorage.js';
|
|
$(document).ready(function() {
|
|
// 登录状态
|
|
if (getLoginStatus()) {
|
|
//getUserInfo()
|
|
}else{
|
|
location.href="/login.html"
|
|
}
|
|
//限时优惠倒计时 无限循环
|
|
memberCountDown()
|
|
getOrderList()
|
|
function getOrderList() {
|
|
fetchApi(apiPayPackage, null,successFn, onError)
|
|
function successFn(res) {
|
|
if (res.code == '000') {
|
|
if (res.data.item.length != 0) {
|
|
res.data.item.forEach((card) => {
|
|
if (card.vp_id == 4) {
|
|
var $list = $(".yh-tc-yjvip");
|
|
var html = '';
|
|
html += `
|
|
<a class="relative" href="/chongzhi?id=${card.vp_id}&val=${card.vp_real_price}">
|
|
<div style="height:9rem;background: #f4dfc2;margin-bottom:5px;border-radius: 5px;"></div>
|
|
<div class="abs _25f0b6f3cd _25ccbe5ac8 _69aa9a34e8">
|
|
<div class="_71ab71e6f0 cd69248791">终身VIP限时优惠</div>
|
|
<div class="_71ab71e6f0 cd69248791 djs_time" id="sc-countdown-time">21:39:46</div>
|
|
<div class="_584c0e0412">限时特价<span>${card.vp_real_price}</span>元 <span class="text_line">原价 ${card.vp_tag_price}</span></div>
|
|
</div>
|
|
</a>
|
|
`;
|
|
$list.append(html);
|
|
}
|
|
|
|
// Render all cards, including those with card.vp_id == 4
|
|
const cardElement = document.createElement("a");
|
|
cardElement.href = `/chongzhi?id=${card.vp_id}&val=${card.vp_real_price}`;
|
|
cardElement.className = "d_none point";
|
|
cardElement.innerHTML = `
|
|
<div class="_5618db95dc _1016bcbbbd grid align_center">
|
|
<div class="grid align_center h100 gap5">
|
|
<div class="fl align_center gap10">
|
|
<div class="a9c1886f50">${card.vp_name}</div>
|
|
${card.vp_best_describe ? `<span class="c3b7fd6d8e">${card.vp_best_describe}</span>` : ''}
|
|
</div>
|
|
<div class="d83e478929">原价 ${card.vp_tag_price}</div>
|
|
</div>
|
|
<div><span class="_2b48c581b1">${card.vp_real_price}</span><span>元</span></div>
|
|
</div>
|
|
`;
|
|
document.querySelector(".cardContainer").appendChild(cardElement);
|
|
});
|
|
}
|
|
} else {
|
|
layerPopup(res.msg, 3);
|
|
}
|
|
}
|
|
|
|
}
|
|
})
|
|
|
|
|