feedBack.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="">
  3. <view class="border">
  4. <!-- <view class="list">
  5. <view class="title">
  6. 标题:
  7. </view>
  8. <view class="put">
  9. <input type="text" value="" placeholder="清晰完整的标题会更快被解答" placeholder-class="place" class="put1" />
  10. </view>
  11. </view> -->
  12. <view class="list">
  13. <view class="title">
  14. <text class="xing">*</text>反馈问题:
  15. </view>
  16. </view>
  17. <view class="put">
  18. <textarea value="" placeholder="在此输入您想反馈的问题" placeholder-class="place" class="put2" v-model="content" />
  19. </view>
  20. <view class="list">
  21. <view class="title">
  22. <text class="xing">*</text>联系方式:
  23. </view>
  24. </view>
  25. <view class="put">
  26. <input type="text" value="" placeholder="输入手机号" placeholder-class="place" class="put1" v-model="mobile"/>
  27. </view>
  28. </view>
  29. <view class="bottom-bt">
  30. <view class="bt" @click="submit">
  31. 提交
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default{
  38. data(){
  39. return{
  40. content:"",
  41. mobile:""
  42. }
  43. },
  44. methods:{
  45. submit(){
  46. var phone=/^1(3|4|5|6|7|8|9)\d{9}$/;
  47. if(!this.content){
  48. uni.showToast({
  49. title:'请输入您要反馈的问题',
  50. icon:'none'
  51. })
  52. }
  53. else if(!this.mobile){
  54. uni.showToast({
  55. title:'电话号码不能为空',
  56. icon:'none'
  57. })
  58. }
  59. else if(!phone.test(this.mobile)){
  60. console.log('正确')
  61. uni.showToast({
  62. title:'电话号码格式错误',
  63. icon:'none'
  64. })
  65. }else{
  66. uni.request({
  67. url: 'http://epidemic.site.ximengnaikang.com/api/v1/retroaction', //仅为示例,并非真实接口地址。
  68. method: 'POST',
  69. data:{
  70. body:this.content,
  71. mobile:this.mobile
  72. },
  73. success: (res) => {
  74. console.log(res,"oooo")
  75. if(res.data.code ==200){
  76. uni.showToast({
  77. title:"提交成功",
  78. icon:'none'
  79. })
  80. }else{
  81. uni.showToast({
  82. title:res.message,
  83. icon:'none'
  84. })
  85. }
  86. }
  87. })
  88. }
  89. }
  90. }
  91. }
  92. </script>
  93. <style>
  94. page {
  95. height: 100vh;
  96. }
  97. .border {
  98. height: 100vh;
  99. /* padding-bottom: 70upx; */
  100. /* position: relative; */
  101. }
  102. .xing{
  103. color: red;font-size: 28upx;
  104. font-weight: 550;
  105. margin-right: 10upx;
  106. }
  107. .border{
  108. padding: 30upx;
  109. }
  110. .list{
  111. /* display: flex; */
  112. /* margin-top: 30upx; */
  113. height: 100upx;
  114. line-height: 100upx;
  115. line-height:84upx ;
  116. }
  117. .title{
  118. display: inline-block;
  119. vertical-align: middle;
  120. font-size:32upx;
  121. font-weight: 500;
  122. color: #333333;
  123. opacity: 1;
  124. }
  125. .put1{
  126. height: 84upx;
  127. line-height: 84upx;
  128. background-color: #F7F7F7;
  129. padding-left: 30upx;
  130. }
  131. .place{
  132. font-size: 28upx;
  133. font-weight: 400;
  134. color: #999999;
  135. opacity: 1;
  136. }
  137. .put2{
  138. min-height: 400upx;
  139. background-color: #F7F7F7;
  140. font-size: 28upx;
  141. padding:15upx;
  142. width: auto;
  143. }
  144. .bottom-bt {
  145. padding: 10upx 0;
  146. width: 100%;
  147. position: fixed;
  148. bottom: 0;
  149. height:100upx;
  150. display: flex;
  151. background-color: #FFFFFF;
  152. z-index: 999;
  153. border-top: solid 4upx #EEEEEE;
  154. }
  155. .bt{
  156. width: 60%;
  157. height: 80upx;
  158. line-height: 80upx;
  159. background-color: #23459D;
  160. color: #FFFFFF;
  161. font-size: 32upx;
  162. text-align: center;
  163. margin-left: 20%;
  164. border-radius: 40upx;
  165. }
  166. </style>