|
@@ -1,5 +1,5 @@
|
|
|
$('html').css('height','100%');
|
|
|
-// $('body').css('height','100%');
|
|
|
+
|
|
|
$.fn.autoTextarea = function(options) {
|
|
|
var defaults={
|
|
|
maxHeight:null,
|
|
@@ -30,7 +30,6 @@ $("#comments").autoTextarea({
|
|
|
|
|
|
var host = (function(){
|
|
|
return window.location.protocol + "//" + window.location.host;
|
|
|
- // return 'http://192.168.0.200';
|
|
|
})();
|
|
|
|
|
|
$('.thumbnail img').picLazyLoad();
|
|
@@ -48,7 +47,8 @@ var event = function (obj, eventType, callback) {
|
|
|
obj.live(eventType, callback);
|
|
|
};
|
|
|
|
|
|
-var ajax = function (url, callback, error) {
|
|
|
+var get_ajax = function (url, callback)
|
|
|
+{
|
|
|
$.ajax({
|
|
|
type: "get",
|
|
|
async: false,
|
|
@@ -56,11 +56,7 @@ var ajax = function (url, callback, error) {
|
|
|
dataType: "jsonp",
|
|
|
jsonp: "callback",
|
|
|
jsonpCallback: "flightHandler",
|
|
|
- success: callback,
|
|
|
- error: error || function () {
|
|
|
- $('.loader').hide();
|
|
|
- alert('网络错误');
|
|
|
- }
|
|
|
+ success: callback
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -339,7 +335,7 @@ var ReplyItem = function (comment, members) {
|
|
|
};
|
|
|
var commentdata = comment;
|
|
|
var sub = '';
|
|
|
- var subnum = 4;
|
|
|
+ var subnum = 10;
|
|
|
if(comment) {
|
|
|
var defaultSubNum = comment['sub_count'];
|
|
|
}
|
|
@@ -459,8 +455,9 @@ var ReplyList = function () {
|
|
|
var getDate = function () {
|
|
|
isLoad = true;
|
|
|
$('.loader').show();
|
|
|
- ajax(host +'/mobile/index.php?act=member_ugc&op=comments&client_type=ajax&special_id=' + specialId + '&curpage=' + curpage, function (data) {
|
|
|
- console.log(data);
|
|
|
+ var url = host +'/mobile/index.php?act=member_ugc&op=comments&client_type=ajax&special_id=' + specialId + '&curpage=' + curpage;
|
|
|
+ get_ajax(url,function (data)
|
|
|
+ {
|
|
|
$('.loader').hide();
|
|
|
isLoad = false;
|
|
|
if (data.code !== 200) {
|
|
@@ -485,10 +482,11 @@ var ReplyList = function () {
|
|
|
document.getElementsByClassName('wrapper')[0].removeEventListener('scroll',loadEvent);
|
|
|
}
|
|
|
}
|
|
|
- }, function () {
|
|
|
- $('.loader').hide();
|
|
|
- $('.comment_list').append(new ReplyItem().empty());
|
|
|
- })
|
|
|
+ });
|
|
|
+ // , function () {
|
|
|
+ // $('.loader').hide();
|
|
|
+ // $('.comment_list').append(new ReplyItem().empty());
|
|
|
+ // })
|
|
|
};
|
|
|
var loadEvent = function () {
|
|
|
var scrollTop = $(this).scrollTop();
|
|
@@ -509,9 +507,11 @@ var ReplyList = function () {
|
|
|
};
|
|
|
|
|
|
|
|
|
-var CommentsBox = function () {
|
|
|
+var CommentsBox = function ()
|
|
|
+{
|
|
|
var maxSize = 150;
|
|
|
- var show = function () {
|
|
|
+ var show = function ()
|
|
|
+ {
|
|
|
$('.pop').show();
|
|
|
$('.answer_comments').show();
|
|
|
$('#comments').focus();
|
|
@@ -519,6 +519,7 @@ var CommentsBox = function () {
|
|
|
event.preventDefault();
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
var inputFocus = function(){
|
|
|
$('#comments').focus(function(){
|
|
|
interval = setInterval(function() {
|
|
@@ -584,7 +585,8 @@ var CommentsBox = function () {
|
|
|
var textVal = $('#comments').val();
|
|
|
if (Comment_type == 'special_id') {
|
|
|
url = host +'/mobile/index.php?act=member_ugc&op=comment&client_type=ajax&special_id=' + specialId + '&content=' + encodeURI(textVal);
|
|
|
- ajax(url, function (data) {
|
|
|
+ get_ajax(url, function (data)
|
|
|
+ {
|
|
|
$('.loader').hide();
|
|
|
if (data.code !== 200) {
|
|
|
alert(data.message);
|
|
@@ -605,7 +607,7 @@ var CommentsBox = function () {
|
|
|
else {
|
|
|
url = host +'/mobile/index.php?act=member_ugc&op=comment&client_type=ajax&special_id=' + specialId + '&content=' + encodeURI(textVal) + '&comment_id=' + res.comment_id;
|
|
|
}
|
|
|
- ajax(url, function (data) {
|
|
|
+ get_ajax(url, function (data) {
|
|
|
$('.loader').hide();
|
|
|
if (data.code !== 200) {
|
|
|
alert(data.message);
|
|
@@ -727,7 +729,7 @@ event($('.btn_appreciate'),'click',function(){
|
|
|
else {
|
|
|
logined = true;
|
|
|
var url = host + '/mobile/index.php?act=member_ugc&op=mine_bonus&client_type=ajax';
|
|
|
- ajax(url,function(data){
|
|
|
+ get_ajax(url,function(data){
|
|
|
$('.loader').hide();
|
|
|
if (data.code !== 200) {
|
|
|
alert(data.message);
|
|
@@ -746,7 +748,7 @@ event($('.btn_appreciate'),'click',function(){
|
|
|
}
|
|
|
else {
|
|
|
var url = host + '/mobile/index.php?act=member_ugc&op=mine_bonus&client_type=ajax';
|
|
|
- ajax(url,function(data){
|
|
|
+ get_ajax(url,function(data){
|
|
|
$('.loader').hide();
|
|
|
if (data.code !== 200) {
|
|
|
alert(data.message);
|
|
@@ -777,7 +779,7 @@ event($('#submit_appreciate'),'click',function(){
|
|
|
var money = $('.bonus_item.active .money').text();
|
|
|
var content = $('#live_msg').val();
|
|
|
var url = host + '/mobile/index.php?act=member_ugc&op=appreciate&client_type=ajax&rate='+rate+'&money=' + money + '&content=' + encodeURI(content) + '&special_id=' + specialId ;
|
|
|
- ajax(url,function(data){
|
|
|
+ get_ajax(url,function(data){
|
|
|
console.log(data);
|
|
|
if (data.code !== 200) {
|
|
|
alert(data.message);
|
|
@@ -837,7 +839,7 @@ $('#submit_btn').on('click', function () {
|
|
|
allAnswers.question = resAnswers;
|
|
|
}
|
|
|
var url = host + "/mobile/index.php?act=special&op=submit&client_type=ajax&special_id=" + specialId + '&content=' + encodeURI(JSON.stringify(allAnswers));
|
|
|
- ajax(url, function (data) {
|
|
|
+ get_ajax(url, function (data) {
|
|
|
$('.loader').hide();
|
|
|
if (data.code !== 200) {
|
|
|
alert(data.message);
|
|
@@ -846,6 +848,14 @@ $('#submit_btn').on('click', function () {
|
|
|
}
|
|
|
_self.css('display', 'none');
|
|
|
|
|
|
+ if($('.vote').length <= 0 && $('.question_list').length <= 0) {
|
|
|
+ if (data.datas['bonus_url'] !== "") {
|
|
|
+ $('.pop').show();
|
|
|
+ $('.bonus_page').attr('href', data.datas["bonus_url"]).addClass('fade-in').show();
|
|
|
+ $('.close_icon').addClass('rotate').show();
|
|
|
+ $('.bonus_page img').attr('src',data.datas["sender_avatar"]);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if ($('.vote').length > 0 && $('.question_list').length <= 0) {
|
|
|
$('.vote_options').css('display', 'none');
|
|
@@ -907,7 +917,7 @@ event($('.like_btn'), 'click', function () {
|
|
|
if ($(this).attr('data-comment_id')) {
|
|
|
var comment_id = $(this).attr('data-comment_id');
|
|
|
url = host + '/mobile/index.php?act=member_ugc&op=support&client_type=ajax&special_id=' + specialId + '&comment_id=' + comment_id;
|
|
|
- ajax(url, function (data) {
|
|
|
+ get_ajax(url, function (data) {
|
|
|
$('.loader').hide();
|
|
|
if (data.code !== 200) {
|
|
|
alert(data.message);
|
|
@@ -927,7 +937,7 @@ event($('.like_btn'), 'click', function () {
|
|
|
}
|
|
|
else {
|
|
|
url = host + '/mobile/index.php?act=member_ugc&op=support&client_type=ajax&special_id=' + specialId;
|
|
|
- ajax(url, function (data) {
|
|
|
+ get_ajax(url, function (data) {
|
|
|
$('.loader').hide();
|
|
|
if (data.code !== 200) {
|
|
|
alert(data.message);
|
|
@@ -952,7 +962,7 @@ event($('.button_load_more'), 'click', function () {
|
|
|
var comment_id = $(this).parent('.comment_item').attr('data-comment_id');
|
|
|
var curpage = $(this).attr('data-page');
|
|
|
var url = host + '/mobile/index.php?act=member_ugc&op=comments&client_type=ajax&special_id=' + specialId + '&comment_id=' + comment_id + '&curpage=' + curpage +'&page=4';
|
|
|
- ajax(url, function (data) {
|
|
|
+ get_ajax(url, function (data) {
|
|
|
$('.loader').hide();
|
|
|
if (data.code !== 200) {
|
|
|
alert(data.message);
|
|
@@ -994,9 +1004,6 @@ register_js_hander('onKeyboardClose',function(data,callback) {
|
|
|
commentsBox.close();
|
|
|
});
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
function app()
|
|
|
{
|
|
|
var app=navigator.userAgent.toLowerCase(),//判断设备
|