|
@@ -171,9 +171,9 @@ Page({
|
|
|
getWeek(list){
|
|
|
var days=list,weeks=[]
|
|
|
days=days.reverse()
|
|
|
- for(let i=0;i<52;i++){
|
|
|
+ for(let i=0;i<55;i++){
|
|
|
weeks.push({
|
|
|
- name:'第'+(i+1)+'周',
|
|
|
+ name:'',
|
|
|
data:[],
|
|
|
total:0
|
|
|
})
|
|
@@ -182,19 +182,22 @@ Page({
|
|
|
var w=this.getWeekNumber(item.stock_date)
|
|
|
weeks[w-1].data.push(item)
|
|
|
})
|
|
|
- weeks.forEach(item=>{
|
|
|
- if(item.data.length>0){
|
|
|
- var total=0
|
|
|
- var money = 10000.0
|
|
|
- item.data.forEach(i=>{
|
|
|
- var incom=Number(i.today_income.replace('%',''))
|
|
|
- money += money*incom/100.0
|
|
|
- i.date=(new Date(i.stock_date).getMonth()+1)+'/'+(new Date(i.stock_date).getDate())
|
|
|
- })
|
|
|
- total = (money-10000)*100.0/10000.0
|
|
|
- item.total=total.toFixed(2)
|
|
|
- }
|
|
|
+ weeks=weeks.filter(item=>item.data.length>0)
|
|
|
+ var w_text=['一','二','三','四','五','六','七','八','九','十','十一','十二','十三','十四','十五']
|
|
|
+ weeks.forEach((item,index)=>{
|
|
|
+ if(item.data.length>0){
|
|
|
+ item.name='第'+w_text[index]+'周'
|
|
|
+ var total=0
|
|
|
+ var money = 10000.0
|
|
|
+ item.data.forEach(i=>{
|
|
|
+ var incom=Number(i.today_income.replace('%',''))
|
|
|
+ money += money*incom/100.0
|
|
|
+ i.date=(new Date(i.stock_date).getMonth()+1)+'/'+(new Date(i.stock_date).getDate())
|
|
|
})
|
|
|
+ total = (money-10000)*100.0/10000.0
|
|
|
+ item.total=total.toFixed(2)
|
|
|
+ }
|
|
|
+ })
|
|
|
this.setData({
|
|
|
days:weeks.reverse()
|
|
|
})
|