<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="HandheldFriendly" content="true" />
<meta name="MobileOptimized" content="320" />
<title>CMM</title>
<link rel="stylesheet" href="dist/css/swiper.min.css">
<link rel="stylesheet" href="css/mui.css">
<link rel="stylesheet" href="css/config.css">
<link rel="stylesheet" href="css/iconfont.css" />
<link rel="stylesheet" href="css/common.css" />
<script src="js/jquery.js"></script>
<script src="js/mui.min.js"></script>
<script src="js/app.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" charset="utf-8">
var shares = null,
bhref = false;
var Intent = null,
File = null,
Uri = null,
main = null;
var ws = null,
list = null;
// 扩展API加载完毕,现在可以正常调用扩展API
// DOMContentLoaded事件处理
// 扩展API加载完毕,现在可以正常调用扩展API
function plusReady() {
var embed = plus.webview.create("http://weibo.com/dhnetwork", "", {
top: "46px",
bottom: "0px"
});
plus.webview.currentWebview().append(embed);
}
//plusReady();
</script>
<style type="text/css">
body {
font-family: 华文细黑;
}
#pull {
width: 24px;
height: 100%;
display: inline-block;
margin: 0 1em;
}
#icon {
height: 24px;
vertical-align: middle;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
</style>
<style>
.mui-popover {
margin-top: 0px;
}
</style>
<style type="text/css">
li {
border-bottom: 1px solid #d2d2d2;
height: 79px;
list-style: none;
width: 100%;
margin-left: 0px;
}
li:active {
background: #f4f4f4;
}
</style>
<STYLE>
html {
-ms-touch-action: none;
-ms-content-zooming: none;
}
body {
position: relative;
margin: 0px;
padding: 0px;
background: #eeeeee;
width: 100%;
height: 100%;
font-weight: bold;
}
#canvas {
position: relative;
width: 100%;
height: 150px;
background: #eeeeee;
top: 60px
}
</STYLE>
<style>
body {
background: #eeeeee;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color: #000;
margin: 0;
padding: 0;
}
.swiper-container {
width: 100%;
padding-top: 50px;
padding-bottom: 50px;
top: 0px
}
.swiper-slide {
background-position: center;
background-size: cover;
width: 250px;
height: 150px;
}
.swiper-container1 {
width: 100%;
height: 72px;
}
.swiper-slide1 {
text-align: center;
font-size: 15px;
background: #eeeeee;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
td {
color: #584234
}
button {
font-size: 12px;
}
</style>
</head>
<body bgcolor="#eeeeeeFFF" style="font-weight: bolder;">
<div style="border-bottom:none;width: 100%;left:0px;height: 45px;text-align: left;font-size: 19px;">
<br> <span id='title'></span></div>
<div style="border-bottom:none;width: 100%;left:0px;height: 25px;text-align: left;font-size: 14px;color: #616161;">
<br> <span id="addtiem"></span> 作者:<span id="author"></span></div>
<div style="width: 100%;left:0px;height: auto;text-align: center;left: 0px;position: relative;top:25px" id="content"></div>
<div id="replies" style="width: 100%;left:0px;height: auto;text-align: center;left: 0px;position: relative;top:25px; "></div>
<div id="reply" style="width: 90%;left:0px;height: auto;text-align: left;left: 0px;position: relative;top:20px">
<textarea id="reply_content" placeholder="我来说两句..." rows="5" style="margin-left:20px; margin-bottom:0px !important;padding:0px !important; position: relative; font-size: 13px; overflow: auto; background: transparent !important;"></textarea>
<a style=" margin-top:0px; margin-left:20px;height:40px;width:65px;line-height:40px;color:#fff;font-size: 16px; border-width:0; background-color: #f66;display: block; padding:10;text-align:center;text-decoration:none;font-weight:bold;"
href="javascript:;" onclick="reply();">评论</a>
</div>
</body>
</html>
<script>
function reply() {
var newsid=localStorage.xqid
var html=""
var url = 'http://cmm.ydsd.top/m_api/index.php?ctl=news&act=reply&article_id=' + newsid
console.log(url)
mui.ajax(url, {
data:{
article_id:newsid,
content: document.getElementById("reply_content").value,
reply_id:0
},
dataType : 'text', //服务器返回json格式数据
type : 'post', //HTTP请求类型
timeout : 10000, //超时时间设置为10秒;
success : function (data) {
//服务器返回响应,根据响应结果,分析是否登录成功;
var objstr = data
var obj = JSON.parse(objstr)
objstr = JSON.stringify(obj)
console.log(objstr)
if(obj.status == 1) {
list = plus.webview.getWebviewById('cms_content.html')
if (list) {
list.reload();
//list.show();//
return
}
}
else {
showalert1("评论失败!" + obj.result)
}
},
error : function (xhr, type, errorThrown) {
//异常处理;
showalert1("网络不好哦,请检查网络!")
}
});
}
function pullupdata() {
var newsid = localStorage.xqid
var html = ""
var url = 'http://cmm.ydsd.top/m_api/index.php?ctl=news&act=getNews&id=' + newsid
mui.ajax(url, {
dataType : 'text', //服务器返回xml格式数据
type : 'post', //HTTP请求类型
timeout : 10000, //超时时间设置为10秒;
success : function (data) {
//服务器返回响应,根据响应结果,分析是否登录成功;
var objstr = data
var obj = JSON.parse(objstr)
objstr = JSON.stringify(obj)
var item = obj.result
document.getElementById("title").innerHTML = item.title
document.getElementById("addtiem").innerHTML = item.create_time
document.getElementById("author").innerHTML = item.author
document.getElementById("content").innerHTML = item.content
var replies = item.replies
var replies_content = '用户评论:<br>'
for (i = 0; i < replies.length; i++) {
replies_content = replies_content + '<div style = "margin:5px;border:1px; border-style:solid; width:90%; margin:0 auto; border-color: #CECECE;">'
replies_content = replies_content + '<p style="text-align:left; margin-left:25px;"><span>用户:' + replies[i].user_name + '</span>'
replies_content = replies_content + ' <span>时间: ' + replies[i].format_create_time + '</span></p>'
replies_content = replies_content + '<p style="text-align:left; margin-left:25px;">' + replies[i].content + '</p>'
replies_content = replies_content + '</div>'
replies_content = replies_content + '<br>'
}
document.getElementById("replies").innerHTML = replies_content
//document.getElementById("replies").innerHTML=item.content
// alert(document.getElementById("content").innerHTML)
},
error : function (xhr, type, errorThrown) {
//异常处理;
showalert1("网络不好哦,请检查网络!")
}
});
}
pullupdata()
</script>
gavincook (作者)
目前我测试过要闪退的机型有mx3(android4.4.4), mx2(android 4.1), 三星note3(android 4.4),华为c8813q(android 4.1). 目前出现问题,主要是第一次打开有输入框的页面,并点击输入框弹出软键盘时会出现。 另外:之前一直没有出该问题,后面Hbuilder有过几次更新后,出现的问题,代码逻辑未变化。
2015-03-27 10:35
Android_磊子
你这是sdk集成时候出现的问题吗?
2015-03-30 10:53
gavincook (作者)
我没有单独用sdk集成,直接用HBuilder开发的
2015-03-30 16:14
Android_磊子
回复 gavincook:今天修改了一个类似问题,更新后看是否已经修复你的bug了。
2015-03-30 20:31
地图
问题依旧,输入框点一下,弹出软键盘,app直接退出了。
2015-11-03 22:37
地图
在线云打包方式
2015-11-03 22:38