Namespace.register("Couple");//注册命名空间 Couple.Bind=function (productId) { var informationtTime = $(".informationtTime")[0]//获取反馈时间 Date.prototype.Format = function (fmt) {//时间处理对Date的扩展 var o = { "M+": this.getMonth() + 1, // 月份 "d+": this.getDate(), // 日 "h+": this.getHours(), // 小时 "m+": this.getMinutes(), // 分 "s+": this.getSeconds(), // 秒 "q+": Math.floor((this.getMonth() + 3) / 3), // 季度 "S": this.getMilliseconds() // 毫秒 }; if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); return fmt; } var time = (new Date()).Format("yyyy-MM-dd hh:mm:ss");//获取时间 var timeSequence=$$("div", { "className": "timeSequence" }, informationtTime); var oneDay=$$("button", { "className": "timeItem","innerText":"今天","onclick":"Couple.OnclickTime('"+productId+"','today')" }, timeSequence); var threeDay=$$("button", { "className": "timeItem","innerText":"最近三天","onclick":"Couple.OnclickTime('"+productId+"','3days')" }, timeSequence); var oneWeek=$$("button", { "className": "timeItem","innerText":"最近一周","onclick":"Couple.OnclickTime('"+productId+"','7days')" }, timeSequence) var oneMonth=$$("button", { "className": "timeItem","innerText":"最近一月","onclick":"Couple.OnclickTime('"+productId+"','30days')" }, timeSequence) } Couple.getDataRow = function(h,i){//创建表格下的行放数据库循环数据 var row = document.createElement('tr'); var sortCell = document.createElement('td'); sortCell.innerText = i; row.appendChild(sortCell); var trTitle = document.createElement('td'); trTitle.setAttribute('class','trTitle'); trTitle.innerText = h.CoupleName; row.appendChild(trTitle); var trContent = document.createElement('td'); trContent.setAttribute('class','trContent'); trContent.innerText = h.CoupleContent; row.appendChild(trContent); var trCoupleTime = document.createElement('td'); trCoupleTime.setAttribute('class','trCoupleTime'); trCoupleTime.innerText = U.UF.D.getYearMonthDay(h.CoupleTime) row.appendChild(trCoupleTime); //每行末尾添加删除按钮 var delCell = document.createElement('td'); row.appendChild(delCell); var btnDel = document.createElement('input'); btnDel.setAttribute('type','button'); btnDel.setAttribute('value','删除'); btnDel.setAttribute('class','delectInfo'); btnDel.onclick=function(){ //删除操作 if(confirm("确定删除这一行嘛?")){ this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); } } delCell.appendChild(btnDel); return row; } Couple.Init=function () { var userName=$(".userName")[0]//获取用户名 var ul = $(".asideMenu ul")[0];//获取项目列表ul var informationtInfo = $(".informationtInfo")[0];//获取反馈信息 var informationtTime = $(".informationtTime")[0];//获取反馈时间 userName.innerText = document.URL.split('?')[1].split("=")[1]; U.A.Request("http://cd.1473.cn/net",["db.1473.cn", "UseStudio_Couple", "GetProductByUserId",U.UF.Cookie.get("usestudiosso","userid")[0]],function (r){//获取项目列表 for(var i=0;i