修改bug

This commit is contained in:
邓洁
2023-02-24 14:13:17 +08:00
parent afccd4c183
commit 8bdb156ec2
9 changed files with 34 additions and 69 deletions

View File

@@ -163,9 +163,7 @@
},
onTabItemTap() {
this.imgUrl = uni.getStorageSync('img_url')
console.log('----onShow')
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
console.log(uni.getStorageSync('loginToken'))
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
@@ -184,14 +182,11 @@
if (options && options.item && uni.getStorageSync(options.item)) {
try {
let publishFormList = uni.getStorageSync(options.item)
console.log(publishFormList.images)
this.fileList1 = publishFormList.images.map(item => {
console.log(this.imgUrl)
return {
url: item
}
})
console.log(this.fileList1)
this.needsPublishForm = publishFormList
} catch (error) {
this.$toast.warn(error)
@@ -256,7 +251,6 @@
// }
// },
getCityValue(data) {
console.log(data)
this.showCityPicker = false
this.needsPublishForm.area_name = data[0].join('-')
this.needsPublishForm.area_code = data[1]
@@ -265,7 +259,6 @@
this.showProductPicker = false
this.showCategoryPicker = false
this.needsPublishForm.product = data.value[0]
// console.log(data)
// const obj = this.productPickerList.find(item => {
// return item.name === data.value[0]
// })
@@ -319,9 +312,6 @@
async afterRead(event) {
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file)
console.log(this.fileList1)
console.log(lists)
console.log(this[`fileList${event.name}`])
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
@@ -331,7 +321,6 @@
})
})
for (let i = 0; i < lists.length; i++) {
console.log(lists[i])
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
@@ -344,16 +333,6 @@
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
// const data = {
// file: new File
// }
// let a = apiService.postImage(data).then(res => {
// console.log(res)
// })
console.log('--345')
console.log(url)
console.log(this.token)
console.log(apiService.uploadImgUrl)
let a = uni.uploadFile({
url: apiService.uploadImgUrl,
filePath: url,
@@ -364,8 +343,6 @@
},
success: (res) => {
setTimeout(() => {
console.log('---355')
console.log(JSON.parse(res.data).data.url)
resolve(JSON.parse(res.data).data.url)
}, 1000)
}
@@ -373,7 +350,6 @@
})
},
submitForm() {
console.log(this.fileList1)
if (!/^1[3456789]\d{9}$/.test(this.needsPublishForm.mobile)) {
this.$toast.warn('请输入正确的手机号')
return false
@@ -404,10 +380,8 @@
pub_time: null,
...this.needsPublishForm
}
console.log(data)
apiService.submitIdeasAndNeeds(data).then(res => {
this.$toast.success('提交成功')
console.log('esf=', res);
if (res.data.code == 1) {
uni.navigateTo({
url: '../../packageMy/myRelease/myRelease?index=' + (this.tabCurrent + 1)
@@ -422,7 +396,6 @@
})
},
reOnLoad() {
console.log('----------------true')
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
@@ -436,19 +409,10 @@
this.getFormData()
},
failToLoad() {
console.log('----------------false')
this.$toast.warn('登录失败请重试')
uni.reLaunch({
url: '/pages/index/index'
})
// uni.navigateBack({
// success: () => {
// let page = getCurrentPages().pop();
// if (page) {
// page.onLoad(page.options);//执行上个页面的方法
// };
// }
// })
}
}