|
@@ -40,7 +40,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="uploading" v-if="uploadingTF[index+3]">
|
|
<view class="uploading" v-if="uploadingTF[index+3]">
|
|
|
<u-icon name="close" class="delete" @click="deletes(index+3)"></u-icon>
|
|
<u-icon name="close" class="delete" @click="deletes(index+3)"></u-icon>
|
|
|
- <video :src="selfList[index]" controls class="uploading"></video>
|
|
|
|
|
|
|
+ <video :src="BASE_URL+selfList[index]" controls class="uploading"></video>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -53,6 +53,7 @@
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ BASE_URL: 'http://182.92.193.64:8002',
|
|
|
adddata:{//设备参数
|
|
adddata:{//设备参数
|
|
|
id:'',
|
|
id:'',
|
|
|
name:'',
|
|
name:'',
|
|
@@ -63,7 +64,6 @@
|
|
|
type_id:''
|
|
type_id:''
|
|
|
},
|
|
},
|
|
|
imageList:[],//图片链接
|
|
imageList:[],//图片链接
|
|
|
- // postimageList:[],
|
|
|
|
|
uploadingTF:[false,false,false,false,false,false],//图片的删除
|
|
uploadingTF:[false,false,false,false,false,false],//图片的删除
|
|
|
selfList:[],//视频链接
|
|
selfList:[],//视频链接
|
|
|
actionSheetList: [//设备选项
|
|
actionSheetList: [//设备选项
|
|
@@ -91,7 +91,9 @@
|
|
|
],
|
|
],
|
|
|
show:false,//选择器的显示
|
|
show:false,//选择器的显示
|
|
|
btnisTorF:false,
|
|
btnisTorF:false,
|
|
|
- deviceid:false//设备号判断
|
|
|
|
|
|
|
+ deviceid:false,//设备号判断
|
|
|
|
|
+ imageFile:[],
|
|
|
|
|
+ phoneTF:true//手机号判断
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -106,14 +108,17 @@
|
|
|
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
sourceType: ['album','camera'], //从相册选择
|
|
sourceType: ['album','camera'], //从相册选择
|
|
|
success: (res)=> {
|
|
success: (res)=> {
|
|
|
- this.imageList[index]=res.tempFilePaths[0]
|
|
|
|
|
- this.$forceUpdate() //强制刷新视图
|
|
|
|
|
- this.uploadingTF[index]=true
|
|
|
|
|
- // this.postimageList[index]=res.tempFilePaths[0].slice(res.tempFilePaths[0].indexOf(":")+1)
|
|
|
|
|
- uni.getImageInfo({
|
|
|
|
|
- src: res.tempFilePaths[0],
|
|
|
|
|
- success:(image)=>{
|
|
|
|
|
- console.log(image);
|
|
|
|
|
|
|
+ uni.uploadFile({
|
|
|
|
|
+ url: 'http://182.92.193.64:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
|
|
|
|
|
+ filePath: res.tempFilePaths[0],
|
|
|
|
|
+ name: 'img_file',
|
|
|
|
|
+ formData: {
|
|
|
|
|
+ 'user': 'test'
|
|
|
|
|
+ },
|
|
|
|
|
+ success: (uploadFileRes) => {
|
|
|
|
|
+ this.imageList[index]=JSON.parse(uploadFileRes.data).data.src
|
|
|
|
|
+ this.$forceUpdate() //强制刷新视图
|
|
|
|
|
+ this.uploadingTF[index]=true
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -124,10 +129,19 @@
|
|
|
count: 1,
|
|
count: 1,
|
|
|
mediaType:['video'],
|
|
mediaType:['video'],
|
|
|
success:(res)=> {
|
|
success:(res)=> {
|
|
|
- console.log(res)
|
|
|
|
|
- this.selfList[index]= res.tempFilePath;
|
|
|
|
|
- this.$forceUpdate() //强制刷新视图
|
|
|
|
|
- this.uploadingTF[index+3]=true
|
|
|
|
|
|
|
+ uni.uploadFile({
|
|
|
|
|
+ url: 'http://182.92.193.64:8002/api/api_gateway?method=after_sale.after_sale_manage.video_upload', //仅为示例,非真实的接口地址
|
|
|
|
|
+ file: res.tempFile,
|
|
|
|
|
+ name: 'upload',
|
|
|
|
|
+ formData: {
|
|
|
|
|
+ 'user': 'test'
|
|
|
|
|
+ },
|
|
|
|
|
+ success: (uploadFileRes) => {
|
|
|
|
|
+ this.selfList[index]=JSON.parse(uploadFileRes.data).data.data.src
|
|
|
|
|
+ this.$forceUpdate() //强制刷新视图
|
|
|
|
|
+ this.uploadingTF[index+3]=true
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -135,7 +149,7 @@
|
|
|
this.uploadingTF[index]=false
|
|
this.uploadingTF[index]=false
|
|
|
this.$forceUpdate() //强制刷新视图
|
|
this.$forceUpdate() //强制刷新视图
|
|
|
},
|
|
},
|
|
|
- async getaddafter(data) {
|
|
|
|
|
|
|
+ async getaddafter(data) {//提交数据
|
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
|
url: '/api/api_gateway?method=after_sale.after_sale_manage.aftersale_apply',
|
|
url: '/api/api_gateway?method=after_sale.after_sale_manage.aftersale_apply',
|
|
|
data:{
|
|
data:{
|
|
@@ -143,6 +157,7 @@
|
|
|
d_type:data.type,
|
|
d_type:data.type,
|
|
|
errordesc:data.text,
|
|
errordesc:data.text,
|
|
|
errorimg:data.imageList,
|
|
errorimg:data.imageList,
|
|
|
|
|
+ errorvideo:data.selfList,
|
|
|
addr:data.site,
|
|
addr:data.site,
|
|
|
user:data.name,
|
|
user:data.name,
|
|
|
userphone:data.phone,
|
|
userphone:data.phone,
|
|
@@ -150,14 +165,6 @@
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- async getaddvideo(data) {
|
|
|
|
|
- const res = await this.$myRequest({
|
|
|
|
|
- url: '/api/api_gateway?method=after_sale.after_sale_manage.video_upload',
|
|
|
|
|
- data:{
|
|
|
|
|
- upload:data
|
|
|
|
|
- }//after_sale.after_sale_manage.device_check
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
async getID(data) {
|
|
async getID(data) {
|
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
|
url: '/api/api_gateway?method=after_sale.after_sale_manage.device_check',
|
|
url: '/api/api_gateway?method=after_sale.after_sale_manage.device_check',
|
|
@@ -177,22 +184,20 @@
|
|
|
obj.type=this.adddata.type_id
|
|
obj.type=this.adddata.type_id
|
|
|
obj.text=this.adddata.text
|
|
obj.text=this.adddata.text
|
|
|
obj.imageList=JSON.stringify(this.imageList)
|
|
obj.imageList=JSON.stringify(this.imageList)
|
|
|
- console.log(obj.imageList)
|
|
|
|
|
obj.site=this.adddata.site
|
|
obj.site=this.adddata.site
|
|
|
obj.name=this.adddata.name
|
|
obj.name=this.adddata.name
|
|
|
obj.phone=this.adddata.phone
|
|
obj.phone=this.adddata.phone
|
|
|
- // if(this.deviceid==false && this.adddata.type_id==''){
|
|
|
|
|
- // uni.showToast({
|
|
|
|
|
- // title: '设备ID和设备类型不能为空',
|
|
|
|
|
- // duration: 2000,
|
|
|
|
|
- // icon:'none'
|
|
|
|
|
- // });
|
|
|
|
|
- // }else{
|
|
|
|
|
- // this.getaddafter(obj)
|
|
|
|
|
- // if(this.selfList.length!=0){
|
|
|
|
|
- // // this.getaddvideo(this.selfList)
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ obj.selfList=JSON.stringify(this.selfList)
|
|
|
|
|
+ if(this.deviceid && this.adddata.type_id!=''&&this.phoneTF){
|
|
|
|
|
+ this.getaddafter(obj)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ console.log(1)
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '设备ID和设备类型不能为空',
|
|
|
|
|
+ duration: 2000,
|
|
|
|
|
+ icon:"none"
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
actionSheetCallback(index) {//选择器选择
|
|
actionSheetCallback(index) {//选择器选择
|
|
|
this.adddata.type = this.actionSheetList[index].text;
|
|
this.adddata.type = this.actionSheetList[index].text;
|
|
@@ -205,6 +210,7 @@
|
|
|
duration: 2000,
|
|
duration: 2000,
|
|
|
icon:'none'
|
|
icon:'none'
|
|
|
});
|
|
});
|
|
|
|
|
+ this.phoneTF=false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
addID(){
|
|
addID(){
|