|
@ -0,0 +1,53 @@
|
|
1
|
mui.ready(function(){
|
|
2
|
mui.plusReady(function(){
|
|
3
|
var self = plus.webview.currentWebview();
|
|
4
|
plus.nativeUI.closeWaiting();
|
|
5
|
plus.webview.currentWebview().show("slide-in-right", 150);
|
|
6
|
var con=document.getElementById("question");
|
|
7
|
con.addEventListener("keyup", function() {
|
|
8
|
if(this.value.length>0) {
|
|
9
|
document.getElementById("refer").removeAttribute("disabled");
|
|
10
|
}else if(this.value.length==0) {
|
|
11
|
document.getElementById("refer").setAttribute("disabled","true");
|
|
12
|
}
|
|
13
|
})
|
|
14
|
document.getElementById("refer").addEventListener("tap",function(){
|
|
15
|
if(!plus.storage.getItem('userid')){
|
|
16
|
mui.openWindow({
|
|
17
|
url: '../html/login.html',
|
|
18
|
id: '../html/login.html',
|
|
19
|
show: {
|
|
20
|
aniShow: "slide-in-right"
|
|
21
|
},
|
|
22
|
extras:{
|
|
23
|
ourl:self.id
|
|
24
|
}
|
|
25
|
});
|
|
26
|
return;
|
|
27
|
}
|
|
28
|
if(con.value.length>500) {
|
|
29
|
plus.nativeUI.toast("内容不能超过500个字");
|
|
30
|
return;
|
|
31
|
}
|
|
32
|
var userid = plus.storage.getItem('userid');
|
|
33
|
mui.ajax(baseUrl + "/ajax/feedback/error/"+self.name, {
|
|
34
|
dataType: 'json', //数据格式类型
|
|
35
|
type: 'post', //http请求类型
|
|
36
|
data: {
|
|
37
|
id: self.proid,
|
|
38
|
cnt:document.getElementById("question").value,
|
|
39
|
user:userid
|
|
40
|
},
|
|
41
|
timeout: 10000, //超时设置
|
|
42
|
success: function(data) {
|
|
43
|
if(data.success) {
|
|
44
|
mui.back();
|
|
45
|
}
|
|
46
|
}
|
|
47
|
})
|
|
48
|
})
|
|
49
|
window.addEventListener("newId", function(event) {
|
|
50
|
alert(111)
|
|
51
|
});
|
|
52
|
})
|
|
53
|
})
|