代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
<link rel="stylesheet" type="text/css" href="commn/base.css" />
<link rel="stylesheet" type="text/css" href="css/weui.min.css" />
<link rel="stylesheet" type="text/css" href="css/jquery-weui.min.css" />
<link rel="stylesheet" type="text/css" href="Hui-iconfont/1.0.8/iconfont.css" />
<style type="text/css">
body {
display: -webkit-box;
-webkit-box-orient: vertical;
width: 100%;
}
.index {
min-width: 240px;
}
.top {
display: -webkit-box;
width: 100%;
height: 40px;
background-color: #0F88EB;
}
.top>span {
line-height: 40px;
text-indent: 1em;
color: white;
display: -webkit-box;
font-size: 18px;
font-weight: bold;
-webkit-box-flex: 1;
}
.back {
color: white;
font-size: 18px;
margin-left: 15px;
line-height: 40px;
}
.content {
margin-top: 5px;
width: 100%;
height: 300px;
outline: none;
border: 1px solid #EEEEEE;
}
.send {
height: 40px;
width: 100px;
color: white;
margin-left: 5%;
font-size: 14px;
border: 1px solid #0F88EB;
background-color: #0F88EB;
outline: none;
border-radius: 40px;
}
</style>
</head>
<body>
<div class="index">
<div class="top">
<i class="back Hui-iconfont Hui-iconfont-slider-left" @click="back()"></i>
<span>回答</span>
</div>
<div class="home_content">
<textarea class="content" placeholder='输入问题的回答.....' v-model="text"></textarea>
<p><input type="button" @click="pinglun()" class="send" value="提交回答" /></p>
</div>
</div>
<script src="js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var newVue = new Vue({
el: "body",
data: {
vueindex: "",
text: ""
},
methods: {
back: function() {
location.href = "questions.html?id=" + newVue.vueindex;
},
pinglun: function() {
send(this.text)
}
}
})
var ss;
var dd;
var index;
var reg = new RegExp("(^|&)" + "id" + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if(r != null) {
console.log(unescape(r[2]));
index = unescape(r[2]);
newVue.vueindex = unescape(r[2]);
} else {
console.log(null);
};
//评论部分
var year = new Date();
var nian = year.getFullYear();
var yue = (year.getMonth() + 1) < 10 ? "0" + (year.getMonth() + 1) : year.getMonth() + 1;
var day = year.getDate() < 10 ? "0" + year.getDate() : year.getDate();
var str1 = nian + "-" + yue + "-" + day;
function send(text) {
var ss;
var dd;
$.ajax({
type: 'get',
//async:false,
url: "http://v2.mashupcloud.cn/developer/auth.do",
data: {
appkey: 'FvWrIYOQoTUYVbscUNQoQAVqsLnZqKEN',
appsecret: 'ugCfcSmyLkcbCGfIuFOPEgTgPQPbyJSE'
},
success: function(json) {
// console.log(json);
ss = JSON.parse(json)[1];
dd = JSON.parse(json)[2];
console.log('获得token成功');
$.ajax({
type: 'get',
url: "http://v2.mashupcloud.cn/SQL/into_p/",
data: {
appid: dd,
token: ss,
name: 'into_p',
_v1: index,
_v2: text,
_v3: sessionStorage.getItem("id"),
_v4: str1
},
success: function(json) {
console.log(JSON.parse(json));
alert("回答成功");
location.href = "questions.html?id=" + newVue.vueindex;
},
error: function(json) {
console.log("err:" + json);
}
});
},
error: function(json) {
console.log("err:" + json);
}
});
};
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。