feedback.vue 5.3 KB

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