feedback.vue 3.2 KB

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