Merge pull request 'lj' (#78) from lj into master

Reviewed-on: http://git.feashow.cn/odjbin/city-store-transfer/pulls/78
This commit is contained in:
luojie
2023-11-18 15:09:42 +00:00
9 changed files with 144 additions and 155 deletions

View File

@@ -15,7 +15,13 @@
</view>
</view>
<view class="item-border">
<DropDownItem v-if="activeIndex !== -1" :list="tablist" @cancelDrop="cancelDrop" :type="'region'" />
<DropDownItem
v-if="activeIndex !== -1"
:list="tablist"
@cancelDrop="cancelDrop"
@getQueryInfo="getQueryInfo"
:type="title[activeIndex]"
/>
</view>
</view>
</template>
@@ -30,23 +36,22 @@
components: {
DropDownItem
},
props: {
postlist: {
type: Array,
default () {
return [
['全部', '餐饮美食', '百货超市', '美容美发'],
['区域1', '区域2', '区域3', '区域4'],
['100m2', '200m2', '300m2'],
['附近的', '最新发布的', '其他']
]
}
}
},
data() {
return {
title: ['行业', '区域', '面积', '筛选'],
activeIndex: -1,
postlist: [
['全部', '餐饮美食', '百货超市', '美容美发'],
['区域1', '区域2', '区域3', '区域4'],
['小于50m²', '50-200m²', '200-600m²', '600-800m²', '800-1000m²', '1000m²以上'],
['面积从大到小', '面积从小到大', '租金从大到小', '租金从小到大']
],
queryInfo: {
region: '',
sortType: '',
areaType: '',
business: ''
}
};
},
computed: {
@@ -56,7 +61,7 @@
},
created() {
this.postlist[0]=JSON.parse(uni.getStorageSync('classList'))
// this.postlist[1]=JSON.parse(uni.getStorageSync('regionList'))
this.postlist[1]=JSON.parse(uni.getStorageSync('regionList'))
},
methods: {
changeActiveIndex(index) {
@@ -66,8 +71,17 @@
this.activeIndex = index
},
cancelDrop() {
console.log("取消遮罩");
this.activeIndex = -1;
},
getQueryInfo(querys) {
this.queryInfo = {
...this.queryInfo,
...querys
}
const query = this.$u.queryParams(this.queryInfo)
console.log(query, 'query');
this.$emit('getQueryInfo', query)
return query
}
}
}

View File

@@ -30,15 +30,38 @@
},
data() {
return {
activeIndex: -1
activeIndex: -1,
queryInfo: {}
}
},
methods: {
handleMask() {
this.$emit('cancelDrop');
},
sendQueryInfo() {
if (this.type === '行业') {
this.queryInfo = {
business: this.list[this.activeIndex]
}
} else if (this.type === '区域') {
this.queryInfo = {
region: this.list[this.activeIndex]
}
} else if (this.type === '面积') {
this.queryInfo = {
areaType: this.activeIndex + 1
}
} else if (this.type === '筛选') {
this.queryInfo = {
sortType: this.activeIndex + 1
}
}
// 发送queryInfo
this.$emit('getQueryInfo', this.queryInfo);
},
async handleActive(index) {
this.activeIndex = index;
this.sendQueryInfo(index);
// 设置一个定时器等待200毫秒
const delayPromise = this.delay(200);
// 等待定时器完成
@@ -55,8 +78,7 @@
}, ms);
});
},
},
}
}
</script>

View File

