123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- 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)
- });
-
- }
- }
|