feedback.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import * as API_Common from '@/apis/common'
  2. import * as WxJsApi from '@/utils/wxJsApi.js'
  3. import * as API from '@/apis/my.js'
  4. export default {
  5. data() {
  6. return {
  7. text:"",
  8. mobile:"",
  9. // 演示地址,请勿直接使用
  10. src:"",
  11. }
  12. },
  13. methods: {
  14. submit(){
  15. if(!this.text){
  16. this.$refs.common.alert('请详细描述您的意见和反馈')
  17. return
  18. }
  19. this.$refs.common.showLoading();
  20. var obj={
  21. content:this.text,
  22. picUrl:this.src,
  23. telephone:this.mobile,
  24. }
  25. API.problemFeedback(obj).then((res) => {
  26. this.$refs.common.setFnc(function(){
  27. uni.switchTab({
  28. url: '/pages/my/index'
  29. });
  30. })
  31. this.$refs.common.alert2("操作成功,感谢您的反馈!");
  32. }).catch(error => {
  33. this.$refs.common.showLoading(false,error);
  34. })
  35. },
  36. upload(){
  37. WxJsApi.chooseImage(1).then(res=>{
  38. var formData = {
  39. 'photoName': '1.jpg',
  40. 'photoFile': res.localData
  41. }
  42. API_Common.upload(formData).then(response => {
  43. this.src=response.data
  44. this.$refs.common.showLoading(false,"上传成功!")
  45. }).catch(error => {
  46. this.$refs.common.showLoading(false,error)
  47. })
  48. })
  49. }
  50. },
  51. onLoad() {
  52. },onReady() {
  53. //this.$refs.common.showLoading()
  54. WxJsApi.getWxConfig().then(()=>{
  55. // this.$refs.common.showLoading(false)
  56. });
  57. }
  58. }