@@ -13,13 +13,18 @@
<script>
/**
* @property {Array} shopInfoList 对象数组,(不带图片)需要展示商铺列表
* @property {Number} showStyle 展示商铺的样式类型(0为首页默认)
* @property {Boolean} isEdit 是否显示编辑和删除
* @property {Number} listType 获取列表类型传递参数部分
* @property {Object} customQuery 自定义查询参数
*/
export default {
name:"SearchShopList",
data() {
return {
pageSize: 5,
pageNum: 1,
shopInfoList: []
};
},
props: {
@@ -35,38 +40,22 @@
return false
}
},
shopInfoList: {
type: Array,
default() {
return [
{
searchid: 1,
title: '寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右',
price: 5000,
date: '2023-11-02',
phoneNum: 13348946108,
pos: '锦江区',
category: '餐饮美食',
uname: 'A先生',
sqr: 500,
yjtzText: "423万元"
},
{
searchid: 2,
title: '寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右',
price: 7000,
date: '2023-11-02',
phoneNum: 13348946108,
pos: '锦江区',
category: '餐饮美食',
uname: '王先生',
sqr: 200,
yjtzText: "423万元"
}
]
listType:{
type: Number,
default(){
return 2
}
},
customQuery:{
type: Object,
default(){
return {}
}
}
},
created() {
this.getList()
},
methods: {
handleDel(shopid){
console.log("删除了商铺", shopid);
@@ -74,6 +63,19 @@
// TODO不能直接修改
// if(delindex !== -1) this.shopInfoList = this.shopInfoList.slice(delindex,1)
// console.log(this.shopInfoList);
},
getList() {
const query = this.$u.queryParams({
type: this.listType,
pageSize: this.pageSize,
pageNum: this.pageNum,
...this.customQuery
})
console.log(query, 'query');
this.$api.getShopList(query).then(res => {
console.log(this.shopInfoList);
this.shopInfoList = res.data.data
})
}
}
}

View File

