2 Star 1 Fork 1

leewell/论坛demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
answer.html 3.91 KB
一键复制 编辑 原始数据 按行查看 历史
<!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>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/leewell/luntandemo.git
git@gitee.com:leewell/luntandemo.git
leewell
luntandemo
论坛demo
master

搜索帮助