user-feedback.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>意见反馈-爽客邦</title>
  6. <meta name="keywords" content="意见反馈-爽客邦">
  7. <meta name="description" content="意见反馈-爽客邦">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="意见反馈-爽客邦">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body class="bgc-back">
  18. <div id="app">
  19. <van-nav-bar class="user_rank_explan_title user_title_normal" left-arrow title="我要反馈" v-if="toptitleisshow" @click-left="goback">
  20. <template #left> <img src="./static/images/left.png" alt=""></template>
  21. </van-nav-bar>
  22. <div class="bt8f7f7f7 bb8f7f7f7 tc" v-cloak>
  23. <van-field v-model="message" rows="5" autosize type="textarea" maxlength="50" placeholder="请输入您的问题或者建议(字数不多余50个汉字)" show-word-limit @input="checkValue"></van-field>
  24. </div>
  25. <van-cell-group class="feedback" :border="false" v-cloak>
  26. <van-cell class="bb8f7f7f7" title="是否需要电话回复" value="">
  27. <template #right-icon>
  28. <van-checkbox v-model="needCall" icon-size=".426667rem" checked-color="#FF5A32"></van-checkbox>
  29. </template>
  30. </van-cell>
  31. <van-cell title="反馈类型:" :border="false">
  32. <template #label>
  33. <div class="pt16">
  34. <van-button class="border" v-for="item,index in typeTags" plain hairline size="small" @click="chooseTag(item)" :class="item.Id == curTag ? 'feedbackclickbtn' : ''">{{item.Name}}</van-button>
  35. </div>
  36. </template>
  37. </van-cell>
  38. </van-cell-group>
  39. <div class="pt16 pl16 pr16">
  40. <van-button class="border_radius8" type="primary" block :disabled="canSubmit ? false : true" color="#FF502A" @click="submitfeedback">提交</van-button>
  41. </div>
  42. </div>
  43. <script src="./static/js/klm-vv.min.js"></script>
  44. <script src="./static/js/klm-axios-config.js"></script>
  45. <script>
  46. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  47. // 可以通过下面的方式手动注册
  48. Vue.use(vant.Lazyload);
  49. // 在 #app 标签下渲染一个按钮组件
  50. let app = new Vue({
  51. el: '#app',
  52. data() {
  53. return {
  54. toptitleisshow:false,
  55. active: 0,
  56. canSubmit: false,
  57. message: '',
  58. needCall: true,
  59. curTag: 0,
  60. typeTags: [
  61. ],
  62. };
  63. },
  64. created() {
  65. this.toptitleisshow = toptitleisshow;
  66. this.getfeedtype();
  67. },
  68. watch:{
  69. message:function(){
  70. this.checkValue();
  71. }
  72. },
  73. methods: {
  74. chooseTag(item){
  75. this.curTag = item.Id;
  76. },
  77. checkValue(){
  78. this.canSubmit = (this.message !== '' ) ? true : false;
  79. },
  80. //- 获取反馈类型
  81. async getfeedtype(){
  82. const res = await getRequest('/api/v1/userbackkind/list',JSON.stringify({value:'',PageNum:1,PageSize:10}));
  83. if(res.status === '1') {
  84. if(res.data.length !== 0){
  85. this.typeTags = res.data;
  86. }else{
  87. this.typeTags = [{Id:1,Name:'基础类型'}];
  88. };
  89. this.curTag = this.typeTags[0].Id;
  90. }
  91. },
  92. //- async submitfeedback(){
  93. //- const Id = PublicLib.getCookieInfo('userId');
  94. //- this.needCall = this.needCall? 1:0;
  95. //- const res = await postRequest('/api/v1/userback/add',JSON.stringify({UserId:Id,Content:this.message,IsPhoneCallBack:this.needCall,BackKind:this.curTag}));
  96. //- if(res.status === 1) tips('提交反馈成功!')
  97. //- },
  98. submitfeedback:undebounce(async function(){
  99. if(this.message === '') return tips('请填写反馈内容');
  100. const Id = PublicLib.getCookieInfo('userId');
  101. this.needCall = this.needCall? 1:0;
  102. const res = await postRequest('/api/v1/userback/add',JSON.stringify({UserId:Id,Content:this.message,IsPhoneCallBack:this.needCall,BackKind:this.curTag}));
  103. if(res.status !== '1') return tips(res.info);
  104. tips('提交反馈成功!');
  105. this.message = '';
  106. }),
  107. goback(){
  108. PublicLib.GoBack({Level:1});
  109. }
  110. }
  111. });
  112. </script>
  113. </body>
  114. </html>