|
|
|
import util from '../../../utils/util';
|
|
|
|
import App from '../../../utils/api';
|
|
|
|
Component({
|
|
|
|
properties:{
|
|
|
|
seller:Object,
|
|
|
|
//选中日期
|
|
|
|
date:{
|
|
|
|
type:String,
|
|
|
|
value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD'),
|
|
|
|
},
|
|
|
|
hidecalendar:{
|
|
|
|
type:Boolean,
|
|
|
|
value:true
|
|
|
|
marklist:{
|
|
|
|
type:Array,
|
|
|
|
value:[]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data: {
|
|
|
|
showprev:false
|
|
|
|
},
|
|
|
|
observers: {
|
|
|
|
'seller,date': function(seller,newdate) {
|
|
|
|
if(seller && newdate!=''){
|
|
|
|
let showYearMonth=this.getshowmonth();
|
|
|
|
'date': function(newdate,newmarklist) {
|
|
|
|
let showYearMonth=this.getshowmonth();
|
|
|
|
let obj={
|
|
|
|
...showYearMonth,
|
|
|
|
action:'defalut'
|
|
|
|
}
|
|
|
|
if(newdate!=''){
|
|
|
|
if(this.data.showYearMonth){ //周历点击
|
|
|
|
if(showYearMonth.showyear==this.data.showYearMonth.showyear && showYearMonth.showmonth==this.data.showYearMonth.showmonth){
|
|
|
|
this.changedatestyle(newdate);
|
|
...
|
...
|
@@ -29,20 +30,27 @@ Component({ |
|
|
|
showprev:this.isShowPrev(showYearMonth)
|
|
|
|
})
|
|
|
|
this.getdayslist(showYearMonth.showyear,showYearMonth.showmonth);
|
|
|
|
// this.gethousefulldate(seller);
|
|
|
|
this.triggerEvent('tellmonth',obj);
|
|
|
|
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
//初始化---默认
|
|
|
|
console.log('默认')
|
|
|
|
this.setData({
|
|
|
|
showYearMonth:showYearMonth,
|
|
|
|
showprev:this.isShowPrev(showYearMonth)
|
|
|
|
})
|
|
|
|
this.getdayslist(showYearMonth.showyear,showYearMonth.showmonth);
|
|
|
|
// this.gethousefulldate(seller);
|
|
|
|
this.triggerEvent('tellmonth',obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
'marklist'(newmarklist){
|
|
|
|
if(this.data.daylist){
|
|
|
|
this.markdaylist(newmarklist)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
attached(){
|
|
...
|
...
|
@@ -83,7 +91,7 @@ Component({ |
|
|
|
},
|
|
|
|
//获取某一天是星期几
|
|
|
|
getdayweek:function(year,month,day){
|
|
|
|
var tmpdate=new Date(year,month,day);
|
|
|
|
var tmpdate=new Date(year,month-1,day);
|
|
|
|
return tmpdate.getDay()
|
|
|
|
},
|
|
|
|
//获取当月日期
|
|
...
|
...
|
@@ -189,12 +197,16 @@ Component({ |
|
|
|
showyear:showyear,
|
|
|
|
showmonth:showmonth
|
|
|
|
}
|
|
|
|
let obj={
|
|
|
|
...showYearMonth,
|
|
|
|
action:'click'
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
showYearMonth:showYearMonth,
|
|
|
|
showprev:this.isShowPrev(showYearMonth)
|
|
|
|
})
|
|
|
|
this.getdayslist(showYearMonth.showyear,showYearMonth.showmonth);
|
|
|
|
this.gethousefulldate(this.data.seller);
|
|
|
|
this.triggerEvent('tellmonth',obj);
|
|
|
|
},
|
|
|
|
//推前月份
|
|
|
|
nextmonth(){
|
|
...
|
...
|
@@ -215,33 +227,21 @@ Component({ |
|
|
|
showprev:this.isShowPrev(showYearMonth)
|
|
|
|
})
|
|
|
|
this.getdayslist(showYearMonth.showyear,showYearMonth.showmonth);
|
|
|
|
this.gethousefulldate(this.data.seller);
|
|
|
|
},
|
|
|
|
//根据指定年份月份获取当月满房的日期
|
|
|
|
gethousefulldate(seller){
|
|
|
|
let showYearMonth=this.data.showYearMonth;
|
|
|
|
let parmdata={
|
|
|
|
sid:seller.id,
|
|
|
|
type:'month',
|
|
|
|
date:showYearMonth.showyear+'-'+(showYearMonth.showmonth<10 ? '0'+showYearMonth.showmonth : showYearMonth.showmonth)
|
|
|
|
let obj={
|
|
|
|
...showYearMonth,
|
|
|
|
action:'click'
|
|
|
|
}
|
|
|
|
App.Customer.GetHouseFullDate(parmdata).then((json)=>{
|
|
|
|
console.log(json)
|
|
|
|
if(json.ret==200){
|
|
|
|
if(json.data && json.data.length>0){
|
|
|
|
this.markFullHouse(json.data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
this.triggerEvent('tellmonth',obj);
|
|
|
|
},
|
|
|
|
//标记满房
|
|
|
|
markFullHouse(fullHouseDate){
|
|
|
|
markdaylist(marklist){
|
|
|
|
console.log('xxxxxx')
|
|
|
|
let daylist=this.data.daylist;
|
|
|
|
daylist.forEach((v,i)=>{
|
|
|
|
v.list.forEach((r,n)=>{
|
|
|
|
fullHouseDate.forEach((r1,n1)=>{
|
|
|
|
if(r1==r.date){
|
|
|
|
r.mark='满'
|
|
|
|
marklist.forEach((r1,n1)=>{
|
|
|
|
if(r.date && r1.date==r.date){
|
|
|
|
r.mark=r1.mark
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
...
|
...
|
|