梁航:合并及数字键盘
This commit is contained in:
@@ -1,21 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="tabs-bg" />
|
<view class="tabs-bg"></view>
|
||||||
<view class="tabs">
|
<view class="tabs">
|
||||||
<view class="title-view" v-for="(item, index) in title" :key="item" @click="changeActiveIndex(index)"
|
<view class="title-view" v-for="(item, index) in title" :key="item" @click="changeActiveIndex(index)"
|
||||||
:class="{isActive: activeIndex === index}">
|
:class="{isActive: activeIndex === index}">
|
||||||
<text>{{item}}</text>
|
<text>{{item}}</text>
|
||||||
<view class="arrow" v-if="activeIndex !== index">
|
<view class="arrow" v-if="activeIndex !== index">
|
||||||
<u-image src="/static/dropdown/dp_icon_lxia.png" width="14rpx" height="11rpx" />
|
<u-image src="/static/dropdown/dp_icon_lxia.png" width="14rpx" height="11rpx"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="arrow" v-if="activeIndex === index">
|
<view class="arrow" v-if="activeIndex === index">
|
||||||
<u-image src="/static/dropdown/dp_icon_hlxia.png" width="14rpx" height="11rpx" />
|
<u-image src="/static/dropdown/dp_icon_hlxia.png" width="14rpx" height="11rpx"></u-image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-border">
|
<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>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -30,23 +31,22 @@
|
|||||||
components: {
|
components: {
|
||||||
DropDownItem
|
DropDownItem
|
||||||
},
|
},
|
||||||
props: {
|
|
||||||
postlist: {
|
|
||||||
type: Array,
|
|
||||||
default () {
|
|
||||||
return [
|
|
||||||
['全部', '餐饮美食', '百货超市', '美容美发'],
|
|
||||||
['区域1', '区域2', '区域3', '区域4'],
|
|
||||||
['100m2', '200m2', '300m2'],
|
|
||||||
['附近的', '最新发布的', '其他']
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: ['行业', '区域', '面积', '筛选'],
|
title: ['行业', '区域', '面积', '筛选'],
|
||||||
activeIndex: -1,
|
activeIndex: -1,
|
||||||
|
postlist: [
|
||||||
|
['全部', '餐饮美食', '百货超市', '美容美发'],
|
||||||
|
['区域1', '区域2', '区域3', '区域4'],
|
||||||
|
['小于50m²', '50-200m²', '200-600m²', '600-800m²', '800-1000m²', '1000m²以上'],
|
||||||
|
['面积从大到小', '面积从小到大', '租金从大到小', '租金从小到大']
|
||||||
|
],
|
||||||
|
queryInfo: {
|
||||||
|
region: '',
|
||||||
|
sortType: '',
|
||||||
|
areatype: '',
|
||||||
|
business: ''
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -55,8 +55,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.postlist[0]=JSON.parse(uni.getStorageSync('classList'))
|
this.postlist[0] = JSON.parse(uni.getStorageSync('classList'))
|
||||||
// this.postlist[1]=JSON.parse(uni.getStorageSync('regionList'))
|
// this.postlist[0].unshift('全部')
|
||||||
|
this.postlist[1] = JSON.parse(uni.getStorageSync('regionList'))
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeActiveIndex(index) {
|
changeActiveIndex(index) {
|
||||||
@@ -66,8 +67,18 @@
|
|||||||
this.activeIndex = index
|
this.activeIndex = index
|
||||||
},
|
},
|
||||||
cancelDrop() {
|
cancelDrop() {
|
||||||
console.log("取消遮罩");
|
|
||||||
this.activeIndex = -1;
|
this.activeIndex = -1;
|
||||||
|
},
|
||||||
|
getQueryInfo(querys) {
|
||||||
|
this.queryInfo = {
|
||||||
|
...this.queryInfo,
|
||||||
|
...querys
|
||||||
|
}
|
||||||
|
const query = this.$u.queryParams(this.queryInfo)
|
||||||
|
console.log(query, 'dropquery');
|
||||||
|
this.$emit('getQueryInfo', this.queryInfo)
|
||||||
|
|
||||||
|
return query
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,15 +30,38 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeIndex: -1
|
activeIndex: -1,
|
||||||
|
queryInfo: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleMask() {
|
handleMask() {
|
||||||
this.$emit('cancelDrop');
|
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) {
|
async handleActive(index) {
|
||||||
this.activeIndex = index;
|
this.activeIndex = index;
|
||||||
|
this.sendQueryInfo(index);
|
||||||
// 设置一个定时器,等待200毫秒
|
// 设置一个定时器,等待200毫秒
|
||||||
const delayPromise = this.delay(200);
|
const delayPromise = this.delay(200);
|
||||||
// 等待定时器完成
|
// 等待定时器完成
|
||||||
@@ -55,8 +78,7 @@
|
|||||||
}, ms);
|
}, ms);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
<view class="input-and-swiper-root">
|
<view class="input-and-swiper-root">
|
||||||
<view class="search-box" v-if="type!=='0'">
|
<view class="search-box" v-if="type!=='0'">
|
||||||
<view class="search-box-input">
|
<view class="search-box-input">
|
||||||
<u-input placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
|
<u-input v-model="keyword" placeholder="请输入店铺名称进行搜索" placeholder-style="color: #969696" prefixIcon="search"
|
||||||
prefixIconStyle="font-size: 24px;color: #909399;" border="true">
|
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @clear="handleClear" clearable @change="changeInput">
|
||||||
<template slot="suffix">
|
<template slot="suffix">
|
||||||
<view style="display: flex;align-items: center;">
|
<view style="display: flex;align-items: center;">
|
||||||
<u-icon name="map-fill" color="#329866" size="22"></u-icon>
|
<u-icon name="map-fill" color="#329866" size="22"></u-icon>
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import QQMapWX from "@/utils/qqmap-wx-jssdk.min.js"
|
||||||
export default {
|
export default {
|
||||||
name: "inputAndSwiper",
|
name: "inputAndSwiper",
|
||||||
props: {
|
props: {
|
||||||
@@ -35,25 +36,142 @@
|
|||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '1'
|
default: '1'
|
||||||
|
},
|
||||||
|
refresh: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
position: uni.getStorageSync('city') + uni.getStorageSync('district').slice(0, 2),
|
position: uni.getStorageSync('city') + uni.getStorageSync('district').slice(0, 2),
|
||||||
currentNum: ''
|
currentNum: '',
|
||||||
|
keyword:''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
styleIsolation: 'shared', // 解除样式隔离
|
styleIsolation: 'shared', // 解除样式隔离
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
refresh(newVal, oldVal) {
|
||||||
|
console.log('newVal',newVal);
|
||||||
|
if(newVal){
|
||||||
|
this.keyword=''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
if (this.type !== '0') {
|
||||||
|
this.open()
|
||||||
|
}
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeInput(e){
|
||||||
|
this.$emit('getQueryInfo',e)
|
||||||
|
},
|
||||||
|
handleClear(e){
|
||||||
|
|
||||||
|
console.log('handleClear',e);
|
||||||
|
},
|
||||||
|
open() {
|
||||||
|
if (!uni.getStorageSync('city') && !uni.getStorageSync('district')) {
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
if (!res.locationEnabled || !res.locationAuthorized) {
|
||||||
|
uni.showModal({
|
||||||
|
content: '检测到您没打开手机系统定位权限,请确保手机系统定位已开启',
|
||||||
|
confirmText: "确认",
|
||||||
|
showCancel: false,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.getUserLocation();
|
||||||
|
} else {
|
||||||
|
console.log('取消');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.getUserLocation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getUserLocation() {
|
||||||
|
var that = this
|
||||||
|
let qqmapsdk = new QQMapWX({
|
||||||
|
key: that.$api.key
|
||||||
|
});
|
||||||
|
uni.getFuzzyLocation({
|
||||||
|
type: 'wgs84',
|
||||||
|
success(res) {
|
||||||
|
console.log('res.latitude', res.latitude);
|
||||||
|
console.log('res.longitude', res.longitude);
|
||||||
|
uni.setStorageSync('latitude', res.latitude);
|
||||||
|
uni.setStorageSync('longitude', res.longitude);
|
||||||
|
qqmapsdk.reverseGeocoder({
|
||||||
|
location: {
|
||||||
|
latitude: res.latitude,
|
||||||
|
longitude: res.longitude
|
||||||
|
},
|
||||||
|
success: (re) => {
|
||||||
|
console.log("解析地址成功", re);
|
||||||
|
console.log(re.result.ad_info.city);
|
||||||
|
console.log(re.result.ad_info.district);
|
||||||
|
let city = re.result.ad_info.city
|
||||||
|
let district = re.result.ad_info.district
|
||||||
|
console.log('city-code', re.result.ad_info.city_code.substring(3));
|
||||||
|
uni.setStorageSync('city_code', re.result.ad_info.city_code.substring(3));
|
||||||
|
uni.setStorageSync('city', city.slice(0, 2));
|
||||||
|
uni.setStorageSync('district', district);
|
||||||
|
that.getRegionList()
|
||||||
|
// that.position = city.slice(0, 2) + district.slice(0, 2)
|
||||||
|
},
|
||||||
|
fail: (re) => {
|
||||||
|
console.log(re, '失败信息');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
console.log("获取经纬度失败", err);
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
if (!res.locationEnabled || !res.locationAuthorized) {
|
||||||
|
uni.showModal({
|
||||||
|
content: '检测到您没打开手机系统定位权限,请确保手机系统定位已开启',
|
||||||
|
confirmText: "确认",
|
||||||
|
showCancel: false,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
// uni.openSetting({
|
||||||
|
// success: (res) => {
|
||||||
|
// console.log(res);
|
||||||
|
that.getUserLocation();
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
} else {
|
||||||
|
console.log('取消');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.getUserLocation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
//点击轮播图
|
//点击轮播图
|
||||||
handleSwiperList(currentNum, bannerURL) {
|
handleSwiperList(currentNum, bannerURL) {
|
||||||
const item=bannerURL[currentNum]
|
const item = bannerURL[currentNum]
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: item.link+`?id=${item.param}&type=${item.type}`
|
url: item.link + `?id=${item.param}&type=${item.type}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,75 +1,64 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<SearchShopListItem
|
<SearchShopListItem v-for="item in searchInfoList" :key="searchid" :shopInfo="item" :show-style="showStyle"
|
||||||
v-for="item in shopInfoList"
|
:isEdit="isEdit" @delItem="handleDel" @updateItem="handleUpdate"></SearchShopListItem>
|
||||||
:key="searchid"
|
|
||||||
:shopInfo="item"
|
|
||||||
:show-style="showStyle"
|
|
||||||
:isEdit="isEdit"
|
|
||||||
@delItem="handleDel"
|
|
||||||
></SearchShopListItem>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* @property {Array} shopInfoList 对象数组,(不带图片)需要展示的商铺列表
|
* @property {Number} showStyle 展示商铺的样式类型(0为首页默认)
|
||||||
|
* @property {Boolean} isEdit 是否显示编辑和删除
|
||||||
|
* @property {Number} listType 获取列表类型传递参数部分
|
||||||
|
* @property {Object} customQuery 自定义查询参数
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
name:"SearchShopList",
|
name: "SearchShopList",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
pageSize: 5,
|
||||||
|
pageNum: 1,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
showStyle:{
|
searchInfoList: {
|
||||||
|
type: Array,
|
||||||
|
default () {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showStyle: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default() {
|
default () {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isEdit: {
|
isEdit: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default() {
|
default () {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
shopInfoList: {
|
listType: {
|
||||||
type: Array,
|
type: Number,
|
||||||
default() {
|
default () {
|
||||||
return [
|
return 2
|
||||||
{
|
}
|
||||||
searchid: 1,
|
},
|
||||||
title: '寻找旺铺,200平米左右,寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右',
|
customQuery: {
|
||||||
price: 5000,
|
type: Object,
|
||||||
date: '2023-11-02',
|
default () {
|
||||||
phoneNum: 13348946108,
|
return {}
|
||||||
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万元"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleDel(shopid){
|
handleUpdate(searchid) {
|
||||||
|
this.$emit('updateItem', searchid)
|
||||||
|
},
|
||||||
|
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)
|
||||||
|
|||||||
@@ -3,99 +3,101 @@
|
|||||||
<view class="yzr" v-if="showStyle === 2">
|
<view class="yzr" v-if="showStyle === 2">
|
||||||
<u-image src="/static/cjal/anl_tu.png" width="156rpx" height="156rpx"></u-image>
|
<u-image src="/static/cjal/anl_tu.png" width="156rpx" height="156rpx"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="list-container">
|
<view class="list-container" @click="enterDetail()">
|
||||||
<view class="text-area">
|
<view class="text-area">
|
||||||
<text>{{shopInfo.title}}</text>
|
<u-text style="font-weight: 500;" :text="shopInfo.tt" :lines="2"></u-text>
|
||||||
|
|
||||||
<view class="style2" v-if="showStyle === 1">
|
<view class="style2" v-if="showStyle === 1">
|
||||||
<view class="rent-and-cost">
|
<view class="rent-and-cost">
|
||||||
<text>租金:{{shopInfo.price}}元/月</text>
|
<text>租金:{{shopInfo.zujin}}元/月</text>
|
||||||
<text v-if="showStyle==1">预计投资:{{shopInfo.yjtzText}}</text>
|
<text v-if="showStyle==1">预计投资:{{shopInfo.zhuanrangfei}}万</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cart-and-pos">
|
<view class="cart-and-pos">
|
||||||
<view>
|
<view style="width: 131rpx;margin-right: 68rpx;">
|
||||||
<view>
|
<view style="margin-right: 4px;">
|
||||||
<u-image src="/static/shoplist/sy_icon_lbhy.png" width="12px" height="15px"></u-image>
|
<u-image src="/static/shoplist/sy_icon_lbhy.png" width="12px" height="15px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text>{{shopInfo.category}}</text>
|
<text>{{shopInfo.trade1}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view style="width: 131rpx;">
|
||||||
<view>
|
<view style="margin-right: 4px;">
|
||||||
<u-image src="/static/shoplist/sy_icon_lbhdw.png" width="12px" height="15px"></u-image>
|
<u-image src="/static/shoplist/sy_icon_lbhdw.png" width="12px" height="15px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text>{{shopInfo.pos}}</text>
|
<text>{{shopInfo.area1}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="style3" v-if="showStyle === 2">
|
<view class="style3" v-if="showStyle === 2">
|
||||||
<view class="cjsj">成交时间:{{shopInfo.date}}</view>
|
<view class="cjsj">
|
||||||
|
<text>成交时间:{{$u.timeFormat(shopInfo.deal_time,'yyyy-mm-dd')}}</text>
|
||||||
|
</view>
|
||||||
<view class="cart-and-pos">
|
<view class="cart-and-pos">
|
||||||
<view>
|
<view style="width: 131rpx;margin-right: 68rpx;">
|
||||||
<view>
|
<view style="margin-right: 4px;">
|
||||||
<u-image src="/static/cjal/al_icon_flh.png" width="12px" height="15px"></u-image>
|
<u-image src="/static/cjal/al_icon_flh.png" width="12px" height="15px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text :class="{style3: showStyle === 2}">{{shopInfo.category}}</text>
|
<text :class="{style3: showStyle === 2}">{{shopInfo.trade1}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view style="width: 131rpx;">
|
||||||
<view>
|
<view style="margin-right: 4px;">
|
||||||
<u-image src="/static/cjal/al_icon_dwh.png" width="12px" height="15px"></u-image>
|
<u-image src="/static/cjal/al_icon_dwh.png" width="12px" height="15px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text :class="{style3: showStyle === 2}">{{shopInfo.pos}}</text>
|
<text :class="{style3: showStyle === 2}">{{shopInfo.area1}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="sqr-and-lx" :class="{pb0: showStyle === 2}">
|
<view class="sqr-and-lx" :class="{pb0: showStyle === 2}">
|
||||||
<view>
|
<view style="width: 131rpx;margin-right: 68rpx;">
|
||||||
<view>
|
<view>
|
||||||
<u-image v-if="showStyle === 2" src="/static/cjal/al_icon_pm.png" width="12px" height="15px"></u-image>
|
<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>
|
<u-image v-else src="/static/shoplist/sy_icon_lbpm.png" width="12px" height="15px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text :class="{style3: showStyle === 2}">{{shopInfo.sqr}}m2</text>
|
<text :class="{style3: showStyle === 2}">{{shopInfo.mianji}}m²</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view style="width: 131rpx;margin-right: 64rpx;">
|
||||||
<view>
|
<view>
|
||||||
<u-image v-if="showStyle === 2" src="/static/cjal/al_icon_mch.png" width="12px" height="15px"></u-image>
|
<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>
|
<u-image v-else src="/static/shoplist/sy_icon_lbxm.png" width="12px" height="15px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text :class="{style3: showStyle === 2}">{{shopInfo.uname}}</text>
|
<text :class="{style3: showStyle === 2}">{{shopInfo.lianxiren}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view style="flex:2">
|
<view style="width: 190rpx;">
|
||||||
<view>
|
<view>
|
||||||
<u-image v-if="showStyle === 2" src="/static/cjal/al_icon_sjh.png" width="12px" height="15px"></u-image>
|
<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>
|
<u-image v-else src="/static/shoplist/sy_icon_lblxr.png" width="12px" height="15px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text :class="{style3: showStyle === 2}">{{shopInfo.phoneNum}}</text>
|
<text :class="{style3: showStyle === 2}">{{shopInfo.mobile}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="cart-and-date" v-if="showStyle === 0">
|
<view class="cart-and-date" v-if="showStyle === 0">
|
||||||
<view>
|
<view style="width: 131rpx;">
|
||||||
<view>
|
<view>
|
||||||
<u-image src="/static/shoplist/sy_icon_lbhy.png" width="12px" height="15px"></u-image>
|
<u-image src="/static/shoplist/sy_icon_lbhy.png" width="12px" height="15px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text>{{shopInfo.category}}</text>
|
<text>{{shopInfo.trade1}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view style="width: 131rpx;">
|
||||||
<view>
|
<view>
|
||||||
<u-image src="/static/shoplist/sy_icon_lbhdw.png" width="12px" height="15px"></u-image>
|
<u-image src="/static/shoplist/sy_icon_lbhdw.png" width="12px" height="15px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text>{{shopInfo.pos}}</text>
|
<text>{{shopInfo.area1}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view style="flex:2">
|
<view style="width: 290rpx;">
|
||||||
<view>
|
<view>
|
||||||
<u-image src="/static/shoplist/sy_icon_lbrq.png" width="12px" height="15px"></u-image>
|
<u-image src="/static/shoplist/sy_icon_lbrq.png" width="12px" height="15px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text>发布日期:{{shopInfo.date}}</text>
|
<text>发布日期:{{$u.timeFormat(shopInfo.pub_time,'yyyy-mm-dd')}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="isEdit" class="del-and-edit bottom-common">
|
<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>
|
<u-image src="/static/shoplist/dp_icon_pj.png" width="12px" height="15px"></u-image>
|
||||||
<text>编辑</text>
|
<text>编辑</text>
|
||||||
</view>
|
</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>
|
<u-image src="/static/shoplist/dp_icon_sc.png" width="12px" height="15px"></u-image>
|
||||||
<text>删除</text>
|
<text>删除</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -110,29 +112,22 @@
|
|||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
shopInfo: {
|
shopInfo: {
|
||||||
type:Object,
|
type: Object,
|
||||||
default(){
|
default () {
|
||||||
return {
|
return {
|
||||||
title: '寻找旺铺,200平米左右,寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右',
|
|
||||||
price: 5000,
|
|
||||||
date: '2023-11-02',
|
|
||||||
phoneNum: 13348946108,
|
|
||||||
pos: '锦江区',
|
|
||||||
category: '餐饮美食',
|
|
||||||
uname: '王先生',
|
|
||||||
sqr: 200
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showStyle: {
|
showStyle: {
|
||||||
type:Number,
|
type: Number,
|
||||||
default() {
|
default () {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isEdit: {
|
isEdit: {
|
||||||
type:Boolean,
|
type: Boolean,
|
||||||
default(){
|
default () {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,9 +143,22 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
enterDetail() {
|
||||||
|
// console.log("进入详情页面");
|
||||||
|
const query = this.$u.queryParams({
|
||||||
|
id: this.shopInfo.id,
|
||||||
|
type: this.shopInfo.type,
|
||||||
|
search: 1
|
||||||
|
})
|
||||||
|
console.log("query", query);
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/detail/detail' + `${query}`
|
||||||
|
})
|
||||||
|
},
|
||||||
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)
|
||||||
@@ -158,27 +166,36 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.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;
|
||||||
|
z-index: 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cjsj {
|
.cjsj {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
margin-bottom: 12rpx;
|
margin-bottom: 12rpx;
|
||||||
|
|
||||||
|
>text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-border {
|
.list-border {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
@@ -187,105 +204,133 @@
|
|||||||
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 {
|
width: 100%;
|
||||||
font-size: 14px;
|
|
||||||
|
>text {
|
||||||
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
>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;
|
||||||
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
padding-bottom: 6px;
|
padding-bottom: 6px;
|
||||||
}
|
}
|
||||||
.cart-and-pos{
|
|
||||||
> view{
|
.cart-and-pos {
|
||||||
|
>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;
|
||||||
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sqr-and-lx {
|
.sqr-and-lx {
|
||||||
justify-content: space-between;
|
display: flex;
|
||||||
|
// 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;
|
||||||
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.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;
|
||||||
margin-right: 48rpx;
|
// margin-right: 48rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,8 @@
|
|||||||
<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"
|
||||||
:key="shopid"
|
@updateItem="hanldeUpdate"></ShowShopListItem>
|
||||||
:shopInfo="item"
|
|
||||||
:is-adshow="isADshow"
|
|
||||||
:adlinkPath="adlinkPath"
|
|
||||||
:show-style="showStyle"
|
|
||||||
:is-edit="isEdit"
|
|
||||||
@delItem="handleDel"
|
|
||||||
></ShowShopListItem>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -19,123 +12,72 @@
|
|||||||
* @property {Number} showStyle 展示商铺的样式类型(0为首页默认)
|
* @property {Number} showStyle 展示商铺的样式类型(0为首页默认)
|
||||||
* @property {Boolean} isADshow 是否显示推广广告
|
* @property {Boolean} isADshow 是否显示推广广告
|
||||||
* @property {Boolean} isEdit 是否显示编辑和删除
|
* @property {Boolean} isEdit 是否显示编辑和删除
|
||||||
|
* @property {String} adlinkPath 推广广告跳转链接
|
||||||
|
* @property {Number} listType 获取列表类型传递参数部分
|
||||||
|
* @property {Object} customQuery 自定义查询参数
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
name:"ShowShopList",
|
name: "ShowShopList",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
pageSize: 5,
|
||||||
|
pageNum: 1,
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
showStyle:{
|
showStyle: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default() {
|
default () {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isADshow: {
|
isADshow: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default() {
|
default () {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
adlinkPath: {
|
adlinkPath: {
|
||||||
type: String,
|
type: String,
|
||||||
default() {
|
default () {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isEdit: {
|
isEdit: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default() {
|
default () {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取列表类型传递参数部分
|
// //获取列表类型传递参数部分
|
||||||
listType:{
|
listType: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default() {
|
default () {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pageSize: {
|
customQuery: {
|
||||||
type: Number,
|
type: Object,
|
||||||
default() {
|
default () {
|
||||||
return 5
|
return {}
|
||||||
}
|
|
||||||
},
|
|
||||||
pageNum: {
|
|
||||||
type: Number,
|
|
||||||
default() {
|
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
shopInfoList: {
|
shopInfoList: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default() {
|
default () {
|
||||||
return [
|
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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
handleDel(shopid){
|
hanldeUpdate(shopid) {
|
||||||
|
this.$emit('updateItem', 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)
|
||||||
@@ -145,17 +87,20 @@
|
|||||||
const query = this.$u.queryParams({
|
const query = this.$u.queryParams({
|
||||||
type: this.listType,
|
type: this.listType,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
pageNum: this.pageNum
|
pageNum: this.pageNum,
|
||||||
|
...this.customQuery
|
||||||
})
|
})
|
||||||
|
console.log("query", query);
|
||||||
this.$api.getShopList(query).then(res => {
|
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
|
||||||
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<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 width="80px" height="80px" :src="shopInfo.pics" radius="8px"></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.title}}</text>
|
<u-text style="font-weight: 500;" :text="shopInfo.tt" :lines="2" ></u-text>
|
||||||
<view v-if="showStyle == 0" class="pos-and-sqr" >
|
<view v-if="showStyle == 0" class="pos-and-sqr">
|
||||||
<view>
|
<view>
|
||||||
<view>
|
<view>
|
||||||
<u-image src="/static/shoplist/sy_icon_lbdw.png" width="12px" height="15px"></u-image>
|
<u-image src="/static/shoplist/sy_icon_lbdw.png" width="12px" height="15px"></u-image>
|
||||||
@@ -17,21 +17,22 @@
|
|||||||
<view>
|
<view>
|
||||||
<u-image src="/static/shoplist/sy_icon_lbpm.png" width="12px" height="15px"></u-image>
|
<u-image src="/static/shoplist/sy_icon_lbpm.png" width="12px" height="15px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text>{{shopInfo.mianji}}m2</text>
|
<text>{{shopInfo.mianji}}m²</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="pos-and-sqr pos-only" >
|
<view v-else class="pos-and-sqr pos-only">
|
||||||
<view>
|
<view>
|
||||||
<view>
|
<view>
|
||||||
<u-image src="/static/shoplist/dp_icon_hhhdw.png" width="12px" height="15px"></u-image>
|
<u-image src="/static/shoplist/dp_icon_hhhdw.png" width="12px" height="15px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text>{{shopInfo.area2}}</text>
|
<text>{{shopInfo.area1}}-{{shopInfo.adress}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="rent-and-date">
|
<view class="rent-and-date">
|
||||||
<text>租金:{{shopInfo.zujin}}元/月</text>
|
<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>
|
<text v-if="showStyle == 1">转让费:{{shopInfo.zhuanrangfei}}万</text>
|
||||||
|
<!-- 有 bug -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -41,7 +42,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<u-image src="/static/shoplist/sy_icon_lbpm.png" width="12px" height="15px"></u-image>
|
<u-image src="/static/shoplist/sy_icon_lbpm.png" width="12px" height="15px"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<text>{{shopInfo.mianji}}m2</text>
|
<text>{{shopInfo.mianji}}m²</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view>
|
<view>
|
||||||
@@ -63,15 +64,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view
|
<view v-if="isADShow" class="list-ads bottom-common" style="font-size: 11px;" @click="handleAD">
|
||||||
v-if="isADShow"
|
|
||||||
class="list-ads bottom-common"
|
|
||||||
style="font-size: 11px;"
|
|
||||||
@click="handleAD"
|
|
||||||
>
|
|
||||||
<view>
|
<view>
|
||||||
<text>已将该店推给</text>
|
<text>已将该店推给</text>
|
||||||
<text style="color:#ce3b3b;margin: 0 4px;"> {{shopInfo.promotionNum}} </text>
|
<text style="color:#ce3b3b;margin: 0 4px;"> {{shopInfo.num}} </text>
|
||||||
<text> 位潜在客户</text>
|
<text> 位潜在客户</text>
|
||||||
</view>
|
</view>
|
||||||
<text style="color:#ce3b3b">我也要推广>></text>
|
<text style="color:#ce3b3b">我也要推广>></text>
|
||||||
@@ -101,80 +97,83 @@
|
|||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
shopInfo: {
|
shopInfo: {
|
||||||
type:Object,
|
type: Object,
|
||||||
default(){
|
default () {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 展示商铺的样式类型
|
// 展示商铺的样式类型
|
||||||
showStyle:{
|
showStyle: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default() {
|
default () {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 是否展示推广广告
|
// 是否展示推广广告
|
||||||
isADShow: {
|
isADShow: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default() {
|
default () {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 推广广告链接
|
// 推广广告链接
|
||||||
adlinkPath: {
|
adlinkPath: {
|
||||||
type: String,
|
type: String,
|
||||||
default() {
|
default () {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 是否可编辑
|
// 是否可编辑
|
||||||
isEdit: {
|
isEdit: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default() {
|
default () {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
delshopid: 0,
|
delshopid: 0,
|
||||||
|
leftImage: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.leftImage = this.$api.imgUrl + this.shopInfo.pics.split(',')[0]
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleEdit(shopid) {
|
handleEdit(shopid) {
|
||||||
// TODO 完成页面跳转
|
// TODO 完成页面跳转
|
||||||
console.log("点击了编辑ID为",shopid);
|
console.log("点击了编辑ID为", shopid);
|
||||||
|
this.$emit('updateItem', shopid)
|
||||||
},
|
},
|
||||||
handleDel(shopid) {
|
handleDel(shopid) {
|
||||||
// 需完善删除请求
|
// 需完善删除请求
|
||||||
this.$emit('delItem', shopid)
|
this.$emit('delItem', shopid)
|
||||||
},
|
},
|
||||||
enterDetail(){
|
enterDetail() {
|
||||||
// console.log("进入详情页面");
|
// console.log("进入详情页面");
|
||||||
const query=this.$u.queryParams({
|
const query = this.$u.queryParams({
|
||||||
id: this.shopInfo.id,
|
id: this.shopInfo.id,
|
||||||
type: this.shopInfo.type
|
type: this.shopInfo.type
|
||||||
})
|
})
|
||||||
// console.log("query",query);
|
console.log("query", query);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/detail/detail' + `${query}`
|
url: '/pages/detail/detail' + `${query}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleAD(){
|
handleAD() {
|
||||||
// TODO 完成页面跳转
|
// TODO 完成页面跳转
|
||||||
if (this.adlinkPath) {
|
if (this.adlinkPath) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: this.adlinkPath
|
url: this.adlinkPath
|
||||||
})
|
})
|
||||||
}else {
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/publish/publishTransfer/publishTransfer'
|
url: '/pages/publish/publishTransfer/publishTransfer'
|
||||||
})
|
})
|
||||||
@@ -193,39 +192,47 @@
|
|||||||
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: 80px;
|
height: 80px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-area {
|
.text-area {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
> text {
|
|
||||||
|
>text, >u-text {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pos-and-sqr {
|
.pos-and-sqr {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
color: #359867;
|
color: #359867;
|
||||||
line-height: 12px;
|
line-height: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
margin-right: 24px;
|
margin-right: 24px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pos-only {
|
.pos-only {
|
||||||
text {
|
text {
|
||||||
color: #A0A0A0;
|
color: #A0A0A0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.rent-and-date {
|
.rent-and-date {
|
||||||
text {
|
text {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -239,42 +246,51 @@
|
|||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cart-and-date {
|
.cart-and-date {
|
||||||
margin-bottom: 6px;
|
margin-bottom: 6px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
color: #359867;
|
color: #359867;
|
||||||
line-height: 12px;
|
line-height: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
flex:1;
|
flex: 1;
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-ads {
|
.list-ads {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
color: #359867;
|
color: #359867;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
14
pages.json
14
pages.json
@@ -36,7 +36,7 @@
|
|||||||
"navigationBarTitleText": "店铺转让",
|
"navigationBarTitleText": "店铺转让",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarBackgroundColor": "#339967",
|
"navigationBarBackgroundColor": "#339967",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
"navigationBarTitleText": "找店地址",
|
"navigationBarTitleText": "找店地址",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarBackgroundColor": "#339967",
|
"navigationBarBackgroundColor": "#339967",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/detail/detail",
|
"path": "pages/detail/detail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "商品详情",
|
"navigationBarTitleText": "商铺详情",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarBackgroundColor": "#339967",
|
"navigationBarBackgroundColor": "#339967",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
@@ -127,7 +127,7 @@
|
|||||||
"navigationBarTitleText": "转让信息",
|
"navigationBarTitleText": "转让信息",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarBackgroundColor": "#339967",
|
"navigationBarBackgroundColor": "#339967",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
"navigationBarTitleText": "找店信息",
|
"navigationBarTitleText": "找店信息",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarBackgroundColor": "#339967",
|
"navigationBarBackgroundColor": "#339967",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -145,7 +145,7 @@
|
|||||||
"navigationBarTitleText": "出租信息",
|
"navigationBarTitleText": "出租信息",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarBackgroundColor": "#339967",
|
"navigationBarBackgroundColor": "#339967",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -154,7 +154,7 @@
|
|||||||
"navigationBarTitleText": "项目招商",
|
"navigationBarTitleText": "项目招商",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarBackgroundColor": "#339967",
|
"navigationBarBackgroundColor": "#339967",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="detail" ref="viewref">
|
<view class="detail" ref="viewref">
|
||||||
<view class="swiper">
|
<view class="swiper" v-if="search">
|
||||||
<u-swiper :list="shopInfo.pics" keyName="pics" height="500rpx" radius="0"></u-swiper>
|
<u-swiper :list="shopInfo.pics" height="500rpx" radius="0"></u-swiper>
|
||||||
</view>
|
</view>
|
||||||
<view class="sub-detail u-flex">
|
<view class="sub-detail u-flex">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
@@ -13,9 +13,10 @@
|
|||||||
<view class="grid-textup">{{shopInfo.zujin}}元/月</view>
|
<view class="grid-textup">{{shopInfo.zujin}}元/月</view>
|
||||||
<view class="grid-text">租金</view>
|
<view class="grid-text">租金</view>
|
||||||
</u-grid-item>
|
</u-grid-item>
|
||||||
<u-grid-item>
|
<u-grid-item v-if="type==1||type==2">
|
||||||
<view class="grid-textup">{{shopInfo.zhuanrangfei}}万元</view>
|
<view class="grid-textup">{{shopInfo.zhuanrangfei}}万元</view>
|
||||||
<view class="grid-text">转让费</view>
|
<view v-if="search" class="grid-text">转让费</view>
|
||||||
|
<view v-else class="grid-text">预计投资</view>
|
||||||
</u-grid-item>
|
</u-grid-item>
|
||||||
<u-grid-item>
|
<u-grid-item>
|
||||||
<view class="grid-textup">{{shopInfo.mianji}}m²</view>
|
<view class="grid-textup">{{shopInfo.mianji}}m²</view>
|
||||||
@@ -30,14 +31,14 @@
|
|||||||
<view class="location-detail">
|
<view class="location-detail">
|
||||||
<text>行业:{{shopInfo.trade1}}</text>
|
<text>行业:{{shopInfo.trade1}}</text>
|
||||||
<text>区域:{{shopInfo.area1}}</text>
|
<text>区域:{{shopInfo.area1}}</text>
|
||||||
<text>地址:{{shopInfo.adress}}</text>
|
<text v-if="search">地址:{{shopInfo.adress}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="bgc">
|
<view class="bgc">
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="seller-shop-detail">
|
<view class="seller-shop-detail">
|
||||||
<view class="avator">
|
<view class="avator">
|
||||||
<u-avatar :src="src"></u-avatar>
|
<u-avatar :src="shopInfo.avatar"></u-avatar>
|
||||||
<u-cell :title="shopInfo.lianxiren" :label="shopInfo.mobile" :border="false"></u-cell>
|
<u-cell :title="shopInfo.lianxiren" :label="shopInfo.mobile" :border="false"></u-cell>
|
||||||
</view>
|
</view>
|
||||||
<u-divider :height="5"></u-divider>
|
<u-divider :height="5"></u-divider>
|
||||||
@@ -68,7 +69,7 @@
|
|||||||
</u-modal>
|
</u-modal>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bug-figure">
|
<view v-if="search" class="bug-figure">
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -79,11 +80,19 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
shopInfo: {},
|
shopInfo: {},
|
||||||
showM: false
|
showM: false,
|
||||||
|
search: true,
|
||||||
|
type: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad: function(options) {
|
onLoad: function(options) {
|
||||||
console.log('detail', options);
|
console.log('detail', options);
|
||||||
|
this.type = options.type
|
||||||
|
if (options.search == "1") {
|
||||||
|
this.search = false
|
||||||
|
} else {
|
||||||
|
this.search = true
|
||||||
|
}
|
||||||
//点击轮播图跳转详情, 传递的参数id, type
|
//点击轮播图跳转详情, 传递的参数id, type
|
||||||
if (options.id !== undefined && options.type !== undefined) {
|
if (options.id !== undefined && options.type !== undefined) {
|
||||||
this.getDetail(options.type, options.id)
|
this.getDetail(options.type, options.id)
|
||||||
@@ -100,7 +109,18 @@
|
|||||||
this.$api.getShopDetail(type, id).then(res => {
|
this.$api.getShopDetail(type, id).then(res => {
|
||||||
const data = res.data.data
|
const data = res.data.data
|
||||||
if (res.data.code == 1) {
|
if (res.data.code == 1) {
|
||||||
data.pics = [this.$api.imgUrl + data.pics]
|
console.log('data.pics', data.pics);
|
||||||
|
var arr = [];
|
||||||
|
var arr1 = [];
|
||||||
|
let obj = {}
|
||||||
|
arr = data.pics.split(",")
|
||||||
|
arr.map(item => {
|
||||||
|
obj = this.$api.imgUrl + item
|
||||||
|
arr1.push(obj)
|
||||||
|
})
|
||||||
|
data.pics = arr1
|
||||||
|
console.log('arr', arr1);
|
||||||
|
data.avatar = this.$api.imgUrl + data.avatar
|
||||||
this.shopInfo = data
|
this.shopInfo = data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,15 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<view class="head-img">
|
<!-- <view class="head-img">
|
||||||
<u-image
|
<u-image :src="headimg" width=100% height=200rpx radius="10px"></u-image>
|
||||||
:src="headimg"
|
</view> -->
|
||||||
width=100%
|
|
||||||
height=200rpx
|
|
||||||
radius="10px"
|
|
||||||
></u-image>
|
|
||||||
</view>
|
|
||||||
<view>
|
<view>
|
||||||
<SearchShopList :show-style="2"></SearchShopList>
|
<SearchShopList :show-style="2" :searchInfoList="shopInfoList"></SearchShopList>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -19,10 +14,20 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
headimg: "https://alifei01.cfp.cn/creative/vcg/800/new/VCG41175510742.jpg",
|
headimg: "https://alifei01.cfp.cn/creative/vcg/800/new/VCG41175510742.jpg",
|
||||||
|
shopInfoList: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getInfo()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getInfo() {
|
||||||
|
this.$api.getSuccList().then(res => {
|
||||||
|
this.shopListLength = res.data.data.length
|
||||||
|
this.shopInfoList = [...this.shopInfoList, ...res.data.data]
|
||||||
|
console.log(this.shopInfoList);
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -31,14 +36,15 @@
|
|||||||
page {
|
page {
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.marginLR10 {
|
.marginLR10 {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.head-img {
|
.head-img {
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -4,58 +4,170 @@
|
|||||||
<view class="bug-fix"></view>
|
<view class="bug-fix"></view>
|
||||||
<view class="search-box">
|
<view class="search-box">
|
||||||
<view class="search-box-input">
|
<view class="search-box-input">
|
||||||
<u-input placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
|
<u-input v-model="keyword" placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
|
||||||
prefixIconStyle="font-size: 24px;color: #909399;" border="true">
|
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput">
|
||||||
</u-input>
|
</u-input>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<DropDown></DropDown>
|
<DropDown @getQueryInfo="getShopList"></DropDown>
|
||||||
</view>
|
</view>
|
||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<ShowShopList :showStyle="2" :adlinkPath = "adlinkPath"/>
|
<ShowShopList :showStyle="2" :adlinkPath="adlinkPath" :listType="3" :shopInfoList="shopInfoList" />
|
||||||
|
</view>
|
||||||
|
<view v-if="showNull" class="showNull">
|
||||||
|
<text>没有符合条件的数据, 请下拉刷新重置数据~
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import DropDownItem from "@/components/DropDown/DropDownItem.vue"
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
DropDownItem
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
adlinkPath: "/pages/publish/publishRent/publishRent"
|
adlinkPath: "/pages/publish/publishRent/publishRent",
|
||||||
|
shopInfoList: [],
|
||||||
|
pageSize: 8,
|
||||||
|
pageNum: 1,
|
||||||
|
customQuery: {},
|
||||||
|
shopListLength: '',
|
||||||
|
showNull: false,
|
||||||
|
refresh: false,
|
||||||
|
keyword: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
onPullDownRefresh() {
|
||||||
|
this.refresh = true
|
||||||
|
// if (this.showNull = true) {
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 3,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: 1,
|
||||||
|
})
|
||||||
|
// if(this.showNull=true){
|
||||||
|
// this.pageNum=1
|
||||||
|
// }
|
||||||
|
this.getShopList(q, "refresh")
|
||||||
|
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.shopListLength !== 0) {
|
||||||
|
this.keyword=''
|
||||||
|
this.pageNum++
|
||||||
|
this.getShopList()
|
||||||
|
console.log("触底加载");
|
||||||
|
} else if (this.shopListLength == 0) {
|
||||||
|
this.pageNum = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getShopList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getInput(val){
|
||||||
|
console.log('搜索值',val);
|
||||||
|
if(this.pageNum!==1){
|
||||||
|
this.pageNum=1
|
||||||
|
}
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 3,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
kw:val
|
||||||
|
})
|
||||||
|
this.$api.getShopList(q).then(res => {
|
||||||
|
this.shopListLength = res.data.data.length
|
||||||
|
this.shopInfoList = res.data.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getShopList(q, type) {
|
||||||
|
let query = {}
|
||||||
|
if (type == "refresh") {
|
||||||
|
query = q
|
||||||
|
} else {
|
||||||
|
query = this.getQueryInfo(q)
|
||||||
|
}
|
||||||
|
console.log("listquery", query);
|
||||||
|
this.$api.getShopList(query).then(res => {
|
||||||
|
this.shopListLength = res.data.data.length
|
||||||
|
if (query.includes('business') || query.includes('areatype') || query.includes('sortType') || query
|
||||||
|
.includes('region') || this.refresh) {
|
||||||
|
console.log('筛选');
|
||||||
|
// this.resetQuery(q)
|
||||||
|
this.shopInfoList = res.data.data
|
||||||
|
this.refresh = false
|
||||||
|
if (res.data.data.length == 0) {
|
||||||
|
this.showNull = true
|
||||||
|
} else {
|
||||||
|
this.showNull = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('查询');
|
||||||
|
this.shopInfoList = [...this.shopInfoList, ...res.data.data]
|
||||||
|
}
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
console.log(this.shopInfoList);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getQueryInfo(query) {
|
||||||
|
console.log("getQueryInfo", query);
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 3,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
...query
|
||||||
|
})
|
||||||
|
this.customQuery = q
|
||||||
|
return q
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page{
|
page {
|
||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
}
|
}
|
||||||
.marginLR10{
|
|
||||||
|
.showNull {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100rpx;
|
||||||
|
color: darkgray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.marginLR10 {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
.search-box-bg{
|
|
||||||
|
.search-box-bg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
|
|
||||||
.bug-fix {
|
.bug-fix {
|
||||||
transform: translateY(-20rpx);
|
transform: translateY(-20rpx);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 20rpx;
|
height: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-box {
|
.search-box {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
width: 84.6%;
|
width: 84.6%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
|
||||||
.search-box-input {
|
.search-box-input {
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -77,5 +189,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -4,58 +4,170 @@
|
|||||||
<view class="bug-fix"></view>
|
<view class="bug-fix"></view>
|
||||||
<view class="search-box">
|
<view class="search-box">
|
||||||
<view class="search-box-input">
|
<view class="search-box-input">
|
||||||
<u-input placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
|
<u-input v-model="keyword" placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
|
||||||
prefixIconStyle="font-size: 24px;color: #909399;" border="true">
|
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput">
|
||||||
</u-input>
|
</u-input>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<DropDown></DropDown>
|
<DropDown @getQueryInfo="getShopList"></DropDown>
|
||||||
</view>
|
</view>
|
||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<ShowShopList :showStyle="2" :adlinkPath="adlinkPath"/>
|
<ShowShopList :showStyle="2" :adlinkPath="adlinkPath" :listType="4" :shopInfoList="shopInfoList" />
|
||||||
|
</view>
|
||||||
|
<view v-if="showNull" class="showNull">
|
||||||
|
<text>没有符合条件的数据, 请下拉刷新重置数据~
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import DropDownItem from "@/components/DropDown/DropDownItem.vue"
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
DropDownItem
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
adlinkPath: "/pages/publish/publishInvestment/publishInvestment"
|
adlinkPath: "/pages/publish/publishInvestment/publishInvestment",
|
||||||
|
shopInfoList: [],
|
||||||
|
pageSize: 8,
|
||||||
|
pageNum: 1,
|
||||||
|
customQuery: {},
|
||||||
|
shopListLength: '',
|
||||||
|
showNull: false,
|
||||||
|
refresh: false,
|
||||||
|
keyword: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
onPullDownRefresh() {
|
||||||
|
this.refresh = true
|
||||||
|
// if (this.showNull = true) {
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 4,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: 1,
|
||||||
|
})
|
||||||
|
// if(this.showNull=true){
|
||||||
|
// this.pageNum=1
|
||||||
|
// }
|
||||||
|
this.getShopList(q, "refresh")
|
||||||
|
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (!this.refresh && this.shopListLength !== 0) {
|
||||||
|
this.keyword = ''
|
||||||
|
this.pageNum++
|
||||||
|
this.getShopList()
|
||||||
|
console.log("触底加载");
|
||||||
|
} else if (this.searchListLength == 0) {
|
||||||
|
this.pageNum = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getShopList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getInput(val) {
|
||||||
|
console.log('搜索值', val);
|
||||||
|
if (this.pageNum !== 1) {
|
||||||
|
this.pageNum = 1
|
||||||
|
}
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 4,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
kw: val
|
||||||
|
})
|
||||||
|
this.$api.getShopList(q).then(res => {
|
||||||
|
this.shopListLength = res.data.data.length
|
||||||
|
this.shopInfoList = res.data.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getShopList(q, type) {
|
||||||
|
let query = {}
|
||||||
|
if (type == "refresh") {
|
||||||
|
query = q
|
||||||
|
} else {
|
||||||
|
query = this.getQueryInfo(q)
|
||||||
|
}
|
||||||
|
console.log("listquery", query);
|
||||||
|
this.$api.getShopList(query).then(res => {
|
||||||
|
this.shopListLength = res.data.data.length
|
||||||
|
if (query.includes('business') || query.includes('areatype') || query.includes('sortType') || query
|
||||||
|
.includes('region') || this.refresh) {
|
||||||
|
console.log('筛选');
|
||||||
|
// this.resetQuery(q)
|
||||||
|
this.shopInfoList = res.data.data
|
||||||
|
this.refresh = false
|
||||||
|
if (res.data.data.length == 0) {
|
||||||
|
this.showNull = true
|
||||||
|
} else {
|
||||||
|
this.showNull = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('查询');
|
||||||
|
this.shopInfoList = [...this.shopInfoList, ...res.data.data]
|
||||||
|
}
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
console.log(this.shopInfoList);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getQueryInfo(query) {
|
||||||
|
console.log("getQueryInfo", query);
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 4,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
...query
|
||||||
|
})
|
||||||
|
this.customQuery = q
|
||||||
|
return q
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page{
|
page {
|
||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
}
|
}
|
||||||
.marginLR10{
|
|
||||||
|
.showNull {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100rpx;
|
||||||
|
color: darkgray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.marginLR10 {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
.search-box-bg{
|
|
||||||
|
.search-box-bg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
|
|
||||||
.bug-fix {
|
.bug-fix {
|
||||||
transform: translateY(-20rpx);
|
transform: translateY(-20rpx);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 20rpx;
|
height: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-box {
|
.search-box {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
width: 84.6%;
|
width: 84.6%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
|
||||||
.search-box-input {
|
.search-box-input {
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -77,5 +189,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -4,58 +4,169 @@
|
|||||||
<view class="bug-fix"></view>
|
<view class="bug-fix"></view>
|
||||||
<view class="search-box">
|
<view class="search-box">
|
||||||
<view class="search-box-input">
|
<view class="search-box-input">
|
||||||
<u-input placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
|
<u-input v-model="keyword" placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
|
||||||
prefixIconStyle="font-size: 24px;color: #909399;" border="true">
|
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput">
|
||||||
</u-input>
|
</u-input>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<DropDown></DropDown>
|
<DropDown @getQueryInfo="getShopList"></DropDown>
|
||||||
</view>
|
</view>
|
||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<SearchShopList :showStyle="1"/>
|
<SearchShopList :showStyle="1" :searchInfoList="searchInfoList" />
|
||||||
|
</view>
|
||||||
|
<view v-if="showNull" class="showNull">
|
||||||
|
<text>没有符合条件的数据, 请下拉刷新重置数据~
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import DropDownItem from "@/components/DropDown/DropDownItem.vue"
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
DropDownItem
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
pageSize: 8,
|
||||||
|
pageNum: 1,
|
||||||
|
searchInfoList: [],
|
||||||
|
customQuery: {},
|
||||||
|
searchListLength: '',
|
||||||
|
showNull: false,
|
||||||
|
refresh: false,
|
||||||
|
keyword: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
onPullDownRefresh() {
|
||||||
|
this.refresh = true
|
||||||
|
// if (this.showNull = true) {
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 2,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: 1,
|
||||||
|
})
|
||||||
|
// if(this.showNull=true){
|
||||||
|
// this.pageNum=1
|
||||||
|
// }
|
||||||
|
this.getShopList(q, "refresh")
|
||||||
|
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (!this.refresh && this.searchListLength !== 0) {
|
||||||
|
this.keyword=''
|
||||||
|
this.pageNum++
|
||||||
|
this.getShopList()
|
||||||
|
console.log("触底加载");
|
||||||
|
} else if (this.searchListLength == 0) {
|
||||||
|
this.pageNum = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getShopList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getInput(val){
|
||||||
|
console.log('搜索值',val);
|
||||||
|
if(this.pageNum!==1){
|
||||||
|
this.pageNum=1
|
||||||
|
}
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 2,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
kw:val
|
||||||
|
})
|
||||||
|
this.$api.getShopList(q).then(res => {
|
||||||
|
this.searchListLength = res.data.data.length
|
||||||
|
this.searchInfoList = res.data.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getShopList(q, type) {
|
||||||
|
let query = {}
|
||||||
|
if (type == "refresh") {
|
||||||
|
query = q
|
||||||
|
} else {
|
||||||
|
query = this.getQueryInfo(q)
|
||||||
|
}
|
||||||
|
console.log("listquery", query);
|
||||||
|
this.$api.getShopList(query).then(res => {
|
||||||
|
this.searchListLength = res.data.data.length
|
||||||
|
if (query.includes('business') || query.includes('areatype') || query.includes('sortType') || query
|
||||||
|
.includes('region') || this.refresh) {
|
||||||
|
console.log('筛选');
|
||||||
|
// this.resetQuery(q)
|
||||||
|
this.searchInfoList = res.data.data
|
||||||
|
this.refresh = false
|
||||||
|
if (res.data.data.length == 0) {
|
||||||
|
this.showNull = true
|
||||||
|
} else {
|
||||||
|
this.showNull = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('查询');
|
||||||
|
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
|
||||||
|
}
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
console.log(this.searchInfoList);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getQueryInfo(query) {
|
||||||
|
console.log("getQueryInfo", query);
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 2,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
...query
|
||||||
|
})
|
||||||
|
this.customQuery = q
|
||||||
|
return q
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page{
|
page {
|
||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
}
|
}
|
||||||
.marginLR10{
|
|
||||||
|
.showNull {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100rpx;
|
||||||
|
color: darkgray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.marginLR10 {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
.search-box-bg{
|
|
||||||
|
.search-box-bg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
|
|
||||||
.bug-fix {
|
.bug-fix {
|
||||||
transform: translateY(-20rpx);
|
transform: translateY(-20rpx);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 20rpx;
|
height: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-box {
|
.search-box {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
width: 84.6%;
|
width: 84.6%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
|
||||||
.search-box-input {
|
.search-box-input {
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -77,5 +188,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -4,58 +4,169 @@
|
|||||||
<view class="bug-fix"></view>
|
<view class="bug-fix"></view>
|
||||||
<view class="search-box">
|
<view class="search-box">
|
||||||
<view class="search-box-input">
|
<view class="search-box-input">
|
||||||
<u-input placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
|
<u-input v-model="keyword" placeholder="请输入店铺名称进行搜索" placeholder-style="color: #969696" prefixIcon="search"
|
||||||
prefixIconStyle="font-size: 24px;color: #909399;" border="true">
|
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput">
|
||||||
</u-input>
|
</u-input>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<DropDown></DropDown>
|
<DropDown @getQueryInfo="getShopList"></DropDown>
|
||||||
</view>
|
</view>
|
||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<ShowShopList :showStyle="1"/>
|
<ShowShopList :showStyle="1" :shopInfoList="shopInfoList" />
|
||||||
|
</view>
|
||||||
|
<view v-if="showNull" class="showNull">
|
||||||
|
<text>没有符合条件的数据, 请下拉刷新重置数据~
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import DropDownItem from "@/components/DropDown/DropDownItem.vue"
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
DropDownItem
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
shopInfoList: [],
|
||||||
|
pageSize: 8,
|
||||||
|
pageNum: 1,
|
||||||
|
customQuery: {},
|
||||||
|
shopListLength: '',
|
||||||
|
showNull: false,
|
||||||
|
refresh: false,
|
||||||
|
keyword: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
onPullDownRefresh() {
|
||||||
|
this.refresh = true
|
||||||
|
// if (this.showNull = true) {
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 1,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: 1,
|
||||||
|
})
|
||||||
|
// if(this.showNull=true){
|
||||||
|
// this.pageNum=1
|
||||||
|
// }
|
||||||
|
this.getShopList(q, "refresh")
|
||||||
|
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (!this.refresh && this.shopListLength !== 0) {
|
||||||
|
this.keyword=''
|
||||||
|
this.pageNum++
|
||||||
|
this.getShopList()
|
||||||
|
console.log("触底加载");
|
||||||
|
} else if (this.shopListLength == 0) {
|
||||||
|
this.pageNum = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getShopList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getInput(val) {
|
||||||
|
console.log('搜索值', val);
|
||||||
|
if (this.pageNum !== 1) {
|
||||||
|
this.pageNum = 1
|
||||||
|
}
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 1,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
kw: val
|
||||||
|
})
|
||||||
|
this.$api.getShopList(q).then(res => {
|
||||||
|
this.shopListLength = res.data.data.length
|
||||||
|
this.shopInfoList = res.data.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getShopList(q, type) {
|
||||||
|
let query = {}
|
||||||
|
if (type == "refresh") {
|
||||||
|
query = q
|
||||||
|
} else {
|
||||||
|
query = this.getQueryInfo(q)
|
||||||
|
}
|
||||||
|
console.log("listquery", query);
|
||||||
|
this.$api.getShopList(query).then(res => {
|
||||||
|
this.shopListLength = res.data.data.length
|
||||||
|
if (query.includes('business') || query.includes('areatype') || query.includes('sortType') || query
|
||||||
|
.includes('region') || this.refresh) {
|
||||||
|
console.log('筛选');
|
||||||
|
// this.resetQuery(q)
|
||||||
|
this.shopInfoList = res.data.data
|
||||||
|
this.refresh = false
|
||||||
|
if (res.data.data.length == 0) {
|
||||||
|
this.showNull = true
|
||||||
|
} else {
|
||||||
|
this.showNull = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('查询');
|
||||||
|
this.shopInfoList = [...this.shopInfoList, ...res.data.data]
|
||||||
|
}
|
||||||
|
console.log(this.shopInfoList);
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getQueryInfo(query) {
|
||||||
|
console.log("getQueryInfo", query);
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 1,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
...query
|
||||||
|
})
|
||||||
|
this.customQuery = q
|
||||||
|
return q
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page{
|
page {
|
||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
}
|
}
|
||||||
.marginLR10{
|
|
||||||
|
.showNull {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100rpx;
|
||||||
|
color: darkgray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.marginLR10 {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
.search-box-bg{
|
|
||||||
|
.search-box-bg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
|
|
||||||
.bug-fix {
|
.bug-fix {
|
||||||
transform: translateY(-20rpx);
|
transform: translateY(-20rpx);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 20rpx;
|
height: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-box {
|
.search-box {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
width: 84.6%;
|
width: 84.6%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
|
||||||
.search-box-input {
|
.search-box-input {
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -77,5 +188,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<InputAndSwiper type='0' :bannerURL="swiperList"></InputAndSwiper>
|
<InputAndSwiper type='0' :bannerURL="swiperList"></InputAndSwiper>
|
||||||
<view class="home-content">
|
<view class="home-content">
|
||||||
<view class="service">
|
<view class="service">
|
||||||
<u-image src="/static/statistics/sy_icon_lxkf.png" width="108rpx" height="108rpx" />
|
<u-image src="/static/statistics/sy_icon_lxkf.png" width="108rpx" height="108rpx"></u-image>
|
||||||
<button open-type="contact" bindcontact="handleContact" session-from="sessionFrom" class="service-btn">
|
<button open-type="contact" bindcontact="handleContact" session-from="sessionFrom" class="service-btn">
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
@@ -18,8 +18,8 @@
|
|||||||
<text>找店列表</text>
|
<text>找店列表</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<SearchShopList v-if="chooseIndex" />
|
<SearchShopList v-if="chooseIndex" :searchInfoList="searchInfoList" />
|
||||||
<ShowShopList v-else />
|
<ShowShopList v-else :shopInfoList="shopInfoList" />
|
||||||
</view>
|
</view>
|
||||||
<TabBar :current-page="0"></TabBar>
|
<TabBar :current-page="0"></TabBar>
|
||||||
</view>
|
</view>
|
||||||
@@ -43,20 +43,68 @@
|
|||||||
chooseIndex: 0,
|
chooseIndex: 0,
|
||||||
statNum: {},
|
statNum: {},
|
||||||
swiperList: [],
|
swiperList: [],
|
||||||
|
shopInfoList: [],
|
||||||
|
searchInfoList: [],
|
||||||
|
shopPageSize: 5,
|
||||||
|
searchPageSize: 5,
|
||||||
|
shopPageNum: 1,
|
||||||
|
searchPageNum: 1,
|
||||||
|
shopListLength: '',
|
||||||
|
shopSearchListLength: '',
|
||||||
|
isAuth: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.getBanner()
|
this.getBanner()
|
||||||
this.getNotice()
|
this.getNotice()
|
||||||
this.getStat()
|
this.getStat()
|
||||||
|
this.getShopList()
|
||||||
|
this.getSearchList()
|
||||||
this.open()
|
this.open()
|
||||||
this.getClassList()
|
this.getClassList()
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
if (this.isAuth) {
|
||||||
|
if (!uni.getStorageSync('city_code')) {
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
if (!res.locationEnabled || !res.locationAuthorized) {
|
||||||
|
uni.showModal({
|
||||||
|
content: '检测到您没打开手机系统定位权限,请确保手机系统定位已开启',
|
||||||
|
confirmText: "确认",
|
||||||
|
showCancel: false,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.getUserLocation();
|
||||||
|
} else {
|
||||||
|
console.log('取消');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.getUserLocation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.chooseIndex == 0 && this.shopListLength !== 0) {
|
||||||
|
this.shopPageNum++
|
||||||
|
this.getShopList()
|
||||||
|
}
|
||||||
|
if (this.chooseIndex == 1 && this.shopSearchListLength !== 0) {
|
||||||
|
this.searchPageNum++
|
||||||
|
this.getSearchList()
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getBanner() {
|
getBanner() {
|
||||||
this.$api.getBanner().then(res => {
|
this.$api.getBanner().then(res => {
|
||||||
res.data.data.forEach(item=>{
|
res.data.data.forEach(item => {
|
||||||
item.img =this.$api.imgUrl + item.img
|
item.img = this.$api.imgUrl + item.img
|
||||||
})
|
})
|
||||||
this.swiperList = res.data.data
|
this.swiperList = res.data.data
|
||||||
// .map(item => this.$api.imgUrl + item.img)
|
// .map(item => this.$api.imgUrl + item.img)
|
||||||
@@ -72,10 +120,37 @@
|
|||||||
this.statNum = res.data.data
|
this.statNum = res.data.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getShopList() {
|
||||||
|
const query = this.$u.queryParams({
|
||||||
|
type: 1,
|
||||||
|
pageSize: this.shopPageSize,
|
||||||
|
pageNum: this.shopPageNum
|
||||||
|
})
|
||||||
|
this.$api.getShopList(query).then(res => {
|
||||||
|
// res.data.data.forEach(item => {
|
||||||
|
// item.pics = this.$api.imgUrl + item.pics
|
||||||
|
// })
|
||||||
|
this.shopListLength = res.data.data.length
|
||||||
|
this.shopInfoList = [...this.shopInfoList, ...res.data.data]
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getSearchList() {
|
||||||
|
const query = this.$u.queryParams({
|
||||||
|
type: 2,
|
||||||
|
pageSize: this.searchPageSize,
|
||||||
|
pageNum: this.searchPageNum
|
||||||
|
})
|
||||||
|
this.$api.getShopList(query).then(res => {
|
||||||
|
this.shopSearchListLength = res.data.data.length
|
||||||
|
// 用于触底刷新 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
|
||||||
|
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
|
||||||
|
console.log(this.searchInfoList);
|
||||||
|
})
|
||||||
|
},
|
||||||
getClassList() {
|
getClassList() {
|
||||||
this.$api.getClassList().then(res => {
|
this.$api.getClassList().then(res => {
|
||||||
let data = res.data.data
|
let data = res.data.data
|
||||||
data.sort((a,b)=>{
|
data.sort((a, b) => {
|
||||||
return a.id - b.id
|
return a.id - b.id
|
||||||
})
|
})
|
||||||
data = data.map(item => item.name)
|
data = data.map(item => item.name)
|
||||||
@@ -132,6 +207,32 @@
|
|||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
console.log("获取经纬度失败", err);
|
console.log("获取经纬度失败", err);
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
if (!res.locationEnabled || !res.locationAuthorized) {
|
||||||
|
uni.showModal({
|
||||||
|
content: '检测到您没打开手机系统定位权限,请确保手机系统定位已开启',
|
||||||
|
confirmText: "确认",
|
||||||
|
showCancel: false,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
// uni.openSetting({
|
||||||
|
// success: (res) => {
|
||||||
|
// console.log(res);
|
||||||
|
that.getUserLocation();
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
} else {
|
||||||
|
console.log('取消');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.getUserLocation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -142,20 +243,78 @@
|
|||||||
success: function(res) {
|
success: function(res) {
|
||||||
if (res.authSetting['scope.userFuzzyLocation']) {
|
if (res.authSetting['scope.userFuzzyLocation']) {
|
||||||
console.log('用户已经授权定位权限');
|
console.log('用户已经授权定位权限');
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
if (!res.locationEnabled || !res.locationAuthorized) {
|
||||||
|
uni.showModal({
|
||||||
|
content: '检测到您没打开手机系统定位权限,请确保手机系统定位已开启',
|
||||||
|
confirmText: "确认",
|
||||||
|
showCancel: false,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
// uni.openSetting({
|
||||||
|
// success: (res) => {
|
||||||
|
// console.log(res);
|
||||||
|
that.getUserLocation();
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
} else {
|
||||||
|
console.log('取消');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.getUserLocation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// that.getUserLocation()
|
||||||
} else {
|
} else {
|
||||||
console.log('用户未授权定位权限');
|
console.log('用户未授权定位权限');
|
||||||
uni.authorize({
|
uni.authorize({
|
||||||
scope: 'scope.userFuzzyLocation',
|
scope: 'scope.userFuzzyLocation',
|
||||||
success: function() {
|
success: function() {
|
||||||
|
this.isAuth = true
|
||||||
console.log('授权成功');
|
console.log('授权成功');
|
||||||
that.getUserLocation()
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
if (!res.locationEnabled || !res.locationAuthorized) {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '请确保手机系统定位已开启',
|
||||||
|
// icon: 'none',
|
||||||
|
// duration: 2000,
|
||||||
|
// })
|
||||||
|
uni.showModal({
|
||||||
|
content: '检测到您没打开手机系统定位权限,请确保手机系统定位已开启',
|
||||||
|
confirmText: "确认",
|
||||||
|
showCancel: false,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
// uni.openSetting({
|
||||||
|
// success: (res) => {
|
||||||
|
// console.log(res);
|
||||||
|
that.getUserLocation();
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
} else {
|
||||||
|
console.log('取消');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.getUserLocation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
fail: function() {
|
fail: function() {
|
||||||
console.log('授权失败');
|
console.log('授权失败');
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
content: '检测到您没打开获取信息功能权限,是否去设置打开?',
|
content: '检测到您没打开手机系统定位权限,请确保手机系统定位已开启',
|
||||||
confirmText: "确认",
|
confirmText: "确认",
|
||||||
cancelText: '取消',
|
showCancel: false,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
uni.openSetting({
|
uni.openSetting({
|
||||||
|
|||||||
@@ -162,6 +162,7 @@
|
|||||||
watch: {
|
watch: {
|
||||||
scale(newVal, oldVal) {
|
scale(newVal, oldVal) {
|
||||||
console.log('thisscale', newVal, Math.round(newVal));
|
console.log('thisscale', newVal, Math.round(newVal));
|
||||||
|
this.showShop = false
|
||||||
let ra = ''
|
let ra = ''
|
||||||
this.scaleM.forEach(item => {
|
this.scaleM.forEach(item => {
|
||||||
if (item.scale == Math.round(newVal)) {
|
if (item.scale == Math.round(newVal)) {
|
||||||
@@ -268,10 +269,12 @@
|
|||||||
this.getDetail(1, markerId)
|
this.getDetail(1, markerId)
|
||||||
this.marker.forEach(item => {
|
this.marker.forEach(item => {
|
||||||
if (markerId === item.id) {
|
if (markerId === item.id) {
|
||||||
|
console.log('变红');
|
||||||
item.iconPath = "../../../static/map/sp_icon_hdw.png"
|
item.iconPath = "../../../static/map/sp_icon_hdw.png"
|
||||||
item.width = '58rpx'
|
item.width = '58rpx'
|
||||||
item.height = '72rpx'
|
item.height = '72rpx'
|
||||||
} else {
|
} else {
|
||||||
|
console.log('变绿');
|
||||||
item.iconPath = "../../../static/map/sp_icon_dw.png"
|
item.iconPath = "../../../static/map/sp_icon_dw.png"
|
||||||
item.width = '58rpx'
|
item.width = '58rpx'
|
||||||
item.height = '72rpx'
|
item.height = '72rpx'
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="区域" label-position="top" border-bottom="true" right-icon="arrow-right" prop="region"
|
<u-form-item label="区域" label-position="top" border-bottom="true" right-icon="arrow-right" prop="region"
|
||||||
label-width="auto">
|
label-width="auto">
|
||||||
<text @click="show1 = true" class="checkedtext" v-if="form.region.length>0">{{form.region}}</text>
|
<text @click="show1 = true" class="checkedtext" v-if="form.region">{{form.region}}</text>
|
||||||
<text @click="show1 = true" class="checktext" v-else>请选择所属区域</text>
|
<text @click="show1 = true" class="checktext" v-else>请选择所属区域</text>
|
||||||
|
|
||||||
<view class="arrow-icon">
|
<view class="arrow-icon">
|
||||||
@@ -16,13 +16,9 @@
|
|||||||
<u-picker :columns="regionColumns" :show="show1" :closeOnClickOverlay="true" @close="show1 = false"
|
<u-picker :columns="regionColumns" :show="show1" :closeOnClickOverlay="true" @close="show1 = false"
|
||||||
v-model="form.region" @confirm="regionConfirm"></u-picker>
|
v-model="form.region" @confirm="regionConfirm"></u-picker>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="地址" label-position="top" border-bottom="true" prop="address" label-width="auto">
|
|
||||||
<u-input v-model="form.address" placeholder="请输入地址" placeholder-class="input-class" border="none"
|
|
||||||
@change="changeAddress"></u-input>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item label="行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
|
<u-form-item label="行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
|
||||||
prop="business">
|
prop="business">
|
||||||
<text @click="show2 = true" class="checkedtext" v-if="form.business.length>0">{{form.business}}</text>
|
<text @click="show2 = true" class="checkedtext" v-if="form.business">{{form.business}}</text>
|
||||||
<text @click="show2 = true" class="checktext" v-else>请选择行业</text>
|
<text @click="show2 = true" class="checktext" v-else>请选择行业</text>
|
||||||
<view class="arrow-icon">
|
<view class="arrow-icon">
|
||||||
<u-icon name="arrow-right" size="30px" @click="show2 = true"></u-icon>
|
<u-icon name="arrow-right" size="30px" @click="show2 = true"></u-icon>
|
||||||
@@ -30,14 +26,18 @@
|
|||||||
<u-picker mode="region" :show="show2" :closeOnClickOverlay="true" @close="show2 = false"
|
<u-picker mode="region" :show="show2" :closeOnClickOverlay="true" @close="show2 = false"
|
||||||
:columns="[Classcolumns]" v-model="form.business" @confirm="tradeConfirm"></u-picker>
|
:columns="[Classcolumns]" v-model="form.business" @confirm="tradeConfirm"></u-picker>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="业态" label-position="top" border-bottom="true" label-width="auto" prop="commercial">
|
<u-form-item label="业态" label-position="top" border-bottom="true" label-width="auto" prop="commercialForm">
|
||||||
<text @click="show3 = true" class="checkedtext" v-if="form.commercial.length>0">{{form.commercial}}</text>
|
<text @click="choosecommercialForm" class="checkedtext"
|
||||||
<text @click="show3 = true" class="checktext" v-else>请选择业态</text>
|
v-if="form.commercialForm">{{form.commercialForm}}</text>
|
||||||
|
<text @click="choosecommercialForm" class="checktext" v-else>请选择业态</text>
|
||||||
<view class="arrow-icon">
|
<view class="arrow-icon">
|
||||||
<u-icon name="arrow-right" size="30px" @click="show3 = true"></u-icon>
|
<u-icon name="arrow-right" size="30px" @click="choosecommercialForm"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<u-picker mode="region" :show="show3" :closeOnClickOverlay="true" @close="show3 = false"
|
<u-picker mode="region" :show="show3" :closeOnClickOverlay="true" @close="show3 = false"
|
||||||
:columns="[Karmacolumns]" v-model="form.commercial" @confirm="karmaConfirm"></u-picker>
|
:columns="[Karmacolumns]" v-model="form.commercialForm" @confirm="karmaConfirm"></u-picker>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="面积" label-position="top" border-bottom="true" label-width="auto" prop="area">
|
||||||
|
<u-input v-model="form.area" placeholder="请输入店铺面积" placeholder-class="input-class" border="none"></u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="预计投资" label-position="top" border-bottom="true" label-width="auto" prop="transferFee">
|
<u-form-item label="预计投资" label-position="top" border-bottom="true" label-width="auto" prop="transferFee">
|
||||||
<u-input v-model="form.transferFee" placeholder="请输入预计投资" placeholder-class="input-class"
|
<u-input v-model="form.transferFee" placeholder="请输入预计投资" placeholder-class="input-class"
|
||||||
@@ -46,14 +46,15 @@
|
|||||||
<u-form-item label="租金(元/月)" label-position="top" border-bottom="true" label-width="auto" prop="rent">
|
<u-form-item label="租金(元/月)" label-position="top" border-bottom="true" label-width="auto" prop="rent">
|
||||||
<u-input v-model="form.rent" placeholder="请输入店铺租金" placeholder-class="input-class" border="none"></u-input>
|
<u-input v-model="form.rent" placeholder="请输入店铺租金" placeholder-class="input-class" border="none"></u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="联系人" label-position="top" border-bottom="true" label-width="auto" prop="contact">
|
<u-form-item label="联系人" label-position="top" border-bottom="true" label-width="auto" prop="contactPerson">
|
||||||
<u-input v-model="form.contact" placeholder="请输入联系人姓名" placeholder-class="input-class" border="none"></u-input>
|
<u-input v-model="form.contactPerson" placeholder="请输入联系人姓名" placeholder-class="input-class"
|
||||||
|
border="none"></u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="手机号码" label-position="top" border-bottom="true" label-width="auto" prop="mobile">
|
<u-form-item label="手机号码" label-position="top" border-bottom="true" label-width="auto" prop="phone">
|
||||||
<u-input v-model="form.mobile" placeholder="请输入联系人手机号码" placeholder-class="input-class" border="none"></u-input>
|
<u-input v-model="form.phone" placeholder="请输入联系人手机号码" placeholder-class="input-class" border="none"></u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="详情介绍" label-position="top" border-bottom="true" label-width="auto" prop="content">
|
<u-form-item label="详情介绍" label-position="top" border-bottom="true" label-width="auto" prop="details">
|
||||||
<u-input v-model="form.content" placeholder="请输入介绍详情" placeholder-class="input-class" border="none"></u-input>
|
<u-input v-model="form.details" placeholder="请输入介绍详情" placeholder-class="input-class" border="none"></u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</u-form>
|
</u-form>
|
||||||
<view class="bug-figure"></view>
|
<view class="bug-figure"></view>
|
||||||
@@ -67,26 +68,19 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
imageLength: '0',
|
regionColumns: [],
|
||||||
fileList1: [],
|
|
||||||
regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [],
|
|
||||||
|
|
||||||
form: {
|
form: {
|
||||||
title: '',
|
title: '',
|
||||||
region: '',
|
region: '',
|
||||||
address: '',
|
|
||||||
business: '',
|
business: '',
|
||||||
commercial: '',
|
commercialForm: '',
|
||||||
transferFee:'',
|
area: '',
|
||||||
|
transferFee: '',
|
||||||
rent: '',
|
rent: '',
|
||||||
contact:'',
|
contactPerson: '',
|
||||||
mobile: '',
|
phone: '',
|
||||||
content: '',
|
details: '',
|
||||||
// images: [],
|
|
||||||
longitude: '',
|
|
||||||
latitude: '',
|
|
||||||
id: '',
|
id: '',
|
||||||
|
|
||||||
},
|
},
|
||||||
Classcolumns: [],
|
Classcolumns: [],
|
||||||
ClassCheckId: '',
|
ClassCheckId: '',
|
||||||
@@ -111,22 +105,27 @@
|
|||||||
message: '请选择地区',
|
message: '请选择地区',
|
||||||
trigger: ['change']
|
trigger: ['change']
|
||||||
}],
|
}],
|
||||||
'commercial': [{
|
'commercialForm': [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择业态',
|
message: '请选择业态',
|
||||||
trigger: ['change']
|
trigger: ['change']
|
||||||
}],
|
}],
|
||||||
|
'area': [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入面积',
|
||||||
|
trigger: ['change', 'blur']
|
||||||
|
}],
|
||||||
'transferFee': [{
|
'transferFee': [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入转让金',
|
message: '请输入转让金',
|
||||||
trigger: ['change', 'blur']
|
trigger: ['change', 'blur']
|
||||||
}],
|
}],
|
||||||
'contact': [{
|
'contactPerson': [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入姓名',
|
message: '请输入姓名',
|
||||||
trigger: ['change', 'blur']
|
trigger: ['change', 'blur']
|
||||||
}],
|
}],
|
||||||
'content': [{
|
'details': [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入介绍',
|
message: '请输入介绍',
|
||||||
trigger: ['change', 'blur']
|
trigger: ['change', 'blur']
|
||||||
@@ -141,12 +140,7 @@
|
|||||||
message: '请输入租金',
|
message: '请输入租金',
|
||||||
trigger: ['change', 'blur']
|
trigger: ['change', 'blur']
|
||||||
}],
|
}],
|
||||||
'address': [{
|
'phone': [{
|
||||||
required: true,
|
|
||||||
message: '请输入地址',
|
|
||||||
trigger: ['change', 'blur']
|
|
||||||
}],
|
|
||||||
'mobile': [{
|
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入电话号码',
|
message: '请输入电话号码',
|
||||||
},
|
},
|
||||||
@@ -162,101 +156,74 @@
|
|||||||
trigger: ['change', 'blur'],
|
trigger: ['change', 'blur'],
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 删除图片
|
getDetail(type, id) {
|
||||||
deletePic(event) {
|
console.log('type, id', type, id);
|
||||||
this[`fileList${event.name}`].splice(event.index, 1)
|
this.$api.getShopDetail(type, id).then(res => {
|
||||||
|
console.log(',re', res);
|
||||||
|
const data = res.data.data
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
this.form = {
|
||||||
|
title: data.tt,
|
||||||
|
region: data.area1,
|
||||||
|
business: data.trade1,
|
||||||
|
commercialForm: data.trade2,
|
||||||
|
area: data.mianji,
|
||||||
|
transferFee: data.zhuanrangfei,
|
||||||
|
rent: data.zujin,
|
||||||
|
contactPerson: data.lianxiren,
|
||||||
|
phone: data.mobile,
|
||||||
|
details: data.content,
|
||||||
|
id: id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
preview(e) {
|
preview(e) {
|
||||||
console.log('预览', e);
|
console.log('预览', e);
|
||||||
},
|
},
|
||||||
// 新增图片
|
|
||||||
async afterRead(event) {
|
|
||||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
|
||||||
let lists = [].concat(event.file)
|
|
||||||
let fileListLen = this[`fileList${event.name}`].length
|
|
||||||
lists.map((item) => {
|
|
||||||
this[`fileList${event.name}`].push({
|
|
||||||
...item,
|
|
||||||
status: 'uploading',
|
|
||||||
message: '上传中'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
for (let i = 0; i < lists.length; i++) {
|
|
||||||
console.log('lists[i].url', lists[i].url);
|
|
||||||
const result = await this.uploadFilePromise(lists[i].url)
|
|
||||||
console.log('result', result);
|
|
||||||
let item = this[`fileList${event.name}`][fileListLen]
|
|
||||||
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
|
||||||
status: 'success',
|
|
||||||
message: '',
|
|
||||||
url: result
|
|
||||||
}))
|
|
||||||
fileListLen++
|
|
||||||
this.imageLength = fileListLen
|
|
||||||
}
|
|
||||||
},
|
|
||||||
uploadFilePromise(filePath) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const token = uni.getStorageSync('loginToken')
|
|
||||||
const a = uni.uploadFile({
|
|
||||||
url: this.$api.uploadImgUrl,
|
|
||||||
filePath: filePath,
|
|
||||||
name: 'file',
|
|
||||||
header: {
|
|
||||||
"Content-Type": "multipart/form-data",
|
|
||||||
'Authorization': token
|
|
||||||
},
|
|
||||||
success: (res) => {
|
|
||||||
resolve(JSON.parse(res.data).data.url)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleSearchAddress() {
|
handleSearchAddress() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/publish/chooseAddress/chooseAddress'
|
url: '/pages/publish/chooseAddress/chooseAddress'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
const temp = []
|
|
||||||
if (this.fileList1.length > 0) {
|
|
||||||
this.fileList1.map(item => {
|
|
||||||
const url = item.url
|
|
||||||
temp.push(url.replace(this.imgUrl + '/', ''))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
console.log('images---', temp.join(','));
|
|
||||||
this.$refs.uForm.validate().then(res => {
|
this.$refs.uForm.validate().then(res => {
|
||||||
console.log("提交表单信息:" + JSON.stringify(this.form))
|
console.log("提交表单信息:", this.form, this.form.id)
|
||||||
uni.$u.toast('发布成功')
|
|
||||||
this.$api.publishAddress(this.form).then(res => {
|
this.$api.publishAddress(this.form).then(res => {
|
||||||
console.log(res);
|
console.log('发布找店地址', res);
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
uni.$u.toast(res.data.msg)
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/my/my'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.$u.toast(res.data.msg)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}).catch(errors => {
|
}).catch(errors => {
|
||||||
console.log("失败信息:" + JSON.stringify(errors))
|
console.log("失败信息:", JSON.stringify(errors))
|
||||||
// uni.$u.toast('校验失败')
|
// uni.$u.toast('校验失败')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
changeAddress(e) {
|
choosecommercialForm() {
|
||||||
// console.log('changeAddress', e);
|
if (!this.form.business) {
|
||||||
this.getAddressList(e)
|
uni.$u.toast('请先选择行业')
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
this.show3 = true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getAddressList(value) {
|
getRegionList() {
|
||||||
var that = this
|
var that = this
|
||||||
uni.request({
|
uni.request({
|
||||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=' + value + '&key=' +
|
url: 'https://apis.map.qq.com/ws/district/v1/getchildren?id=' + uni.getStorageSync('city_code') + '&key=' +
|
||||||
that.$api.key,
|
that.$api.key,
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log('diz', res.data.result.location);
|
that.regionColumns = [res.data.result[0].map(item => item.fullname)]
|
||||||
// console.log('lat', res.data.result.location.lat);
|
|
||||||
that.form.latitude = res.data.result.location.lat
|
|
||||||
// console.log('lng', res.data.result.location.lng);
|
|
||||||
that.form.longitude = res.data.result.location.lng
|
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
console.log('请求区域失败:', err);
|
console.log('请求区域失败:', err);
|
||||||
@@ -276,7 +243,7 @@
|
|||||||
},
|
},
|
||||||
karmaConfirm(e) {
|
karmaConfirm(e) {
|
||||||
this.show3 = false
|
this.show3 = false
|
||||||
this.form.commercial = e.value[0]
|
this.form.commercialForm = e.value[0]
|
||||||
},
|
},
|
||||||
regionConfirm(e) {
|
regionConfirm(e) {
|
||||||
this.show1 = false
|
this.show1 = false
|
||||||
@@ -287,7 +254,17 @@
|
|||||||
this.$refs.uForm.setRules(this.rules)
|
this.$refs.uForm.setRules(this.rules)
|
||||||
|
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
|
console.log('修改找店地址', options);
|
||||||
|
if (options.item) {
|
||||||
|
console.log('修改');
|
||||||
|
if (options.id) {
|
||||||
|
this.getDetail(2, options.id)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('发布');
|
||||||
|
}
|
||||||
|
this.getRegionList()
|
||||||
this.$api.getClassList().then(res => {
|
this.$api.getClassList().then(res => {
|
||||||
// console.log(res.data.data.length);
|
// console.log(res.data.data.length);
|
||||||
this.Classcolumns = res.data.data.map((item) => {
|
this.Classcolumns = res.data.data.map((item) => {
|
||||||
@@ -336,6 +313,7 @@
|
|||||||
.count {
|
.count {
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// margin-right: 20px;
|
// margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,8 @@
|
|||||||
v-model="form.region" @confirm="regionConfirm"></u-picker>
|
v-model="form.region" @confirm="regionConfirm"></u-picker>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="项目地址" label-position="top" border-bottom="true" prop="address" label-width="auto">
|
<u-form-item label="项目地址" label-position="top" border-bottom="true" prop="address" label-width="auto">
|
||||||
<u-input v-model="form.address" placeholder="请输入店铺地址" placeholder-class="input-class" border="none"
|
<u-input v-model="form.address" placeholder="请输入项目地址" placeholder-class="input-class" border="none"
|
||||||
@change="changeAddress"></u-input>
|
@focus="changeAddressFocus" @blur="changeAddress"></u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="项目行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
|
<u-form-item label="项目行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
|
||||||
prop="business">
|
prop="business">
|
||||||
@@ -44,8 +44,9 @@
|
|||||||
<u-form-item label="租金(元/月)" label-position="top" border-bottom="true" label-width="auto" prop="rent">
|
<u-form-item label="租金(元/月)" label-position="top" border-bottom="true" label-width="auto" prop="rent">
|
||||||
<u-input v-model="form.rent" placeholder="请输入店铺租金" placeholder-class="input-class" border="none" type="number"></u-input>
|
<u-input v-model="form.rent" placeholder="请输入店铺租金" placeholder-class="input-class" border="none" type="number"></u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="详情介绍" label-position="top" border-bottom="true" label-width="auto" prop="content">
|
<u-form-item label="联系人" label-position="top" border-bottom="true" label-width="auto" prop="contactPerson">
|
||||||
<u-input v-model="form.content" placeholder="请输入介绍详情" placeholder-class="input-class" border="none"></u-input>
|
<u-input v-model="form.contactPerson" placeholder="请输入联系人姓名" placeholder-class="input-class"
|
||||||
|
border="none"></u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="手机号码" label-position="top" border-bottom="true" label-width="auto" prop="phone">
|
<u-form-item label="手机号码" label-position="top" border-bottom="true" label-width="auto" prop="phone">
|
||||||
<u-input v-model="form.phone" placeholder="请输入联系人手机号码" placeholder-class="input-class" border="none" type="number"></u-input>
|
<u-input v-model="form.phone" placeholder="请输入联系人手机号码" placeholder-class="input-class" border="none" type="number"></u-input>
|
||||||
@@ -65,18 +66,19 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
imageLength: '0',
|
imageLength: 0,
|
||||||
fileList1: [],
|
fileList1: [],
|
||||||
regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [],
|
regionColumns: [],
|
||||||
|
|
||||||
form: {
|
form: {
|
||||||
title: '',
|
title: '',
|
||||||
region: '',
|
region: '',
|
||||||
address: '',
|
address: '',
|
||||||
business: '',
|
business: '',
|
||||||
mobile: '',
|
area: '',
|
||||||
contact:'',
|
rent: '',
|
||||||
content: '',
|
phone: '',
|
||||||
|
contactPerson: '',
|
||||||
|
details: '',
|
||||||
images: [],
|
images: [],
|
||||||
longitude: '',
|
longitude: '',
|
||||||
latitude: '',
|
latitude: '',
|
||||||
@@ -106,12 +108,22 @@
|
|||||||
message: '请选择地区',
|
message: '请选择地区',
|
||||||
trigger: ['change']
|
trigger: ['change']
|
||||||
}],
|
}],
|
||||||
'contact': [{
|
'area': [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入面积',
|
||||||
|
trigger: ['change', 'blur']
|
||||||
|
}],
|
||||||
|
'rent': [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入租金',
|
||||||
|
trigger: ['change', 'blur']
|
||||||
|
}],
|
||||||
|
'contactPerson': [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入姓名',
|
message: '请输入姓名',
|
||||||
trigger: ['change', 'blur']
|
trigger: ['change', 'blur']
|
||||||
}],
|
}],
|
||||||
'content': [{
|
'details': [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入介绍',
|
message: '请输入介绍',
|
||||||
trigger: ['change', 'blur']
|
trigger: ['change', 'blur']
|
||||||
@@ -121,7 +133,7 @@
|
|||||||
message: '请输入地址',
|
message: '请输入地址',
|
||||||
trigger: ['change', 'blur']
|
trigger: ['change', 'blur']
|
||||||
}],
|
}],
|
||||||
'mobile': [{
|
'phone': [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入电话号码',
|
message: '请输入电话号码',
|
||||||
},
|
},
|
||||||
@@ -198,40 +210,79 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
const temp = []
|
|
||||||
if (this.fileList1.length > 0) {
|
|
||||||
this.fileList1.map(item => {
|
|
||||||
const url = item.url
|
|
||||||
temp.push(url.replace(this.imgUrl + '/', ''))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
console.log('images---', temp.join(','));
|
|
||||||
this.$refs.uForm.validate().then(res => {
|
this.$refs.uForm.validate().then(res => {
|
||||||
console.log("提交表单信息:" + JSON.stringify(this.form))
|
const temp = []
|
||||||
uni.$u.toast('发布成功')
|
if (this.fileList1.length > 0) {
|
||||||
this.$api.publishInvestment(this.form).then(res => {
|
this.fileList1.map(item => {
|
||||||
|
const url = item.url
|
||||||
|
temp.push(url.replace(this.$api.imgUrl, ''))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (this.form.latitude && this.form.longitude) {
|
||||||
|
console.log('经纬度都存在');
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('请输入准确地址')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
let data = {
|
||||||
|
...this.form,
|
||||||
|
images: temp.join(',')
|
||||||
|
}
|
||||||
|
console.log("项目招商:", data)
|
||||||
|
this.$api.publishInvestment(data).then(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
uni.$u.toast(res.data.msg)
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/my/my'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.$u.toast(res.data.msg)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}).catch(errors => {
|
}).catch(errors => {
|
||||||
console.log("失败信息:" + JSON.stringify(errors))
|
console.log("失败信息:" + JSON.stringify(errors))
|
||||||
// uni.$u.toast('校验失败')
|
// uni.$u.toast('校验失败')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
changeAddressFocus() {
|
||||||
|
if (!this.form.region) {
|
||||||
|
uni.$u.toast('请先选择区域')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
changeAddress(e) {
|
changeAddress(e) {
|
||||||
// console.log('changeAddress', e);
|
// console.log('changeAddress', e);
|
||||||
this.getAddressList(e)
|
this.getAddressList(e)
|
||||||
},
|
},
|
||||||
|
getRegionList() {
|
||||||
|
var that = this
|
||||||
|
uni.request({
|
||||||
|
url: 'https://apis.map.qq.com/ws/district/v1/getchildren?id=' + uni.getStorageSync('city_code') + '&key=' +
|
||||||
|
that.$api.key,
|
||||||
|
success(res) {
|
||||||
|
that.regionColumns = [res.data.result[0].map(item => item.fullname)]
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
console.log('请求区域失败:', err);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
getAddressList(value) {
|
getAddressList(value) {
|
||||||
var that = this
|
var that = this
|
||||||
uni.request({
|
uni.request({
|
||||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=' + value + '&key=' +
|
url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=' + that.form.region + value + '&key=' +
|
||||||
that.$api.key,
|
that.$api.key,
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log('diz', res.data.result.location);
|
console.log('diz', res.data.result.location);
|
||||||
// console.log('lat', res.data.result.location.lat);
|
if (res.data.message == "query ok") {
|
||||||
that.form.latitude = res.data.result.location.lat
|
// console.log('lat', res.data.result.location.lat);
|
||||||
// console.log('lng', res.data.result.location.lng);
|
that.form.latitude = res.data.result.location.lat
|
||||||
that.form.longitude = res.data.result.location.lng
|
// console.log('lng', res.data.result.location.lng);
|
||||||
|
that.form.longitude = res.data.result.location.lng
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('请输入准确地址')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
console.log('请求区域失败:', err);
|
console.log('请求区域失败:', err);
|
||||||
@@ -257,12 +308,59 @@
|
|||||||
this.show1 = false
|
this.show1 = false
|
||||||
this.form.region = e.value[0]
|
this.form.region = e.value[0]
|
||||||
},
|
},
|
||||||
|
getDetail(type, id) {
|
||||||
|
console.log('type, id', type, id);
|
||||||
|
this.$api.getShopDetail(type, id).then(res => {
|
||||||
|
console.log(',re', res);
|
||||||
|
const data = res.data.data
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
this.form = {
|
||||||
|
title: data.tt,
|
||||||
|
region: data.area1,
|
||||||
|
address: data.adress,
|
||||||
|
business: data.trade1,
|
||||||
|
area: data.mianji,
|
||||||
|
rent: data.zujin,
|
||||||
|
phone: data.mobile,
|
||||||
|
contactPerson: data.lianxiren,
|
||||||
|
details: data.content,
|
||||||
|
// images: data.pics,
|
||||||
|
id: id,
|
||||||
|
longitude: data.lng,
|
||||||
|
latitude: data.lat,
|
||||||
|
}
|
||||||
|
var arr = [];
|
||||||
|
var arr1 = [];
|
||||||
|
let obj = {}
|
||||||
|
arr = data.pics.split(",")
|
||||||
|
arr.map(item => {
|
||||||
|
obj = this.$api.imgUrl + item
|
||||||
|
arr1.push(obj)
|
||||||
|
})
|
||||||
|
data.pics = arr1
|
||||||
|
this.fileList1 = data.pics.map(item => {
|
||||||
|
return {
|
||||||
|
url: item
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
this.$refs.uForm.setRules(this.rules)
|
this.$refs.uForm.setRules(this.rules)
|
||||||
|
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
|
if (options.item) {
|
||||||
|
console.log('修改');
|
||||||
|
if (options.id) {
|
||||||
|
this.getDetail(4, options.id)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('发布');
|
||||||
|
}
|
||||||
|
this.getRegionList()
|
||||||
this.$api.getClassList().then(res => {
|
this.$api.getClassList().then(res => {
|
||||||
// console.log(res.data.data.length);
|
// console.log(res.data.data.length);
|
||||||
this.Classcolumns = res.data.data.map((item) => {
|
this.Classcolumns = res.data.data.map((item) => {
|
||||||
@@ -311,6 +409,7 @@
|
|||||||
.count {
|
.count {
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// margin-right: 20px;
|
// margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="地址" label-position="top" border-bottom="true" prop="address" label-width="auto">
|
<u-form-item label="地址" label-position="top" border-bottom="true" prop="address" label-width="auto">
|
||||||
<u-input v-model="form.address" placeholder="请输入店铺地址" placeholder-class="input-class" border="none"
|
<u-input v-model="form.address" placeholder="请输入店铺地址" placeholder-class="input-class" border="none"
|
||||||
@change="changeAddress"></u-input>
|
@focus="changeAddressFocus" @blur="changeAddress"></u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="适合行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
|
<u-form-item label="适合行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
|
||||||
prop="business">
|
prop="business">
|
||||||
@@ -38,15 +38,15 @@
|
|||||||
<u-picker mode="region" :show="show2" :closeOnClickOverlay="true" @close="show2 = false"
|
<u-picker mode="region" :show="show2" :closeOnClickOverlay="true" @close="show2 = false"
|
||||||
:columns="[Classcolumns]" v-model="form.business" @confirm="tradeConfirm"></u-picker>
|
:columns="[Classcolumns]" v-model="form.business" @confirm="tradeConfirm"></u-picker>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="业态" label-position="top" border-bottom="true" label-width="auto" prop="commercial">
|
<!-- <u-form-item label="业态" label-position="top" border-bottom="true" label-width="auto" prop="commercial">
|
||||||
<text @click="show3 = true" class="checkedtext" v-if="form.commercial.length>0">{{form.commercial}}</text>
|
<text @click="chooseCommercial" class="checkedtext" v-if="form.commercial.length>0">{{form.commercial}}</text>
|
||||||
<text @click="show3 = true" class="checktext" v-else>请选择店铺业态</text>
|
<text @click="chooseCommercial" class="checktext" v-else>请选择店铺业态</text>
|
||||||
<view class="arrow-icon">
|
<view class="arrow-icon">
|
||||||
<u-icon name="arrow-right" size="30px" @click="show3 = true"></u-icon>
|
<u-icon name="arrow-right" size="30px" @click="chooseCommercial"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<u-picker mode="region" :show="show3" :closeOnClickOverlay="true" @close="show3 = false"
|
<u-picker mode="region" :show="show3" :closeOnClickOverlay="true" @close="show3 = false"
|
||||||
:columns="[Karmacolumns]" v-model="form.commercial" @confirm="karmaConfirm"></u-picker>
|
:columns="[Karmacolumns]" v-model="form.commercial" @confirm="karmaConfirm"></u-picker>
|
||||||
</u-form-item>
|
</u-form-item> -->
|
||||||
<u-form-item label="面积" label-position="top" border-bottom="true" label-width="auto" prop="area">
|
<u-form-item label="面积" label-position="top" border-bottom="true" label-width="auto" prop="area">
|
||||||
<u-input v-model="form.area" placeholder="请输入店铺面积" placeholder-class="input-class" border="none" type="number"></u-input>
|
<u-input v-model="form.area" placeholder="请输入店铺面积" placeholder-class="input-class" border="none" type="number"></u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
commercial: '',
|
commercial: '',
|
||||||
area: '',
|
area: '',
|
||||||
rent: '',
|
rent: '',
|
||||||
contact:'',
|
contact: '',
|
||||||
mobile: '',
|
mobile: '',
|
||||||
content: '',
|
content: '',
|
||||||
images: [],
|
images: [],
|
||||||
@@ -225,40 +225,78 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
const temp = []
|
|
||||||
if (this.fileList1.length > 0) {
|
|
||||||
this.fileList1.map(item => {
|
|
||||||
const url = item.url
|
|
||||||
temp.push(url.replace(this.imgUrl + '/', ''))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
console.log('images---', temp.join(','));
|
|
||||||
this.$refs.uForm.validate().then(res => {
|
this.$refs.uForm.validate().then(res => {
|
||||||
console.log("提交表单信息:" + JSON.stringify(this.form))
|
const temp = []
|
||||||
uni.$u.toast('发布成功')
|
if (this.fileList1.length > 0) {
|
||||||
this.$api.publishRent(this.form).then(res => {
|
this.fileList1.map(item => {
|
||||||
console.log(res);
|
const url = item.url
|
||||||
|
temp.push(url.replace(this.$api.imgUrl, ''))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (this.form.latitude && this.form.longitude) {
|
||||||
|
console.log('经纬度都存在');
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('请输入准确地址')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
let data = {
|
||||||
|
...this.form,
|
||||||
|
images: temp.join(',')
|
||||||
|
}
|
||||||
|
console.log("提交表单信息:", data)
|
||||||
|
this.$api.publishRent(data).then(res => {
|
||||||
|
console.log('发布店铺出租', res);
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
uni.$u.toast(res.data.msg)
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/my/my'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.$u.toast(res.data.msg)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}).catch(errors => {
|
}).catch(errors => {
|
||||||
console.log("失败信息:" + JSON.stringify(errors))
|
console.log("失败信息:" + JSON.stringify(errors))
|
||||||
// uni.$u.toast('校验失败')
|
// uni.$u.toast('校验失败')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
chooseCommercial() {
|
||||||
|
if (!this.form.business) {
|
||||||
|
uni.$u.toast('请先选择行业')
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
this.show3 = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeAddressFocus() {
|
||||||
|
if (!this.form.region) {
|
||||||
|
uni.$u.toast('请先选择区域')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
changeAddress(e) {
|
changeAddress(e) {
|
||||||
// console.log('changeAddress', e);
|
// console.log('changeAddress', e);
|
||||||
this.getAddressList(e)
|
this.getAddressList(e)
|
||||||
},
|
},
|
||||||
getAddressList(value) {
|
getAddressList(value) {
|
||||||
|
if (!this.form.region) {
|
||||||
|
uni.$u.toast('请先选择区域')
|
||||||
|
return false
|
||||||
|
}
|
||||||
var that = this
|
var that = this
|
||||||
uni.request({
|
uni.request({
|
||||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=' + value + '&key=' +
|
url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=' + that.form.region + value + '&key=' +
|
||||||
that.$api.key,
|
that.$api.key,
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log('diz', res.data.result.location);
|
console.log('diz', res.data.result.location);
|
||||||
// console.log('lat', res.data.result.location.lat);
|
if (res.data.message == "query ok") {
|
||||||
that.form.latitude = res.data.result.location.lat
|
// console.log('lat', res.data.result.location.lat);
|
||||||
// console.log('lng', res.data.result.location.lng);
|
that.form.latitude = res.data.result.location.lat
|
||||||
that.form.longitude = res.data.result.location.lng
|
// console.log('lng', res.data.result.location.lng);
|
||||||
|
that.form.longitude = res.data.result.location.lng
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('请输入准确地址')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
console.log('请求区域失败:', err);
|
console.log('请求区域失败:', err);
|
||||||
@@ -284,12 +322,61 @@
|
|||||||
this.show1 = false
|
this.show1 = false
|
||||||
this.form.region = e.value[0]
|
this.form.region = e.value[0]
|
||||||
},
|
},
|
||||||
|
getDetail(type, id) {
|
||||||
|
console.log('type, id', type, id);
|
||||||
|
this.$api.getShopDetail(type, id).then(res => {
|
||||||
|
console.log(',re', res);
|
||||||
|
const data = res.data.data
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
this.form = {
|
||||||
|
title: data.tt,
|
||||||
|
region: data.area1,
|
||||||
|
address: data.adress,
|
||||||
|
business: data.trade1,
|
||||||
|
commercial: data.trade2,
|
||||||
|
area: data.mianji,
|
||||||
|
rent: data.zujin,
|
||||||
|
transferFee: data.zhuanrangfei,
|
||||||
|
mobile: data.mobile,
|
||||||
|
content: data.content,
|
||||||
|
// images: data.pics,
|
||||||
|
id: id,
|
||||||
|
contact: data.lianxiren,
|
||||||
|
longitude: data.lng,
|
||||||
|
latitude: data.lat,
|
||||||
|
}
|
||||||
|
var arr = [];
|
||||||
|
var arr1 = [];
|
||||||
|
let obj = {}
|
||||||
|
arr = data.pics.split(",")
|
||||||
|
arr.map(item => {
|
||||||
|
obj = this.$api.imgUrl + item
|
||||||
|
arr1.push(obj)
|
||||||
|
})
|
||||||
|
data.pics = arr1
|
||||||
|
this.fileList1 = data.pics.map(item => {
|
||||||
|
return {
|
||||||
|
url: item
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
this.$refs.uForm.setRules(this.rules)
|
this.$refs.uForm.setRules(this.rules)
|
||||||
|
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
|
console.log('修改出租', options);
|
||||||
|
if (options.item) {
|
||||||
|
console.log('修改');
|
||||||
|
if (options.id) {
|
||||||
|
this.getDetail(3, options.id)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('发布');
|
||||||
|
}
|
||||||
this.$api.getClassList().then(res => {
|
this.$api.getClassList().then(res => {
|
||||||
// console.log(res.data.data.length);
|
// console.log(res.data.data.length);
|
||||||
this.Classcolumns = res.data.data.map((item) => {
|
this.Classcolumns = res.data.data.map((item) => {
|
||||||
@@ -338,6 +425,7 @@
|
|||||||
.count {
|
.count {
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// margin-right: 20px;
|
// margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<view class="upload">
|
<view class="upload">
|
||||||
<view style="padding-left: 20rpx;margin-top: 20rpx;">
|
<view style="padding-left: 20rpx;margin-top: 20rpx;">
|
||||||
<u-upload :fileList="fileList1" :auto-upload="false" @afterRead="afterRead" @delete="deletePic" name="1"
|
<u-upload :fileList="fileList1" :auto-upload="false" @afterRead="afterRead" @delete="deletePic" name="1"
|
||||||
multiple :maxCount="5" :on-preview="preview"></u-upload>
|
multiple :maxCount="5"></u-upload>
|
||||||
</view>
|
</view>
|
||||||
<!-- <u-upload max-count="5" upload-icon="photo"></u-upload> -->
|
<!-- <u-upload max-count="5" upload-icon="photo"></u-upload> -->
|
||||||
<text class="count">发布房源图片({{imageLength}}/5})</text>
|
<text class="count">发布房源图片({{imageLength}}/5})</text>
|
||||||
@@ -15,9 +15,8 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="区域" label-position="top" border-bottom="true" right-icon="arrow-right" prop="region"
|
<u-form-item label="区域" label-position="top" border-bottom="true" right-icon="arrow-right" prop="region"
|
||||||
label-width="auto">
|
label-width="auto">
|
||||||
<text @click="show1 = true" class="checkedtext" v-if="form.region.length>0">{{form.region}}</text>
|
<text @click="show1 = true" class="checkedtext" v-if="form.region">{{form.region}}</text>
|
||||||
<text @click="show1 = true" class="checktext" v-else>请选择所属区域</text>
|
<text @click="show1 = true" class="checktext" v-else>请选择所属区域</text>
|
||||||
|
|
||||||
<view class="arrow-icon">
|
<view class="arrow-icon">
|
||||||
<u-icon name="arrow-right" size="30px" @click="show1 = true"></u-icon>
|
<u-icon name="arrow-right" size="30px" @click="show1 = true"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
@@ -26,11 +25,11 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="地址" label-position="top" border-bottom="true" prop="address" label-width="auto">
|
<u-form-item label="地址" label-position="top" border-bottom="true" prop="address" label-width="auto">
|
||||||
<u-input v-model="form.address" placeholder="请输入店铺地址" placeholder-class="input-class" border="none"
|
<u-input v-model="form.address" placeholder="请输入店铺地址" placeholder-class="input-class" border="none"
|
||||||
@change="changeAddress"></u-input>
|
@focus="changeAddressFocus" @blur="changeAddress"></u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
|
<u-form-item label="行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
|
||||||
prop="business">
|
prop="business">
|
||||||
<text @click="show2 = true" class="checkedtext" v-if="form.business.length>0">{{form.business}}</text>
|
<text @click="show2 = true" class="checkedtext" v-if="form.business">{{form.business}}</text>
|
||||||
<text @click="show2 = true" class="checktext" v-else>请选择店铺行业</text>
|
<text @click="show2 = true" class="checktext" v-else>请选择店铺行业</text>
|
||||||
<view class="arrow-icon">
|
<view class="arrow-icon">
|
||||||
<u-icon name="arrow-right" size="30px" @click="show2 = true"></u-icon>
|
<u-icon name="arrow-right" size="30px" @click="show2 = true"></u-icon>
|
||||||
@@ -39,10 +38,10 @@
|
|||||||
:columns="[Classcolumns]" v-model="form.business" @confirm="tradeConfirm"></u-picker>
|
:columns="[Classcolumns]" v-model="form.business" @confirm="tradeConfirm"></u-picker>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="业态" label-position="top" border-bottom="true" label-width="auto" prop="commercial">
|
<u-form-item label="业态" label-position="top" border-bottom="true" label-width="auto" prop="commercial">
|
||||||
<text @click="show3 = true" class="checkedtext" v-if="form.commercial.length>0">{{form.commercial}}</text>
|
<text @click="chooseCommercial" class="checkedtext" v-if="form.commercial">{{form.commercial}}</text>
|
||||||
<text @click="show3 = true" class="checktext" v-else>请选择店铺业态</text>
|
<text @click="chooseCommercial" class="checktext" v-else>请选择店铺业态</text>
|
||||||
<view class="arrow-icon">
|
<view class="arrow-icon">
|
||||||
<u-icon name="arrow-right" size="30px" @click="show3 = true"></u-icon>
|
<u-icon name="arrow-right" size="30px" @click="chooseCommercial"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<u-picker mode="region" :show="show3" :closeOnClickOverlay="true" @close="show3 = false"
|
<u-picker mode="region" :show="show3" :closeOnClickOverlay="true" @close="show3 = false"
|
||||||
:columns="[Karmacolumns]" v-model="form.commercial" @confirm="karmaConfirm"></u-picker>
|
:columns="[Karmacolumns]" v-model="form.commercial" @confirm="karmaConfirm"></u-picker>
|
||||||
@@ -77,9 +76,9 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
imageLength: '0',
|
imageLength: 0,
|
||||||
fileList1: [],
|
fileList1: [],
|
||||||
regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [],
|
regionColumns: [],
|
||||||
|
|
||||||
form: {
|
form: {
|
||||||
title: '',
|
title: '',
|
||||||
@@ -197,9 +196,7 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
for (let i = 0; i < lists.length; i++) {
|
for (let i = 0; i < lists.length; i++) {
|
||||||
console.log('lists[i].url', lists[i].url);
|
|
||||||
const result = await this.uploadFilePromise(lists[i].url)
|
const result = await this.uploadFilePromise(lists[i].url)
|
||||||
console.log('result', result);
|
|
||||||
let item = this[`fileList${event.name}`][fileListLen]
|
let item = this[`fileList${event.name}`][fileListLen]
|
||||||
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
||||||
status: 'success',
|
status: 'success',
|
||||||
@@ -233,40 +230,95 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
const temp = []
|
|
||||||
if (this.fileList1.length > 0) {
|
|
||||||
this.fileList1.map(item => {
|
|
||||||
const url = item.url
|
|
||||||
temp.push(url.replace(this.imgUrl + '/', ''))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
console.log('images---', temp.join(','));
|
|
||||||
this.$refs.uForm.validate().then(res => {
|
this.$refs.uForm.validate().then(res => {
|
||||||
console.log("提交表单信息:" + JSON.stringify(this.form))
|
const temp = []
|
||||||
uni.$u.toast('发布成功')
|
if (this.fileList1.length > 0) {
|
||||||
this.$api.publishTransfer(this.form).then(res => {
|
this.fileList1.map(item => {
|
||||||
console.log(res);
|
const url = item.url
|
||||||
|
console.log('url', url, this.$api.imgUrl);
|
||||||
|
temp.push(url.replace(this.$api.imgUrl, ''))
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log('images---', temp.join(','));
|
||||||
|
if (this.form.latitude && this.form.longitude) {
|
||||||
|
console.log('经纬度都存在');
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('请输入准确地址')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
let data = {
|
||||||
|
...this.form,
|
||||||
|
images: temp.join(',')
|
||||||
|
}
|
||||||
|
console.log('提交表单信息', data, this.form);
|
||||||
|
this.$api.publishTransfer(data).then(res => {
|
||||||
|
console.log('发布店铺转让', res);
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
uni.$u.toast(res.data.msg)
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/my/my'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.$u.toast(res.data.msg)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}).catch(errors => {
|
}).catch(errors => {
|
||||||
console.log("失败信息:" + JSON.stringify(errors))
|
console.log("失败信息:" + JSON.stringify(errors))
|
||||||
// uni.$u.toast('校验失败')
|
// uni.$u.toast('校验失败')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
chooseCommercial() {
|
||||||
|
if (!this.form.business) {
|
||||||
|
uni.$u.toast('请先选择行业')
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
this.show3 = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeAddressFocus() {
|
||||||
|
if (!this.form.region) {
|
||||||
|
uni.$u.toast('请先选择区域')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
changeAddress(e) {
|
changeAddress(e) {
|
||||||
// console.log('changeAddress', e);
|
// console.log('changeAddress', e);
|
||||||
this.getAddressList(e)
|
this.getAddressList(e)
|
||||||
},
|
},
|
||||||
getAddressList(value) {
|
getRegionList() {
|
||||||
var that = this
|
var that = this
|
||||||
uni.request({
|
uni.request({
|
||||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=' + value + '&key=' +
|
url: 'https://apis.map.qq.com/ws/district/v1/getchildren?id=' + uni.getStorageSync('city_code') + '&key=' +
|
||||||
that.$api.key,
|
that.$api.key,
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log('diz', res.data.result.location);
|
that.regionColumns = [res.data.result[0].map(item => item.fullname)]
|
||||||
// console.log('lat', res.data.result.location.lat);
|
},
|
||||||
that.form.latitude = res.data.result.location.lat
|
fail(err) {
|
||||||
// console.log('lng', res.data.result.location.lng);
|
console.log('请求区域失败:', err);
|
||||||
that.form.longitude = res.data.result.location.lng
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getAddressList(value) {
|
||||||
|
if (!this.form.region) {
|
||||||
|
uni.$u.toast('请先选择区域')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
var that = this
|
||||||
|
uni.request({
|
||||||
|
url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=' + that.form.region + value + '&key=' +
|
||||||
|
that.$api.key,
|
||||||
|
success(res) {
|
||||||
|
console.log('地址转经纬度', res.data);
|
||||||
|
if (res.data.message == "query ok") {
|
||||||
|
// console.log('lat', res.data.result.location.lat);
|
||||||
|
that.form.latitude = res.data.result.location.lat
|
||||||
|
// console.log('lng', res.data.result.location.lng);
|
||||||
|
that.form.longitude = res.data.result.location.lng
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('请输入准确地址')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
console.log('请求区域失败:', err);
|
console.log('请求区域失败:', err);
|
||||||
@@ -292,12 +344,61 @@
|
|||||||
this.show1 = false
|
this.show1 = false
|
||||||
this.form.region = e.value[0]
|
this.form.region = e.value[0]
|
||||||
},
|
},
|
||||||
|
getDetail(type, id) {
|
||||||
|
console.log('type, id', type, id);
|
||||||
|
this.$api.getShopDetail(type, id).then(res => {
|
||||||
|
console.log(',re', res);
|
||||||
|
const data = res.data.data
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
this.form = {
|
||||||
|
title: data.tt,
|
||||||
|
region: data.area1,
|
||||||
|
address: data.adress,
|
||||||
|
business: data.trade1,
|
||||||
|
commercial: data.trade2,
|
||||||
|
area: data.mianji,
|
||||||
|
rent: data.zujin,
|
||||||
|
transferFee: data.zhuanrangfei,
|
||||||
|
mobile: data.mobile,
|
||||||
|
content: data.content,
|
||||||
|
// images: data.pics,
|
||||||
|
id: id,
|
||||||
|
contact: data.lianxiren,
|
||||||
|
longitude: data.lng,
|
||||||
|
latitude: data.lat,
|
||||||
|
}
|
||||||
|
var arr = [];
|
||||||
|
var arr1 = [];
|
||||||
|
let obj = {}
|
||||||
|
arr = data.pics.split(",")
|
||||||
|
arr.map(item => {
|
||||||
|
obj = this.$api.imgUrl + item
|
||||||
|
arr1.push(obj)
|
||||||
|
})
|
||||||
|
data.pics = arr1
|
||||||
|
this.fileList1 = data.pics.map(item => {
|
||||||
|
return {
|
||||||
|
url: item
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
this.$refs.uForm.setRules(this.rules)
|
this.$refs.uForm.setRules(this.rules)
|
||||||
|
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
|
console.log('修改转让', options);
|
||||||
|
if (options.item) {
|
||||||
|
console.log('修改');
|
||||||
|
if (options.id) {
|
||||||
|
this.getDetail(1, options.id)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('发布');
|
||||||
|
}
|
||||||
|
this.getRegionList()
|
||||||
this.$api.getClassList().then(res => {
|
this.$api.getClassList().then(res => {
|
||||||
// console.log(res.data.data.length);
|
// console.log(res.data.data.length);
|
||||||
this.Classcolumns = res.data.data.map((item) => {
|
this.Classcolumns = res.data.data.map((item) => {
|
||||||
|
|||||||
@@ -8,11 +8,16 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<ShowShopList v-if="listId == 0" class="list" :isEdit="true" :showStyle="1"></ShowShopList>
|
<ShowShopList v-if="listId == 0" :isEdit="true" :showStyle="1" :shopInfoList="searchInfoList" @delItem="handleDel"
|
||||||
<SearchShopList v-if="listId == 1" class="list" :is-edit="true" :showStyle="1"></SearchShopList>
|
@updateItem="handleUpdate1"></ShowShopList>
|
||||||
<ShowShopList v-if="listId == 2" class="list" :is-edit="true" :showStyle="2"></ShowShopList>
|
<SearchShopList v-if="listId == 1" :searchInfoList="searchInfoList" :is-edit="true" :showStyle="1"
|
||||||
<ShowShopList v-if="listId == 3" class="list" :is-edit="true" :showStyle="2"></ShowShopList>
|
@delItem="handleDel" @updateItem="handleUpdate2">
|
||||||
<ShowShopList v-if="listId == 4" class="list" :showStyle="0"></ShowShopList>
|
</SearchShopList>
|
||||||
|
<ShowShopList v-if="listId == 3" :is-edit="true" :showStyle="2" :shopInfoList="searchInfoList"
|
||||||
|
@delItem="handleDel" @updateItem="handleUpdate3"></ShowShopList>
|
||||||
|
<ShowShopList v-if="listId == 2" :is-edit="true" :showStyle="2" :shopInfoList="searchInfoList"
|
||||||
|
@delItem="handleDel" @updateItem="handleUpdate4"></ShowShopList>
|
||||||
|
<ShowShopList v-if="listId == 4" :showStyle="0" :shopInfoList="matchList"></ShowShopList>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -21,84 +26,187 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
titletext:'',
|
titletext: '',
|
||||||
listId:'',
|
listId: '',
|
||||||
matchList:[]
|
matchList: [],
|
||||||
|
shopInfoList: [],
|
||||||
|
searchInfoList: [],
|
||||||
|
matchListLength: '',
|
||||||
|
searchListLength: '',
|
||||||
|
pageSize: 5,
|
||||||
|
pageNum: 1,
|
||||||
|
matchPageSize: 5,
|
||||||
|
matchPageNum: 1,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.listId !== 4 && this.searchListLength !== 0) {
|
||||||
|
this.pageNum++
|
||||||
|
this.getMyPublished(this.listId + 1, this.pageSize, this.pageNum)
|
||||||
|
} else if (this.listId == 4 && this.matchListLength !== 0) {
|
||||||
|
this.matchPageNum++
|
||||||
|
this.getMatch()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getMatch(){
|
handleUpdate1(searchid) {
|
||||||
this.$api.getMyMatch().then(res => {
|
console.log('页面更新');
|
||||||
this.macthList = res.data.data
|
uni.navigateTo({
|
||||||
console.log(res);
|
url: '/pages/publish/publishTransfer/publishTransfer?item=' + 1 + '&id=' +
|
||||||
|
searchid
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
handleUpdate2(searchid) {
|
||||||
|
console.log('页面更新');
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/publish/publishAddress/publishAddress?item=' + 2 + '&id=' +
|
||||||
|
searchid
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleUpdate3(searchid) {
|
||||||
|
console.log('页面更新');
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/publish/publishInvestment/publishInvestment?item=' + 3 + '&id=' +
|
||||||
|
searchid
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleUpdate4(searchid) {
|
||||||
|
console.log('页面更新');
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/publish/publishRent/publishRent?item=' + 4 + '&id=' +
|
||||||
|
searchid
|
||||||
|
})
|
||||||
|
},
|
||||||
|
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,
|
||||||
|
pageNum: this.matchPageNum
|
||||||
|
}).then(res => {
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
this.matchListLength = res.data.data.length
|
||||||
|
this.matchList = [...this.matchList, ...res.data.data[0]]
|
||||||
|
} else {
|
||||||
|
uni.$u.toast(res.data.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getMyPublished(type, pageSize, pageNum, isDelete) {
|
||||||
|
this.$api.getMyPublished({
|
||||||
|
type: type,
|
||||||
|
pageSize: pageSize,
|
||||||
|
pageNum: pageNum
|
||||||
|
}).then(res => {
|
||||||
|
console.log('发布信息', res);
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
this.searchListLength = res.data.data.length
|
||||||
|
if (isDelete == 1) {
|
||||||
|
this.searchInfoList = res.data.data
|
||||||
|
} else {
|
||||||
|
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.$u.toast(res.data.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad: function(option) {
|
||||||
|
console.log('option', option.listId);
|
||||||
|
this.listId = option.listId
|
||||||
|
wx.setNavigationBarTitle({
|
||||||
|
title: option.titletext
|
||||||
|
})
|
||||||
|
this.titletext = option.titletext
|
||||||
|
if (this.titletext == '发布的店铺转让') {
|
||||||
|
this.listId = 0
|
||||||
|
this.getMyPublished(1, this.pageSize, this.pageNum)
|
||||||
|
}
|
||||||
|
if (this.titletext == '发布的找店选址') {
|
||||||
|
this.listId = 1
|
||||||
|
this.getMyPublished(2, this.pageSize, this.pageNum)
|
||||||
|
}
|
||||||
|
if (this.titletext == '发布的店铺出租') {
|
||||||
|
this.listId = 2
|
||||||
|
this.getMyPublished(3, this.pageSize, this.pageNum)
|
||||||
|
}
|
||||||
|
if (this.titletext == '发布的项目招商') {
|
||||||
|
this.listId = 3
|
||||||
|
this.getMyPublished(4, this.pageSize, this.pageNum)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.titletext == '我的匹配') {
|
||||||
|
this.listId = 4
|
||||||
|
this.getMatch()
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
onLoad: function (option) {
|
computed: {
|
||||||
wx.setNavigationBarTitle({
|
|
||||||
title: option.titletext
|
|
||||||
})
|
|
||||||
this.titletext = option.titletext
|
|
||||||
if(this.titletext == '发布的店铺转让'){
|
|
||||||
this.listId = 0
|
|
||||||
}
|
|
||||||
if(this.titletext == '发布的找店选址'){
|
|
||||||
this.listId = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.titletext == '发布的项目招商'){
|
|
||||||
this.listId = 2
|
|
||||||
}
|
|
||||||
if(this.titletext == '发布的店铺出租'){
|
|
||||||
this.listId = 3
|
|
||||||
}
|
|
||||||
if(this.titletext == '我的匹配'){
|
|
||||||
this.listId = 4
|
|
||||||
this.getMatch()
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
computed:{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.search-box {
|
.search-box {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
width: 84.6%;
|
width: 84.6%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
|
||||||
.search-box-input {
|
.search-box-input {
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
opacity: 0.85;
|
opacity: 0.85;
|
||||||
|
|
||||||
.u-border {
|
.u-border {
|
||||||
border: none;
|
border: none;
|
||||||
|
|
||||||
.u-input__content {
|
.u-input__content {
|
||||||
height: 62rpx;
|
height: 62rpx;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
||||||
.u-input__content__field-wrapper__field {
|
.u-input__content__field-wrapper__field {
|
||||||
font-size: 26rpx !important;
|
font-size: 26rpx !important;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
page{
|
}
|
||||||
background-color: #F8F8F8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content{
|
page {
|
||||||
margin: 0 10px;
|
background-color: #F8F8F8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,19 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="root">
|
<view class="root">
|
||||||
<InputAndSwiper></InputAndSwiper>
|
<InputAndSwiper @getQueryInfo="getInput" :bannerURL="swiperList" :refresh="isRefresh"></InputAndSwiper>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<view class="dropdown-bug">
|
<view class="dropdown-bug">
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<DropDown></DropDown>
|
<DropDown @getQueryInfo="getShopList"></DropDown>
|
||||||
</view>
|
</view>
|
||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<SearchShopList :showStyle="1"/>
|
<SearchShopList :showStyle="1" :searchInfoList="searchInfoList" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="showNull" class="showNull">
|
||||||
|
<text>没有符合条件的数据, 请下拉刷新重置数据~
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
<TabBar :current-page="3"></TabBar>
|
<TabBar :current-page="3"></TabBar>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -26,22 +29,133 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
pageSize: 8,
|
||||||
|
pageNum: 1,
|
||||||
|
searchInfoList: [],
|
||||||
|
swiperList: [],
|
||||||
|
customQuery: {},
|
||||||
|
searchListLength: '',
|
||||||
|
showNull: false,
|
||||||
|
refresh: false,
|
||||||
|
isRefresh: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
onPullDownRefresh() {
|
||||||
|
this.refresh = true
|
||||||
|
// if (this.showNull = true) {
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 2,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: 1,
|
||||||
|
})
|
||||||
|
// if(this.showNull=true){
|
||||||
|
// this.pageNum=1
|
||||||
|
// }
|
||||||
|
this.getShopList(q, "refresh")
|
||||||
|
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (!this.refresh && this.searchListLength !== 0) {
|
||||||
|
this.isRefresh = true
|
||||||
|
this.pageNum++
|
||||||
|
this.getShopList()
|
||||||
|
console.log("触底加载");
|
||||||
|
} else if (this.searchListLength == 0) {
|
||||||
|
this.pageNum = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getShopList()
|
||||||
|
this.getBanner()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getBanner() {
|
||||||
|
this.$api.getBanner().then(res => {
|
||||||
|
res.data.data.forEach(item => {
|
||||||
|
item.img = this.$api.imgUrl + item.img
|
||||||
|
})
|
||||||
|
this.swiperList = res.data.data
|
||||||
|
// .map(item => this.$api.imgUrl + item.img)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getInput(val) {
|
||||||
|
console.log('搜索值', val);
|
||||||
|
if (this.pageNum !== 1) {
|
||||||
|
this.pageNum = 1
|
||||||
|
}
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 2,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
kw: val
|
||||||
|
})
|
||||||
|
this.$api.getShopList(q).then(res => {
|
||||||
|
this.searchListLength = res.data.data.length
|
||||||
|
this.searchInfoList = res.data.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getShopList(q, type) {
|
||||||
|
let query = {}
|
||||||
|
if (type == "refresh") {
|
||||||
|
query = q
|
||||||
|
} else {
|
||||||
|
query = this.getQueryInfo(q)
|
||||||
|
}
|
||||||
|
console.log("listquery", query);
|
||||||
|
this.$api.getShopList(query).then(res => {
|
||||||
|
this.searchListLength = res.data.data.length
|
||||||
|
if (query.includes('business') || query.includes('areatype') || query.includes('sortType') || query
|
||||||
|
.includes('region') || this.refresh) {
|
||||||
|
console.log('筛选');
|
||||||
|
// this.resetQuery(q)
|
||||||
|
this.searchInfoList = res.data.data
|
||||||
|
this.refresh = false
|
||||||
|
if (res.data.data.length == 0) {
|
||||||
|
this.showNull = true
|
||||||
|
} else {
|
||||||
|
this.showNull = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('查询');
|
||||||
|
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
|
||||||
|
}
|
||||||
|
console.log(this.searchInfoList);
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getQueryInfo(query) {
|
||||||
|
console.log("getQueryInfo", query);
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 2,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
...query
|
||||||
|
})
|
||||||
|
return q
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.showNull {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100rpx;
|
||||||
|
color: darkgray;
|
||||||
|
}
|
||||||
|
|
||||||
page {
|
page {
|
||||||
background-color: $uni-bg-color-grey;
|
background-color: $uni-bg-color-grey;
|
||||||
}
|
}
|
||||||
.root{
|
|
||||||
|
.root {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-bug {
|
.dropdown-bug {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: $uni-bg-color-grey;
|
background-color: $uni-bg-color-grey;
|
||||||
@@ -50,8 +164,8 @@
|
|||||||
transform: translateY(-20rpx);
|
transform: translateY(-20rpx);
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
.marginLR10{
|
|
||||||
|
.marginLR10 {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -1,19 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="root">
|
<view class="root">
|
||||||
<InputAndSwiper></InputAndSwiper>
|
<InputAndSwiper @getQueryInfo="getInput" :bannerURL="swiperList" :refresh="isRefresh">
|
||||||
|
</InputAndSwiper>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<view class="dropdown-bug">
|
<view class="dropdown-bug">
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<DropDown></DropDown>
|
<DropDown @getQueryInfo="getShopList"></DropDown>
|
||||||
</view>
|
</view>
|
||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<ShowShopList :showStyle="1"></ShowShopList>
|
<ShowShopList :showStyle="1" :shopInfoList="shopInfoList"></ShowShopList>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="showNull" class="showNull">
|
||||||
|
<text>没有符合条件的数据, 请下拉刷新重置数据~
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
<TabBar :current-page="1"></TabBar>
|
<TabBar :current-page="1"></TabBar>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -26,11 +30,110 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
pageSize: 8,
|
||||||
|
pageNum: 1,
|
||||||
|
shopInfoList: [],
|
||||||
|
customQuery: {},
|
||||||
|
swiperList: [],
|
||||||
|
shopListLength: '',
|
||||||
|
showNull: false,
|
||||||
|
refresh: false,
|
||||||
|
isRefresh: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
onPullDownRefresh() {
|
||||||
|
this.refresh = true
|
||||||
|
// if (this.showNull = true) {
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 1,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: 1,
|
||||||
|
})
|
||||||
|
// if(this.showNull=true){
|
||||||
|
// this.pageNum=1
|
||||||
|
// }
|
||||||
|
this.getShopList(q, "refresh")
|
||||||
|
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (!this.refresh && this.shopListLength !== 0) {
|
||||||
|
this.isRefresh = true
|
||||||
|
this.pageNum++
|
||||||
|
this.getShopList()
|
||||||
|
console.log("触底加载");
|
||||||
|
} else if (this.shopListLength == 0) {
|
||||||
|
this.pageNum = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getShopList()
|
||||||
|
this.getBanner()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getBanner() {
|
||||||
|
this.$api.getBanner().then(res => {
|
||||||
|
res.data.data.forEach(item => {
|
||||||
|
item.img = this.$api.imgUrl + item.img
|
||||||
|
})
|
||||||
|
this.swiperList = res.data.data
|
||||||
|
// .map(item => this.$api.imgUrl + item.img)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getInput(val) {
|
||||||
|
console.log('搜索值', val);
|
||||||
|
if (this.pageNum !== 1) {
|
||||||
|
this.pageNum = 1
|
||||||
|
}
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 1,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
kw: val
|
||||||
|
})
|
||||||
|
this.$api.getShopList(q).then(res => {
|
||||||
|
this.shopListLength = res.data.data.length
|
||||||
|
this.shopInfoList = res.data.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getShopList(q, type) {
|
||||||
|
let query = {}
|
||||||
|
if (type == "refresh") {
|
||||||
|
query = q
|
||||||
|
} else {
|
||||||
|
query = this.getQueryInfo(q)
|
||||||
|
}
|
||||||
|
console.log("listquery", query);
|
||||||
|
this.$api.getShopList(query).then(res => {
|
||||||
|
this.shopListLength = res.data.data.length
|
||||||
|
if (query.includes('business') || query.includes('areatype') || query.includes('sortType') || query
|
||||||
|
.includes('region') || this.refresh) {
|
||||||
|
console.log('筛选');
|
||||||
|
// this.resetQuery(q)
|
||||||
|
this.shopInfoList = res.data.data
|
||||||
|
this.refresh = false
|
||||||
|
if (res.data.data.length == 0) {
|
||||||
|
this.showNull = true
|
||||||
|
} else {
|
||||||
|
this.showNull = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('查询');
|
||||||
|
this.shopInfoList = [...this.shopInfoList, ...res.data.data]
|
||||||
|
}
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
console.log(this.shopInfoList);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getQueryInfo(query) {
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 1,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
...query
|
||||||
|
})
|
||||||
|
return q
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -39,9 +142,19 @@
|
|||||||
page {
|
page {
|
||||||
background-color: $uni-bg-color-grey;
|
background-color: $uni-bg-color-grey;
|
||||||
}
|
}
|
||||||
.root{
|
|
||||||
|
.showNull {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100rpx;
|
||||||
|
color: darkgray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.root {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-bug {
|
.dropdown-bug {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: $uni-bg-color-grey;
|
background-color: $uni-bg-color-grey;
|
||||||
@@ -50,8 +163,8 @@
|
|||||||
transform: translateY(-20rpx);
|
transform: translateY(-20rpx);
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
.marginLR10{
|
|
||||||
|
.marginLR10 {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -1,4 +1,17 @@
|
|||||||
const serverHost = 'https://spsp.feashow.com/api' //http://xx.xxx.xx
|
const serverHost = 'https://spsp.feashow.com/api' //http://xx.xxx.xx
|
||||||
|
function isOutTime(res) {
|
||||||
|
if (res.data.msg == '登录超时,请重新登录') {
|
||||||
|
uni.showToast('登录信息已过期,请重新登录')
|
||||||
|
// setTimeout(() => {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pages/login/login'
|
||||||
|
})
|
||||||
|
// }, 1000)
|
||||||
|
uni.removeStorageSync('loginToken')
|
||||||
|
} else {
|
||||||
|
// uni.showToast(res.data.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
const service = {
|
const service = {
|
||||||
get(url, data) {
|
get(url, data) {
|
||||||
const header = {}
|
const header = {}
|
||||||
@@ -12,8 +25,11 @@ const service = {
|
|||||||
header: header,
|
header: header,
|
||||||
success: res => {
|
success: res => {
|
||||||
resolve(res)
|
resolve(res)
|
||||||
|
console.log('res===',res);
|
||||||
|
isOutTime(res);
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
|
console.log('错误',err);
|
||||||
reject(err)
|
reject(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -31,6 +47,7 @@ const service = {
|
|||||||
header: header,
|
header: header,
|
||||||
success: res => {
|
success: res => {
|
||||||
resolve(res)
|
resolve(res)
|
||||||
|
isOutTime(res);
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
try {
|
try {
|
||||||
@@ -55,6 +72,7 @@ const service = {
|
|||||||
header: header,
|
header: header,
|
||||||
success: res => {
|
success: res => {
|
||||||
resolve(res)
|
resolve(res)
|
||||||
|
isOutTime(res);
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
reject(err)
|
reject(err)
|
||||||
@@ -74,6 +92,7 @@ const service = {
|
|||||||
header: header,
|
header: header,
|
||||||
success: res => {
|
success: res => {
|
||||||
resolve(res)
|
resolve(res)
|
||||||
|
isOutTime(res);
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
reject(err)
|
reject(err)
|
||||||
@@ -93,6 +112,7 @@ const service = {
|
|||||||
header: header,
|
header: header,
|
||||||
success: res => {
|
success: res => {
|
||||||
resolve(res)
|
resolve(res)
|
||||||
|
isOutTime(res);
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
reject(err)
|
reject(err)
|
||||||
@@ -128,7 +148,7 @@ const toast = {
|
|||||||
const apiService = {
|
const apiService = {
|
||||||
serverHost,
|
serverHost,
|
||||||
imgUrl: 'https://spsp.feashow.com/',
|
imgUrl: 'https://spsp.feashow.com/',
|
||||||
key: 'ZRKBZ-Q7FWL-GVZPK-MCRBU-4XFB5-ATBDB',
|
key: 'XR3BZ-SHJKJ-VK6FR-DOYXJ-C3F7Z-Y5BY6',
|
||||||
uploadImgUrl: serverHost + '/upload/image/',
|
uploadImgUrl: serverHost + '/upload/image/',
|
||||||
//登录接口
|
//登录接口
|
||||||
login(data) {
|
login(data) {
|
||||||
@@ -159,7 +179,7 @@ const apiService = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取详情
|
// 获取详情
|
||||||
getShopDetail(type,id) {
|
getShopDetail(type, id) {
|
||||||
const url = `/home/adetail/?type=${type}&id=${id}`
|
const url = `/home/adetail/?type=${type}&id=${id}`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.get(url))
|
resolve(service.get(url))
|
||||||
@@ -225,10 +245,10 @@ const apiService = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取我的匹配
|
//获取我的匹配
|
||||||
getMyMatch() {
|
getMyMatch(data) {
|
||||||
const url = `/center/match/`
|
const url = `/center/match/`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.get(url))
|
resolve(service.get(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取行业和业态
|
//获取行业和业态
|
||||||
@@ -239,48 +259,71 @@ const apiService = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
//招募合伙
|
//招募合伙
|
||||||
toBePartner(data){
|
toBePartner(data) {
|
||||||
const url = `/center/partner`
|
const url = `/center/partner`
|
||||||
return new Promise((resolve,reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
resolve(service.post(url,data))
|
resolve(service.post(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取商铺列表
|
//获取商铺列表
|
||||||
getShopList(query){
|
getShopList(query) {
|
||||||
const url = `/shop/alllist${query}`
|
const url = `/shop/alllist${query}`
|
||||||
return new Promise((resolve,reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.get(url))
|
resolve(service.get(url))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//发布店铺转让
|
//发布店铺转让
|
||||||
publishTransfer(data){
|
publishTransfer(data) {
|
||||||
const url = `/shop/transfer/`
|
const url = `/shop/transfer/`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.post(url, data))
|
resolve(service.post(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//发布店铺出租
|
//发布店铺出租
|
||||||
publishRent(data){
|
publishRent(data) {
|
||||||
const url = `/shop/rent/`
|
const url = `/shop/rent/`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.post(url, data))
|
resolve(service.post(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//发布找店地址
|
//发布找店地址
|
||||||
publishAddress(data){
|
publishAddress(data) {
|
||||||
const url = `/shop/selection/`
|
const url = `/shop/selection/`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.post(url, data))
|
resolve(service.post(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//发布项目招商
|
//发布项目招商
|
||||||
publishInvestment(data){
|
publishInvestment(data) {
|
||||||
const url = `/shop/investment/`
|
const url = `/shop/investment/`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.post(url, data))
|
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))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//获取个人发布过的信息
|
||||||
|
getMyPublished(data) {
|
||||||
|
const url = `/center/mypub/`
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolve(service.post(url, data))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deleteMyPublished(data) {
|
||||||
|
const url = '/shop/adel'
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolve(service.delete(url, data))
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
export {
|
export {
|
||||||
apiService,
|
apiService,
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Reference in New Issue
Block a user