import * as API_Common from '@/apis/common' import * as WxJsApi from '@/utils/wxJsApi.js' import * as API from '@/apis/my.js' export default { data() { return { text:"", mobile:"", // 演示地址,请勿直接使用 src:"", } }, methods: { submit(){ if(!this.text){ this.$refs.common.alert('请详细描述您的意见和反馈') return } this.$refs.common.showLoading(); var obj={ content:this.text, picUrl:this.src, telephone:this.mobile, } API.problemFeedback(obj).then((res) => { this.$refs.common.setFnc(function(){ uni.switchTab({ url: '/pages/my/index' }); }) this.$refs.common.alert2("操作成功,感谢您的反馈!"); }).catch(error => { this.$refs.common.showLoading(false,error); }) }, upload(){ WxJsApi.chooseImage(1).then(res=>{ var formData = { 'photoName': '1.jpg', 'photoFile': res.localData } API_Common.upload(formData).then(response => { this.src=response.data this.$refs.common.showLoading(false,"上传成功!") }).catch(error => { this.$refs.common.showLoading(false,error) }) }) } }, onLoad() { },onReady() { //this.$refs.common.showLoading() WxJsApi.getWxConfig().then(()=>{ // this.$refs.common.showLoading(false) }); } }