@@ -5,42 +5,42 @@
</view>
<view class="list-container">
<view class="text-area">
<text>{{shopInfo.title}}</text>
<text>{{shopInfo.tt}}</text>
<view class="style2" v-if="showStyle === 1">
<view class="rent-and-cost">
<text>租金{{shopInfo.price}}/</text>
<text v-if="showStyle==1">预计投资{{shopInfo.yjtzText}}</text>
<text>租金{{shopInfo.zujin}}/</text>
<text v-if="showStyle==1">预计投资{{shopInfo.zhuanrangfei}}</text>
</view>
<view class="cart-and-pos">
<view>
<view>
<u-image src="/static/shoplist/sy_icon_lbhy.png" width="12px" height="15px"></u-image>
</view>
<text>{{shopInfo.category}}</text>
<text>{{shopInfo.trade1}}</text>
</view>
<view>
<view>
<u-image src="/static/shoplist/sy_icon_lbhdw.png" width="12px" height="15px"></u-image>
</view>
<text>{{shopInfo.pos}}</text>
<text>{{shopInfo.area1}}</text>
</view>
</view>
</view>
<view class="style3" v-if="showStyle === 2">
<view class="cjsj">成交时间{{shopInfo.date}}</view>
<view class="cjsj">成交时间{{$u.timeFormat(shopInfo.deal_time,'yyyy-mm-dd')}}</view>
<view class="cart-and-pos">
<view>
<view>
<u-image src="/static/cjal/al_icon_flh.png" width="12px" height="15px"></u-image>
</view>
<text :class="{style3: showStyle === 2}">{{shopInfo.category}}</text>
<text :class="{style3: showStyle === 2}">{{shopInfo.trade1}}</text>
</view>
<view>
<view>
<u-image src="/static/cjal/al_icon_dwh.png" width="12px" height="15px"></u-image>
</view>
<text :class="{style3: showStyle === 2}">{{shopInfo.pos}}</text>
<text :class="{style3: showStyle === 2}">{{shopInfo.area1}}</text>
</view>
</view>
</view>
@@ -51,21 +51,21 @@
<u-image v-if="showStyle === 2" src="/static/cjal/al_icon_pm.png" width="12px" height="15px"></u-image>
<u-image v-else src="/static/shoplist/sy_icon_lbpm.png" width="12px" height="15px"></u-image>
</view>
<text :class="{style3: showStyle === 2}">{{shopInfo.sqr}}m2</text>
<text :class="{style3: showStyle === 2}">{{shopInfo.mianji}}m2</text>
</view>
<view>
<view>
<u-image v-if="showStyle === 2" src="/static/cjal/al_icon_mch.png" width="12px" height="15px"></u-image>
<u-image v-else src="/static/shoplist/sy_icon_lbxm.png" width="12px" height="15px"></u-image>
</view>
<text :class="{style3: showStyle === 2}">{{shopInfo.uname}}</text>
<text :class="{style3: showStyle === 2}">{{shopInfo.lianxiren}}</text>
</view>
<view style="flex:2">
<view>
<u-image v-if="showStyle === 2" src="/static/cjal/al_icon_sjh.png" width="12px" height="15px"></u-image>
<u-image v-else src="/static/shoplist/sy_icon_lblxr.png" width="12px" height="15px"></u-image>
</view>
<text :class="{style3: showStyle === 2}">{{shopInfo.phoneNum}}</text>
<text :class="{style3: showStyle === 2}">{{shopInfo.mobile}}</text>
</view>
</view>
@@ -74,28 +74,28 @@
<view>
<u-image src="/static/shoplist/sy_icon_lbhy.png" width="12px" height="15px"></u-image>
</view>
<text>{{shopInfo.category}}</text>
<text>{{shopInfo.trade1}}</text>
</view>
<view>
<view>
<u-image src="/static/shoplist/sy_icon_lbhdw.png" width="12px" height="15px"></u-image>
</view>
<text>{{shopInfo.pos}}</text>
<text>{{shopInfo.area1}}</text>
</view>
<view style="flex:2">
<view>
<u-image src="/static/shoplist/sy_icon_lbrq.png" width="12px" height="15px"></u-image>
</view>
<text>发布日期{{shopInfo.date}}</text>
<text>发布日期{{$u.timeFormat(shopInfo.pub_time,'yyyy-mm-dd')}}</text>
</view>
</view>
<view v-if="isEdit" class="del-and-edit bottom-common">
<view class="edit" @click="handleEdit(shopInfo.searchid)">
<view class="edit" @click="handleEdit(shopInfo.id)">
<u-image src="/static/shoplist/dp_icon_pj.png" width="12px" height="15px"></u-image>
<text>编辑</text>
</view>
<view class="del" @click="handleDel(shopInfo.searchid)">
<view class="del" @click="handleDel(shopInfo.id)">
<u-image src="/static/shoplist/dp_icon_sc.png" width="12px" height="15px"></u-image>
<text>删除</text>
</view>
@@ -113,14 +113,7 @@
type:Object,
default(){
return {
title: '寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右',
price: 5000,
date: '2023-11-02',
phoneNum: 13348946108,
pos: '锦江区',
category: '餐饮美食',
uname: '王先生',
sqr: 200
}
}
},
@@ -151,6 +144,7 @@
handleEdit(searchid) {
// TODO 完成页面跳转
console.log("点击了编辑ID为",searchid);
},
handleDel(searchid) {
this.$emit('delItem', searchid)

View File

@@ -19,12 +19,18 @@
* @property {Number} showStyle 展示商铺的样式类型(0为首页默认)
* @property {Boolean} isADshow 是否显示推广广告
* @property {Boolean} isEdit 是否显示编辑和删除
* @property {String} adlinkPath 推广广告跳转链接
* @property {Number} listType 获取列表类型传递参数部分
* @property {Object} customQuery 自定义查询参数
*/
export default {
name:"ShowShopList",
data() {
return {
pageSize: 5,
pageNum: 1,
shopInfoList: []
};
},
props: {
@@ -52,87 +58,22 @@
return false
}
},
//获取列表类型传递参数部分
// //获取列表类型传递参数部分
listType:{
type: Number,
default() {
return 1
}
},
pageSize: {
type: Number,
customQuery:{
type: Object,
default() {
return 5
}
},
pageNum: {
type: Number,
default() {
return 1
}
},
shopInfoList: {
type: Array,
default() {
return [
{
id: 1,
type: 1,
shopid: 1,
imageUrl: 'https://alifei01.cfp.cn/creative/vcg/800/new/VCG41175510742.jpg',
title: '琴行铺面转让',
promotionNum: 23,
price: 5000,
date: '2023-11-02',
pos: '锦江区',
exactPos: '锦江区-汇源南路366号',
sqr: 100,
zrfText: "转让费20000万",
category: '餐饮美食',
uname: "张先生",
phoneNum: 13348946108,
},
{
"id": "1",
"pic": "3",
"tt": "333",
"type": "0",
"adress": "",
"trade1": "啊",
"trade2": "餐馆",
"btype1": "",
"btype2": "",
"area1": "青羊区",
"area2": "",
"mianji": "33",
"zhuanrangfei": "44",
"zujin": "44",
"hits": "0",
"58url": "",
"personurl": "",
"kw": "",
"remark": "",
"content": "44vv",
"pics": "",
"user_level_id": "1",
"lianxiren": "3333",
"mobile": "44444",
"status": "1",
"shangpulx": "1",
"zhuangtai": "1",
"lng": "2222.00000000",
"lat": "3333.00000000",
"pub_time": "0",
"create_time": "1699973131",
"update_time": "1699973131",
"delete_time": "0",
"userid": "1",
"success": "2"
}
]
return {}
}
}
},
methods: {
handleDel(shopid){
console.log("删除了商铺", shopid);
@@ -145,11 +86,16 @@
const query = this.$u.queryParams({
type: this.listType,
pageSize: this.pageSize,
pageNum: this.pageNum
pageNum: this.pageNum,
...this.customQuery
})
console.log("query",query);
this.$api.getShopList(query).then(res => {
console.log("shoplist",res.data.data);
this.shopInfoList = res.data.data
this.shopInfoList.forEach(item=>{
item.pics =this.$api.imgUrl + item.pics
});
})
}
},

View File

@@ -5,7 +5,7 @@
<u-image width="80px" height="80px" :src="shopInfo.pics" radius="8px"></u-image>
</view>
<view class="text-area">
<text style="font-weight: 500;">{{shopInfo.title}}</text>
<text style="font-weight: 500;">{{shopInfo.tt}}</text>
<view v-if="showStyle == 0" class="pos-and-sqr" >
<view>
<view>
@@ -30,8 +30,9 @@
</view>
<view class="rent-and-date">
<text>租金{{shopInfo.zujin}}/</text>
<text v-if="showStyle == 0">发布日期{{shopInfo.create_time}}</text>
<text v-if="showStyle == 0">发布日期{{$u.timeFormat(shopInfo.pub_time,'yyyy-mm-dd')}}</text>
<text v-if="showStyle == 1">转让费{{shopInfo.zhuanrangfei}}</text>
<!-- bug -->
</view>
</view>
</view>
@@ -71,7 +72,7 @@
>
<view>
<text>已将该店推给</text>
<text style="color:#ce3b3b;margin: 0 4px;"> {{shopInfo.promotionNum}} </text>
<text style="color:#ce3b3b;margin: 0 4px;"> {{shopInfo.num}} </text>
<text> 位潜在客户</text>
</view>
<text style="color:#ce3b3b">我也要推广>></text>
@@ -163,7 +164,7 @@
id: this.shopInfo.id,
type: this.shopInfo.type
})
// console.log("query",query);
console.log("query",query);
uni.navigateTo({
url: '/pages/detail/detail' + `${query}`
})

View File

@@ -15,7 +15,7 @@
<DropDown></DropDown>
</view>
<view class="marginLR10">
<ShowShopList :showStyle="2" :adlinkPath = "adlinkPath"/>
<ShowShopList :showStyle="2" :adlinkPath = "adlinkPath" :listType="3"/>
</view>
</view>
</template>

View File

@@ -15,7 +15,7 @@
<DropDown></DropDown>
</view>
<view class="marginLR10">
<ShowShopList :showStyle="2" :adlinkPath="adlinkPath"/>
<ShowShopList :showStyle="2" :adlinkPath="adlinkPath" :listType="4"/>
</view>
</view>
</template>

View File

@@ -281,6 +281,16 @@ const apiService = {
resolve(service.post(url, data))
})
},
// 获得成交案例
getSuccList(type){
if (!type) {
type = 1
}
const url = `/shop/succ/?type=${type}`
return new Promise((resolve,reject) => {
resolve(service.get(url))
})
}
}
export {
apiService,