online-calendar.js
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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'),
},
},
data:{
marklist:[]
},
attached(){
},
observers:{
'seller'(newseller){
if(newseller){
this.showYearMonth=this.getshowmonth();
console.log(newseller,this.showYearMonth);
this.gethousefulldate(newseller,this.showYearMonth)
}
}
},
methods:{
//获取当前选中日期
getshowmonth(){
let datearr=this.data.date.split('-');
return{
showyear:Number(datearr[0]),
showmonth:Number(datearr[1]),
}
},
//切换月份
getmonth(e){
console.log('tellmonth',e)
this.showYearMonth=e.detail;
if(e.detail.action='click'){
this.gethousefulldate(this.data.seller,this.showYearMonth)
}
},
//根据指定年份月份获取当月满房的日期
gethousefulldate(seller,showYearMonth){
let parmdata={
sid:seller.id,
type:'month',
date:showYearMonth.showyear+'-'+(showYearMonth.showmonth<10 ? '0'+showYearMonth.showmonth : showYearMonth.showmonth)
}
App.Customer.GetHouseFullDate(parmdata).then((json)=>{
console.log(json)
if(json.ret==200){
if(json.data && json.data.length>0){
let marklist=[];
json.data.forEach((v,i)=>{
marklist.push({
date:v,
mark:'满'
})
})
this.setData({
marklist:marklist
})
}
}
})
},
tellselectdate(e){
this.triggerEvent('tellselectdate',e.detail);
}
}
})