Nenhuma Descrição

feedback.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. mui.ready(function() {
  2. var feedbackCon = document.getElementById("question");
  3. var sendBtn = document.querySelector('.tijiao');
  4. /*提交反馈*/
  5. function sendFeedBack(userid){
  6. mui.ajax(baseUrl+'',{
  7. data:{
  8. },
  9. dataType:'json',//服务器返回json格式数据
  10. type:'post',//HTTP请求类型
  11. timeout:10000,//超时时间设置为10秒;
  12. success:function(data){
  13. },
  14. error:function(xhr,type,errorThrown){
  15. mui.toast('反馈失败');
  16. }
  17. });
  18. };
  19. /*反馈字数限制*/
  20. function checkLen(obj) {
  21. var maxChars = 500;//最多字符数
  22. if (obj.value.length > maxChars) {
  23. obj.value = obj.value.substring(0,maxChars);
  24. }
  25. var curr = maxChars - obj.value.length;
  26. document.getElementById("count").innerHTML = curr.toString();
  27. };
  28. feedbackCon.addEventListener('keyup',function(){
  29. checkLen(feedbackCon);
  30. });
  31. mui.plusReady(function() {
  32. var self = plus.webview.currentWebview();
  33. var userId = self.userId;
  34. console.log(userId);
  35. sendBtn.addEventListener('tap',function(){
  36. // sendFeedBack(userId);
  37. });
  38. });
  39. });