jubao.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <view v-if="XCXIsSelect == '是'" class="page" style="background-color: #ffffff;">
  3. <view class="feedback-title">
  4. <text>问题和意见</text>
  5. <text @tap="chooseMsg">快速键入</text>
  6. </view>
  7. <view class="feedback-body"><textarea placeholder="请详细描述你的问题和意见..." v-model="sendDate.content"
  8. class="feedback-textare" /></view>
  9. <view class="feedback-title"><text>电话/微信</text></view>
  10. <view class="feedback-body"><input class="feedback-input" v-model="sendDate.contact" placeholder="方便我们联系你 " />
  11. </view>
  12. <view class="feedback-title"><text>上传图片</text></view>
  13. <view class="imgs flex align-center justify-between flex-wrap">
  14. <!-- imgs -->
  15. <view class="imgs-item" v-for="(item,index) in imgs" :key="index">
  16. <image :src="item" mode="aspectFill"></image>
  17. <view class="imgs-item-close" @click="close(index)">
  18. <u-icon name="close-circle" color="red" size="38"></u-icon>
  19. </view>
  20. </view>
  21. <view class="imgs-item" @click="uploadImg">
  22. <u-icon name="photo" color="#00B88F" size="58"></u-icon>
  23. <view class="imgs-item-txt">
  24. 上传图片
  25. </view>
  26. </view>
  27. <view class="imgs-item" style="height: 0;">
  28. </view>
  29. </view>
  30. <button style="" class="feedback-submit" @tap="send">提交</button>
  31. </view>
  32. <view class="" v-else>
  33. 帮助中心,联系我们,为你提供帮助
  34. </view>
  35. </template>
  36. <script>
  37. import config from '../../common/config';
  38. export default {
  39. data() {
  40. return {
  41. msgContents: ['岗位不符', '虚假岗位', '内容违规', '虚假招聘'],
  42. stars: [1, 2, 3, 4, 5],
  43. imageList: [],
  44. sendDate: {
  45. score: 5,
  46. content: '',
  47. contact: ''
  48. },
  49. postPushId: '',
  50. XCXIsSelect: '是',
  51. imgs: [],
  52. resumesId: '',
  53. };
  54. },
  55. onLoad(e) {
  56. this.XCXIsSelect = uni.getStorageSync('XCXIsSelect')
  57. if (e.resumesId) {
  58. this.resumesId = e.resumesId
  59. }
  60. if (e.postPushId) {
  61. this.postPushId = e.postPushId
  62. }
  63. // #ifdef APP
  64. let deviceInfo = {
  65. appid: plus.runtime.appid,
  66. imei: plus.device.imei, //设备标识
  67. p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型,i表示iOS平台,a表示Android平台。
  68. md: plus.device.model, //设备型号
  69. app_version: plus.runtime.version,
  70. plus_version: plus.runtime.innerVersion, //基座版本号
  71. os: plus.os.version,
  72. net: '' + plus.networkinfo.getCurrentType()
  73. };
  74. this.sendDate = Object.assign(deviceInfo, this.sendDate);
  75. // #endif
  76. },
  77. methods: {
  78. //上传图片
  79. uploadImg() {
  80. let that = this
  81. uni.chooseImage({
  82. count: 1, //默认9
  83. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  84. sourceType: ['album'], //从相册选择
  85. success: function(res) {
  86. uni.showLoading({
  87. title: '上传中...'
  88. });
  89. uni.uploadFile({
  90. url: 'https://zp.xianmaxiong.com/sqx_fast/alioss/upload',
  91. // url: config.APIHOST + '/alioss/upload',
  92. filePath: res.tempFilePaths[0],
  93. name: 'file',
  94. success: uploadFileRes => {
  95. uni.hideLoading();
  96. let url = JSON.parse(uploadFileRes.data);
  97. console.log(url)
  98. that.imgs.push(url.data)
  99. },
  100. fail() {
  101. uni.hideLoading()
  102. uni.showToast({
  103. title: '上传失败',
  104. icon: 'none'
  105. })
  106. }
  107. });
  108. }
  109. });
  110. },
  111. close(e) {
  112. this.imgs.splice(e, 1);
  113. },
  114. chooseMsg() {
  115. //快速输入
  116. uni.showActionSheet({
  117. itemList: this.msgContents,
  118. success: res => {
  119. this.sendDate.content = this.msgContents[res.tapIndex];
  120. }
  121. });
  122. },
  123. chooseStar(e) {
  124. //点击评星
  125. this.sendDate.score = e;
  126. },
  127. previewImage() {
  128. //预览图片
  129. uni.previewImage({
  130. urls: this.imageList
  131. });
  132. },
  133. send() {
  134. //发送反馈
  135. console.log(JSON.stringify(this.sendDate));
  136. if (!this.sendDate.content) {
  137. uni.showToast({
  138. icon: 'none',
  139. title: '请输入反馈内容'
  140. });
  141. return;
  142. }
  143. if (!this.sendDate.contact) {
  144. uni.showToast({
  145. icon: 'none',
  146. title: '请填写电话或微信'
  147. });
  148. return;
  149. }
  150. this.$queue.showLoading('加载中...');
  151. if (this.imgs.length > 0) {
  152. this.sendDate.imgs = this.imgs.join(',')
  153. }
  154. this.$Request.postJson('/app/message/insertMessage', {
  155. title: this.sendDate.contact,
  156. content: JSON.stringify(this.sendDate),
  157. state: this.postPushId ? 3 : 6, //3:举报岗位 6:举报简历
  158. byUserId: this.postPushId ? this.postPushId : this.resumesId
  159. }).then(res => {
  160. if (res.code === 0) {
  161. uni.showToast({
  162. title: '提交成功'
  163. });
  164. setTimeout(function() {
  165. uni.navigateBack();
  166. }, 1000);
  167. } else {
  168. uni.hideLoading();
  169. uni.showModal({
  170. showCancel: false,
  171. title: '投诉失败',
  172. content: res.msg
  173. });
  174. }
  175. });
  176. }
  177. }
  178. };
  179. </script>
  180. <style>
  181. @font-face {
  182. font-family: uniicons;
  183. font-weight: normal;
  184. font-style: normal;
  185. src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
  186. }
  187. page {
  188. background-color: #F5F5F5 !important;
  189. }
  190. view {
  191. font-size: 28upx;
  192. }
  193. /*问题反馈*/
  194. .feedback-title {
  195. display: flex;
  196. flex-direction: row;
  197. justify-content: space-between;
  198. align-items: center;
  199. padding: 20upx;
  200. color: #8f8f94;
  201. font-size: 28upx;
  202. }
  203. .feedback-star-view.feedback-title {
  204. justify-content: flex-start;
  205. margin: 0;
  206. }
  207. .feedback-body {
  208. font-size: 32upx;
  209. padding: 16upx;
  210. margin: 16upx;
  211. border-radius: 16upx;
  212. background: #FFFFFF;
  213. /* color: #FFF; */
  214. }
  215. .feedback-textare {
  216. height: 200upx;
  217. font-size: 34upx;
  218. line-height: 50upx;
  219. width: 100%;
  220. box-sizing: border-box;
  221. padding: 20upx 30upx 0;
  222. }
  223. .feedback-input {
  224. font-size: 32upx;
  225. height: 60upx;
  226. padding: 15upx 20upx;
  227. line-height: 60upx;
  228. }
  229. .imgs {
  230. margin: 20rpx;
  231. }
  232. .imgs-item {
  233. width: 220rpx;
  234. height: 220rpx;
  235. background-color: #f5f5f5;
  236. margin-bottom: 20rpx;
  237. border-radius: 10rpx;
  238. display: flex;
  239. flex-direction: column;
  240. align-items: center;
  241. justify-content: center;
  242. position: relative;
  243. }
  244. .imgs-item-close {
  245. position: absolute;
  246. top: 0;
  247. right: 0;
  248. }
  249. .imgs-item image {
  250. width: 100%;
  251. height: 100%;
  252. border-radius: 10rpx;
  253. }
  254. .feedback-submit {
  255. background: #00B88F;
  256. color: #ffffff;
  257. margin: 20upx;
  258. margin-top: 32upx;
  259. }
  260. </style>