邓洁 : "我的"模块删除功能
This commit is contained in:
@@ -8,11 +8,15 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<ShowShopList v-if="listId == 0" :isEdit="true" :showStyle="1" :shopInfoList="searchInfoList"></ShowShopList>
|
||||
<SearchShopList v-if="listId == 1" :searchInfoList="searchInfoList" :is-edit="true" :showStyle="1">
|
||||
<ShowShopList v-if="listId == 0" :isEdit="true" :showStyle="1" :shopInfoList="searchInfoList"
|
||||
@delItem="handleDel"></ShowShopList>
|
||||
<SearchShopList v-if="listId == 1" :searchInfoList="searchInfoList" :is-edit="true" :showStyle="1"
|
||||
@delItem="handleDel" @updateItem="handleUpdate">
|
||||
</SearchShopList>
|
||||
<ShowShopList v-if="listId == 3" :is-edit="true" :showStyle="2" :shopInfoList="searchInfoList"></ShowShopList>
|
||||
<ShowShopList v-if="listId == 2" :is-edit="true" :showStyle="2" :shopInfoList="searchInfoList"></ShowShopList>
|
||||
<ShowShopList v-if="listId == 3" :is-edit="true" :showStyle="2" :shopInfoList="searchInfoList"
|
||||
@delItem="handleDel"></ShowShopList>
|
||||
<ShowShopList v-if="listId == 2" :is-edit="true" :showStyle="2" :shopInfoList="searchInfoList"
|
||||
@delItem="handleDel"></ShowShopList>
|
||||
<ShowShopList v-if="listId == 4" :showStyle="0" :shopInfoList="matchList"></ShowShopList>
|
||||
</view>
|
||||
</view>
|
||||
@@ -38,13 +42,46 @@
|
||||
onReachBottom() {
|
||||
if (this.listId !== 4 && this.searchListLength !== 0) {
|
||||
this.pageNum++
|
||||
this.getMyPublished(this.listId + 1)
|
||||
this.getMyPublished(this.listId + 1, this.pageSize, this.pageNum)
|
||||
} else if (this.listId == 4 && this.matchListLength !== 0) {
|
||||
this.matchPageNum++
|
||||
this.getMatch()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleUpdate(searchid) {
|
||||
console.log('页面更新');
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/publishAddress/publishAddress?item=update_item' + '&index=' +
|
||||
// tabCurrent
|
||||
// })
|
||||
},
|
||||
handleDel(shopid) {
|
||||
console.log('页面删除', this.listId + 1, shopid);
|
||||
var that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '你确定要删除吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
that.$api.deleteMyPublished({
|
||||
type: that.listId + 1,
|
||||
id: shopid
|
||||
}).then(res => {
|
||||
if (res.data.code == 1) {
|
||||
that.$toast.warn('删除成功')
|
||||
that.getMyPublished(that.listId + 1, that.pageSize, that.pageNum, 1)
|
||||
} else {
|
||||
that.$toast.warn(res.data.msg)
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
that.$toast.warn('取消操作')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
getMatch() {
|
||||
this.$api.getMyMatch({
|
||||
pageSize: this.matchPageSize,
|
||||
@@ -58,17 +95,20 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
getMyPublished(type) {
|
||||
getMyPublished(type, pageSize, pageNum, isDelete) {
|
||||
this.$api.getMyPublished({
|
||||
type: type,
|
||||
pageSize: this.pageSize,
|
||||
pageNum: this.pageNum
|
||||
pageSize: pageSize,
|
||||
pageNum: pageNum
|
||||
}).then(res => {
|
||||
console.log('发布信息', res);
|
||||
console.log(type);
|
||||
if (res.data.code == 1) {
|
||||
this.searchListLength = res.data.data.length
|
||||
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
|
||||
if (isDelete == 1) {
|
||||
this.searchInfoList = res.data.data
|
||||
} else {
|
||||
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
|
||||
}
|
||||
} else {
|
||||
uni.$u.toast(res.data.msg)
|
||||
}
|
||||
@@ -82,19 +122,19 @@
|
||||
this.titletext = option.titletext
|
||||
if (this.titletext == '发布的店铺转让') {
|
||||
this.listId = 0
|
||||
this.getMyPublished(1)
|
||||
this.getMyPublished(1, this.pageSize, this.pageNum)
|
||||
}
|
||||
if (this.titletext == '发布的找店选址') {
|
||||
this.listId = 1
|
||||
this.getMyPublished(2)
|
||||
this.getMyPublished(2, this.pageSize, this.pageNum)
|
||||
}
|
||||
if (this.titletext == '发布的店铺出租') {
|
||||
this.listId = 2
|
||||
this.getMyPublished(3)
|
||||
this.getMyPublished(3, this.pageSize, this.pageNum)
|
||||
}
|
||||
if (this.titletext == '发布的项目招商') {
|
||||
this.listId = 3
|
||||
this.getMyPublished(4)
|
||||
this.getMyPublished(4, this.pageSize, this.pageNum)
|
||||
}
|
||||
|
||||
if (this.titletext == '我的匹配') {
|
||||
|
||||
Reference in New Issue
Block a user