dengjie : 修改发布后跳转到我的发布页面

This commit is contained in:
邓洁
2023-02-05 15:28:18 +08:00
parent 5b2b58cdf8
commit 5819705f54

View File

@@ -177,8 +177,8 @@
console.log(options.item) console.log(options.item)
this.imgUrl = uni.getStorageSync('img_url') this.imgUrl = uni.getStorageSync('img_url')
//我的发布点击修改回显数据 //我的发布点击修改回显数据
if(options && options.item && uni.getStorageSync(options.item)) { if (options && options.item && uni.getStorageSync(options.item)) {
try{ try {
let publishFormList = uni.getStorageSync(options.item) let publishFormList = uni.getStorageSync(options.item)
console.log(publishFormList.images) console.log(publishFormList.images)
this.fileList1 = publishFormList.images.map(item => { this.fileList1 = publishFormList.images.map(item => {
@@ -189,7 +189,7 @@
}) })
console.log(this.fileList1) console.log(this.fileList1)
this.needsPublishForm = publishFormList this.needsPublishForm = publishFormList
} catch(error) { } catch (error) {
this.$toast.warn(error) this.$toast.warn(error)
} }
} }
@@ -380,7 +380,7 @@
if (this.fileList1.length > 0) { if (this.fileList1.length > 0) {
this.fileList1.map(item => { this.fileList1.map(item => {
const url = item.url const url = item.url
temp.push(url.replace(this.imgUrl+'/', '')) temp.push(url.replace(this.imgUrl + '/', ''))
}) })
} }
this.needsPublishForm.images = temp.join(';') this.needsPublishForm.images = temp.join(';')
@@ -403,10 +403,10 @@
apiService.submitIdeasAndNeeds(data).then(res => { apiService.submitIdeasAndNeeds(data).then(res => {
this.$toast.success('提交成功') this.$toast.success('提交成功')
console.log('esf=', res); console.log('esf=', res);
if(this.needsPublishForm.id) { if (res.data.code == 1) {
uni.navigateTo({ uni.navigateTo({
url: '../../packageMy/myRelease/myRelease?index=' + (this.tabCurrent + 1) url: '../../packageMy/myRelease/myRelease?index=' + (this.tabCurrent + 1)
}) })
} }
this.tabCurrent = 0 this.tabCurrent = 0
this.fileList1 = [] this.fileList1 = []