You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
2.7 KiB

4 years ago
  1. <template>
  2. <view class="app">
  3. <view class="page-tip row">
  4. <text>问题和建议</text>
  5. </view>
  6. <view class="textarea-wrap">
  7. <textarea maxlength="150" v-model="content" placeholder="请详细描述您的问题和意见 .." placeholder-style="color:#999" />
  8. </view>
  9. <view class="page-tip row">
  10. <text>相关图片选填</text>
  11. </view>
  12. <view class="upload-wrap">
  13. <mix-upload-image ref="mixUploadImage" :length="4"></mix-upload-image>
  14. </view>
  15. <view class="page-tip row" style="padding-top: 0;height: 70rpx;">
  16. <text>联系人</text>
  17. </view>
  18. <input v-model="name" class="input-cell" type="text" maxlength="8" placeholder="请留下您的姓名或称呼" placeholder-style="color:#999" />
  19. <view class="page-tip row">
  20. <text>联系方式</text>
  21. </view>
  22. <input v-model="mobile" class="input-cell" type="number" maxlength="11" placeholder="请输入您的手机号码" placeholder-style="color:#999" />
  23. <mix-button ref="confirmBtn" text="提交" marginTop="80rpx" @onConfirm="confirm"></mix-button>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. data() {
  29. return {
  30. content: '',
  31. name: '',
  32. mobile: '',
  33. }
  34. },
  35. methods: {
  36. async confirm(){
  37. const {content, name, mobile} = this;
  38. if(!content){
  39. this.$util.msg('请输入您的问题或建议');
  40. this.$refs.confirmBtn.stop();
  41. return;
  42. }
  43. if(!name){
  44. this.$util.msg('请输入您的姓名或称呼');
  45. this.$refs.confirmBtn.stop();
  46. return;
  47. }
  48. if(!mobile){
  49. this.$util.msg('请输入您的手机号码,以便我们与您联系');
  50. this.$refs.confirmBtn.stop();
  51. return;
  52. }
  53. const data = {
  54. content,
  55. name,
  56. mobile,
  57. images: this.$refs.mixUploadImage.imageList.map(item=> item.url)
  58. }
  59. const res = await this.$request('feedback', 'add', data);
  60. this.$util.msg(res.msg);
  61. this.$refs.confirmBtn.stop();
  62. if(res.status == 1){
  63. setTimeout(()=>{
  64. uni.navigateBack();
  65. }, 1000)
  66. }
  67. }
  68. }
  69. }
  70. </script>
  71. <style scoped lang="scss">
  72. .app{
  73. padding: 0 34rpx 40rpx;
  74. }
  75. .page-tip{
  76. height: 80rpx;
  77. padding: 8rpx 6rpx 0;
  78. font-size: 26rpx;
  79. color: #666;
  80. }
  81. .textarea-wrap{
  82. padding: 20rpx;
  83. background-color: #f7f7f7;
  84. border-radius: 12rpx;
  85. textarea{
  86. width: 100%;
  87. height: 200rpx;
  88. font-size:30rpx;
  89. color: #333;
  90. line-height: 1.4;
  91. }
  92. }
  93. .upload-wrap{
  94. padding-top: 0;
  95. /deep/ {
  96. .upload-content{
  97. background-color: #fff;
  98. }
  99. }
  100. }
  101. .input-cell{
  102. padding: 0 30rpx;
  103. height: 88rpx;
  104. line-height: 88rpx;
  105. font-size:28rpx;
  106. color: #333;
  107. background-color: #f7f7f7;
  108. border-radius: 12rpx;
  109. }
  110. </style>