debug
This commit is contained in:
100
code/public/template/shikong/huiyuan/js/member/bill.js
Normal file
100
code/public/template/shikong/huiyuan/js/member/bill.js
Normal file
@@ -0,0 +1,100 @@
|
||||
import { fetchApi,onError} from '../public/api/fetch.js';
|
||||
import { getLoginStatus }from '../public/localstorage.js';
|
||||
import { getValFromBrowserAddress ,pageJumpFn,layerPopup} from '../public/commonFun.js';
|
||||
import { apiFundsTransactionsList } from '../public/api/index.js';
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
// 登录状态
|
||||
if (getLoginStatus()) {
|
||||
//getUserInfo()
|
||||
}else{
|
||||
location.href="/login.html"
|
||||
}
|
||||
const BillJs = function () {
|
||||
//支付订单列表
|
||||
var page = 1
|
||||
var allpage = 1
|
||||
$('.load-morn').text('暂无')
|
||||
getOrderList(page)
|
||||
function getOrderList(page) {
|
||||
let apiUrl = apiFundsTransactionsList + '?limit=10' + '&page=' + page
|
||||
fetchApi(apiUrl, null,successFn, onError)
|
||||
function successFn(res) {
|
||||
if (res.code == '000') {
|
||||
allpage = res.data.total_page
|
||||
var data = res.data.item
|
||||
if (page >= res.data.total_page) {
|
||||
$('.load-morn').text('没有了')
|
||||
if(data.length ==0 ){
|
||||
$('.load-morn').text('暂无')
|
||||
}
|
||||
} else {
|
||||
$('.load-morn').text('加载更多 ↓')
|
||||
}
|
||||
|
||||
data.forEach((item) => {
|
||||
if (item.vo_status == 1) {
|
||||
item['vp_name'] = '已支付'
|
||||
} else if (item.vo_status == 1) {
|
||||
item['vp_name'] = '未支付'
|
||||
}else {
|
||||
item['vp_name'] = '已过期'
|
||||
}
|
||||
})
|
||||
if (page == 1) {
|
||||
data = data
|
||||
} else {
|
||||
data = data.concat(data)
|
||||
}
|
||||
var $list = $(".detail-list");
|
||||
setLunDate(data)
|
||||
// let data2 = [
|
||||
// {vo_success_at:'2021-06888',created_at:'2021-06',vp_name:'VIP购买',vo_order_no:'171882135426094995HU',vo_price:'¥50.00'},
|
||||
// {vo_success_at:'2021-07',created_at:'2021-08',vp_name:'VIP购买',vo_order_no:'171882135426094995HU',vo_price:'¥150.00'},
|
||||
// {vo_success_at:'2021-08',created_at:'2021-09',vp_name:'VIP购买',vo_order_no:'171882135426094995HU',vo_price:'¥250.00'},
|
||||
// {vo_success_at:'2021-07',created_at:'2021-10',vp_name:'VIP购买',vo_order_no:'171882135426094995HU',vo_price:'¥350.00'}
|
||||
// ]
|
||||
// setLunDate(data2)
|
||||
function setLunDate(data) {
|
||||
data.forEach((item) => {
|
||||
var html = ''
|
||||
html += `
|
||||
<div class="f48f2ef5_yh">
|
||||
<div class="f48f2ef5ec">${item.vo_success_at}</div>
|
||||
<div class="ef9739b7e6 _7d85f9f50c _2e9da47136">
|
||||
<div>
|
||||
<div>${item.created_at}</div>
|
||||
<div>${item.vo_order_no}</div>
|
||||
</div>
|
||||
<div>${item.vo_price}</div>
|
||||
<div class="_4af47fba7d">${item.vp_name}</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
$list.append(html);
|
||||
// 这是jquery的拼接
|
||||
$list.append($list);
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
layerPopup(res.msg, 3)
|
||||
console.log(res)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//加载更多
|
||||
$('.load-morn').click(function () {
|
||||
if (page >= allpage) {
|
||||
$('.load-morn').text('没有了')
|
||||
} else {
|
||||
page++
|
||||
getOrderList(page)
|
||||
}
|
||||
})
|
||||
|
||||
}()
|
||||
})
|
||||
Reference in New Issue
Block a user