Merge pull request '邓洁 : "我的"模块删除功能' (#86) from dj into master
Reviewed-on: http://git.feashow.cn/odjbin/city-store-transfer/pulls/86
This commit is contained in:
@@ -1,13 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<SearchShopListItem
|
<SearchShopListItem v-for="item in searchInfoList" :key="searchid" :shopInfo="item" :show-style="showStyle"
|
||||||
v-for="item in searchInfoList"
|
:isEdit="isEdit" @delItem="handleDel" @updateItem="handleUpdate"></SearchShopListItem>
|
||||||
:key="searchid"
|
|
||||||
:shopInfo="item"
|
|
||||||
:show-style="showStyle"
|
|
||||||
:isEdit="isEdit"
|
|
||||||
@delItem="handleDel"
|
|
||||||
></SearchShopListItem>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -59,8 +53,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleUpdate(searchid) {
|
||||||
|
this.$emit('updateItem', searchid)
|
||||||
|
},
|
||||||
handleDel(shopid) {
|
handleDel(shopid) {
|
||||||
console.log("删除了商铺", shopid);
|
console.log("删除了商铺", shopid);
|
||||||
|
this.$emit('delItem', shopid)
|
||||||
// const delindex = this.shopInfoList.findIndex((item,index)=> item.shopid === shopid)
|
// const delindex = this.shopInfoList.findIndex((item,index)=> item.shopid === shopid)
|
||||||
// TODO:不能直接修改
|
// TODO:不能直接修改
|
||||||
// if(delindex !== -1) this.shopInfoList = this.shopInfoList.slice(delindex,1)
|
// if(delindex !== -1) this.shopInfoList = this.shopInfoList.slice(delindex,1)
|
||||||
|
|||||||
@@ -144,7 +144,7 @@
|
|||||||
handleEdit(searchid) {
|
handleEdit(searchid) {
|
||||||
// TODO 完成页面跳转
|
// TODO 完成页面跳转
|
||||||
console.log("点击了编辑ID为", searchid);
|
console.log("点击了编辑ID为", searchid);
|
||||||
|
this.$emit('updateItem', searchid)
|
||||||
},
|
},
|
||||||
handleDel(searchid) {
|
handleDel(searchid) {
|
||||||
this.$emit('delItem', searchid)
|
this.$emit('delItem', searchid)
|
||||||
@@ -157,22 +157,27 @@
|
|||||||
.style3 {
|
.style3 {
|
||||||
position: relative;
|
position: relative;
|
||||||
color: #696969 !important;
|
color: #696969 !important;
|
||||||
|
|
||||||
.cart-and-pos {
|
.cart-and-pos {
|
||||||
border-top: 1px solid #eee !important;
|
border-top: 1px solid #eee !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pb0 {
|
.pb0 {
|
||||||
padding-bottom: 0 !important;
|
padding-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.yzr {
|
.yzr {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 30rpx;
|
top: 30rpx;
|
||||||
right: 13rpx;
|
right: 13rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cjsj {
|
.cjsj {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
margin-bottom: 12rpx;
|
margin-bottom: 12rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-border {
|
.list-border {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
@@ -181,101 +186,125 @@
|
|||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
box-shadow: 0 1px 2px 0 rgba(224, 224, 224, 0.50);
|
box-shadow: 0 1px 2px 0 rgba(224, 224, 224, 0.50);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|
||||||
.list-container {
|
.list-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom-common {
|
.bottom-common {
|
||||||
border-top: 1px solid #f7f7f7;
|
border-top: 1px solid #f7f7f7;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.del-and-edit {
|
.del-and-edit {
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
margin-left: 38rpx;
|
margin-left: 38rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
text {
|
text {
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-area {
|
.text-area {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
>text {
|
>text {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.style2,.style3 {
|
.style2,
|
||||||
|
.style3 {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
color: #CC3333;
|
color: #CC3333;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
||||||
.rent-and-cost {
|
.rent-and-cost {
|
||||||
text {
|
text {
|
||||||
margin-right: 26rpx;
|
margin-right: 26rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
padding-bottom: 6px;
|
padding-bottom: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cart-and-pos {
|
.cart-and-pos {
|
||||||
>view {
|
>view {
|
||||||
margin-right: 50rpx;
|
margin-right: 50rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
border-top: 1px solid #f7f7f7;
|
border-top: 1px solid #f7f7f7;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
justify-content: start;
|
justify-content: start;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
color: #CC3333;
|
color: #CC3333;
|
||||||
line-height: 12px;
|
line-height: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sqr-and-lx {
|
.sqr-and-lx {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
padding-bottom: 6px;
|
padding-bottom: 6px;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
color: #359867;
|
color: #359867;
|
||||||
line-height: 12px;
|
line-height: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.style3 {
|
.style3 {
|
||||||
color: #696969;
|
color: #696969;
|
||||||
}
|
}
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cart-and-date {
|
.cart-and-date {
|
||||||
display: flex;
|
display: flex;
|
||||||
border-top: 1px solid #f7f7f7;
|
border-top: 1px solid #f7f7f7;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
color: #CC3333;
|
color: #CC3333;
|
||||||
line-height: 12px;
|
line-height: 12px;
|
||||||
|
|||||||
@@ -1,15 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<ShowShopListItem
|
<ShowShopListItem v-for="item in shopInfoList" :key="shopid" :shopInfo="item" :is-adshow="isADshow"
|
||||||
v-for="item in shopInfoList"
|
:adlinkPath="adlinkPath" :show-style="showStyle" :is-edit="isEdit" @delItem="handleDel"></ShowShopListItem>
|
||||||
:key="shopid"
|
|
||||||
:shopInfo="item"
|
|
||||||
:is-adshow="isADshow"
|
|
||||||
:adlinkPath="adlinkPath"
|
|
||||||
:show-style="showStyle"
|
|
||||||
:is-edit="isEdit"
|
|
||||||
@delItem="handleDel"
|
|
||||||
></ShowShopListItem>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -81,6 +73,7 @@
|
|||||||
methods: {
|
methods: {
|
||||||
handleDel(shopid) {
|
handleDel(shopid) {
|
||||||
console.log("删除了商铺", shopid);
|
console.log("删除了商铺", shopid);
|
||||||
|
this.$emit('delItem', shopid)
|
||||||
// const delindex = this.shopInfoList.findIndex((item,index)=> item.shopid === shopid)
|
// const delindex = this.shopInfoList.findIndex((item,index)=> item.shopid === shopid)
|
||||||
// TODO:不能直接修改
|
// TODO:不能直接修改
|
||||||
// if(delindex !== -1) this.shopInfoList = this.shopInfoList.slice(delindex,1)
|
// if(delindex !== -1) this.shopInfoList = this.shopInfoList.slice(delindex,1)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view class="list-border">
|
<view class="list-border">
|
||||||
<view class="list-container" @click="enterDetail()">
|
<view class="list-container" @click="enterDetail()">
|
||||||
<view class="shop-list-img">
|
<view class="shop-list-img">
|
||||||
<u-image :src="leftImage" width="80px" height="80px" radius="8px" :lazy-load="true"></u-image>
|
<u-image :src="leftImage" width="80px" height="80px" radius="8px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-area">
|
<view class="text-area">
|
||||||
<text style="font-weight: 500;">{{shopInfo.tt}}</text>
|
<text style="font-weight: 500;">{{shopInfo.tt}}</text>
|
||||||
|
|||||||
@@ -99,9 +99,9 @@
|
|||||||
pageNum: this.shopPageNum
|
pageNum: this.shopPageNum
|
||||||
})
|
})
|
||||||
this.$api.getShopList(query).then(res => {
|
this.$api.getShopList(query).then(res => {
|
||||||
res.data.data.forEach(item => {
|
// res.data.data.forEach(item => {
|
||||||
item.pics = this.$api.imgUrl + item.pics
|
// item.pics = this.$api.imgUrl + item.pics
|
||||||
})
|
// })
|
||||||
this.shopListLength = res.data.data.length
|
this.shopListLength = res.data.data.length
|
||||||
this.shopInfoList = [...this.shopInfoList, ...res.data.data]
|
this.shopInfoList = [...this.shopInfoList, ...res.data.data]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -8,11 +8,15 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<ShowShopList v-if="listId == 0" :isEdit="true" :showStyle="1" :shopInfoList="searchInfoList"></ShowShopList>
|
<ShowShopList v-if="listId == 0" :isEdit="true" :showStyle="1" :shopInfoList="searchInfoList"
|
||||||
<SearchShopList v-if="listId == 1" :searchInfoList="searchInfoList" :is-edit="true" :showStyle="1">
|
@delItem="handleDel"></ShowShopList>
|
||||||
|
<SearchShopList v-if="listId == 1" :searchInfoList="searchInfoList" :is-edit="true" :showStyle="1"
|
||||||
|
@delItem="handleDel" @updateItem="handleUpdate">
|
||||||
</SearchShopList>
|
</SearchShopList>
|
||||||
<ShowShopList v-if="listId == 3" :is-edit="true" :showStyle="2" :shopInfoList="searchInfoList"></ShowShopList>
|
<ShowShopList v-if="listId == 3" :is-edit="true" :showStyle="2" :shopInfoList="searchInfoList"
|
||||||
<ShowShopList v-if="listId == 2" :is-edit="true" :showStyle="2" :shopInfoList="searchInfoList"></ShowShopList>
|
@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>
|
<ShowShopList v-if="listId == 4" :showStyle="0" :shopInfoList="matchList"></ShowShopList>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -38,13 +42,46 @@
|
|||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.listId !== 4 && this.searchListLength !== 0) {
|
if (this.listId !== 4 && this.searchListLength !== 0) {
|
||||||
this.pageNum++
|
this.pageNum++
|
||||||
this.getMyPublished(this.listId + 1)
|
this.getMyPublished(this.listId + 1, this.pageSize, this.pageNum)
|
||||||
} else if (this.listId == 4 && this.matchListLength !== 0) {
|
} else if (this.listId == 4 && this.matchListLength !== 0) {
|
||||||
this.matchPageNum++
|
this.matchPageNum++
|
||||||
this.getMatch()
|
this.getMatch()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
getMatch() {
|
||||||
this.$api.getMyMatch({
|
this.$api.getMyMatch({
|
||||||
pageSize: this.matchPageSize,
|
pageSize: this.matchPageSize,
|
||||||
@@ -58,17 +95,20 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getMyPublished(type) {
|
getMyPublished(type, pageSize, pageNum, isDelete) {
|
||||||
this.$api.getMyPublished({
|
this.$api.getMyPublished({
|
||||||
type: type,
|
type: type,
|
||||||
pageSize: this.pageSize,
|
pageSize: pageSize,
|
||||||
pageNum: this.pageNum
|
pageNum: pageNum
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log('发布信息', res);
|
console.log('发布信息', res);
|
||||||
console.log(type);
|
|
||||||
if (res.data.code == 1) {
|
if (res.data.code == 1) {
|
||||||
this.searchListLength = res.data.data.length
|
this.searchListLength = res.data.data.length
|
||||||
|
if (isDelete == 1) {
|
||||||
|
this.searchInfoList = res.data.data
|
||||||
|
} else {
|
||||||
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
|
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.$u.toast(res.data.msg)
|
uni.$u.toast(res.data.msg)
|
||||||
}
|
}
|
||||||
@@ -82,19 +122,19 @@
|
|||||||
this.titletext = option.titletext
|
this.titletext = option.titletext
|
||||||
if (this.titletext == '发布的店铺转让') {
|
if (this.titletext == '发布的店铺转让') {
|
||||||
this.listId = 0
|
this.listId = 0
|
||||||
this.getMyPublished(1)
|
this.getMyPublished(1, this.pageSize, this.pageNum)
|
||||||
}
|
}
|
||||||
if (this.titletext == '发布的找店选址') {
|
if (this.titletext == '发布的找店选址') {
|
||||||
this.listId = 1
|
this.listId = 1
|
||||||
this.getMyPublished(2)
|
this.getMyPublished(2, this.pageSize, this.pageNum)
|
||||||
}
|
}
|
||||||
if (this.titletext == '发布的店铺出租') {
|
if (this.titletext == '发布的店铺出租') {
|
||||||
this.listId = 2
|
this.listId = 2
|
||||||
this.getMyPublished(3)
|
this.getMyPublished(3, this.pageSize, this.pageNum)
|
||||||
}
|
}
|
||||||
if (this.titletext == '发布的项目招商') {
|
if (this.titletext == '发布的项目招商') {
|
||||||
this.listId = 3
|
this.listId = 3
|
||||||
this.getMyPublished(4)
|
this.getMyPublished(4, this.pageSize, this.pageNum)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.titletext == '我的匹配') {
|
if (this.titletext == '我的匹配') {
|
||||||
|
|||||||
@@ -297,6 +297,12 @@ const apiService = {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.post(url, data))
|
resolve(service.post(url, data))
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
deleteMyPublished(data) {
|
||||||
|
const url = '/shop/adel'
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolve(service.delete(url, data))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export {
|
export {
|
||||||
|
|||||||
Reference in New Issue
Block a user