|
|
@ -15,11 +15,11 @@ |
|
|
|
</view> |
|
|
|
<view class="phoneBox"> |
|
|
|
<view class="imgBox"> |
|
|
|
<view class="img"> |
|
|
|
<view class="minusCircle"> |
|
|
|
<view class="img" v-for="(item,index) in imgArr" :key="item"> |
|
|
|
<view class="minusCircle" @click="deleteImg(item,index)"> |
|
|
|
<u-icon name="close-circle-fill" size="20" color="#b9061d"></u-icon> |
|
|
|
</view> |
|
|
|
<image src="../../../../static/logo.png" mode=""></image> |
|
|
|
<image :src="item" mode=""></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="phone" @click="chooseImages"> |
|
|
@ -45,7 +45,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { WX_API, H5_API } from '@/config/site.config.js'; |
|
|
|
import { WX_API, H5_API, prefix } from '@/config/site.config.js'; |
|
|
|
import { createconsult } from '@/config/api.js' |
|
|
|
var _url = H5_API+ WX_API |
|
|
|
// let url = 'api' |
|
|
@ -57,19 +57,22 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.value = this.vuex_userInfo.mobile |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
async submintFn() { |
|
|
|
let images = this.imgArr.join(',') |
|
|
|
let obj = { |
|
|
|
images: 'abc.png', |
|
|
|
images, |
|
|
|
studentPhone: this.vuex_userInfo.mobile, |
|
|
|
type: 1, |
|
|
|
studentId: this.$store.state.user.vuex_loginInfo.userId |
|
|
|
studentId: this.$store.state.user.vuex_loginInfo.userId, |
|
|
|
content: this.value |
|
|
|
} |
|
|
|
const {data: res} = await createconsult(obj) |
|
|
|
}, |
|
|
|
deleteImg(item,index) { |
|
|
|
this.imgArr.splice(index, 1) |
|
|
|
}, |
|
|
|
//选择图片 |
|
|
|
chooseImages(type) { |
|
|
|
let imgNum = 3 - (this.imgArr.length) |
|
|
@ -89,16 +92,19 @@ |
|
|
|
}, |
|
|
|
uploadImgApi(filePath) { |
|
|
|
console.log(filePath) |
|
|
|
let token = 'Bearer '+ this.$store.state.user.vuex_loginInfo.accessToken |
|
|
|
// let token = 'Bearer '+ this.$store.state.user.vuex_loginInfo.accessToken |
|
|
|
let token = 'Bearer 15409b4b67574665bbc4a3e16dd3debb' |
|
|
|
let _this = this |
|
|
|
let name = new Date() * 1 |
|
|
|
// 上传图片到服务器 |
|
|
|
uni.uploadFile({ |
|
|
|
url: _url + 'infra/file/upload',//接口 |
|
|
|
url: _url + 'app-api/infra/file/upload',//接口 |
|
|
|
filePath: filePath,//要上传的图片的本地路径 |
|
|
|
name: 'file', |
|
|
|
|
|
|
|
formData: { |
|
|
|
fileType: 1, |
|
|
|
path: 'complain/'+name, |
|
|
|
type: 1, |
|
|
|
fileSuffix: "png" |
|
|
|
}, |
|
|
|
header: { |
|
|
|