You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
143 lines
4.4 KiB
143 lines
4.4 KiB
<!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> |
|
<!--REM自适应布局JS--> |
|
<link rel="stylesheet" type="text/css" href="../../../lib/css/mui.min.css"> |
|
<link rel="stylesheet" type="text/css" href="../../../lib/css/basic.css"/> |
|
<link rel="stylesheet" type="text/css" href="../../css/base.css" /> |
|
<script src="../../../lib/js/mui.min.js"></script> |
|
<script src="../../../lib/js/vue.js"></script> |
|
<script src="../../../lib/js/app.js"></script> |
|
<script src="../../js/base/rem-layout.js"></script> |
|
<script type="text/javascript" src="../../js/my/my_ajax.js"></script> |
|
<script type="text/javascript" src="../../js/base/regular.js"></script>s |
|
<script src="../../../lib/js/require2.1.11.js"></script> |
|
</head> |
|
<style> |
|
.app-textarea { |
|
margin-top: 0.25rem; |
|
} |
|
|
|
.alert-text div { |
|
margin-bottom: 0.05rem; |
|
} |
|
|
|
.text-right { |
|
float: right; |
|
margin-right: 0.05rem; |
|
color:#6A85E8 !important; |
|
} |
|
|
|
</style> |
|
|
|
<body> |
|
<div id="data-info"> |
|
<header class="mui-bar mui-bar-nav app-header app-header-darkly"> |
|
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a> |
|
<h1 class="mui-title">{{dataBase.MyFeedBackTitle}}</h1> |
|
</header> |
|
<div class="mui-content"> |
|
<div> |
|
<textarea v-model="text_area" class="app-textarea app-textarea-darkly" @input="text_count" maxlength="200" rows="10" :placeholder="dataBase.MyFeedBackPlaceholder"></textarea> |
|
<div class="app-text-color app-text-warning-color alert-text"> |
|
<div>{{dataBase.MyFeedBackAlert1}}</div> |
|
<span>{{dataBase.MyFeedBackAlert2}}</span> |
|
<span class="app-text-color text-right">{{text_length}}/{{text_max}}</span> |
|
</div> |
|
|
|
<button id="submit" class="app-btn-darkly">{{dataBase.MyFeedBackSubmiBTN}}</button> |
|
|
|
</div> |
|
</div> |
|
</div> |
|
</body> |
|
|
|
</html> |
|
<script> |
|
var data_info = new Vue({ |
|
el: "#data-info", |
|
data: { |
|
dataBase: {}, |
|
text_area: "", |
|
text_length: "0", |
|
text_max: "200" |
|
}, |
|
methods: { |
|
text_count: function() { |
|
this.text_length = this.text_area.length; |
|
} |
|
} |
|
}) |
|
|
|
mui.plusReady(function() { |
|
|
|
document.getElementById("submit").addEventListener("tap", function() { |
|
var regular_emoji = /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/ig; |
|
var emoji_test = regular_emoji.test(data_info.text_area); |
|
if(!data_info.text_area || data_info.text_area == '' || data_info.text_area.length <= 0) { |
|
mui.toast(data_info.dataBase.MyFeedBackTextNullMsg); |
|
} else if(emoji_test) { |
|
mui.toast(data_info.dataBase.MyFeedBackTextErrorMsg); |
|
} else if(!regular.chinese_english1.test(data_info.text_area)) { |
|
mui.toast(data_info.dataBase.MyFeedBackTextErrorMsg); |
|
} else { |
|
saveFeedback(); |
|
} |
|
}); |
|
|
|
}); |
|
|
|
function saveFeedback() { |
|
plus.nativeUI.showWaiting(data_info.dataBase.ShowWaiting); |
|
var username = app.getWalletUserLocalStorage().username; |
|
mui.ajax(myAjaxJs.AJAX_SAVE_FEEDBACK.getUrl, { |
|
headers: { |
|
"X-Requested-Token": localStorage.getItem("user_token"), |
|
}, |
|
data: { |
|
userName: username, |
|
suggestion: data_info.text_area |
|
}, |
|
dataType: 'json', //服务器返回json格式数据 |
|
type: myAjaxJs.AJAX_SAVE_FEEDBACK.getType, //HTTP请求类型 |
|
timeout: 10000, |
|
success: function(data) { |
|
if(data.code == "200") { |
|
plus.nativeUI.closeWaiting(); |
|
mui.toast(data_info.dataBase.SubmitSuccessMsg, data_info.dataBase.AlertMsg); |
|
mui.back(); |
|
self.close(); |
|
} else if(data.code == "201" || data.code == "202") { //未登录 |
|
plus.nativeUI.closeWaiting(); |
|
mui.openWindow({ |
|
id: "mine/html/wallet_login.html", |
|
url: "../wallet_login.html" |
|
}); |
|
} else { |
|
plus.nativeUI.closeWaiting(); |
|
mui.alert(data.msg); |
|
} |
|
}, |
|
error: function(xhr, type, errorThrown) { |
|
plus.nativeUI.closeWaiting(); |
|
// mui.alert(data_info.dataBase.AjaxError2, data_info.dataBase.AlertMsg) |
|
} |
|
}); |
|
} |
|
|
|
|
|
appLanguageFun(); |
|
/** |
|
* 国际化方法 |
|
*/ |
|
function appLanguageFun() { |
|
var type = app.getLanguageLocalStorage(); |
|
require(['../../js/language/' + type], function(dataBase) { |
|
data_info.dataBase = dataBase; |
|
}) |
|
} |
|
</script> |