Merge pull request '需求信息回显' (#67) from chenxuelian into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/67
This commit is contained in:
@@ -109,7 +109,7 @@
|
|||||||
item.pub_time = dateFormatXwDetail(item.pub_time)
|
item.pub_time = dateFormatXwDetail(item.pub_time)
|
||||||
item.images = item.images.split(';')
|
item.images = item.images.split(';')
|
||||||
item.images = item.images.map(item1 => {
|
item.images = item.images.map(item1 => {
|
||||||
item1 = uni.getStorageSync('img_url') + item1
|
item1 = uni.getStorageSync('img_url') + '/' + item1
|
||||||
return item1
|
return item1
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,11 +150,12 @@
|
|||||||
isLoad: true,
|
isLoad: true,
|
||||||
cateName: null,
|
cateName: null,
|
||||||
tagName: null,
|
tagName: null,
|
||||||
token: null
|
token: null,
|
||||||
|
imgUrl: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onTabItemTap() {
|
onTabItemTap() {
|
||||||
console.log('----onTabItemTap')
|
console.log('----onShow')
|
||||||
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
|
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
|
||||||
console.log(uni.getStorageSync('loginToken'))
|
console.log(uni.getStorageSync('loginToken'))
|
||||||
this.isLoad = false
|
this.isLoad = false
|
||||||
@@ -163,18 +164,35 @@
|
|||||||
// })
|
// })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
|
console.log(this.imgUrl)
|
||||||
this.isLoad = true
|
this.isLoad = true
|
||||||
this.token = uni.getStorageSync('loginToken')
|
this.token = uni.getStorageSync('loginToken')
|
||||||
this.getFormData()
|
this.getFormData()
|
||||||
|
this.tabCurrent = 0
|
||||||
this.fileList1 = []
|
this.fileList1 = []
|
||||||
this.needsPublishForm = {}
|
this.needsPublishForm = {}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
console.log('---onLoad')
|
console.log('---onLoad')
|
||||||
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
//我的发布点击修改回显数据
|
//我的发布点击修改回显数据
|
||||||
let publishFormList = JSON.parse(options.item)
|
if(options && options.item) {
|
||||||
this.fileList1 = publishFormList.images
|
console.log(options.item)
|
||||||
this.needsPublishForm = publishFormList
|
try{
|
||||||
|
let publishFormList = JSON.parse(options.item)
|
||||||
|
this.fileList1 = publishFormList.images.map(item => {
|
||||||
|
console.log(item)
|
||||||
|
return {
|
||||||
|
url: item
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(this.fileList1)
|
||||||
|
this.needsPublishForm = publishFormList
|
||||||
|
} catch(error) {
|
||||||
|
this.$toast.warn(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
if (options.index == 0) {
|
if (options.index == 0) {
|
||||||
this.tabCurrent = 0
|
this.tabCurrent = 0
|
||||||
} else if (options.index == 1) {
|
} else if (options.index == 1) {
|
||||||
@@ -341,26 +359,6 @@
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//BlobUrl转blob数据
|
|
||||||
objectURLToBlob(blodurl) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
var http = new XMLHttpRequest();
|
|
||||||
http.open('GET', blodurl, true);
|
|
||||||
http.responseType = 'blob';
|
|
||||||
http.onload = function(e) {
|
|
||||||
if (this.status == 200 || this.status === 0) {
|
|
||||||
// console.log('blod数据',this.response);
|
|
||||||
// 在将blod数据转为file
|
|
||||||
let files = new window.File([this.response], 'file.name', {
|
|
||||||
type: 'image'
|
|
||||||
});
|
|
||||||
// console.log('blod数据转换file',files);
|
|
||||||
resolve(files);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
http.send();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
submitForm() {
|
submitForm() {
|
||||||
console.log(this.fileList1)
|
console.log(this.fileList1)
|
||||||
if (!/^1[3456789]\d{9}$/.test(this.needsPublishForm.mobile)) {
|
if (!/^1[3456789]\d{9}$/.test(this.needsPublishForm.mobile)) {
|
||||||
@@ -373,7 +371,7 @@
|
|||||||
const temp = []
|
const temp = []
|
||||||
if (this.fileList1.length > 0) {
|
if (this.fileList1.length > 0) {
|
||||||
this.fileList1.map(item => {
|
this.fileList1.map(item => {
|
||||||
temp.push(item.url)
|
temp.push(item.url.replace(this.imgUrl, ''))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.needsPublishForm.images = temp.join(';')
|
this.needsPublishForm.images = temp.join(';')
|
||||||
@@ -417,6 +415,7 @@
|
|||||||
this.$toast.warn('登录失败请重试')
|
this.$toast.warn('登录失败请重试')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user