feedback.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view>
  3. <statusBar :item="navBarData"></statusBar>
  4. <view class="area">
  5. <textarea v-model.trim="cont" class="txt" maxlength='-1' placeholder="请输入您的反馈信息" />
  6. </view>
  7. <!-- 弹窗 -->
  8. <view>
  9. <view class="mask" v-show="showPopup" @click="closePopup"></view>
  10. <view class="popup-container" v-show="showPopup">
  11. <view class="popup">
  12. <view class="header">
  13. <text>确认提交</text>
  14. </view>
  15. <view class="footer">
  16. <view class="cancel-btn" @click="showPopup=false">取消</view>
  17. <view class="confirm-btn" @click="conf">确认</view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <button class="btn" @click="popShow">提交</button>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. navBarData: {
  30. title: "反馈与帮助", //导航栏标题
  31. btn: 1, //是否显示返回按钮 0不显示 1 显示
  32. },
  33. cont: '',
  34. showPopup: false
  35. };
  36. },
  37. methods: {
  38. popShow() {
  39. if (!this.cont) {
  40. uni.showToast({
  41. title: '请先填写反馈信息',
  42. icon: 'none'
  43. });
  44. } else {
  45. this.showPopup = true
  46. }
  47. },
  48. conf() {
  49. let data = {
  50. oid: this.$store.state.user.openid,
  51. cont: encodeURIComponent(this.cont)
  52. }
  53. this.$request('/insertFeedback', 'POST', data).then(res => {
  54. uni.showToast({
  55. title: '提交成功,感谢您的反馈',
  56. icon: 'none'
  57. });
  58. this.cont = ''
  59. this.showPopup = false
  60. })
  61. }
  62. }
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .btn {
  67. background-color: #0056a8;
  68. color: #ffffff;
  69. border-radius: 30px;
  70. margin: 30rpx 55rpx;
  71. // padding: 10rpx 0;
  72. display: flex;
  73. align-items: center;
  74. justify-content: center;
  75. margin-top: 30rpx;
  76. // padding: 0rpx 10rpx;
  77. font-size: 16px;
  78. }
  79. .mask {
  80. position: fixed;
  81. top: 0;
  82. left: 0;
  83. width: 100%;
  84. height: 100%;
  85. background-color: rgba(0, 0, 0, 0.3);
  86. z-index: 999;
  87. overflow: hidden;
  88. // display: none;
  89. }
  90. .popup {
  91. width: 100%;
  92. height: 100%;
  93. display: flex;
  94. flex-direction: column;
  95. background-color: #fff;
  96. border-radius: 16rpx;
  97. overflow: hidden;
  98. .header {
  99. flex: 1;
  100. display: flex;
  101. justify-content: center;
  102. align-items: center;
  103. flex-direction: column;
  104. margin-top: 24px;
  105. font-size: 34rpx;
  106. font-weight: 600;
  107. .imgShade {
  108. width: 170rpx;
  109. height: 170rpx;
  110. display: flex;
  111. justify-content: center;
  112. align-items: center;
  113. border: 10rpx #0056A8 solid;
  114. border-radius: 50%;
  115. box-shadow: 0 0 10rpx #0056A8;
  116. margin-bottom: 10rpx;
  117. }
  118. image {
  119. width: 150rpx;
  120. height: 150rpx;
  121. margin-top: 15px;
  122. margin-bottom: 15px;
  123. }
  124. }
  125. .footer {
  126. width: 100%;
  127. display: flex;
  128. overflow: hidden;
  129. .cancel-btn {
  130. width: 50%;
  131. height: 100rpx;
  132. background-color: #F7F7F7;
  133. color: #000;
  134. font-size: 34rpx;
  135. text-align: center;
  136. border-bottom-left-radius: 16rpx;
  137. line-height: 50px;
  138. }
  139. .confirm-btn {
  140. width: 50%;
  141. height: 100rpx;
  142. background-color: #0081FE;
  143. color: #fff;
  144. font-size: 34rpx;
  145. text-align: center;
  146. line-height: 50px;
  147. }
  148. }
  149. }
  150. .area {
  151. margin-top: 10px;
  152. box-sizing: border-box;
  153. padding: 15rpx;
  154. background-color: #ffffff;
  155. }
  156. .txt {
  157. width: 100%;
  158. height: 60vh;
  159. }
  160. </style>