敢为人鲜小程序前端代码仓库
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.

173 lines
3.6 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <!-- 帮助与反馈 -->
  3. <view class="help">
  4. <navbar title="帮助与反馈" leftClick @leftClick="$utils.navigateBack" />
  5. <view class="help-box">
  6. <view>
  7. <view class="help-issue">
  8. <text>帮助与反馈</text>
  9. <text style="color: #BD3624;">*</text>
  10. </view>
  11. <uv-textarea v-model="form.question" :count="true" border="none" height="400"
  12. placeholder="请把您需要的帮助或者您发现的问题提交给我们,感谢您的参与(必填)" :text-style="{color:'#BCB7B7',fontSize:'28rpx'}" />
  13. </view>
  14. <view>
  15. <view class="help-issue">
  16. <text>问题截图</text>
  17. <text style="color: #BD3624;">*</text>
  18. </view>
  19. <view class="help-screenshot">
  20. <uv-upload :fileList="fileList" multiple :maxCount="3" width="180rpx" height="180rpx" multiple
  21. @afterRead="afterRead" @delete="deleteImage">
  22. <image src="../static/help/uploading.png" mode="aspectFill"
  23. style="width: 180rpx;height: 180rpx;" />
  24. </uv-upload>
  25. </view>
  26. </view>
  27. <view>
  28. <view class="help-issue">
  29. <text>联系方式</text>
  30. <text style="color: #BD3624;">*</text>
  31. </view>
  32. <view class="form-sheet-cell">
  33. <view>
  34. 联系姓名
  35. </view>
  36. <input placeholder="请输入联系姓名" v-model="form.name" />
  37. </view>
  38. <view class="form-sheet-cell">
  39. <view>
  40. 联系电话
  41. </view>
  42. <input placeholder="请输入联系电话" v-model="form.phone" />
  43. </view>
  44. </view>
  45. <view class="b-fiexd">
  46. <view @click="submit" class="button-submit">确认</view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. form: {
  56. question: '',
  57. phone: '',
  58. name: '',
  59. image: '',
  60. },
  61. fileList: []
  62. }
  63. },
  64. onLoad(args) {
  65. },
  66. methods: {
  67. deleteImage(e) {
  68. this.fileList.splice(e.index, 1)
  69. },
  70. afterRead(e) {
  71. let self = this
  72. e.file.forEach(file => {
  73. self.$Oss.ossUpload(file.url).then(url => {
  74. self.fileList.push({
  75. url
  76. })
  77. })
  78. })
  79. },
  80. submit() {
  81. let data = JSON.parse(JSON.stringify(this.form))
  82. data.image = this.fileList.map((item) => item.url).join(",")
  83. if (this.$utils.verificationAll(data, {
  84. question: '请输入你的问题和意见', //问题和意见
  85. image: '请上传截图', //
  86. name: '请输入姓名', //
  87. phone: '请输入手机号码', //手机号码
  88. })) {
  89. return
  90. }
  91. this.$api('addFeedback', data, res => {
  92. if (res.code == 200) {
  93. uni.showToast({
  94. title: res.message,
  95. icon: 'none'
  96. })
  97. setTimeout(uni.navigateBack, 800, -1)
  98. }
  99. })
  100. },
  101. }
  102. }
  103. </script>
  104. <style scoped lang="scss">
  105. .help {
  106. .help-box {
  107. width: 92%;
  108. margin-left: 4%;
  109. .help-issue {
  110. margin: 20rpx;
  111. font-size: 28rpx;
  112. font-weight: 600;
  113. color: #333333;
  114. }
  115. .help-screenshot {
  116. display: flex;
  117. align-items: center;
  118. background-color: #fff;
  119. padding: 20rpx;
  120. }
  121. .form-sheet-cell {
  122. display: flex;
  123. background-color: #fff;
  124. padding: 20rpx 30rpx;
  125. font-size: 24rpx;
  126. align-items: center;
  127. view {
  128. width: 150rpx;
  129. }
  130. }
  131. .b-fiexd {
  132. position: fixed;
  133. left: 0;
  134. bottom: 0;
  135. width: 100%;
  136. .button-submit {
  137. display: flex;
  138. align-items: center;
  139. justify-content: center;
  140. width: 596rpx;
  141. height: 90rpx;
  142. background: #E3441A;
  143. border-radius: 46rpx;
  144. margin: 20rpx auto;
  145. font-size: 28rpx;
  146. font-family: PingFang SC, PingFang SC-Regular;
  147. font-weight: 400;
  148. text-align: center;
  149. color: #ffffff;
  150. }
  151. }
  152. }
  153. }
  154. </style>