jiazhipeng 11 months ago
parent
commit
503bd82984
  1. 80
      subPackages/user/infoFilling.vue

80
subPackages/user/infoFilling.vue

@ -12,7 +12,7 @@
</view>
<view class="lingo-container" v-else-if="valueType=='lingo_ids'">
<view class="userinfo-item">
<view class="userinfo-item" @click="changeSelection({arr:lingoIds, })">
<span>语言能力</span>
<view v-if="inputValueStr" class="text-overflow" >{{inputValueStr}}</view>
<view v-else class="empty-value" >请选择</view>
@ -170,20 +170,47 @@
popSubmit () {
let tempSelect = JSON.parse(JSON.stringify(this.selection))
let valueHave = tempSelect.arr.filter(x=>tempSelect.value.includes(x.id))
this.selectionItem.value = tempSelect.value
this.selectionItem.valueStr = valueHave.map(x=>x.name).join(',')
if (['scenic_ids'].includes(this.valueType)) {
let valueHave = tempSelect.arr.filter(x=>tempSelect.value.includes(x.id))
this.selectionItem.value = tempSelect.value
this.selectionItem.valueStr = valueHave.map(x=>x.name).join(',')
} else if (['lingo_ids'].includes(this.valueType)) {
this.inputValue = tempSelect.value
this.inputValueStr = tempSelect.valueStr
}
this.$refs.popup.close()
},
uploadImg() {
let url = this.NEWAPIURL+'/api/api/Common/upload'
let merchants_token =''
if (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo')).token) merchants_token = JSON.parse(uni.getStorageSync('userInfo')).token
uni.chooseImage({
count:1,
success: (res) => {
for(let i =0 ;i<res.tempFilePaths.length;i++) {
let param = {img:res.tempFilePaths[i], tempFile:res.tempFiles[i] }
this.fileList.push(param)
}
console.log(this.fileList)
// for(let i =0 ;i<res.tempFilePaths.length;i++) {
// let param = {img:res.tempFilePaths[i], tempFile:res.tempFiles[i] }
// this.fileList.push(param)
// }
// console.log(this.fileList)
const tempFilePaths = res.tempFilePaths;
const uploadTask = uni.uploadFile({
url: url,
filePath: tempFilePaths[0],
name: 'file',
header: {
'merchants_token': merchants_token || ''
},
success: (uploadFileRes) => {
console.log(uploadFileRes.data);
},
fail:()=> {
uni.showToast({
title:'上传失败',
icon:'none'
})
}
});
},
fail:()=> {
@ -197,25 +224,26 @@
//
handleSubmitData() {
let data = []
if (this.valueType == 'lingo_ids') {
data = this.lingoIds
}
if (this.valueType == 'scenic_ids') {
data = this.scenicIds
}
let value = []
data.forEach(v=>{
if(Array.isArray(v.value) && v.value.length>0) {
value.push(v)
//
if (["scenic_ids"].includes(this.valueType)) {
let data = []
if (this.valueType == 'lingo_ids') {
data = this.lingoIds
}
if (this.valueType == 'scenic_ids') {
data = this.scenicIds
}
})
this.inputValue = value.map(v=>v.value.join(',')).join(',')
this.inputValueStr = value.map(v=>v.valueStr).join(',')
console.log(this.inputValue,this.inputValueStr)
let value = []
data.forEach(v=>{
if(Array.isArray(v.value) && v.value.length>0) {
value.push(v)
}
})
this.inputValue = value.map(v=>v.value.join(',')).join(',')
this.inputValueStr = value.map(v=>v.valueStr).join(',')
console.log(this.inputValue,this.inputValueStr)
}
},
submit() {

Loading…
Cancel
Save