var e = n.document,
t = e.documentElement,
i = 750,
d = i / 100,
o = "orientationchange" in n ? "orientationchange" : "resize",
a = function () {
var n = t.clientWidth || 320;
n > 750 && (n = 750);
t.style.fontSize = n / d + "px"
};
e.addEventListener && (n.addEventListener(o, a, !1), e.addEventListener("DOMContentLoaded", a, !1))
}(window);
$(document).ready(function() {
if (!location.search) {
new Dialog({
type: 'alert',
msg: '没找到相关动态或征婚'
})
return false
}
var id = getUrlParam('id');
$.ajax({
url: 'https://WWW.hongdoulian.net/index.php/home/squares/read?t=1548641752971',
type: 'post',
data: {
sqid: id
},
dataType: 'JSON',
success: function(res) {
if (res.code === 1) {
var data = res.data;
var gender = data.gender === '1' ? '男性' : '女性';
var html = '
'' +
'
'
'
'
'
' + data.nickname + '
' +'' + gender + '' +
'' + data.saddress + '' +
''+ data.opstatus + '' +
'
'
'
'
'' + data.age + '岁' +
'' + fomartTime(data.create_time) + '' +
'
'
if (data.pics[0]) {
html += '
$.each(data.pics, function(index, item) {
html += '';
})
html += '
}
html += '
'
'
console.log(html)
$(".comment-article").append(html);
} else {
new Dialog({
type: 'alert',
msg: res.msg
})
}
},
error: function(error) {
load.close()
new Dialog({
type: 'showMsg',
msg: '网络错误'
})
}
})
var load = loading()
$.ajax({
url: 'https://WWW.hongdoulian.net/index.php/home/comments/getCommentsByid',
type: 'POST',
dataType: 'json',
data: {
sqid: id,
page: 1,
listrow: 20
},
success: function(res) {
setTimeout(function(){
$(".comment").show();
load.close();
if (res.code === 1) {
var html = '';
if (res.data.data.length) {
$.each(res.data.data, function(index, item) {
html += '
})
$(".comment-wrap").append(html);
}
} else {
new Dialog({
type: 'alert',
msg: res.msg
})
}
}, 500)
},
error: function(error) {
load.close()
new Dialog({
type: 'showMsg',
msg: '网络错误'
})
}
})
})
一键复制
编辑
Web IDE
原始数据
按行查看
历史
'' +
'
'
'
'
' + item.nickname + '
' +'
'
'
'' + fomartTime(item.create_time) +'' +
'
'
'
'
'
'