feedback.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <s-layout class="set-wrap" title="问题反馈">
  3. <uni-forms ref="form" :modelValue="state.formData" border>
  4. <view class="bg-white type-box ss-p-x-20 ss-p-y-30">
  5. <view class="title ss-m-b-44">请选择类型</view>
  6. <view class="ss-m-l-12">
  7. <radio-group @change="radioChange">
  8. <label
  9. class="ss-flex ss-col-center ss-m-b-40"
  10. v-for="item in state.radioList"
  11. :key="item.type"
  12. >
  13. <radio :value="item.type" color="var(--ui-BG-Main)" style="transform: scale(0.8)" />
  14. <view class="radio-subtitle">{{ item.type }}</view>
  15. </label>
  16. </radio-group>
  17. </view>
  18. </view>
  19. <view class="bg-white ss-p-x-20 ss-p-y-30 ss-m-t-20">
  20. <view class="title ss-m-b-30"> 相关描述 </view>
  21. <view class="textarea">
  22. <uni-easyinput
  23. :inputBorder="false"
  24. type="textarea"
  25. v-model="state.formData.content"
  26. placeholderStyle="color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
  27. placeholder="客官~请描述您遇到的问题,建议上传照片"
  28. clearable
  29. ></uni-easyinput>
  30. <s-uploader
  31. v-model:url="state.formData.images"
  32. fileMediatype="image"
  33. limit="9"
  34. mode="grid"
  35. :imageStyles="{ width: '168rpx', height: '168rpx' }"
  36. ></s-uploader>
  37. </view>
  38. </view>
  39. <view class="bg-white ss-p-x-20 ss-p-y-30 ss-m-t-20">
  40. <view class="title ss-m-b-30"> 联系方式 </view>
  41. <view class="mobile-box">
  42. <uni-easyinput
  43. :inputBorder="false"
  44. type="number"
  45. v-model="state.formData.phone"
  46. paddingLeft="10"
  47. placeholder="请输入您的联系电话"
  48. />
  49. </view>
  50. </view>
  51. </uni-forms>
  52. <su-fixed bottom placeholder>
  53. <view class="ss-flex ss-row-between ss-p-x-30 ss-p-y-10">
  54. <button class="kefu-btn ss-reset-button" @tap="sheep.$router.go('/pages/chat/index')">
  55. 联系客服
  56. </button>
  57. <button class="submit-btn ss-reset-button ui-BG-Main ui-Shadow-Main" @tap="onSubmit">
  58. 提交
  59. </button>
  60. </view>
  61. </su-fixed>
  62. </s-layout>
  63. </template>
  64. <script setup>
  65. import { onLoad } from '@dcloudio/uni-app';
  66. import { computed, reactive, ref, unref } from 'vue';
  67. import sheep from '@/sheep';
  68. const filesRef = ref(null);
  69. const state = reactive({
  70. radioList: [
  71. {
  72. type: '产品功能问题反馈',
  73. },
  74. {
  75. type: '建议及意见反馈',
  76. },
  77. {
  78. type: '投诉客服其他问题',
  79. },
  80. ],
  81. formData: {
  82. content: '',
  83. phone: '',
  84. images: [],
  85. type: '',
  86. },
  87. imageFiles: [],
  88. current: 0,
  89. });
  90. async function onSubmit() {
  91. if (!state.formData.type) {
  92. sheep.$helper.toast('请选择类型');
  93. return;
  94. }
  95. if (!state.formData.content) {
  96. sheep.$helper.toast('请描述您遇到的问题');
  97. return;
  98. }
  99. if (!state.formData.phone) {
  100. sheep.$helper.toast('请输入您的联系方式');
  101. return;
  102. }
  103. const { error } = await sheep.$api.app.feedback(state.formData);
  104. if (error === 0) {
  105. sheep.$router.back();
  106. }
  107. }
  108. function radioChange(e) {
  109. state.formData.type = e.detail.value;
  110. }
  111. </script>
  112. <style lang="scss" scoped>
  113. .type-box {
  114. border-top: 2rpx solid #f9fafb;
  115. }
  116. .uni-forms {
  117. width: 100%;
  118. }
  119. .title {
  120. font-size: 30rpx;
  121. font-weight: bold;
  122. color: #333333;
  123. line-height: normal;
  124. }
  125. :deep() {
  126. .uni-easyinput__placeholder-class {
  127. color: #bbbbbb !important;
  128. font-size: 28rpx !important;
  129. font-weight: 400 !important;
  130. line-height: normal !important;
  131. }
  132. .uni-forms-item__label .label-text {
  133. font-size: 28rpx !important;
  134. color: #333333 !important;
  135. line-height: normal !important;
  136. }
  137. .uni-list-item__content-title {
  138. font-size: 28rpx !important;
  139. color: #333333 !important;
  140. line-height: normal !important;
  141. }
  142. .uni-easyinput__content-textarea {
  143. font-size: 28rpx !important;
  144. color: #333333 !important;
  145. line-height: normal !important;
  146. margin-top: 4rpx !important;
  147. padding-left: 20rpx !important;
  148. }
  149. .uni-icons {
  150. font-size: 40rpx !important;
  151. }
  152. .icon-del-box {
  153. width: 32rpx;
  154. height: 32rpx;
  155. top: 0;
  156. right: 0;
  157. .icon-del {
  158. width: 24rpx;
  159. }
  160. }
  161. }
  162. .radio-subtitle {
  163. font-size: 28rpx;
  164. font-weight: 500;
  165. color: #333333;
  166. line-height: 42rpx;
  167. }
  168. .textarea {
  169. min-height: 322rpx;
  170. background: #f9fafb;
  171. border-radius: 20rpx;
  172. padding: 20rpx;
  173. margin: 30rpx 20rpx 46rpx 0;
  174. .area {
  175. height: 238rpx;
  176. font-size: 26rpx;
  177. font-weight: 500;
  178. color: #333;
  179. line-height: 50rpx;
  180. width: 100%;
  181. }
  182. .pl-style {
  183. font-size: 24rpx;
  184. color: #b1b3c7;
  185. font-weight: 500;
  186. }
  187. }
  188. .mobile-box {
  189. background: #f9fafb;
  190. border-radius: 20rpx;
  191. }
  192. .submit-btn {
  193. width: 334rpx;
  194. height: 74rpx;
  195. border-radius: 37rpx;
  196. }
  197. .kefu-btn {
  198. width: 334rpx;
  199. height: 74rpx;
  200. border-radius: 37rpx;
  201. background: #eeeeee;
  202. color: #333333;
  203. }
  204. </style>