邓洁 : 编辑接口
This commit is contained in:
@@ -215,7 +215,7 @@
|
||||
if (this.fileList1.length > 0) {
|
||||
this.fileList1.map(item => {
|
||||
const url = item.url
|
||||
temp.push(url.replace(this.imgUrl + '/', ''))
|
||||
temp.push(url.replace(this.$api.imgUrl, ''))
|
||||
})
|
||||
}
|
||||
if (this.form.latitude && this.form.longitude) {
|
||||
@@ -232,7 +232,10 @@
|
||||
this.$api.publishInvestment(data).then(res => {
|
||||
console.log(res);
|
||||
if (res.data.code == 1) {
|
||||
uni.$u.toast('发布成功')
|
||||
uni.$u.toast(res.data.msg)
|
||||
uni.reLaunch({
|
||||
url: '/pages/my/my'
|
||||
})
|
||||
} else {
|
||||
uni.$u.toast(res.data.msg)
|
||||
}
|
||||
@@ -305,12 +308,58 @@
|
||||
this.show1 = false
|
||||
this.form.region = e.value[0]
|
||||
},
|
||||
getDetail(type, id) {
|
||||
console.log('type, id', type, id);
|
||||
this.$api.getShopDetail(type, id).then(res => {
|
||||
console.log(',re', res);
|
||||
const data = res.data.data
|
||||
if (res.data.code == 1) {
|
||||
this.form = {
|
||||
title: data.tt,
|
||||
region: data.area1,
|
||||
address: data.adress,
|
||||
business: data.trade1,
|
||||
area: data.mianji,
|
||||
rent: data.zujin,
|
||||
phone: data.mobile,
|
||||
contactPerson: data.lianxiren,
|
||||
details: data.content,
|
||||
// images: data.pics,
|
||||
id: id,
|
||||
longitude: data.lng,
|
||||
latitude: data.lat,
|
||||
}
|
||||
var arr = [];
|
||||
var arr1 = [];
|
||||
let obj = {}
|
||||
arr = data.pics.split(",")
|
||||
arr.map(item => {
|
||||
obj = this.$api.imgUrl + item
|
||||
arr1.push(obj)
|
||||
})
|
||||
data.pics = arr1
|
||||
this.fileList1 = data.pics.map(item => {
|
||||
return {
|
||||
url: item
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.uForm.setRules(this.rules)
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(options) {
|
||||
if (options.item) {
|
||||
console.log('修改');
|
||||
if (options.id) {
|
||||
this.getDetail(4, options.id)
|
||||
}
|
||||
} else {
|
||||
console.log('发布');
|
||||
}
|
||||
this.getRegionList()
|
||||
this.$api.getClassList().then(res => {
|
||||
// console.log(res.data.data.length);
|
||||
|
||||
Reference in New Issue
Block a user