|
@@ -1,5 +1,71 @@
|
|
|
Namespace.register("Couple");//注册命名空间
|
|
Namespace.register("Couple");//注册命名空间
|
|
|
-Couple.Bind=function (productId) {
|
|
|
|
|
|
|
+Couple.Bind=function () {
|
|
|
|
|
+ var userName=$(".userName")[0]//获取用户名
|
|
|
|
|
+ var ul = $(".asideMenu ul")[0];//获取项目列表ul
|
|
|
|
|
+ var asideMenu = $(".asideMenu")[0];
|
|
|
|
|
+
|
|
|
|
|
+ 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<r.value.length;i++){
|
|
|
|
|
+ var li=$$("li", {
|
|
|
|
|
+ "className": "asideItem","productId":r.value[i].ProductId
|
|
|
|
|
+ }, ul);
|
|
|
|
|
+ var a=$$("a", {}, li);
|
|
|
|
|
+ var icon=$$("span", {
|
|
|
|
|
+ "className": "icon icon-times icon-2x",
|
|
|
|
|
+ }, a);
|
|
|
|
|
+ var span=$$("span", {
|
|
|
|
|
+ "className": "asideItemText","innerText":r.value[i].ProductName
|
|
|
|
|
+ }, a);
|
|
|
|
|
+ ul.onclick = function(ev) {//点击项目列表
|
|
|
|
|
+ ev = ev || event;
|
|
|
|
|
+ var target = ev.target || ev.srcElement;
|
|
|
|
|
+ var productId = target.parentNode.parentElement.productId;
|
|
|
|
|
+ if(informationtTime.firstChild==null){
|
|
|
|
|
+ Couple.createInfo(productId)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ informationtInfo.removeChild(informationtInfo.firstChild);
|
|
|
|
|
+ informationtTime.removeChild(informationtTime.firstChild);
|
|
|
|
|
+ Couple.createInfo(productId)
|
|
|
|
|
+ }
|
|
|
|
|
+ Couple.OnclickTime=function(id,time){//点击时间对应获取信息
|
|
|
|
|
+ U.A.Request("http://cd.1473.cn/net",["db.1473.cn", "UseStudio_Couple", "GetCouple",id,time],function (r){//获取产品的反馈信息
|
|
|
|
|
+ if(informationtInfo.firstChild==null){}else{
|
|
|
|
|
+ informationtInfo.removeChild(informationtInfo.firstChild);
|
|
|
|
|
+ informationtTime.removeChild(informationtTime.firstChild);
|
|
|
|
|
+ Couple.createInfo(productId)
|
|
|
|
|
+ }
|
|
|
|
|
+ var tbody = $$("tbody", {//创建表格
|
|
|
|
|
+ "className": "tbMain",
|
|
|
|
|
+ }, informationtInfo);
|
|
|
|
|
+ var tr = $$("tr", {}, tbody);
|
|
|
|
|
+ var td = $$("td", {
|
|
|
|
|
+ "className":"infoTitle","innerText":"排序"
|
|
|
|
|
+ }, tr);
|
|
|
|
|
+ var td = $$("td", {
|
|
|
|
|
+ "className":"infoTitle trTitle","innerText":"标题"
|
|
|
|
|
+ }, tr);
|
|
|
|
|
+ var td = $$("td", {
|
|
|
|
|
+ "className":"infoTitle trContent","innerText":"内容",
|
|
|
|
|
+ }, tr);
|
|
|
|
|
+ var td = $$("td", {
|
|
|
|
|
+ "className":"infoTitle trCoupleTime","innerText":"反馈时间"
|
|
|
|
|
+ }, tr);
|
|
|
|
|
+ var td = $$("td", {}, tr);
|
|
|
|
|
+ for(var i=0;i<r.value.length;i++){
|
|
|
|
|
+ var trow = Couple.getDataRow(r.value[i],i+1);
|
|
|
|
|
+ tbody.appendChild(trow);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+Couple.createInfo=function(productId){
|
|
|
var informationtTime = $(".informationtTime")[0]//获取反馈时间
|
|
var informationtTime = $(".informationtTime")[0]//获取反馈时间
|
|
|
Date.prototype.Format = function (fmt) {//时间处理对Date的扩展
|
|
Date.prototype.Format = function (fmt) {//时间处理对Date的扩展
|
|
|
var o = {
|
|
var o = {
|
|
@@ -34,6 +100,14 @@ Couple.Bind=function (productId) {
|
|
|
"className": "timeItem","innerText":"最近一月","onclick":"Couple.OnclickTime('"+productId+"','30days')"
|
|
"className": "timeItem","innerText":"最近一月","onclick":"Couple.OnclickTime('"+productId+"','30days')"
|
|
|
}, timeSequence)
|
|
}, timeSequence)
|
|
|
}
|
|
}
|
|
|
|
|
+Couple.logout=function(){//退出
|
|
|
|
|
+ U.UF.CD.loadAjaxCrossDomain(function(){
|
|
|
|
|
+ U.A.Request(US.AUTH, ["UserOffline", U.UF.Cookie.get("usestudiosso","userid")[0]],function(r){
|
|
|
|
|
+ window.location.href="http://couple.1473.cn/login.html";
|
|
|
|
|
+ console.log(r)
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
Couple.getDataRow = function(h,i){//创建表格下的行放数据库循环数据
|
|
Couple.getDataRow = function(h,i){//创建表格下的行放数据库循环数据
|
|
|
var row = document.createElement('tr');
|
|
var row = document.createElement('tr');
|
|
|
var sortCell = document.createElement('td');
|
|
var sortCell = document.createElement('td');
|
|
@@ -69,70 +143,8 @@ Couple.getDataRow = function(h,i){//创建表格下的行放数据库循环数
|
|
|
return row;
|
|
return row;
|
|
|
}
|
|
}
|
|
|
Couple.Init=function () {
|
|
Couple.Init=function () {
|
|
|
- var userName=$(".userName")[0]//获取用户名
|
|
|
|
|
- var ul = $(".asideMenu ul")[0];//获取项目列表ul
|
|
|
|
|
var asideMenu = $(".asideMenu")[0];
|
|
var asideMenu = $(".asideMenu")[0];
|
|
|
-
|
|
|
|
|
- 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<r.value.length;i++){
|
|
|
|
|
- var li=$$("li", {
|
|
|
|
|
- "className": "asideItem","productId":r.value[i].ProductId
|
|
|
|
|
- }, ul);
|
|
|
|
|
- var a=$$("a", {}, li);
|
|
|
|
|
- var icon=$$("span", {
|
|
|
|
|
- "className": "icon icon-times icon-2x",
|
|
|
|
|
- }, a);
|
|
|
|
|
- var span=$$("span", {
|
|
|
|
|
- "className": "asideItemText","innerText":r.value[i].ProductName
|
|
|
|
|
- }, a);
|
|
|
|
|
- ul.onclick = function(ev) {//点击项目列表
|
|
|
|
|
- ev = ev || event;
|
|
|
|
|
- var target = ev.target || ev.srcElement;
|
|
|
|
|
- var productId = target.parentNode.parentElement.productId;
|
|
|
|
|
- if(informationtTime.firstChild==null){
|
|
|
|
|
- Couple.Bind(productId)
|
|
|
|
|
- }else{
|
|
|
|
|
- informationtInfo.removeChild(informationtInfo.firstChild);
|
|
|
|
|
- informationtTime.removeChild(informationtTime.firstChild);
|
|
|
|
|
- Couple.Bind(productId)
|
|
|
|
|
- }
|
|
|
|
|
- Couple.OnclickTime=function(id,time){//点击时间对应获取信息
|
|
|
|
|
- U.A.Request("http://cd.1473.cn/net",["db.1473.cn", "UseStudio_Couple", "GetCouple",id,time],function (r){//获取产品的反馈信息
|
|
|
|
|
- if(informationtInfo.firstChild==null){}else{
|
|
|
|
|
- informationtInfo.removeChild(informationtInfo.firstChild);
|
|
|
|
|
- informationtTime.removeChild(informationtTime.firstChild);
|
|
|
|
|
- Couple.Bind(productId)
|
|
|
|
|
- }
|
|
|
|
|
- var tbody = $$("tbody", {//创建表格
|
|
|
|
|
- "className": "tbMain",
|
|
|
|
|
- }, informationtInfo);
|
|
|
|
|
- var tr = $$("tr", {}, tbody);
|
|
|
|
|
- var td = $$("td", {
|
|
|
|
|
- "className":"infoTitle","innerText":"排序"
|
|
|
|
|
- }, tr);
|
|
|
|
|
- var td = $$("td", {
|
|
|
|
|
- "className":"infoTitle trTitle","innerText":"标题"
|
|
|
|
|
- }, tr);
|
|
|
|
|
- var td = $$("td", {
|
|
|
|
|
- "className":"infoTitle trContent","innerText":"内容",
|
|
|
|
|
- }, tr);
|
|
|
|
|
- var td = $$("td", {
|
|
|
|
|
- "className":"infoTitle trCoupleTime","innerText":"反馈时间"
|
|
|
|
|
- }, tr);
|
|
|
|
|
- var td = $$("td", {}, tr);
|
|
|
|
|
- for(var i=0;i<r.value.length;i++){
|
|
|
|
|
- var trow = Couple.getDataRow(r.value[i],i+1);
|
|
|
|
|
- tbody.appendChild(trow);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ Couple.Bind();
|
|
|
window.onscroll = function(){
|
|
window.onscroll = function(){
|
|
|
var scrollTop = document.documentElement.scrollTop;
|
|
var scrollTop = document.documentElement.scrollTop;
|
|
|
if(scrollTop>=1){
|
|
if(scrollTop>=1){
|
|
@@ -141,12 +153,4 @@ Couple.Init=function () {
|
|
|
asideMenu.style.top = "70px";
|
|
asideMenu.style.top = "70px";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- Couple.logout=function(){//退出
|
|
|
|
|
- U.UF.CD.loadAjaxCrossDomain(function(){
|
|
|
|
|
- U.A.Request(US.AUTH, ["UserOffline", U.UF.Cookie.get("usestudiosso","userid")[0]],function(r){
|
|
|
|
|
- window.location.href="http://couple.1473.cn/login.html";
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
}();
|
|
}();
|