Commit 854f87ee by 施宇

21212

parent ceb5207d
......@@ -54,9 +54,10 @@ $(function () {
},
rendChatSection: function (data) {
this.addUser(this.defaultName);
for (var key in data) {
this.addUser(data[key]);
};
for(var i=0;i<data.length;i++){
this.addUser(data[i].im_username)
}
},
singleChat: function () {
if (JSON.stringify(this.templateObj) == '{}') {
......
......@@ -57,19 +57,19 @@ $(function () {
$('.zz').on('click', '.fl', function () {
var index = $(this).index();
var spOrXj = 1;
var time = new Date(Util.getDay(0));
var time = Util.getDay(0);
$(this).addClass('active').siblings().removeClass('active');
if ($('.search_xj').hasClass('active')) {
spOrXj = 2
}
if (index == 0) {
self.getData(spOrXj, time.getTime() / 1000)
self.getData(spOrXj, time)
} else if (index == 1) {
time = new Date(Util.getDay(-3));
self.getData(spOrXj, time.getTime() / 1000)
time = Util.getDay(-3);
self.getData(spOrXj, time)
} else {
time = new Date(Util.getDay(-7));
self.getData(spOrXj, time.getTime() / 1000)
time = Util.getDay(-7);
self.getData(spOrXj, time)
}
})
}
......
......@@ -88,7 +88,8 @@ $(function () {
num = parent.find('.num').find('span').text(),
hq = parent.find('.hq').find('span').text(),
time = parent.find('.time').find('span').text(),
img = $('.xj_img').attr('src');
img = $('.xj_img').attr('src'),
name = parent.find('.name').text();
obj = {
userId: userId,
type: type,
......@@ -98,8 +99,10 @@ $(function () {
num: num,
hq: hq,
time: time,
image: img
image: img,
userName:name
};
console.log(obj)
Util.setCookie('template', JSON.stringify(obj), 1, cookieHostname)
window.location.href = '/chat'
} else {
......
......@@ -72,19 +72,19 @@ $(function () {
$('.zz').on('click', '.fl', function () {
var index = $(this).index();
var spOrXj = 1;
var time = new Date(Util.getDay(0));
var time = Util.getDay(0);
$(this).addClass('active').siblings().removeClass('active');
if ($('.search_xj').hasClass('active')) {
spOrXj = 2
}
if (index == 0) {
self.getData(spOrXj, 1,time.getTime() / 1000)
self.getData(spOrXj, 1,time)
} else if (index == 1) {
time = new Date(Util.getDay(-3));
self.getData(spOrXj, 1,time.getTime() / 1000)
time = Util.getDay(-3);
self.getData(spOrXj, 1,time)
} else {
time = new Date(Util.getDay(-7));
self.getData(spOrXj, 1,time.getTime() / 1000)
time = Util.getDay(-7);
self.getData(spOrXj, 1,time)
}
});
$('.goods_data_list').on('click','.xj_item',function(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment