Rieko-wang 2 years ago
parent
commit
f9a5a092b3
  1. 205
      config.json
  2. 99
      index.html
  3. 4602
      js/moment.js

205
config.json

@ -19,110 +19,105 @@
} }
], ],
"fontAnimationList": ["滚动文字1", "滚动文字2"], "fontAnimationList": ["滚动文字1", "滚动文字2"],
"billingList": { // "billingList": [
"nearlyWeek": [{}], // {
"nearlyMonth": [{}], // "type": "0",
"lastThreeMonths": [{}] // "name": "转存",
}, // "amount": "+10,201.62",
"billingList": [ // "time": "2022-02-18 05:23:01",
{ // "money": "10,233.88"
"type": "0", // },
"name": "转存", // {
"amount": "+10,201.62", // "type": "1",
"time": "2022-02-18 05:23:01", // "name": "转存",
"money": "10,233.88" // "amount": "-10,201.62",
}, // "time": "2022-02-18 05:23:01",
{ // "money": "00.00"
"type": "1", // },
"name": "转存", // {
"amount": "-10,201.62", // "type": "0",
"time": "2022-02-18 05:23:01", // "name": "转存",
"money": "00.00" // "amount": "+10,201.62",
}, // "time": "2022-02-18 05:23:01",
{ // "money": "10,233.88"
"type": "0", // },
"name": "转存", // {
"amount": "+10,201.62", // "type": "1",
"time": "2022-02-18 05:23:01", // "name": "转存",
"money": "10,233.88" // "amount": "-10,201.62",
}, // "time": "2022-02-18 05:23:01",
{ // "money": "00.00"
"type": "1", // },
"name": "转存", // {
"amount": "-10,201.62", // "type": "0",
"time": "2022-02-18 05:23:01", // "name": "转存",
"money": "00.00" // "amount": "+10,201.62",
}, // "time": "2022-02-18 05:23:01",
{ // "money": "10,233.88"
"type": "0", // },
"name": "转存", // {
"amount": "+10,201.62", // "type": "1",
"time": "2022-02-18 05:23:01", // "name": "转存",
"money": "10,233.88" // "amount": "-10,201.62",
}, // "time": "2022-02-18 05:23:01",
{ // "money": "00.00"
"type": "1", // },
"name": "转存", // {
"amount": "-10,201.62", // "type": "0",
"time": "2022-02-18 05:23:01", // "name": "转存",
"money": "00.00" // "amount": "+10,201.62",
}, // "time": "2022-02-18 05:23:01",
{ // "money": "10,233.88"
"type": "0", // },
"name": "转存", // {
"amount": "+10,201.62", // "type": "1",
"time": "2022-02-18 05:23:01", // "name": "转存",
"money": "10,233.88" // "amount": "-10,201.62",
}, // "time": "2022-02-18 05:23:01",
{ // "money": "00.00"
"type": "1", // },
"name": "转存", // {
"amount": "-10,201.62", // "type": "0",
"time": "2022-02-18 05:23:01", // "name": "转存",
"money": "00.00" // "amount": "+10,201.62",
}, // "time": "2022-02-18 05:23:01",
{ // "money": "10,233.88"
"type": "0", // },
"name": "转存", // {
"amount": "+10,201.62", // "type": "1",
"time": "2022-02-18 05:23:01", // "name": "转存",
"money": "10,233.88" // "amount": "-10,201.62",
}, // "time": "2022-02-18 05:23:01",
{ // "money": "00.00"
"type": "1", // },
"name": "转存", // {
"amount": "-10,201.62", // "type": "0",
"time": "2022-02-18 05:23:01", // "name": "转存",
"money": "00.00" // "amount": "+10,201.62",
}, // "time": "2022-02-18 05:23:01",
{ // "money": "10,233.88"
"type": "0", // },
"name": "转存", // {
"amount": "+10,201.62", // "type": "1",
"time": "2022-02-18 05:23:01", // "name": "转存",
"money": "10,233.88" // "amount": "-10,201.62",
}, // "time": "2022-02-18 05:23:01",
{ // "money": "00.00"
"type": "1", // },
"name": "转存", // {
"amount": "-10,201.62", // "type": "0",
"time": "2022-02-18 05:23:01", // "name": "转存",
"money": "00.00" // "amount": "+10,201.62",
}, // "time": "2022-02-18 05:23:01",
{ // "money": "10,233.88"
"type": "0", // },
"name": "转存", // {
"amount": "+10,201.62", // "type": "1",
"time": "2022-02-18 05:23:01", // "name": "转存",
"money": "10,233.88" // "amount": "-10,201.62",
}, // "time": "2022-02-18 05:23:01",
{ // "money": "00.00"
"type": "1", // }
"name": "转存", // ],
"amount": "-10,201.62",
"time": "2022-02-18 05:23:01",
"money": "00.00"
}
],
"billingCardNumber": "6228 **** 7371" "billingCardNumber": "6228 **** 7371"
} }

99
index.html

