wangfukang 6 days ago
parent
commit
527249c4d5
  1. 11
      package2/IdleTrad/detail.vue
  2. 55
      package2/myCenter/addGoods.vue
  3. 3
      package2/myCenter/myPost.vue

11
package2/IdleTrad/detail.vue

@ -481,10 +481,15 @@
uni.showModal({
title: '举报原因',
editable: true,
placeholderText: '请描述问题',
placeholderText: '请描述问题(必填)',
success: (res) => {
if (!res.confirm || !res.content) return
submitFishComplaint({ ...base, reason: res.content }).then(() => {
if (!res.confirm) return
const reason = String(res.content || '').trim()
if (!reason) {
uni.showToast({ title: '请输入举报内容', icon: 'none' })
return
}
submitFishComplaint({ ...base, reason }).then(() => {
uni.showToast({ title: '已提交举报', icon: 'none' })
})
}

55
package2/myCenter/addGoods.vue

@ -182,6 +182,7 @@
currentCanbuy:1,
canbuyMap:{},
categoryData:[],
productCategoryList:[],
categoryIndex: 0,
modalclassType:'',
categorySonData:[],
@ -249,9 +250,11 @@
this.tui.toast("您未授权,图片上传功能可能会出现错误")
}
})
this.typeItem = JSON.parse(JSON.stringify(this.typeItem)) || ''
if (this.typeItem) {
if (this.hasSelectedTypeItem(this.typeItem)) {
this.typeItem = JSON.parse(JSON.stringify(this.typeItem))
this.formData.categoryId = this.typeItem.id
this.formData.categoryName = this.typeItem.categoryName
this.syncSelectedCategory()
}
this.formData.shopId = uni.getStorageSync('shopId')
},
@ -284,6 +287,7 @@
this.formData.productIntro = res.result.productIntro
this.formData.categoryId = res.result.categoryId
this.edit(this.formData)
this.syncSelectedCategory()
} else {
this.tui.toast(res.message)
}
@ -385,23 +389,46 @@
shopId:uni.getStorageSync('shopId')
}, false, true).then((res) => {
if (res.code == 200) {
if (res.result.length > 0) {
if(this.formData.categoryId != '' && this.formData.categoryId != undefined){
for(let i=0;i<res.result.length;i++){
if(res.result[i].id == this.formData.categoryId){
this.typeItem = res.result[i]
this.productCategoryList = Array.isArray(res.result) ? res.result : []
this.syncSelectedCategory()
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
hasCategoryValue(value) {
return value !== '' && value !== undefined && value !== null
},
hasSelectedTypeItem(item) {
return item && this.hasCategoryValue(item.id)
},
syncSelectedCategory() {
if (this.hasCategoryValue(this.formData.categoryId)) {
const selected = this.productCategoryList.find(item => String(item.id) == String(this.formData.categoryId))
if (selected) {
this.typeItem = selected
this.formData.categoryId = selected.id
this.formData.categoryName = selected.categoryName
return
}
}else{
this.typeItem = res.result[0]
this.formData.categoryId = this.typeItem.id
if (this.formData.categoryName) {
this.typeItem = {
id: this.formData.categoryId,
categoryName: this.formData.categoryName
}
}
} else {
this.tui.toast(res.message)
return
}
if (this.hasSelectedTypeItem(this.typeItem)) {
this.formData.categoryId = this.typeItem.id
this.formData.categoryName = this.typeItem.categoryName
return
}
if (this.productCategoryList.length > 0) {
this.typeItem = this.productCategoryList[0]
this.formData.categoryId = this.typeItem.id
this.formData.categoryName = this.typeItem.categoryName
}
}).catch((res) => {})
},
//
submit() {

3
package2/myCenter/myPost.vue

@ -159,7 +159,7 @@
}, {
text: offShelf ? '上架' : '下架',
style: {
backgroundColor: offShelf ? '#24b979' : '#ff9f2d',
backgroundColor: offShelf ? '#2f8cff' : '#ff9f2d',
color: '#fff',
fontSize: '26rpx'
}
@ -187,6 +187,7 @@
},
editItem(item) {
if (!item || !item.id) return
uni.hideKeyboard()
const type = this.activeTab == 'wants' ? 'want' : 'sell'
uni.navigateTo({
url: `/package1/tabbar/fishRelease?mode=edit&type=${type}&id=${item.id}`

Loading…
Cancel
Save