opinion1.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template style=" background-color: #FFFFFF">
  2. <view style="height: 100%;width: 100%;background-color: #FFFFFF">
  3. <view style="width: 100vw;height: 100vh;">
  4. <view style="height: 20rpx;w^idth: 100%;background-color: #F6F6F6;"></view>
  5. <!-- 标题 -->
  6. <view class="title">请描述您遇到的问题</view>
  7. <!-- 问题列表 -->
  8. <view class="textArea">
  9. <view class="body">
  10. <textarea placeholder="请描述您遇到的问题" maxlength="200" @input="input" style="font-size: 28rpx;color: #666666;height: 250rpx;width: 100%;" />
  11. <view style="height: 68rpx;width: 100%;color:#999999;padding: 20rpx 30rpx;font-size: 28rpx;text-align: right;">
  12. <text>{{problem_lenght}}</text>/200
  13. </view>
  14. </view>
  15. </view>
  16. <view style="width: 100%;padding:40rpx 30rpx 0 30rpx;font-size: 26rpx;color: #999999;">请详细描述您的问题或建议,我们将及时跟你并解决。</view>
  17. <view class="footer">
  18. <view style="width: 100%;text-align: center;padding-bottom: 35rpx;">
  19. <text style="color: #999999;font-size: 24rpx;">如有疑问,请联系客服\n08:30-22:00</text>
  20. </view>
  21. <view class="cu-bar bg-white tabbar border shop" style="width: 100%;">
  22. <view class="submit" @click="next" style="background-color: #0B73B9; color: #FFFFFF; font-size: 32rpx;" >提交反馈</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. problem:'',
  33. problem_lenght:'0'
  34. }
  35. },
  36. methods:{
  37. //输入问题
  38. input(e){
  39. this.problem = e.detail.value
  40. this.problem_lenght = this.problem.length
  41. console.log(this.problem);
  42. console.log(this.problem_lenght);
  43. },
  44. next:async function(){
  45. if(this.problem_lenght>200){
  46. uni.showToast({
  47. title:"最多只能输入200个字符",
  48. icon:"none"
  49. })
  50. return false
  51. }
  52. let res = await this.$request.post("/api/v1/feedback/sumitFeedback",{
  53. content:this.problem
  54. })
  55. console.log(res)
  56. if(res.status == 0){
  57. uni.showToast({
  58. title:"提交成功",
  59. icon:"none",
  60. duration:1500
  61. })
  62. setTimeout(()=>{
  63. uni.navigateBack({
  64. delta:1
  65. })
  66. },1500)
  67. }else{
  68. uni.showToast({
  69. title:res.message,
  70. icon:"none",
  71. })
  72. }
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss">
  78. .title {
  79. background-color: #FFFFFF;
  80. height: auto;
  81. display: flex;
  82. align-items: center;
  83. padding: 30rpx 30rpx;
  84. font-size: 30rpx;
  85. font-weight: bold;
  86. }
  87. .textArea {
  88. height: auto;
  89. width: 100%;
  90. padding: 0 30rpx;
  91. background-color: #FFFFFF;
  92. .body {
  93. width: 100%;
  94. height: auto;
  95. padding: 35rpx 20rpx;
  96. word-break: break-all;
  97. word-wrap: break-word;
  98. background: #F6F6F6;
  99. border-radius: 10rpx;
  100. }
  101. }
  102. .footer {
  103. width: 100%;
  104. height: auto;
  105. display: block;
  106. position: fixed;
  107. bottom: 0;
  108. }
  109. </style>