|

楼主 |
发表于 2017-6-19 10:39:02
|
显示全部楼层
我是自己写的代码
define(function(require){
var $ = require("jquery");
var justep = require("$UI/system/lib/justep");
var dayNumber = require("$UI/JdptApp/js/dayNumber");
var currentYear;
var currentMonth;
var currentDay;
var Model = function(){
this.callParent();
currentYear = "1900";
currentMonth = "1月";
currentDay = "1日"
};
Model.prototype.CloseimageClick = function(event){
this.close();
};
Model.prototype.button3Click = function(event){
var monthNum = currentMonth.substr(0, currentMonth.length - 1);
var dayNum = currentDay.substr(0, currentDay.length - 1);
var data = {
"currentYear":currentYear,
"currentMonth":monthNum,
"currentDay":dayNum,
}
//传参方法
this.owner.send(data);
this.close();
};
//年份
Model.prototype.pickerYearChange = function(event){
var year = this.comp("Data_Year").getValue("yearClass");
currentYear = year.substr(0, year.length - 1);
this.comp("Data_Day").refreshData();
};
//月份
Model.prototype.pickerMonthChange = function(event){
var month = this.comp("Data_Month").getValue("monthClass");
currentMonth = month;
//刷新日期
this.comp("Data_Day").refreshData();
};
Model.prototype.pickerDayChange = function(event){
var day = this.comp("Data_Day").getValue("dayClass");
currentDay = day;
};
Model.prototype.Data_DayCustomRefresh = function(event){
var data3=this.comp("Data_Day");
data3.clear();
//增加年和月份的判断,获取指定月份的天数
var num;
var daylist;
if(currentMonth === "1月" || currentMonth === "3月" || currentMonth === "5月" || currentMonth === "7月" || currentMonth === "8月" || currentMonth === "10月" || currentMonth === "12月"){
//赋值
daylist=dayNumber["31天"];
num = 31;
}else if(currentMonth === "4月" || currentMonth === "6月" || currentMonth === "9月" || currentMonth === "11月"){
daylist=dayNumber["30天"];
num = 30;
}else if(((currentYear % 4 == 0) && (currentYear % 100 != 0 ||currentYear % 400 == 0)) && currentMonth === "2月"){
daylist=dayNumber["29天"];
num = 29;
}else if(!((currentYear % 4 == 0) && (currentYear % 100 != 0 ||currentYear % 400 == 0)) && currentMonth === "2月"){
daylist=dayNumber["28天"];
num = 28;
}
for( var i = 0;i< num ;i++ )
{
data3.add({dayClass:daylist});
}
};
// Model.prototype.modelLoad = function(event){
//
// this.comp("Data_Year").refreshData();
// };
//
// Model.prototype.Data_YearCustomRefresh = function(event){
//
//
// };
return Model;
});
你帮我看下一吧,我在modelLoad里应该怎样写一下;
我不了解怎样用picker的属性
|
|