tousu.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view class="main">
  3. <view class="top">
  4. <image src="../../static/index/img1.png" mode=""></image>
  5. </view>
  6. <view class="upload">
  7. <view class="title">
  8. <text class="title-item">投诉建议:</text>
  9. </view>
  10. <view class="upload-content">
  11. <textarea v-model="ComplaintContent" placeholder="说说你的问题,描述清楚问题解决更快哦~" maxlength="1000" class="upl" />
  12. </view>
  13. <view class="upload-content margin-top-sm">
  14. <input class="upl" style="height: 80rpx;" type="text" v-model="username" placeholder="请输入您的真实姓名" />
  15. </view>
  16. <view class="upload-content margin-top-sm">
  17. <input class="upl" style="height: 80rpx;" type="text" v-model="phone" placeholder="请输入您的手机号" />
  18. </view>
  19. <!-- <view class="prompt">
  20. 提交投诉后,24小时内会有专人联系解决,敬请谅解
  21. </view> -->
  22. <view class="sub" @click="submit">提交反馈</view>
  23. </view>
  24. <!-- <view class="footer">
  25. <view class="flex flex-direction align-start">
  26. <text style="color: #999999;">联系我们:</text>
  27. <view class="">
  28. <text class="cuIcon-mail text-gray" style="font-size: 32rpx;"></text>
  29. <text class="margin-left-sm">541417720@qq.com</text>
  30. </view>
  31. <view class="">
  32. <text class="cuIcon-phone text-gray" style="font-size: 32rpx;"></text>
  33. <text class="margin-left-sm">13676933748</text>
  34. </view>
  35. </view>
  36. </view> -->
  37. </view>
  38. </template>
  39. <script>
  40. // 注册一个进度条
  41. var _self;
  42. export default {
  43. name: 'Complaint',
  44. data() {
  45. return {
  46. percent:0,
  47. ComplaintContent:'',
  48. username:"",
  49. phone:""
  50. }
  51. },
  52. onLoad() {
  53. _self = this;
  54. },
  55. methods: {
  56. async submit(){
  57. console.log('123')
  58. if(this.ComplaintContent == (null || '')){
  59. uni.showToast({
  60. title: '请填写投诉信息' ,
  61. icon:"none"
  62. })
  63. return false
  64. }
  65. if(this.username==""){
  66. uni.showToast({
  67. title: '请输入姓名',
  68. icon:"none"
  69. })
  70. return false
  71. }
  72. if(this.phone==""){
  73. uni.showToast({
  74. title: '请输入手机号',
  75. icon:"none"
  76. })
  77. return false
  78. }
  79. let res = await this.$request.post('/api/Complaint/addComplaint',{
  80. content: this.ComplaintContent,
  81. name:this.username,
  82. phone:this.phone
  83. });
  84. if(res.code == 200){
  85. uni.showToast({
  86. title: '投诉成功',
  87. content: res.message
  88. })
  89. setTimeout(function() {
  90. uni.navigateBack();
  91. }, 2000);
  92. }else if(res.code == 10001){
  93. uni.showModal({
  94. title: '提示',
  95. content: '一个小时内只能提交一次',
  96. showCancel: false
  97. })
  98. }else if(res.code == 10002){
  99. uni.showToast({
  100. title: '请填写信息'
  101. })
  102. }else{
  103. uni.showToast({
  104. title: '投诉失败',
  105. content: res.message
  106. })
  107. }
  108. },
  109. }
  110. }
  111. </script>
  112. <style>
  113. .footer {
  114. display: flex;
  115. flex-direction: row;
  116. justify-content: flex-start;
  117. align-items: center;
  118. font-size: 28rpx;
  119. color: rgba(0, 0, 0, 0.7);
  120. text-align: center;
  121. /* height: 40rpx; */
  122. line-height: 40rpx;
  123. margin: 0 5vw;
  124. margin-top: 50rpx;
  125. }
  126. .footer text {
  127. font-size: 24rpx;
  128. }
  129. page{
  130. margin: 0;
  131. padding: 0;
  132. background: #f5f5f5;
  133. height: 100%;
  134. }
  135. .main{
  136. width: 100%;
  137. height: 100%;
  138. position: relative;
  139. margin-bottom: 55px;
  140. }
  141. .top{
  142. width: 100vw;
  143. height: 42vw;
  144. }
  145. .top image{
  146. width: 100%;
  147. height: 100%;
  148. padding: 10px;
  149. }
  150. .upload{
  151. width: 100%;
  152. height: auto;
  153. background: #fff;
  154. padding: 15px;
  155. }
  156. .upload .title{
  157. width: 100%;
  158. /* display: flex; */
  159. }
  160. .title, .prompt{
  161. margin: 10px 0;
  162. }
  163. .prompt{
  164. color: #555864;
  165. font-size: 25rpx;
  166. }
  167. .upload .title .title-item{
  168. flex-shrink: 0;
  169. font-size: 32rpx;
  170. font-weight: 400;
  171. font-family: PingFangSC-Regular, sans-serif;
  172. }
  173. .upload .upl{
  174. width: 100%;
  175. /* margin-left: calc( 10% - 7.5px ); */
  176. /* margin-top: 20px; */
  177. /* height: 100px; */
  178. border: 2px solid #f0f0f0;
  179. /* line-height: 100px; */
  180. /* text-align: center; */
  181. font-size: 14px;
  182. border-radius: 15px;
  183. padding: 10px;
  184. /* margin: 10px calc( 50% - 57px ); */
  185. }
  186. .upload .sub{
  187. height: 75rpx;
  188. line-height: 75rpx;
  189. text-align: center;
  190. color: #fff;
  191. background: #F1C554;
  192. border-radius: 30px;
  193. margin: 45rpx auto;
  194. width: 600rpx;
  195. background-color:rgb(251, 198, 0);
  196. box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);
  197. }
  198. .upload-content{
  199. display: flex;
  200. justify-content: content;
  201. align-items: center;
  202. }
  203. </style>