增加音乐,摇一摇,服务等页面

This commit is contained in:
cansnow
2026-02-15 19:41:13 +08:00
parent abd279e7a7
commit 271ec4b9c2
74 changed files with 14021 additions and 2 deletions
+898
View File
@@ -0,0 +1,898 @@
//---------------start----------------------账单列表---------------------start-------------------
var billData=[
{
"currentYear": 2025,
"currentMonth": 9,
"outputAmount": 1100,
"inputAmount": 11000,
"recordList":[
{
"tradeDirection": "in",
"finishTime": "2025-09-03 14:59:00",
"createTime": "2025-09-03 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "转账-来自莉莉-11",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType":"6"
},
{
"tradeDirection": "out",
"finishTime": "2025-09-03 12:15:00",
"createTime": "2025-09-03 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "转账给莉莉-11",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "微信红包-发给莉-11",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2025-09-03 14:59:00",
"createTime": "2025-09-03 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2025-09-03 12:15:00",
"createTime": "2025-09-03 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2025-09-03 14:59:00",
"createTime": "2025-09-03 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2025-09-03 12:15:00",
"createTime": "2025-09-03 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
}
]
},
{
"currentYear": 2025,
"currentMonth": 8,
"outputAmount": 1000,
"inputAmount": 10000,
"recordList": [
{
"tradeDirection": "in",
"finishTime": "2025-09-03 14:59:00",
"createTime": "2025-09-03 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2025-09-03 12:15:00",
"createTime": "2025-09-03 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2025-09-03 14:59:00",
"createTime": "2025-09-03 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2025-09-03 12:15:00",
"createTime": "2025-09-03 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2025-09-03 14:59:00",
"createTime": "2025-09-03 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2025-09-03 12:15:00",
"createTime": "2025-09-03 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
}
]
},
{
"currentYear": 2025,
"currentMonth": 7,
"outputAmount": 900,
"inputAmount": 9000,
"recordList": [
{
"tradeDirection": "in",
"finishTime": "2025-09-03 14:59:00",
"createTime": "2025-09-03 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2025-09-03 12:15:00",
"createTime": "2025-09-03 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2025-09-03 14:59:00",
"createTime": "2025-09-03 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2025-09-03 12:15:00",
"createTime": "2025-09-03 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2025-09-03 14:59:00",
"createTime": "2025-09-03 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2025-09-03 12:15:00",
"createTime": "2025-09-03 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
}
]
}
]
function getRecordList(year,month,tradeType){
console.log("=======year"+year+"====month==="+month+"=====type==="+tradeType);
let tempData=JSON.parse(JSON.stringify(billData));
let recordItem= tempData.find(item=>(item.currentYear==year&&item.currentMonth==month));
console.log("recordItem===",recordItem);
if(recordItem!=undefined&&recordItem!=null){
recordItem.recordList=recordItem.recordList.filter(item=>item.tradeType==tradeType);
return recordItem;
}else{
return {
"currentYear": year,
"currentMonth": month,
"outputAmount": 0.00,
"inputAmount": 0.00,
"recordList":[]
};
}
}
function addItem(newItem,callback){
let tempData=JSON.parse(JSON.stringify(billData));
let recordItem= tempData.find((item,index)=>{
return item.currentYear==year&&item.currentMonth==month
})
recordItem.recordList.push(newItem);
billData=tempData;
callback();
}
function deleteItem(delItem,callback){
let tempData=JSON.parse(JSON.stringify(billData));
let recordItem= tempData.find((item,index)=>{
return item.currentYear==year&&item.currentMonth==month
})
recordItem.recordList=recordItem.recordList.filter((item)=>{
return item.createTime!=delItem.createTime;
});
billData=tempData;
callback();
}
function updateItem(updateItem,callback){
let tempData=JSON.parse(JSON.stringify(billData));
let recordItem= tempData.find((item,index)=>{
return item.currentYear==year&&item.currentMonth==month
})
recordItem.recordList=recordItem.recordList.filter((item)=>{
return item.createTime!=delItem.createTime;
});
addItem(updateItem,callback);
}
//---------------end----------------------账单列表---------------------end-------------------
const tempChartData={
"outdata": {
"list": [
{
"id": 3,
"trade_typetxt": "转账",
"sum_value": "65906.00",
"trade_icon": "/assets/icon/zd3.png",
"sum_count": 18,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/zd3.png",
"billTitle": "转账",
"amountValue": "65906.00"
},
{
"id": 2,
"trade_typetxt": "二维码收付款",
"sum_value": "1348.40",
"trade_icon": "/assets/icon/zd1.png",
"sum_count": 17,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/zd1.png",
"billTitle": "二维码收付款",
"amountValue": "1348.40"
},
{
"id": 1,
"trade_typetxt": "微信红包",
"sum_value": "326.00",
"trade_icon": "/assets/icon/sh19.png",
"sum_count": 2,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/sh19.png",
"billTitle": "微信红包",
"amountValue": "326.00"
}
],
"money": 81127.53,
"count": 54,
"month_list": {
"month": [
"06月",
"07月",
"08月",
"09月",
"10月",
"11月"
],
"money": [
136253.37,
140794.18,
140792.95,
136254.18,
140792.97,
81127.53
],
"list": [
{
"money": 136253.37,
"month": "06月"
},
{
"money": 140794.18,
"month": "07月"
},
{
"money": 140792.95,
"month": "08月"
},
{
"money": 136254.18,
"month": "09月"
},
{
"money": 140792.97,
"month": "10月"
},
{
"money": 81127.53,
"month": "11月"
}
]
}
},
"indata": {
"list": [
{
"id": 1,
"trade_typetxt": "二维码收付款",
"sum_value": "62803.00",
"trade_icon": "/assets/icon/zd1.png",
"sum_count": 24,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/zd1.png",
"billTitle": "二维码收付款",
"amountValue": "62803.00"
},
{
"id": 3,
"trade_typetxt": "转账",
"sum_value": "5591.00",
"trade_icon": "/assets/icon/zd3.png",
"sum_count": 10,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/zd3.png",
"billTitle": "转账",
"amountValue": "5591.00"
},
{
"id": 2,
"trade_typetxt": "微信红包",
"sum_value": "137.00",
"trade_icon": "/assets/icon/sh19.png",
"sum_count": 4,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/sh19.png",
"billTitle": "微信红包",
"amountValue": "137.00"
}
],
"money": 119630,
"count": 46,
"month_list": {
"month": [
"06月",
"07月",
"08月",
"09月",
"10月",
"11月"
],
"money": [
137061,
130787,
152473,
120999,
157692,
119630
],
"list": [
{
"money": 137061,
"month": "06月"
},
{
"money": 130787,
"month": "07月"
},
{
"money": 152473,
"month": "08月"
},
{
"money": 120999,
"month": "09月"
},
{
"money": 157692,
"month": "10月"
},
{
"money": 119630,
"month": "11月"
}
]
}
},
"otherdata": {
"list": [
{
"id": 3,
"trade_typetxt": "零钱充值",
"sum_value": "50850.00",
"trade_icon": "/assets/icon/sh20.png",
"sum_count": 7,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/sh20.png",
"billTitle": "零钱充值",
"amountValue": "50850.00"
},
{
"id": 1,
"trade_typetxt": "零钱提现",
"sum_value": "13000.00",
"trade_icon": "/assets/icon/sh20.png",
"sum_count": 9,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/sh20.png",
"billTitle": "零钱提现",
"amountValue": "13000.00"
},
{
"id": 2,
"trade_typetxt": "信用卡还款",
"sum_value": "249.00",
"trade_icon": "/assets/icon/sh8.png",
"sum_count": 1,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/sh8.png",
"billTitle": "信用卡还款",
"amountValue": "249.00"
}
]
},
"sumoutdata": {
"list": [
{
"id": 3,
"trade_typetxt": "转账",
"sum_value": "817456.00",
"trade_icon": "/assets/icon/nzz.png",
"sum_count": 190,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nzz.png",
"billTitle": "转账",
"amountValue": "817456.00",
"percentValue": 95.81,
"color": "#0ABF5E"
},
{
"id": 1,
"trade_typetxt": "消费支出",
"sum_value": "18745.78",
"trade_icon": "/assets/icon/nxfzc.png",
"sum_count": 263,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nxfzc.png",
"billTitle": "消费支出",
"amountValue": "18745.78",
"percentValue": 2.2,
"color": "#57A3F9"
},
{
"id": 2,
"trade_typetxt": "发红包",
"sum_value": "4024.00",
"trade_icon": "/assets/icon/nfhb.png",
"sum_count": 43,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nfhb.png",
"billTitle": "发红包",
"amountValue": "4024.00",
"percentValue": 0.47,
"color": "#fa3534"
}
],
"money": 853225.78,
"count": 505
},
"sumindata": {
"list": [
{
"id": 1,
"trade_typetxt": "二维码收款",
"sum_value": "724802.00",
"trade_icon": "/assets/icon/newm.png",
"sum_count": 274,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/newm.png",
"billTitle": "二维码收款",
"amountValue": "724802.00",
"percentValue": 81.22,
"color": "#D7B746"
},
{
"id": 3,
"trade_typetxt": "收转账",
"sum_value": "114567.00",
"trade_icon": "/assets/icon/nzz.png",
"sum_count": 91,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nzz.png",
"billTitle": "收转账",
"amountValue": "114567.00",
"percentValue": 12.84,
"color": "#0ABF5E"
},
{
"id": 2,
"trade_typetxt": "收红包",
"sum_value": "1966.00",
"trade_icon": "/assets/icon/nfhb.png",
"sum_count": 33,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nfhb.png",
"billTitle": "收红包",
"amountValue": "1966.00",
"percentValue": 0.22,
"color": "#fa3534"
}
],
"money": 892434,
"count": 406
},
"sumotherdata": {
"list": [
{
"id": 3,
"trade_typetxt": "零钱充值",
"sum_value": "50850.00",
"trade_icon": "/assets/icon/nlq.png",
"sum_count": 7,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nlq.png",
"billTitle": "零钱充值",
"title": "零钱充值",
"amountValue": "50850.00",
"percentValue": 7,
"color": "#be8913"
},
{
"id": 1,
"trade_typetxt": "零钱提现",
"sum_value": "13000.00",
"trade_icon": "/assets/icon/nlq.png",
"sum_count": 9,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nlq.png",
"billTitle": "零钱提现",
"title": "零钱提现",
"amountValue": "13000.00",
"percentValue": 9,
"color": "#3d7a25"
},
{
"id": 2,
"trade_typetxt": "信用卡还款",
"sum_value": "249.00",
"trade_icon": "/assets/icon/nxyk.png",
"sum_count": 1,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nxyk.png",
"billTitle": "信用卡还款",
"title": "信用卡还款",
"amountValue": "249.00",
"percentValue": 1,
"color": "#a254e0"
}
]
}
}
//---------------start----------------------账单统计数据---------------------start-------------------
function getChartData(param){
console.log("=======获取图表数据参数======",param);
console.log("----------------------!!!!!!!!!!注意!!!!!!!!!!!!!这里只模拟了一组数据!!!!!!!!注意!!!!!!!!!!=============");
return tempChartData;
};
//
module.exports = {
tempBillList:billData,
tempChartData:tempChartData,
queryRecordList:function(year,month,tradeType){
return getRecordList(year,month,tradeType)
},
addItem:function(newItem,callback){
return addItem(newItem,callback)
},
updateItem:function(newItem,callback){
return updateItem(newItem,callback)
},
deleteItem:function(newItem,callback){
return deleteItem(newItem,callback)
},
getChartData:function(param){
return getChartData(param)
},
}
+333
View File
@@ -0,0 +1,333 @@
const emojiUrl = 'https://web.sdk.qcloud.com/im/assets/emoji/';
const emojiMap = {
'[NO]': 'emoji_0@2x.png',
'[OK]': 'emoji_1@2x.png',
'[下雨]': 'emoji_2@2x.png',
'[么么哒]': 'emoji_3@2x.png',
'[乒乓]': 'emoji_4@2x.png',
'[便便]': 'emoji_5@2x.png',
'[信封]': 'emoji_6@2x.png',
'[偷笑]': 'emoji_7@2x.png',
'[傲慢]': 'emoji_8@2x.png',
'[再见]': 'emoji_9@2x.png',
'[冷汗]': 'emoji_10@2x.png',
'[凋谢]': 'emoji_11@2x.png',
'[刀]': 'emoji_12@2x.png',
'[删除]': 'emoji_13@2x.png',
'[勾引]': 'emoji_14@2x.png',
'[发呆]': 'emoji_15@2x.png',
'[发抖]': 'emoji_16@2x.png',
'[可怜]': 'emoji_17@2x.png',
'[可爱]': 'emoji_18@2x.png',
'[右哼哼]': 'emoji_19@2x.png',
'[右太极]': 'emoji_20@2x.png',
'[右车头]': 'emoji_21@2x.png',
'[吐]': 'emoji_22@2x.png',
'[吓]': 'emoji_23@2x.png',
'[咒骂]': 'emoji_24@2x.png',
'[咖啡]': 'emoji_25@2x.png',
'[啤酒]': 'emoji_26@2x.png',
'[嘘]': 'emoji_27@2x.png',
'[回头]': 'emoji_28@2x.png',
'[困]': 'emoji_29@2x.png',
'[坏笑]': 'emoji_30@2x.png',
'[多云]': 'emoji_31@2x.png',
'[大兵]': 'emoji_32@2x.png',
'[大哭]': 'emoji_33@2x.png',
'[太阳]': 'emoji_34@2x.png',
'[奋斗]': 'emoji_35@2x.png',
'[奶瓶]': 'emoji_36@2x.png',
'[委屈]': 'emoji_37@2x.png',
'[害羞]': 'emoji_38@2x.png',
'[尴尬]': 'emoji_39@2x.png',
'[左哼哼]': 'emoji_40@2x.png',
'[左太极]': 'emoji_41@2x.png',
'[左车头]': 'emoji_42@2x.png',
'[差劲]': 'emoji_43@2x.png',
'[弱]': 'emoji_44@2x.png',
'[强]': 'emoji_45@2x.png',
'[彩带]': 'emoji_46@2x.png',
'[彩球]': 'emoji_47@2x.png',
'[得意]': 'emoji_48@2x.png',
'[微笑]': 'emoji_49@2x.png',
'[心碎了]': 'emoji_50@2x.png',
'[快哭了]': 'emoji_51@2x.png',
'[怄火]': 'emoji_52@2x.png',
'[怒]': 'emoji_53@2x.png',
'[惊恐]': 'emoji_54@2x.png',
'[惊讶]': 'emoji_55@2x.png',
'[憨笑]': 'emoji_56@2x.png',
'[手枪]': 'emoji_57@2x.png',
'[打哈欠]': 'emoji_58@2x.png',
'[抓狂]': 'emoji_59@2x.png',
'[折磨]': 'emoji_60@2x.png',
'[抠鼻]': 'emoji_61@2x.png',
'[抱抱]': 'emoji_62@2x.png',
'[抱拳]': 'emoji_63@2x.png',
'[拳头]': 'emoji_64@2x.png',
'[挥手]': 'emoji_65@2x.png',
'[握手]': 'emoji_66@2x.png',
'[撇嘴]': 'emoji_67@2x.png',
'[擦汗]': 'emoji_68@2x.png',
'[敲打]': 'emoji_69@2x.png',
'[晕]': 'emoji_70@2x.png',
'[月亮]': 'emoji_71@2x.png',
'[棒棒糖]': 'emoji_72@2x.png',
'[汽车]': 'emoji_73@2x.png',
'[沙发]': 'emoji_74@2x.png',
'[流汗]': 'emoji_75@2x.png',
'[流泪]': 'emoji_76@2x.png',
'[激动]': 'emoji_77@2x.png',
'[灯泡]': 'emoji_78@2x.png',
'[炸弹]': 'emoji_79@2x.png',
'[熊猫]': 'emoji_80@2x.png',
'[爆筋]': 'emoji_81@2x.png',
'[爱你]': 'emoji_82@2x.png',
'[爱心]': 'emoji_83@2x.png',
'[爱情]': 'emoji_84@2x.png',
'[猪头]': 'emoji_85@2x.png',
'[猫咪]': 'emoji_86@2x.png',
'[献吻]': 'emoji_87@2x.png',
'[玫瑰]': 'emoji_88@2x.png',
'[瓢虫]': 'emoji_89@2x.png',
'[疑问]': 'emoji_90@2x.png',
'[白眼]': 'emoji_91@2x.png',
'[皮球]': 'emoji_92@2x.png',
'[睡觉]': 'emoji_93@2x.png',
'[磕头]': 'emoji_94@2x.png',
'[示爱]': 'emoji_95@2x.png',
'[礼品袋]': 'emoji_96@2x.png',
'[礼物]': 'emoji_97@2x.png',
'[篮球]': 'emoji_98@2x.png',
'[米饭]': 'emoji_99@2x.png',
'[糗大了]': 'emoji_100@2x.png',
'[红双喜]': 'emoji_101@2x.png',
'[红灯笼]': 'emoji_102@2x.png',
'[纸巾]': 'emoji_103@2x.png',
'[胜利]': 'emoji_104@2x.png',
'[色]': 'emoji_105@2x.png',
'[药]': 'emoji_106@2x.png',
'[菜刀]': 'emoji_107@2x.png',
'[蛋糕]': 'emoji_108@2x.png',
'[蜡烛]': 'emoji_109@2x.png',
'[街舞]': 'emoji_110@2x.png',
'[衰]': 'emoji_111@2x.png',
'[西瓜]': 'emoji_112@2x.png',
'[调皮]': 'emoji_113@2x.png',
'[象棋]': 'emoji_114@2x.png',
'[跳绳]': 'emoji_115@2x.png',
'[跳跳]': 'emoji_116@2x.png',
'[车厢]': 'emoji_117@2x.png',
'[转圈]': 'emoji_118@2x.png',
'[鄙视]': 'emoji_119@2x.png',
'[酷]': 'emoji_120@2x.png',
'[钞票]': 'emoji_121@2x.png',
'[钻戒]': 'emoji_122@2x.png',
'[闪电]': 'emoji_123@2x.png',
'[闭嘴]': 'emoji_124@2x.png',
'[闹钟]': 'emoji_125@2x.png',
'[阴险]': 'emoji_126@2x.png',
'[难过]': 'emoji_127@2x.png',
'[雨伞]': 'emoji_128@2x.png',
'[青蛙]': 'emoji_129@2x.png',
'[面条]': 'emoji_130@2x.png',
'[鞭炮]': 'emoji_131@2x.png',
'[风车]': 'emoji_132@2x.png',
'[飞吻]': 'emoji_133@2x.png',
'[飞机]': 'emoji_134@2x.png',
'[饥饿]': 'emoji_135@2x.png',
'[香蕉]': 'emoji_136@2x.png',
'[骷髅]': 'emoji_137@2x.png',
'[麦克风]': 'emoji_138@2x.png',
'[麻将]': 'emoji_139@2x.png',
'[鼓掌]': 'emoji_140@2x.png',
'[龇牙]': 'emoji_141@2x.png'
};
const emojiName = [
'[龇牙]',
'[调皮]',
'[流汗]',
'[偷笑]',
'[再见]',
'[敲打]',
'[擦汗]',
'[猪头]',
'[玫瑰]',
'[流泪]',
'[大哭]',
'[嘘]',
'[酷]',
'[抓狂]',
'[委屈]',
'[便便]',
'[炸弹]',
'[菜刀]',
'[可爱]',
'[色]',
'[害羞]',
'[得意]',
'[吐]',
'[微笑]',
'[怒]',
'[尴尬]',
'[惊恐]',
'[冷汗]',
'[爱心]',
'[示爱]',
'[白眼]',
'[傲慢]',
'[难过]',
'[惊讶]',
'[疑问]',
'[困]',
'[么么哒]',
'[憨笑]',
'[爱情]',
'[衰]',
'[撇嘴]',
'[阴险]',
'[奋斗]',
'[发呆]',
'[右哼哼]',
'[抱抱]',
'[坏笑]',
'[飞吻]',
'[鄙视]',
'[晕]',
'[大兵]',
'[可怜]',
'[强]',
'[弱]',
'[握手]',
'[胜利]',
'[抱拳]',
'[凋谢]',
'[米饭]',
'[蛋糕]',
'[西瓜]',
'[啤酒]',
'[瓢虫]',
'[勾引]',
'[OK]',
'[爱你]',
'[咖啡]',
'[月亮]',
'[刀]',
'[发抖]',
'[差劲]',
'[拳头]',
'[心碎了]',
'[太阳]',
'[礼物]',
'[皮球]',
'[骷髅]',
'[挥手]',
'[闪电]',
'[饥饿]',
'[咒骂]',
'[折磨]',
'[抠鼻]',
'[鼓掌]',
'[糗大了]',
'[左哼哼]',
'[打哈欠]',
'[快哭了]',
'[吓]',
'[篮球]',
'[乒乓]',
'[NO]',
'[跳跳]',
'[怄火]',
'[转圈]',
'[磕头]',
'[回头]',
'[跳绳]',
'[激动]',
'[街舞]',
'[献吻]',
'[左太极]',
'[右太极]',
'[闭嘴]',
'[猫咪]',
'[红双喜]',
'[鞭炮]',
'[红灯笼]',
'[麻将]',
'[麦克风]',
'[礼品袋]',
'[信封]',
'[象棋]',
'[彩带]',
'[蜡烛]',
'[爆筋]',
'[棒棒糖]',
'[奶瓶]',
'[面条]',
'[香蕉]',
'[飞机]',
'[左车头]',
'[车厢]',
'[右车头]',
'[多云]',
'[下雨]',
'[钞票]',
'[熊猫]',
'[灯泡]',
'[风车]',
'[闹钟]',
'[雨伞]',
'[彩球]',
'[钻戒]',
'[沙发]',
'[纸巾]',
'[手枪]',
'[青蛙]',
];
const faceUrl = 'https://web.sdk.qcloud.com/im/assets/face-elem/';
const bigEmojiList = [
{
icon: 'yz00',
list: ['yz00', 'yz01', 'yz02', 'yz03', 'yz04', 'yz05', 'yz06', 'yz07', 'yz08',
'yz09', 'yz10', 'yz11', 'yz12', 'yz13', 'yz14', 'yz15', 'yz16', 'yz17']
},
{
icon: 'ys00',
list: ['ys00', 'ys01', 'ys02', 'ys03', 'ys04', 'ys05', 'ys06', 'ys07', 'ys08',
'ys09', 'ys10', 'ys11', 'ys12', 'ys13', 'ys14', 'ys15']
},
{
icon: 'gcs00',
list: ['gcs00', 'gcs01', 'gcs02', 'gcs03', 'gcs04', 'gcs05', 'gcs06', 'gcs07',
'gcs08', 'gcs09', 'gcs10', 'gcs11', 'gcs12', 'gcs13', 'gcs14', 'gcs15', 'gcs16'],
},
];
function splitEmojiList() {
let self = this;
let length = Math.ceil(emojiName.length / 24);
let arr = new Array(length);
for (let j = 0; j < length; j++) {
let subArr = [];
for (var i = j * 24; i < 24 * (j + 1); i++) {
if (i > emojiName.length - 1) {
break;
}
subArr.push(emojiName[i]);
}
arr[j] = subArr;
}
//console.log("分割",arr);
return arr;
}
module.exports = {
emojiUrl:emojiUrl,
emojiMap:emojiMap,
emojiName:emojiName,
bigEmojiList:bigEmojiList,
faceUrl:faceUrl,
splitEmojiList:function(){
return splitEmojiList();
}
}
+120
View File
@@ -0,0 +1,120 @@
/**
* 秒数转时长 1 → 00:01
*/
export function secondToDuration(second, fixed = 0) {
var sec = (second % 60).toFixed(fixed);
var min = Math.floor(second / 60);
if (min.toString().length < 2) {
min = '0' + min;
}
if (sec < 10) {
sec = '0' + sec;
}
return min + ':' + sec
}
/**
* 判断两个对象是否相等
* @param {Object} o1
* @param {Object} o2
*/
export function objEquals(o1,o2){
if(o1 && o2){
return o1.platform == o2.platform && o1.id == o2.id;
}else{
return false;
}
}
export function isExist(list,obj){
for (let itemIndex in list) {
const item = list[itemIndex];
if (objEquals(item,obj)) {
return true;
}
}
return false;
}
export function findIndex(list,obj){
for (let itemIndex in list) {
const item = list[itemIndex];
if (objEquals(item,obj)) {
return parseInt(itemIndex);
}
}
return -1;
}
export function findObj(list,obj){
const index = findIndex(list,obj);
if(inde != -1){
return list[index];
}
return null;
}
export function isFind(list,obj){
const index = findIndex(list,obj);
if(index != -1){
return true;
}
return false;
}
export function showToast(title,duration = 2000,icon="none",position="bottom"){
uni.showToast({
title,
icon,
duration,
position
});
}
/**
* 格式化歌词
* @param {String} lrcStr 歌词文本
* @param {String} mode 格式 object 对象模式,array 数组模式
*/
export function formatLrc(lrcStr,mode = 'object'){
const reg = /\[\d*:\d*(\.|:)\d*]/g
const timeReg = /\[(\d{2,})\:(\d{2})(?:\.(\d{1,3}))?\]/g; // eslint-disable-line no-useless-escape
let timeResult = [];
let index = 0;
if(mode == 'object'){
let lrcs = {};
lrcStr.split("\n").forEach(item => {
const timeRegAry = item.match(reg);
if (timeRegAry) {
const time = timeRegAry[0];
const min = parseInt(time.match(/\[\d*/i).toString().slice(1))
const sec = parseInt(time.match(/\:\d*/i).toString().slice(1))
const second = min * 60 + sec
const content = item.replace(timeRegAry, "")
lrcs[second] = {
time,
content
};
}
})
return lrcs;
}else{
let lrcs = [];
lrcStr.split("\n").forEach(item => {
const timeRegAry = item.match(reg);
if (timeRegAry) {
const time = timeRegAry[0];
const min = parseInt(time.match(/\[\d*/i).toString().slice(1))
const sec = parseInt(time.match(/\:\d*/i).toString().slice(1))
const second = min * 60 + sec
const content = item.replace(timeRegAry, "")
lrcs.push({
second,
time,
content
});
}
})
return lrcs;
}
}
+134
View File
@@ -0,0 +1,134 @@
const storage_constants = {
searchHistory:'searchHistory',
paramSongList:'paramSongList',
mySongList:'mySongList',
playList:'playList',
playMode:'playMode',
progress:'progress',
playSeconds:'playSeconds',
playDuration:'playDuration',
playIndex:'playIndex',
isFirstRun:'isFirstRun',
recentlyPlayList:'recentlyPlayList'
}
function set(key, value) {
try {
uni.setStorageSync(key, value);
return true;
} catch (e) {
return false;
}
}
function get(key) {
try {
return uni.getStorageSync(key);
} catch (e) {
return null;
}
}
function getDefault(key, defaultVal) {
try {
let val = uni.getStorageSync(key);
if(val || val == 0){
return val;
}else{
val = defaultVal;
return val;
}
} catch (e) {
return defaultVal;
}
}
function getObj(key) {
try {
const val = uni.getStorageSync(key);
if (val) {
return val;
}
return null;
} catch (e) {
return null;
}
}
function getObjDefault(key, defaultVal) {
try {
const val = uni.getStorageSync(key);
if (val) {
return val;
}
return defaultVal;
} catch (e) {
return defaultVal;
}
}
function getArray(key) {
try {
const val = uni.getStorageSync(key);
if (val) {
return val;
}
return [];
} catch (e) {
return [];
}
}
function getArrayDefault(key, defaultVal) {
try {
const val = uni.getStorageSync(key);
if (val) {
return val;
}
return defaultVal;
} catch (e) {
return defaultVal;
}
}
function clearStorage(){
uni.clearStorage();
let item = {
coverImg:"/static/mylike.png",
name:`我喜欢的音乐`,
id:"mylike",
url:null,
singer:"我喜欢的音乐",
desc:null,
platform:'local',
album:null,
list:[]
}
let allSongList = [];
allSongList.push(item);
set(storage_constants.mySongList,allSongList)
}
function remove(key){
uni.removeStorageSync(key);
}
const storage = {
set,
get,
getDefault,
getObj,
getObjDefault,
getArray,
getArrayDefault,
clearStorage,
remove
}
export {
storage,
storage_constants
}
+10
View File
@@ -0,0 +1,10 @@
export const playModeConfig = {
list:{id:'list',icon:'play-list-foreach',name:'列表循环'},
random:{id:'random',icon:'play-random',name:'随机播放'},
single:{id:'single',icon:'play-one-foreach',name:'单曲循环'}
}
export const config = {
playModel:playModeConfig
}
+278
View File
@@ -0,0 +1,278 @@
import Vue from 'vue'
import Store from './store.js'
import {
playModeConfig
} from './config.js';
import {
storage,
storage_constants
} from "./StorageUtil.js"
import * as util from "./BaseUtil.js"
export default {
extends: Store,
data() {},
methods: {
initMusic() {
let audioPlayer = null;
/* #ifdef H5 */
audioPlayer = uni.createInnerAudioContext();
/* #endif */
/* #ifdef APP-PLUS */
audioPlayer = uni.getBackgroundAudioManager();
/* #endif */
audioPlayer.autoplay = false;
audioPlayer.onTimeUpdate((e) => {
this.setPlaySeconds(audioPlayer.currentTime);
let progress = (audioPlayer.currentTime / audioPlayer.duration) * 100;
if (progress) {
this.setProgress(progress);
}
this.updateLrc(false);
});
audioPlayer.onCanplay(() => {
this.setMusicIsReady(true);
})
audioPlayer.onError(()=>{
util.showToast('播放错误,即将播放下一首');
this.next();
})
audioPlayer.onEnded(() => {
if (playModeConfig.single.id == this.playMode.id) {
this.setMusic(this.playIndex, null, () => {
this.play();
this.setPlayState(true);
});
} else if (playModeConfig.random.id == this.playMode.id) {
const index = parseInt((this.playList.length - 1) * Math.random())
this.setMusic(index, null, () => {
this.play();
this.setPlayState(true);
});
} else {
this.next();
}
})
Vue.prototype.audioPlayer = audioPlayer;
Vue.prototype.prev = this.prev;
Vue.prototype.next = this.next;
Vue.prototype.stop = this.stop;
Vue.prototype.pause = this.pause;
Vue.prototype.play = this.play;
Vue.prototype.loadLrc = this.loadLrc;
Vue.prototype.setMusic = this.setMusic;
// Vue.prototype.getMusicPlayUrl = this.musicApi.getPlayUrl;
// Vue.prototype.getLrc = this.musicApi.getLrc;
// Vue.prototype.getMusicOtherInfo = this.musicApi.getMusicOtherInfo
const playMode = storage.get(storage_constants.playMode);
if (!playMode) {
this.setPlayMode(playModeConfig.list);
}
const mySongList = storage.getArrayDefault(storage_constants.mySongList, []);
/**
* 初始化歌词
*/
if (this.playList && this.playIndex >= 0) {
let music = this.playList[this.playIndex];
if (music) {
this.loadLrc(music, () => {
this.updateLrc(true);
});
}
}
},
/**
* 设置音乐
* @param {Object} index
* @param {type} progress
* @param {Object} call
*/
setMusic(index, progress, call) {
if (this.playList && this.playList.length > 0) {
if (index == null) {
index = 0
}
// 停止播放
this.audioPlayer.stop();
// 更新播放状态
this.setPlayState(false);
if (progress) {
// 重置进度条
this.setProgress(progress.progress || 0)
// 重置播放秒数
this.setPlaySeconds(progress.playSeconds || 0)
} else {
// 重置进度条
this.setProgress(0)
// 重置播放秒数
this.setPlaySeconds(0)
}
// 重置总秒数
this.setTotalSeconds(0)
// 音乐状态为未准备
this.setMusicIsReady(false)
let music = this.playList[index];
/* this.getMusicOtherInfo(music,(musicOtherInfo)=>{
music = musicOtherInfo;
}) */
const oldPlayMusic = this.playList[this.playIndex];
if (!util.objEquals(oldPlayMusic, music)) {
// 重置歌词
this.setLrcs([{
time: '[00:00.00]',
content: '歌词加载中'
}]);
this.setLrc({
time: '[00:00.00]',
content: '歌词加载中'
})
}
this.setPlayIndex(index);
// 加载歌词
this.loadLrc(music);
// 获取播放地址
Vue.prototype.getMusicPlayUrl && Vue.prototype.getMusicPlayUrl(music).then(playUrl => {
console.log(`播放地址:${playUrl}`)
this.audioPlayer.src = playUrl;
this.audioPlayer.title = music.name;
this.audioPlayer.singer = music.singer;
this.audioPlayer.coverImgUrl = music.coverImg;
let timer = setInterval(() => {
if (this.musicIsReady) {
this.setTotalSeconds(this.audioPlayer.duration)
if (this.playSeconds > 0) {
this.audioPlayer.seek(this.playSeconds)
}
this.setMusicIsReady(false)
clearInterval(timer);
if (call) {
call();
}
}
}, 200);
})
}
},
getMusicOtherInfo(music, call) {
if (music.loadOtherInfo) {
Vue.prototype.getMusicOtherInfo && Vue.prototype.getMusicOtherInfo(music).then(musicResult => {
call(musicResult)
})
}
},
/**
* 加载歌词
*/
loadLrc(music, call) {
Vue.prototype.getLrc && Vue.prototype.getLrc(music).then(lrcStr => {
if (lrcStr) {
this.setLrcStr(lrcStr)
if (call) {
call();
}
} else {
this.setLrcStr('[00:00.00]无歌词')
}
})
},
/**
* 更新当前歌词
* @param {Object} isInit
*/
updateLrc(isInit) {
if (this.lrcs) {
const sec = parseInt(this.playSeconds);
let index = sec + 1;
let line = this.lrcs[index];
if (line) {
this.setLrc(line);
} else {
if (isInit) {
for (var i = index; i >= 0; i--) {
let initLine = this.lrcs[i];
if (initLine) {
this.setLrc(initLine);
break;
}
}
}
}
}
},
/**
* 播放
*/
play() {
this.audioPlayer.play();
this.setPlayState(true);
const music = this.playList[this.playIndex];
this.pushRecentlyPlayList(music);
},
/**
* 暂停
*/
pause() {
this.audioPlayer.pause();
this.setPlayState(false);
},
/**
* 停止
*/
stop() {
this.audioPlayer.stop();
this.setPlayState(false);
this.setProgress(0);
this.setPlaySeconds(0)
},
/**
* 下一曲
*/
next() {
const length = this.playList.length;
let index = -1;
if (this.playIndex == length - 1) {
index = 0;
} else {
index = this.playIndex + 1;
}
this.setMusic(index, null, () => {
this.play();
this.setPlayState(true);
});
},
/**
* 上一曲
*/
prev() {
const length = this.playList.length;
let index = this.playIndex;
if (index == 0) {
index = length - 1;
} else {
index = index - 1;
}
this.setMusic(index, null, () => {
this.play();
this.setPlayState(true);
});
},
pushRecentlyPlayList(music){
let recentlyPlayList = storage.getArrayDefault(storage_constants.recentlyPlayList, []);
let index = util.findIndex(recentlyPlayList,music);
if(index >= 0){
recentlyPlayList.splice(index,1)
}
recentlyPlayList.splice(0,0,music)
this.setRecentlyPlayList(recentlyPlayList);
this.$forceUpdate()
}
}
}
+70
View File
@@ -0,0 +1,70 @@
/* #ifdef H5 */
const bgAudioManager = uni.createInnerAudioContext();
/* #endif */
/* #ifdef APP-PLUS */
const bgAudioManager = uni.getBackgroundAudioManager();
/* #endif */
bgAudioManager.autoplay = false;
function initPlayer(that){
if(that.currentPlaySong){
that.$u.vuex("currentPlayer",{
playState:false,
progress:0,
musicId:that.currentPlaySong.id,
});
bgAudioManager.title = that.currentPlaySong.songName;
bgAudioManager.singer = that.currentPlaySong.artist;
bgAudioManager.coverImgUrl = that.currentPlaySong.pic;
bgAudioManager.src = that.currentPlaySong.playSrc;
console.log("播放器初始化完成");
bindOnControllerPlay(that);
}
}
function bindOnControllerPlay(that){
let playState=that.currentPlayer.playState;
console.log("that.currentPlayer.progress",that.currentPlayer.progress);
if(playState){
bgAudioManager.pause();
}else{
if(that.currentPlayer.canPlay==false){
initPlayer(that);
return;
}else{
bgAudioManager.play();
that.$u.vuex("currentPlayer.canPlay",true);
}
}
playState=!playState;
console.log("当前播放状态===",playState);
that.$u.vuex("currentPlayer.playState",playState);
that.$u.vuex("currentPlayer.canPlay",true);
bgAudioManager.onTimeUpdate((e) => {
let progress = (bgAudioManager.currentTime / bgAudioManager.duration) * 100;
if (progress) {
that.$u.vuex("currentPlayer.progress",progress);
}
});
bgAudioManager.onError(()=>{
resetPlayer(that);
});
bgAudioManager.onEnded(() => {
resetPlayer(that);
});
}
function resetPlayer(that,player){
bgAudioManager.stop();
that.$u.vuex("currentPlayer.playState",false);
that.$u.vuex("currentPlayer.progress",0);
that.$u.vuex("currentPlayer.canPlay",false);
}
module.exports = {
initPlayer,
bindOnControllerPlay,
resetPlayer,
bgAudioManager
}
+88
View File
@@ -0,0 +1,88 @@
import {
mapState,
mapMutations
} from 'vuex'
import * as util from './BaseUtil.js'
export default {
computed: {
...mapState(['totalSeconds', 'totalDuration', 'playSeconds', 'playDuration', 'progress', 'playState',
'playMode', 'musicIsReady', 'playList', 'playIndex', 'lrcStr', 'lrcs', 'lrc', 'recentlyPlayList'
]),
...mapState(['paramSongList', 'isFirstRun', 'showPlayBar'])
},
methods: {
...mapMutations(['setPlayIndex', 'setTotalSeconds', 'setPlaySeconds', 'setProgress', 'setPlayState',
'setPlayMode', 'setMusicIsReady', 'setPlayList', 'setLrcStr', 'setLrcs', 'setLrc', 'setRecentlyPlayList'
]),
...mapMutations(['setParamSongList', 'setIsFirstRun', 'setShowPlayBar']),
like(music) {
this.songListService.like(music)
this.$forceUpdate();
},
unLike(music) {
this.songListService.unLike(music);
this.$forceUpdate();
},
isLike(music) {
return this.musicService.isLike(music);
},
controllerPlay(type) {
if (type == 'play') {
if (this.playState) {
this.pause();
} else {
if (this.isFirstRun) {
const progress = {
progress: this.progress,
playSeconds: this.playSeconds
}
this.setMusic(this.playIndex, progress, () => {
this.play();
})
} else {
this.play();
}
}
} else if (type == 'next') {
this.next();
} else if (type == 'prev') {
this.prev();
}
},
playMusicByMusic(music) {
let playList = this.playList;
const index = util.findIndex(playList, music);
let playIndex = null;
if (index == -1) {
playList.push(music);
this.setPlayList(playList);
playIndex = playList.length - 1;
} else {
playIndex = index;
}
this.setMusic(playIndex, null, () => {
this.play();
})
},
nextPlay(music) {
const playIndex = this.playIndex;
let playList = this.playList;
const musicIndex = util.findIndex(playList, music);
if (musicIndex != -1) {
if (playList.length - 1 == playIndex) {
playList.push(music);
} else {
let index = playIndex + 1;
playList[musicIndex] = playList.splice(index, 1, playList[musicIndex])[0];
}
} else {
const index = playIndex + 1;
playList.splice(index, 0, music);
}
this.setPlayList(playList);
}
}
}
+286
View File
@@ -0,0 +1,286 @@
// 手机权限js
/// null = 未请求,1 = 已允许,0 = 拒绝|受限, 2 = 系统未开启
var isIOS
function album() {
var result = 0;
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
var authStatus = PHPhotoLibrary.authorizationStatus();
if (authStatus === 0) {
result = null;
} else if (authStatus == 3) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(PHPhotoLibrary);
return result;
}
function camera() {
var result = 0;
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
if (authStatus === 0) {
result = null;
} else if (authStatus == 3) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(AVCaptureDevice);
return result;
}
function location() {
var result = 0;
var cllocationManger = plus.ios.import("CLLocationManager");
var enable = cllocationManger.locationServicesEnabled();
var status = cllocationManger.authorizationStatus();
if (!enable) {
result = 2;
} else if (status === 0) {
result = null;
} else if (status === 3 || status === 4) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(cllocationManger);
return result;
}
function push() {
var result = 0;
var UIApplication = plus.ios.import("UIApplication");
var app = UIApplication.sharedApplication();
var enabledTypes = 0;
if (app.currentUserNotificationSettings) {
var settings = app.currentUserNotificationSettings();
enabledTypes = settings.plusGetAttribute("types");
if (enabledTypes == 0) {
result = 0;
console.log("推送权限没有开启");
} else {
result = 1;
console.log("已经开启推送功能!")
}
plus.ios.deleteObject(settings);
} else {
enabledTypes = app.enabledRemoteNotificationTypes();
if (enabledTypes == 0) {
result = 3;
console.log("推送权限没有开启!");
} else {
result = 4;
console.log("已经开启推送功能!")
}
}
plus.ios.deleteObject(app);
plus.ios.deleteObject(UIApplication);
return result;
}
function contact() {
var result = 0;
var CNContactStore = plus.ios.import("CNContactStore");
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
if (authStatus === 0) {
result = null;
} else if (authStatus == 3) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(CNContactStore);
return result;
}
function record() {
var result = null;
var avaudiosession = plus.ios.import("AVAudioSession");
var avaudio = avaudiosession.sharedInstance();
var status = avaudio.recordPermission();
console.log("permissionStatus:" + status);
if (status === 1970168948) {
result = null;
} else if (status === 1735552628) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(avaudiosession);
return result;
}
function calendar() {
var result = null;
var EKEventStore = plus.ios.import("EKEventStore");
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
if (ekAuthStatus == 3) {
result = 1;
console.log("日历权限已经开启");
} else {
console.log("日历权限没有开启");
}
plus.ios.deleteObject(EKEventStore);
return result;
}
function memo() {
var result = null;
var EKEventStore = plus.ios.import("EKEventStore");
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
if (ekAuthStatus == 3) {
result = 1;
console.log("备忘录权限已经开启");
} else {
console.log("备忘录权限没有开启");
}
plus.ios.deleteObject(EKEventStore);
return result;
}
function requestIOS(permissionID) {
return new Promise((resolve, reject) => {
switch (permissionID) {
case "push":
resolve(push());
break;
case "location":
resolve(location());
break;
case "record":
resolve(record());
break;
case "camera":
resolve(camera());
break;
case "album":
resolve(album());
break;
case "contact":
resolve(contact());
break;
case "calendar":
resolve(calendar());
break;
case "memo":
resolve(memo());
break;
default:
resolve(0);
break;
}
});
}
function requestAndroid(permissionID) {
return new Promise((resolve, reject) => {
plus.android.requestPermissions(
[permissionID],
function(resultObj) {
var result = 0;
for (var i = 0; i < resultObj.granted.length; i++) {
var grantedPermission = resultObj.granted[i];
console.log('已获取的权限:' + grantedPermission);
result = 1
}
for (var i = 0; i < resultObj.deniedPresent.length; i++) {
var deniedPresentPermission = resultObj.deniedPresent[i];
console.log('拒绝本次申请的权限:' + deniedPresentPermission);
result = 0
}
for (var i = 0; i < resultObj.deniedAlways.length; i++) {
var deniedAlwaysPermission = resultObj.deniedAlways[i];
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
result = -1
}
resolve(result);
},
function(error) {
console.log('result error: ' + error.message)
resolve({
code: error.code,
message: error.message
});
}
);
});
}
function gotoAppPermissionSetting() {
if (permission.isIOS) {
var UIApplication = plus.ios.import("UIApplication");
var application2 = UIApplication.sharedApplication();
var NSURL2 = plus.ios.import("NSURL");
var setting2 = NSURL2.URLWithString("app-settings:");
application2.openURL(setting2);
plus.ios.deleteObject(setting2);
plus.ios.deleteObject(NSURL2);
plus.ios.deleteObject(application2);
} else {
var Intent = plus.android.importClass("android.content.Intent");
var Settings = plus.android.importClass("android.provider.Settings");
var Uri = plus.android.importClass("android.net.Uri");
var mainActivity = plus.android.runtimeMainActivity();
var intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
intent.setData(uri);
mainActivity.startActivity(intent);
}
}
function gotoiOSPermissionSetting() {
var UIApplication = plus.ios.import("UIApplication");
var application2 = UIApplication.sharedApplication();
var NSURL2 = plus.ios.import("NSURL");
var setting2 = NSURL2.URLWithString("App-prefs:root=General");
application2.openURL(setting2);
plus.ios.deleteObject(setting2);
plus.ios.deleteObject(NSURL2);
plus.ios.deleteObject(application2);
}
function openAndroidPushSetting() {
var mainActivity = plus.android.runtimeMainActivity();
var pkName = mainActivity.getPackageName();
var uid = mainActivity.getApplicationInfo().plusGetAttribute("uid");
var Intent = plus.android.importClass('android.content.Intent');
var Build = plus.android.importClass("android.os.Build");
if (Build.VERSION.SDK_INT >= 26) {
//android 8.0引导
var intent = new Intent('android.settings.APP_NOTIFICATION_SETTINGS');
intent.putExtra('android.provider.extra.APP_PACKAGE', pkName);
} else if (Build.VERSION.SDK_INT >= 21) {
//android 5.0-7.0
var intent = new Intent('android.settings.APP_NOTIFICATION_SETTINGS');
intent.putExtra("app_package", pkName);
intent.putExtra("app_uid", uid);
} else {
//(<21)其他--跳转到该应用管理的详情页
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", pkName, null);
intent.setData(uri);
}
// 跳转到该应用的系统通知设置页
mainActivity.startActivity(intent);
}
const permission = {
get isIOS(){
return typeof isIOS === 'boolean' ? isIOS : (isIOS = uni.getSystemInfoSync().platform === 'ios')
},
requestIOS: requestIOS,
requestAndroid: requestAndroid,
gotoAppSetting: gotoAppPermissionSetting,
gotoiOSSetting: gotoiOSPermissionSetting,
openAndroidPushSetting:openAndroidPushSetting
}
module.exports = permission
+898
View File
@@ -0,0 +1,898 @@
//---------------start----------------------账单列表---------------------start-------------------
var billData=[
{
"currentYear": 2023,
"currentMonth": 11,
"outputAmount": 1100,
"inputAmount": 11000,
"recordList":[
{
"tradeDirection": "in",
"finishTime": "2023-11-07 14:59:00",
"createTime": "2023-11-07 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "转账-来自莉莉-11",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType":"6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-07 12:15:00",
"createTime": "2023-11-07 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "转账给莉莉-11",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "微信红包-发给莉-11",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-09-07 14:59:00",
"createTime": "2023-11-07 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-07 12:15:00",
"createTime": "2023-11-07 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-09-07 14:59:00",
"createTime": "2023-11-07 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-07 12:15:00",
"createTime": "2023-11-07 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "11微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
}
]
},
{
"currentYear": 2023,
"currentMonth": 10,
"outputAmount": 1000,
"inputAmount": 10000,
"recordList": [
{
"tradeDirection": "in",
"finishTime": "2023-09-07 14:59:00",
"createTime": "2023-11-07 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-07 12:15:00",
"createTime": "2023-11-07 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-09-07 14:59:00",
"createTime": "2023-11-07 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-07 12:15:00",
"createTime": "2023-11-07 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-09-07 14:59:00",
"createTime": "2023-11-07 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-07 12:15:00",
"createTime": "2023-11-07 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "10-微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
}
]
},
{
"currentYear": 2023,
"currentMonth": 9,
"outputAmount": 900,
"inputAmount": 9000,
"recordList": [
{
"tradeDirection": "in",
"finishTime": "2023-09-07 14:59:00",
"createTime": "2023-09-07 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-09-07 12:15:00",
"createTime": "2023-09-07 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-09-07 14:59:00",
"createTime": "2023-11-07 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-07 12:15:00",
"createTime": "2023-11-07 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-09-07 14:59:00",
"createTime": "2023-11-07 15:00:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-转账-来自莉莉",
"tradeCode": "TJTC_1721784520610545664",
"tradeValue": 10000,
"id": 1635,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-07 12:15:00",
"createTime": "2023-11-07 12:15:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-转账给莉莉",
"tradeCode": "TJTC_1721743291227176960",
"tradeValue": 500,
"id": 1630,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "out",
"finishTime": "2023-11-06 14:44:00",
"createTime": "2023-11-06 14:44:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-微信红包-发给莉",
"tradeCode": "TJTC_1721780784832053248",
"tradeValue": 200,
"id": 1633,
"userId": 554,
"tradeType": "6"
},
{
"tradeDirection": "in",
"finishTime": "2023-11-05 14:55:00",
"createTime": "2023-11-05 14:55:00",
"tradeIcon": "/static/image/mycenter/default-record-icon.jpg",
"tradeStatus": "2",
"tradeTitle": "9-微信红包-来自莉莉",
"tradeCode": "TJTC_1721783502145454080",
"tradeValue": 200,
"id": 1634,
"userId": 554,
"tradeType": "6"
}
]
}
]
function getRecordList(year,month,tradeType){
console.log("=======year"+year+"====month==="+month+"=====type==="+tradeType);
let tempData=JSON.parse(JSON.stringify(billData));
let recordItem= tempData.find(item=>(item.currentYear==year&&item.currentMonth==month));
console.log("recordItem===",recordItem);
if(recordItem!=undefined&&recordItem!=null){
recordItem.recordList=recordItem.recordList.filter(item=>item.tradeType==tradeType);
return recordItem;
}else{
return {
"currentYear": year,
"currentMonth": month,
"outputAmount": 0.00,
"inputAmount": 0.00,
"recordList":[]
};
}
}
function addItem(newItem,callback){
let tempData=JSON.parse(JSON.stringify(billData));
let recordItem= tempData.find((item,index)=>{
return item.currentYear==year&&item.currentMonth==month
})
recordItem.recordList.push(newItem);
billData=tempData;
callback();
}
function deleteItem(delItem,callback){
let tempData=JSON.parse(JSON.stringify(billData));
let recordItem= tempData.find((item,index)=>{
return item.currentYear==year&&item.currentMonth==month
})
recordItem.recordList=recordItem.recordList.filter((item)=>{
return item.createTime!=delItem.createTime;
});
billData=tempData;
callback();
}
function updateItem(updateItem,callback){
let tempData=JSON.parse(JSON.stringify(billData));
let recordItem= tempData.find((item,index)=>{
return item.currentYear==year&&item.currentMonth==month
})
recordItem.recordList=recordItem.recordList.filter((item)=>{
return item.createTime!=delItem.createTime;
});
addItem(updateItem,callback);
}
//---------------end----------------------账单列表---------------------end-------------------
const tempChartData={
"outdata": {
"list": [
{
"id": 3,
"trade_typetxt": "转账",
"sum_value": "65906.00",
"trade_icon": "/assets/icon/zd3.png",
"sum_count": 18,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/zd3.png",
"billTitle": "转账",
"amountValue": "65906.00"
},
{
"id": 2,
"trade_typetxt": "二维码收付款",
"sum_value": "1348.40",
"trade_icon": "/assets/icon/zd1.png",
"sum_count": 17,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/zd1.png",
"billTitle": "二维码收付款",
"amountValue": "1348.40"
},
{
"id": 1,
"trade_typetxt": "微信红包",
"sum_value": "326.00",
"trade_icon": "/assets/icon/sh19.png",
"sum_count": 2,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/sh19.png",
"billTitle": "微信红包",
"amountValue": "326.00"
}
],
"money": 81127.53,
"count": 54,
"month_list": {
"month": [
"06月",
"07月",
"08月",
"09月",
"10月",
"11月"
],
"money": [
136253.37,
140794.18,
140792.95,
136254.18,
140792.97,
81127.53
],
"list": [
{
"money": 136253.37,
"month": "06月"
},
{
"money": 140794.18,
"month": "07月"
},
{
"money": 140792.95,
"month": "08月"
},
{
"money": 136254.18,
"month": "09月"
},
{
"money": 140792.97,
"month": "10月"
},
{
"money": 81127.53,
"month": "11月"
}
]
}
},
"indata": {
"list": [
{
"id": 1,
"trade_typetxt": "二维码收付款",
"sum_value": "62803.00",
"trade_icon": "/assets/icon/zd1.png",
"sum_count": 24,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/zd1.png",
"billTitle": "二维码收付款",
"amountValue": "62803.00"
},
{
"id": 3,
"trade_typetxt": "转账",
"sum_value": "5591.00",
"trade_icon": "/assets/icon/zd3.png",
"sum_count": 10,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/zd3.png",
"billTitle": "转账",
"amountValue": "5591.00"
},
{
"id": 2,
"trade_typetxt": "微信红包",
"sum_value": "137.00",
"trade_icon": "/assets/icon/sh19.png",
"sum_count": 4,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/sh19.png",
"billTitle": "微信红包",
"amountValue": "137.00"
}
],
"money": 119630,
"count": 46,
"month_list": {
"month": [
"06月",
"07月",
"08月",
"09月",
"10月",
"11月"
],
"money": [
137061,
130787,
152473,
120999,
157692,
119630
],
"list": [
{
"money": 137061,
"month": "06月"
},
{
"money": 130787,
"month": "07月"
},
{
"money": 152473,
"month": "08月"
},
{
"money": 120999,
"month": "09月"
},
{
"money": 157692,
"month": "10月"
},
{
"money": 119630,
"month": "11月"
}
]
}
},
"otherdata": {
"list": [
{
"id": 3,
"trade_typetxt": "零钱充值",
"sum_value": "50850.00",
"trade_icon": "/assets/icon/sh20.png",
"sum_count": 7,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/sh20.png",
"billTitle": "零钱充值",
"amountValue": "50850.00"
},
{
"id": 1,
"trade_typetxt": "零钱提现",
"sum_value": "13000.00",
"trade_icon": "/assets/icon/sh20.png",
"sum_count": 9,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/sh20.png",
"billTitle": "零钱提现",
"amountValue": "13000.00"
},
{
"id": 2,
"trade_typetxt": "信用卡还款",
"sum_value": "249.00",
"trade_icon": "/assets/icon/sh8.png",
"sum_count": 1,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/sh8.png",
"billTitle": "信用卡还款",
"amountValue": "249.00"
}
]
},
"sumoutdata": {
"list": [
{
"id": 3,
"trade_typetxt": "转账",
"sum_value": "817456.00",
"trade_icon": "/assets/icon/nzz.png",
"sum_count": 190,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nzz.png",
"billTitle": "转账",
"amountValue": "817456.00",
"percentValue": 95.81,
"color": "#0ABF5E"
},
{
"id": 1,
"trade_typetxt": "消费支出",
"sum_value": "18745.78",
"trade_icon": "/assets/icon/nxfzc.png",
"sum_count": 263,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nxfzc.png",
"billTitle": "消费支出",
"amountValue": "18745.78",
"percentValue": 2.2,
"color": "#57A3F9"
},
{
"id": 2,
"trade_typetxt": "发红包",
"sum_value": "4024.00",
"trade_icon": "/assets/icon/nfhb.png",
"sum_count": 43,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nfhb.png",
"billTitle": "发红包",
"amountValue": "4024.00",
"percentValue": 0.47,
"color": "#fa3534"
}
],
"money": 853225.78,
"count": 505
},
"sumindata": {
"list": [
{
"id": 1,
"trade_typetxt": "二维码收款",
"sum_value": "724802.00",
"trade_icon": "/assets/icon/newm.png",
"sum_count": 274,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/newm.png",
"billTitle": "二维码收款",
"amountValue": "724802.00",
"percentValue": 81.22,
"color": "#D7B746"
},
{
"id": 3,
"trade_typetxt": "收转账",
"sum_value": "114567.00",
"trade_icon": "/assets/icon/nzz.png",
"sum_count": 91,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nzz.png",
"billTitle": "收转账",
"amountValue": "114567.00",
"percentValue": 12.84,
"color": "#0ABF5E"
},
{
"id": 2,
"trade_typetxt": "收红包",
"sum_value": "1966.00",
"trade_icon": "/assets/icon/nfhb.png",
"sum_count": 33,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nfhb.png",
"billTitle": "收红包",
"amountValue": "1966.00",
"percentValue": 0.22,
"color": "#fa3534"
}
],
"money": 892434,
"count": 406
},
"sumotherdata": {
"list": [
{
"id": 3,
"trade_typetxt": "零钱充值",
"sum_value": "50850.00",
"trade_icon": "/assets/icon/nlq.png",
"sum_count": 7,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nlq.png",
"billTitle": "零钱充值",
"title": "零钱充值",
"amountValue": "50850.00",
"percentValue": 7,
"color": "#be8913"
},
{
"id": 1,
"trade_typetxt": "零钱提现",
"sum_value": "13000.00",
"trade_icon": "/assets/icon/nlq.png",
"sum_count": 9,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nlq.png",
"billTitle": "零钱提现",
"title": "零钱提现",
"amountValue": "13000.00",
"percentValue": 9,
"color": "#3d7a25"
},
{
"id": 2,
"trade_typetxt": "信用卡还款",
"sum_value": "249.00",
"trade_icon": "/assets/icon/nxyk.png",
"sum_count": 1,
"iconSrc": "http://weadmin1.fyhcard.com/assets/icon/nxyk.png",
"billTitle": "信用卡还款",
"title": "信用卡还款",
"amountValue": "249.00",
"percentValue": 1,
"color": "#a254e0"
}
]
}
}
//---------------start----------------------账单统计数据---------------------start-------------------
function getChartData(param){
console.log("=======获取图表数据参数======",param);
console.log("----------------------!!!!!!!!!!注意!!!!!!!!!!!!!这里只模拟了一组数据!!!!!!!!注意!!!!!!!!!!=============");
return tempChartData;
};
//
module.exports = {
tempBillList:billData,
tempChartData:tempChartData,
queryRecordList:function(year,month,tradeType){
return getRecordList(year,month,tradeType)
},
addItem:function(newItem,callback){
return addItem(newItem,callback)
},
updateItem:function(newItem,callback){
return updateItem(newItem,callback)
},
deleteItem:function(newItem,callback){
return deleteItem(newItem,callback)
},
getChartData:function(param){
return getChartData(param)
},
}