You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
38
static/app2/js/journalism_con.js
Executable file
38
static/app2/js/journalism_con.js
Executable file
@ -0,0 +1,38 @@
|
||||
$('.con_').html('');
|
||||
|
||||
mui.plusReady(function() {
|
||||
var self = plus.webview.currentWebview();
|
||||
var msgId = self.data_articleId;
|
||||
mui.ajax(kxUrl('app/Articles/detail'), {
|
||||
|
||||
data: {
|
||||
articleId: msgId
|
||||
},
|
||||
dataType: 'json', //服务器返回json格式数据
|
||||
type: 'post', //HTTP请求类型
|
||||
timeout: 10000, //超时时间设置为10秒;
|
||||
success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
|
||||
// var data = toJson(data,1);
|
||||
|
||||
if(data.status == 1) {
|
||||
var data = data.data;
|
||||
|
||||
var coverImg = '';
|
||||
|
||||
if(data.coverImg){
|
||||
coverImg = ectImgUrl(data.coverImg)
|
||||
}else{
|
||||
coverImg = '../img/mujiimg.png'
|
||||
}
|
||||
var html = '<div class="con_top"><img class="headImg" src="'+ coverImg +'" /><div class="con_top_title">'+ data.articleKey +'</div><div class="num">'+ data.visitorNum +'阅读</div><button class="guanzhu"style="display: none;">关注</button></div><div class="con_con">'+ data.articleContent +'</div><div class="time">'+ data.createTime +'</div>';
|
||||
$('.con_').html(html);
|
||||
} else {
|
||||
console.log(data.status);
|
||||
}
|
||||
},
|
||||
error: function(xhr, type, errorThrown) { //异常处理;
|
||||
// alert(type);
|
||||
}
|
||||
});
|
||||
|
||||
})
|
Reference in New Issue
Block a user