feedback.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="feedback-wrapper">
  3. <!-- #ifdef H5 -->
  4. <view class="goPage">
  5. <view class="iconfont icon-fanhui1 acea-row row-center-wrapper" @click="gotoPre"></view>
  6. </view>
  7. <!-- #endif -->
  8. <view class="head">
  9. <view class="left-wrapper">
  10. <view class="title">商城客服已离线</view>
  11. <view class="txt">{{feedback}}</view>
  12. </view>
  13. <view class="img-box"><image src="../static/feed-icon.png" mode=""></image></view>
  14. </view>
  15. <view class="main">
  16. <view class="title">我要反馈</view>
  17. <view class="input-box">
  18. <input type="text" placeholder="请输入您的姓名" v-model="name">
  19. </view>
  20. <view class="input-box">
  21. <input type="text" placeholder="请输入您的联系电话" v-model="phone">
  22. </view>
  23. <view class="input-box">
  24. <textarea type="text" placeholder="请填写内容" v-model="con" />
  25. </view>
  26. <view class="sub_btn" @click="subMit">提交</view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import { serviceFeedBack,feedBackPost } from '@/api/kefu.js'
  32. export default{
  33. name:'feedback',
  34. data(){
  35. return {
  36. name:'',
  37. phone:'',
  38. con:'',
  39. feedback:''
  40. }
  41. },
  42. onLoad(){
  43. this.getInfo()
  44. },
  45. onShow(){
  46. uni.removeStorageSync('form_type_cart');
  47. },
  48. methods:{
  49. // 返回上一页
  50. gotoPre(){
  51. uni.navigateBack();
  52. },
  53. getInfo(){
  54. serviceFeedBack().then(res=>{
  55. this.feedback = res.data.feedback
  56. })
  57. },
  58. subMit(){
  59. if(!this.name){
  60. return this.$util.Tips({
  61. title:'请填写姓名'
  62. })
  63. }
  64. if(!this.phone || !(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(this.phone))){
  65. return this.$util.Tips({
  66. title:'请填写正确的手机号码'
  67. })
  68. }
  69. if(!this.con){
  70. return this.$util.Tips({
  71. title:'请填写内容'
  72. })
  73. }
  74. feedBackPost({
  75. rela_name:this.name,
  76. phone:this.phone,
  77. content:this.con
  78. }).then(res=>{
  79. this.$util.Tips({
  80. title:res.msg,
  81. icon:'success'
  82. },{
  83. tab:3
  84. })
  85. }).catch(function(res) {
  86. that.$util.Tips({ title: res });
  87. });
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="stylus">
  93. .goPage{
  94. background-color #3A3A3A;
  95. padding 20rpx 0 0 20rpx;
  96. .icon-fanhui1{
  97. background-color #fff;
  98. color #333;
  99. width 50rpx;
  100. height 50rpx;
  101. border-radius 50%;
  102. font-size 20rpx
  103. }
  104. }
  105. .feedback-wrapper
  106. .head
  107. display flex
  108. align-items center
  109. justify-content space-between
  110. height 215rpx
  111. padding 0rpx 30rpx
  112. background-color #3A3A3A
  113. .left-wrapper
  114. width 456rpx
  115. color #fff
  116. font-size 24rpx
  117. .title
  118. margin-bottom 15rpx
  119. font-size 32rpx
  120. .img-box
  121. image
  122. width 173rpx
  123. height 156rpx
  124. .info
  125. display flex
  126. background-color #fff
  127. .info-item
  128. flex 1
  129. display flex
  130. flex-direction column
  131. align-items center
  132. justify-content center
  133. height 138rpx
  134. border-right 1px solid #F0F1F2
  135. &:last-child
  136. border:none
  137. .big-txt
  138. font-size 32rpx
  139. font-weight bold
  140. color #282828
  141. .small
  142. margin-top 10rpx
  143. font-size 24rpx
  144. color #9F9F9F
  145. .main
  146. margin-top 16rpx
  147. padding 30rpx 30rpx 68rpx
  148. background-color #FFF
  149. .title
  150. font-size 30rpx
  151. font-weight bold
  152. .input-box
  153. margin-top 20rpx
  154. input
  155. display block
  156. width 100%
  157. height 78rpx
  158. background #F5F5F5
  159. font-size 28rpx
  160. padding-left 20rpx
  161. textarea
  162. display block
  163. width 100%
  164. height 260rpx
  165. padding 20rpx
  166. background #F5F5F5
  167. font-size 28rpx
  168. .sub_btn
  169. margin-top 130rpx
  170. width 100%
  171. height 86rpx
  172. line-height 86rpx
  173. font-size 30rpx
  174. text-align center
  175. color #fff
  176. border-radius 43rpx
  177. background-color #3875EA
  178. </style>