device-reback.js 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. (function() {
  2. Vue.component('device-reback', {
  3. template: `<div>
  4. <h3 class="pt40 pb20 pl30 pr40 m0 mb30 c-f16 c-border-b clearfix">意见反馈<span class="fr c-f14 c-0ad8c8 f-w400" @click="record()">反馈记录</span></h3>
  5. <div class="edit-question" v-if="!isRecord && isQuestion">
  6. <div class="question-form pl20 pr50">
  7. <h4 class="c-909090 f-w400 m0 mb30 txt-center" v-if="!isEdit">hi~你发现了什么问题?</h4>
  8. <ul class="container-fluid p0 mb20 clearfix">
  9. <li v-if="isEdit" class="fl question-li mr30">
  10. <div class="question-li-div c-323232 c-f14 txt-center select-active">功能优化</div>
  11. </li>
  12. <li v-if="!isEdit" class="fl question-li mr30" v-for="list in questionArr" :key="list.code">
  13. <div class="question-li-div c-323232 c-f14 txt-center" :class="{'select-active': judgeSelectIndex == list.code}" @click="select(list.code)">{{list.name}}</div>
  14. <p class="c-909090 m0 mt5 c-f12 txt-center">{{list.detail}}</p>
  15. </li>
  16. </ul>
  17. <div class="suggestcss">
  18. <label class="">问题&建议<span class="c-f00">*</span></label>
  19. <p class="c-position-r m0" v-if="!isEdit">
  20. <textarea @input="limit" class="form-control" placeholder="请描述您在使用过程中遇到的问题或建议,如果遇到功能异常,上传异常页面截图能更快解决哦~"></textarea>
  21. <span class="limit c-909090">最多300字</span>
  22. </p>
  23. <p class="c-position-r m0" v-if="isEdit">
  24. <textarea @input="limit" readonly class="form-control" placeholder="请描述您在使用过程中遇到的问题或建议,如果遇到功能异常,上传异常页面截图能更快解决哦~"></textarea>
  25. <span class="limit c-909090">最多300字</span>
  26. </p>
  27. </div>
  28. <div class="h100 mtb20">
  29. <div class="fl set-img mr20 c-position-r" v-if="quesImg.length > 0" v-for="(imgs, key) in quesImg" :key="key">
  30. <img src="imgs.src" \>
  31. <span class="delete-img" v-if="!isEdit" @click="remove(key)"></span>
  32. </div>
  33. <div v-if="isEdit ? !isEdit : quesImg.length < 4" class="fl img-add mr20">
  34. <input type="file" @change="uploadImg()" class="fl set-img type-hide" accept="image/jpg,image/jpeg,image/png">
  35. </div>
  36. <span class="fl pt40 c-909090">(选填,图片最多可传4张)</span>
  37. </div>
  38. <div v-if="isEdit">
  39. <label class="">答复内容</label>
  40. <p class="c-position-r m0">
  41. <textarea readonly="true" class="form-control" placeholder="请描述您在使用过程中遇到的问题或建议,如果遇到功能异常,上传异常页面截图能更快解决哦~"></textarea>
  42. <span class="limit c-909090">最多300字</span>
  43. </p>
  44. </div>
  45. <p class="form-group mt10 clearfix" v-if="!isEdit">
  46. <input class="fl mr10 form-control" placeholder="请输入您的手机号码(必填)" /><span class="c-323232 c-f14">请留下您的联系方式,管理员会尽快为您找到解决方案</span>
  47. </p>
  48. <div class="pt20">
  49. <span v-if="!isEdit" class="btn" @click="submit()">提&emsp;交</span>
  50. <span v-if="isEdit" class="btn" @click="backRecord()">返&emsp;回</span>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="finish-device txt-center" v-if="!isRecord && !isQuestion">
  55. <h3 class="device-success">意见反馈已完成</h3>
  56. <p class="c-909090 c-f18">您可以在反馈记录查看意见进展</p>
  57. <div class="pt30">
  58. <span class="btn" @click="back()">返&emsp;回</span>
  59. </div>
  60. </div>
  61. <div v-if="isRecord">
  62. <ul class="list-record pl30 c-f14 m0">
  63. <li v-if="recordList.length == 0" class="txt-center">暂无反馈记录</li>
  64. <li v-if="recordList.length > 0" class="c-border-b ptb10 clearfix" v-for="(list, index) in recordList" :key="index">
  65. <span class="fl c-fff list-tap pr5 mr20">{{list.tit}}</span>
  66. <p class="fl c-909090 list-detail m0">{{list.detail}}</p>
  67. <span class="fl list-status mr30" :class="{'list-status-active':list.status == 1}">{{list.status == 1 ? "已答复" : '未处理'}}</span>
  68. <span class="fl list-view pr20 c-0ad8c8" @click="view(list)">查看</span>
  69. </li>
  70. </ul>
  71. <div v-if="recordList.length == 0">
  72. <span class="btn" @click="back()">返&emsp;回</span>
  73. </div>
  74. <div class="mt15 h30 pr30 txt-center clearfix" v-if="recordList.length > 0">
  75. <div class="fr ml10 clearfix">
  76. <span class="fl c-border-tb c-border-l page-btn-input m0"><input class="fl c-888 page-input" v-model="editPage" /></span><span class="fr c-f12 btn page-btn page-btn-sure" @click="setPage(editPage)">确定</span>
  77. </div>
  78. <span class="fr btn page-btn" @click="setPage(page + 2)" v-if="page == 1">{{page + 2}}</span>
  79. <span class="fr btn page-btn" @click="setPage(page + 1)">{{page + 1}}</span>
  80. <span class="fr btn page-btn page-btn-active">{{page}}</span>
  81. <span class="fr btn page-btn" @click="setPage(page - 1)" v-if="page != 1">{{page - 1}}</span>
  82. </div>
  83. </div>
  84. </div>`,
  85. props: [],
  86. data: function() {
  87. return {
  88. isQuestion: true,
  89. isRecord: false,
  90. isEdit: false,
  91. judgeSelectIndex: null,
  92. questionArr: [{
  93. name: "功能异常",
  94. detail: "举例:无法使用功能",
  95. code: "1"
  96. },{
  97. name: "功能优化",
  98. detail: "举例:不好用、界面难看",
  99. code: "2"
  100. },{
  101. name: "新功能建议",
  102. detail: "你希望有什么功能?",
  103. code: "3"
  104. },{
  105. name: "其他",
  106. detail: "举例:身份信息丢失",
  107. code: "4"
  108. }],
  109. quesImg: [{src: '../../../images/bg.png'}],
  110. recordList: [{
  111. tit: "功能异常",
  112. detail: "是啥东西爱尔家圣诞节哦按时大多数萨达阿达擦擦擦市场擦拭菜市场大神擦拭的",
  113. status: "1"
  114. },{
  115. tit: "功能异常",
  116. detail: "是啥东西爱尔家圣诞节哦按时大多数萨达阿达擦擦擦市场擦拭菜市场大神擦拭的",
  117. status: "1"
  118. },{
  119. tit: "功能异常",
  120. detail: "是啥东西爱尔家圣诞节哦按时大多数萨达阿达擦擦擦市场擦拭菜市场大神擦拭的",
  121. status: "0"
  122. },{
  123. tit: "功能异常",
  124. detail: "是啥东西爱尔家圣诞节哦按时大多数萨达阿达擦擦擦市场擦拭菜市场大神擦拭的",
  125. status: "1"
  126. },{
  127. tit: "功能异常",
  128. detail: "是啥东西爱尔家圣诞节哦按时大多数萨达阿达擦擦擦市场擦拭菜市场大神擦拭的",
  129. status: "1"
  130. },{
  131. tit: "功能异常",
  132. detail: "是啥东西爱尔家圣诞节哦按时大多数萨达阿达擦擦擦市场擦拭菜市场大神擦拭的",
  133. status: "0"
  134. },{
  135. tit: "功能异常",
  136. detail: "是啥东西爱尔家圣诞节哦按时大多数萨达阿达擦擦擦市场擦拭菜市场大神擦拭的",
  137. status: "1"
  138. },{
  139. tit: "功能异常",
  140. detail: "是啥东西爱尔家圣诞节哦按时大多数萨达阿达擦擦擦市场擦拭菜市场大神擦拭的",
  141. status: "1"
  142. },{
  143. tit: "功能异常",
  144. detail: "是啥东西爱尔家圣诞节哦按时大多数萨达阿达擦擦擦市场擦拭菜市场大神擦拭的",
  145. status: "0"
  146. },{
  147. tit: "功能异常",
  148. detail: "是啥东西爱尔家圣诞节哦按时大多数萨达阿达擦擦擦市场擦拭菜市场大神擦拭的",
  149. status: "0"
  150. }],
  151. page: 1,
  152. editPage: null
  153. }
  154. },
  155. methods: {
  156. select: function(key) {
  157. if(this.judgeSelectIndex == key) {
  158. this.judgeSelectIndex = null
  159. } else {
  160. this.judgeSelectIndex = key
  161. }
  162. },
  163. record: function() {
  164. this.isRecord = true
  165. },
  166. limit: function() {},
  167. remove: function(key) {
  168. this.quesImg.splice(key, 1)
  169. },
  170. submit: function() {
  171. this.isQuestion = false
  172. },
  173. back: function() {
  174. this.isQuestion = true
  175. this.isRecord = false
  176. },
  177. setPage: function(key) {
  178. if(+key) {
  179. this.page = +key
  180. } else {
  181. alert(key)
  182. }
  183. },
  184. view: function(list) {
  185. this.isRecord = false
  186. this.isQuestion = true
  187. this.isEdit = true
  188. },
  189. backRecord: function() {
  190. this.isRecord = true
  191. this.isQuestion = false
  192. this.isEdit = false
  193. }
  194. }
  195. })
  196. })()