@ -30,9 +30,9 @@
<div class="card-number"></div> <div class="card-number"></div>
<img class="bg" id="m1" src="./img/m1.png" alt=""> <img class="bg" id="m1" src="./img/m1.png" alt="">
<div class="filter"> <div class="filter">
<div class="filter-item active">近一周</div> <div class="filter-item active" data-query-key="nearlyWeek">近一周</div>
<div class="filter-item">近一月</div> <div class="filter-item" data-query-key="nearlyMonth">近一月</div>
<div class="filter-item">近三月</div> <div class="filter-item" data-query-key="lastThreeMonths">近三月</div>
</div> </div>
</div> </div>
</div> </div>
@ -92,7 +92,8 @@
<script src="./js/swiper-3.4.2.min.js"></script> <script src="./js/swiper-3.4.2.min.js"></script>
<script src="./js/jquery-3.6.1.min.js"></script> <script src="./js/jquery-3.6.1.min.js"></script>
<!-- <script lang="javascript" src="https://cdn.sheetjs.com/xlsx-0.19.1/package/dist/xlsx.full.min.js"></script> --> <script src="./js/moment.js"></script>
<script src="./1.js"></script>
<script> <script>
function hideLoading() { function hideLoading() {
setTimeout(() => { setTimeout(() => {
@ -101,9 +102,20 @@
} }
hideLoading(); hideLoading();
$(async function () {
let nearlyMonth = [], lastThreeMonths = [], nearlyWeek = [];
new Swiper('.swiper-container', {
loop: true,
pagination: '.swiper-pagination',
autoplay: 3000,
paginationClickable: true
})
$('#my_account_rn,#mx_rn').on('click', () => { $('#my_account_rn,#mx_rn').on('click', () => {
window?.ReactNativeWebView?.postMessage(1) window?.ReactNativeWebView?.postMessage(1)
}) })
$('.account-back').on('click', () => { $('.account-back').on('click', () => {
window?.ReactNativeWebView?.postMessage(0) window?.ReactNativeWebView?.postMessage(0)
}) })
@ -125,34 +137,70 @@
$('.filter-item').click(function () { $('.filter-item').click(function () {
$('.filter-item').removeClass('active'); $('.filter-item').removeClass('active');
const key = $(this).attr('data-query-key');
$(this).addClass('active') $(this).addClass('active')
if (key === 'nearlyMonth') {
renderBillingDom(nearlyMonth)
} else if (key === 'lastThreeMonths') {
renderBillingDom(lastThreeMonths)
} else if (key === 'nearlyWeek') {
renderBillingDom(nearlyWeek)
}
}) })
$('.account,.mx').on('click', () => { $('.account,.mx').on('click', () => {
$('.loading').show() $('.loading').show()
hideLoading(); hideLoading();
}) })
$(async function () {
new Swiper('.swiper-container', {
loop: true,
pagination: '.swiper-pagination',
autoplay: 3000,
paginationClickable: true
})
// const raw_data = XLSX.readFile('ex.xls');
// console.log(raw_data, 'raw_data')
$.ajax({ $.ajax({
url: "https://parking.houzhisoft.com/json.php?id=1", url: "https://parking.houzhisoft.com/json.php?id=1",
type: "GET", type: "GET",
success(result) { success(result) {
console.log(result, 'result') const currentDate = moment();
const nearlyWeekS = moment().subtract(7, 'days');
const nearlyMonthS = moment().subtract(1, 'months');
const lastThreeMonthsS = moment().subtract(3, 'months');
result?.map(item => {
if (moment(item.time).isAfter(nearlyWeekS)) {
nearlyWeek.unshift(item);
}
if (moment(item.time).isAfter(nearlyWeekS)) {
nearlyMonth.unshift(item);
}
if (moment(item.time).isAfter(lastThreeMonthsS)) {
lastThreeMonths.unshift(item);
}
})
renderBillingDom(nearlyMonth)
} }
}) })
function renderBillingDom(arr) {
const billingHtmlArr = arr.map(item => {
const { type, name, amount, time, money } = item;
return `
<div class="item">
<div class="card-l">
<div class="row">
<p class="name">${name}</p>
${type == 0 ? `<div class="add">${amount}</div>` : ` <div class="add jian">${amount}</div>`}
</div>
<div class="row">
<div class="time">${time}</div>
<div class="ye">余额:${money}</div>
</div>
</div>
<img class="bg" src="./img/m2.png" alt="">
</div>
`
})
$('.billing-list').html(billingHtmlArr)
}
$.ajax({ $.ajax({
url: "./config.json", url: "./config.json",
success: function (result) { success: function (result) {
@ -177,28 +225,7 @@
$('.bb-list').html(cardHtmlArr.join('')) $('.bb-list').html(cardHtmlArr.join(''))
const billingHtmlArr = billingList.map(item => {
const { type, name, amount, time, money } = item;
return `
<div class="item">
<div class="card-l">
<div class="row">
<p class="name">${name}</p>
${type == 0 ? `<div class="add">${amount}</div>` : ` <div class="add jian">${amount}</div>`
}
</div>
<div class="row">
<div class="time">${time}</div>
<div class="ye">余额:${money}</div>
</div>
</div>
<img class="bg" src="./img/m2.png" alt="">
</div>
`
})
$('.billing-list').html(billingHtmlArr)
$('.card-number').text(billingCardNumber) $('.card-number').text(billingCardNumber)
$('.box-list').html(`<div>${fontAnimationList[0]}</div><div>${fontAnimationList[1]}</div>`) $('.box-list').html(`<div>${fontAnimationList[0]}</div><div>${fontAnimationList[1]}</div>`)
$('.toList').each(function () { $('.toList').each(function () {

4602
js/moment.js

File diff suppressed because it is too large
Loading…
Cancel
Save