梁航:合并及数字键盘

This commit is contained in:
hot777zz
2023-11-25 18:41:14 +08:00
25 changed files with 2104 additions and 684 deletions

View File

@@ -1,21 +1,22 @@
<template>
<view class="container">
<view class="tabs-bg" />
<view class="tabs-bg"></view>
<view class="tabs">
<view class="title-view" v-for="(item, index) in title" :key="item" @click="changeActiveIndex(index)"
:class="{isActive: activeIndex === index}">
<text>{{item}}</text>
<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 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 class="item-border">
<DropDownItem v-if="activeIndex !== -1" :list="tablist" @cancelDrop="cancelDrop" :type="'region'" />
<DropDownItem v-if="activeIndex !== -1" :list="tablist" @cancelDrop="cancelDrop" @getQueryInfo="getQueryInfo"
:type="title[activeIndex]" />
</view>
</view>
</template>
@@ -30,23 +31,22 @@
components: {
DropDownItem
},
props: {
postlist: {
type: Array,
default () {
return [
['全部', '餐饮美食', '百货超市', '美容美发'],
['区域1', '区域2', '区域3', '区域4'],
['100m2', '200m2', '300m2'],
['附近的', '最新发布的', '其他']
]
}
}
},
data() {
return {
title: ['行业', '区域', '面积', '筛选'],
activeIndex: -1,
postlist: [
['全部', '餐饮美食', '百货超市', '美容美发'],
['区域1', '区域2', '区域3', '区域4'],
['小于50m²', '50-200m²', '200-600m²', '600-800m²', '800-1000m²', '1000m²以上'],
['面积从大到小', '面积从小到大', '租金从大到小', '租金从小到大']
],
queryInfo: {
region: '',
sortType: '',
areatype: '',
business: ''
}
};
},
computed: {
@@ -56,7 +56,8 @@
},
created() {
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: {
changeActiveIndex(index) {
@@ -66,8 +67,18 @@
this.activeIndex = index
},
cancelDrop() {
console.log("取消遮罩");
this.activeIndex = -1;
},
getQueryInfo(querys) {
this.queryInfo = {
...this.queryInfo,
...querys
}
const query = this.$u.queryParams(this.queryInfo)
console.log(query, 'dropquery');
this.$emit('getQueryInfo', this.queryInfo)
return query
}
}
}

View File

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

View File

@@ -2,8 +2,8 @@
<view class="input-and-swiper-root">
<view class="search-box" v-if="type!=='0'">
<view class="search-box-input">
<u-input placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true">
<u-input v-model="keyword" placeholder="请输入店铺名称进行搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @clear="handleClear" clearable @change="changeInput">
<template slot="suffix">
<view style="display: flex;align-items: center;">
<u-icon name="map-fill" color="#329866" size="22"></u-icon>
@@ -19,6 +19,7 @@
</template>
<script>
import QQMapWX from "@/utils/qqmap-wx-jssdk.min.js"
export default {
name: "inputAndSwiper",
props: {
@@ -35,20 +36,137 @@
type: {
type: String,
default: '1'
},
refresh: {
type: Boolean,
default: false
}
},
data() {
return {
position: uni.getStorageSync('city') + uni.getStorageSync('district').slice(0, 2),
currentNum: ''
currentNum: '',
keyword:''
};
},
options: {
styleIsolation: 'shared', // 解除样式隔离
},
watch: {
refresh(newVal, oldVal) {
console.log('newVal',newVal);
if(newVal){
this.keyword=''
}
}
},
onShow() {
if (this.type !== '0') {
this.open()
}
},
created() {
},
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) {
const item = bannerURL[currentNum]

View File

@@ -1,28 +1,32 @@
<template>
<view>
<SearchShopListItem
v-for="item in shopInfoList"
:key="searchid"
:shopInfo="item"
:show-style="showStyle"
:isEdit="isEdit"
@delItem="handleDel"
></SearchShopListItem>
<SearchShopListItem v-for="item in searchInfoList" :key="searchid" :shopInfo="item" :show-style="showStyle"
:isEdit="isEdit" @delItem="handleDel" @updateItem="handleUpdate"></SearchShopListItem>
</view>
</template>
<script>
/**
* @property {Array} shopInfoList 对象数组,(不带图片)需要展示商铺列表
* @property {Number} showStyle 展示商铺的样式类型(0为首页默认)
* @property {Boolean} isEdit 是否显示编辑和删除
* @property {Number} listType 获取列表类型传递参数部分
* @property {Object} customQuery 自定义查询参数
*/
export default {
name: "SearchShopList",
data() {
return {
pageSize: 5,
pageNum: 1,
};
},
props: {
searchInfoList: {
type: Array,
default () {
return []
}
},
showStyle: {
type: Number,
default () {
@@ -35,41 +39,26 @@
return false
}
},
shopInfoList: {
type: Array,
listType: {
type: Number,
default () {
return [
{
searchid: 1,
title: '寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右',
price: 5000,
date: '2023-11-02',
phoneNum: 13348946108,
pos: '锦江区',
category: '餐饮美食',
uname: 'A先生',
sqr: 500,
yjtzText: "423万元"
},
{
searchid: 2,
title: '寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右',
price: 7000,
date: '2023-11-02',
phoneNum: 13348946108,
pos: '锦江区',
category: '餐饮美食',
uname: '王先生',
sqr: 200,
yjtzText: "423万元"
return 2
}
]
},
customQuery: {
type: Object,
default () {
return {}
}
}
},
methods: {
handleUpdate(searchid) {
this.$emit('updateItem', searchid)
},
handleDel(shopid) {
console.log("删除了商铺", shopid);
this.$emit('delItem', shopid)
// const delindex = this.shopInfoList.findIndex((item,index)=> item.shopid === shopid)
// TODO不能直接修改
// if(delindex !== -1) this.shopInfoList = this.shopInfoList.slice(delindex,1)

View File

@@ -3,99 +3,101 @@
<view class="yzr" v-if="showStyle === 2">
<u-image src="/static/cjal/anl_tu.png" width="156rpx" height="156rpx"></u-image>
</view>
<view class="list-container">
<view class="list-container" @click="enterDetail()">
<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="rent-and-cost">
<text>租金{{shopInfo.price}}/</text>
<text v-if="showStyle==1">预计投资{{shopInfo.yjtzText}}</text>
<text>租金{{shopInfo.zujin}}/</text>
<text v-if="showStyle==1">预计投资{{shopInfo.zhuanrangfei}}</text>
</view>
<view class="cart-and-pos">
<view>
<view>
<view style="width: 131rpx;margin-right: 68rpx;">
<view style="margin-right: 4px;">
<u-image src="/static/shoplist/sy_icon_lbhy.png" width="12px" height="15px"></u-image>
</view>
<text>{{shopInfo.category}}</text>
<text>{{shopInfo.trade1}}</text>
</view>
<view>
<view>
<view style="width: 131rpx;">
<view style="margin-right: 4px;">
<u-image src="/static/shoplist/sy_icon_lbhdw.png" width="12px" height="15px"></u-image>
</view>
<text>{{shopInfo.pos}}</text>
<text>{{shopInfo.area1}}</text>
</view>
</view>
</view>
<view class="style3" v-if="showStyle === 2">
<view class="cjsj">成交时间{{shopInfo.date}}</view>
<view class="cjsj">
<text>成交时间{{$u.timeFormat(shopInfo.deal_time,'yyyy-mm-dd')}}</text>
</view>
<view class="cart-and-pos">
<view>
<view>
<view style="width: 131rpx;margin-right: 68rpx;">
<view style="margin-right: 4px;">
<u-image src="/static/cjal/al_icon_flh.png" width="12px" height="15px"></u-image>
</view>
<text :class="{style3: showStyle === 2}">{{shopInfo.category}}</text>
<text :class="{style3: showStyle === 2}">{{shopInfo.trade1}}</text>
</view>
<view>
<view>
<view style="width: 131rpx;">
<view style="margin-right: 4px;">
<u-image src="/static/cjal/al_icon_dwh.png" width="12px" height="15px"></u-image>
</view>
<text :class="{style3: showStyle === 2}">{{shopInfo.pos}}</text>
<text :class="{style3: showStyle === 2}">{{shopInfo.area1}}</text>
</view>
</view>
</view>
<view class="sqr-and-lx" :class="{pb0: showStyle === 2}">
<view>
<view style="width: 131rpx;margin-right: 68rpx;">
<view>
<u-image v-if="showStyle === 2" src="/static/cjal/al_icon_pm.png" width="12px" height="15px"></u-image>
<u-image v-else src="/static/shoplist/sy_icon_lbpm.png" width="12px" height="15px"></u-image>
</view>
<text :class="{style3: showStyle === 2}">{{shopInfo.sqr}}m2</text>
<text :class="{style3: showStyle === 2}">{{shopInfo.mianji}}m²</text>
</view>
<view>
<view style="width: 131rpx;margin-right: 64rpx;">
<view>
<u-image v-if=" showStyle===2" src="/static/cjal/al_icon_mch.png" width="12px" height="15px"></u-image>
<u-image v-else src="/static/shoplist/sy_icon_lbxm.png" width="12px" height="15px"></u-image>
</view>
<text :class="{style3: showStyle === 2}">{{shopInfo.uname}}</text>
<text :class="{style3: showStyle === 2}">{{shopInfo.lianxiren}}</text>
</view>
<view style="flex:2">
<view style="width: 190rpx;">
<view>
<u-image v-if="showStyle === 2" src="/static/cjal/al_icon_sjh.png" width="12px" height="15px"></u-image>
<u-image v-else src="/static/shoplist/sy_icon_lblxr.png" width="12px" height="15px"></u-image>
</view>
<text :class="{style3: showStyle === 2}">{{shopInfo.phoneNum}}</text>
<text :class="{style3: showStyle === 2}">{{shopInfo.mobile}}</text>
</view>
</view>
<view class="cart-and-date" v-if="showStyle === 0">
<view>
<view style="width: 131rpx;">
<view>
<u-image src="/static/shoplist/sy_icon_lbhy.png" width="12px" height="15px"></u-image>
</view>
<text>{{shopInfo.category}}</text>
<text>{{shopInfo.trade1}}</text>
</view>
<view>
<view style="width: 131rpx;">
<view>
<u-image src="/static/shoplist/sy_icon_lbhdw.png" width="12px" height="15px"></u-image>
</view>
<text>{{shopInfo.pos}}</text>
<text>{{shopInfo.area1}}</text>
</view>
<view style="flex:2">
<view style="width: 290rpx;">
<view>
<u-image src="/static/shoplist/sy_icon_lbrq.png" width="12px" height="15px"></u-image>
</view>
<text>发布日期{{shopInfo.date}}</text>
<text>发布日期{{$u.timeFormat(shopInfo.pub_time,'yyyy-mm-dd')}}</text>
</view>
</view>
<view v-if="isEdit" class="del-and-edit bottom-common">
<view class="edit" @click="handleEdit(shopInfo.searchid)">
<view class="edit" @click="handleEdit(shopInfo.id)">
<u-image src="/static/shoplist/dp_icon_pj.png" width="12px" height="15px"></u-image>
<text>编辑</text>
</view>
<view class="del" @click="handleDel(shopInfo.searchid)">
<view class="del" @click="handleDel(shopInfo.id)">
<u-image src="/static/shoplist/dp_icon_sc.png" width="12px" height="15px"></u-image>
<text>删除</text>
</view>
@@ -113,14 +115,7 @@
type: Object,
default () {
return {
title: '寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右',
price: 5000,
date: '2023-11-02',
phoneNum: 13348946108,
pos: '锦江区',
category: '餐饮美食',
uname: '王先生',
sqr: 200
}
}
},
@@ -148,9 +143,22 @@
},
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) {
// TODO 完成页面跳转
console.log("点击了编辑ID为", searchid);
this.$emit('updateItem', searchid)
},
handleDel(searchid) {
this.$emit('delItem', searchid)
@@ -158,27 +166,36 @@
}
}
</script>
<style lang="scss" scoped>
.style3 {
position: relative;
color: #696969 !important;
.cart-and-pos {
border-top: 1px solid #eee !important;
}
}
.pb0 {
padding-bottom: 0 !important;
}
.yzr {
position: absolute;
top: 30rpx;
right: 13rpx;
z-index: 5;
}
.cjsj {
margin-top: 20rpx;
margin-bottom: 12rpx;
>text {
font-size: 24rpx;
}
}
.list-border {
position: relative;
margin: 10px 0;
@@ -187,105 +204,133 @@
border-radius: 7px;
box-shadow: 0 1px 2px 0 rgba(224, 224, 224, 0.50);
font-size: 12px;
.list-container {
display: flex;
height: auto;
}
.bottom-common {
border-top: 1px solid #f7f7f7;
padding-top: 5px;
display: flex;
>view {
display: flex;
}
}
.del-and-edit {
margin-top: 6px;
justify-content: flex-end;
>view {
margin-left: 38rpx;
}
text {
margin-left: 4px;
color: #666666;
}
}
.text-area {
display: flex;
flex-direction: column;
justify-content: space-between;
width: 100%;
>text {
font-size: 14px;
font-size: 28rpx;
}
>view {
display: flex;
>view {
display: flex;
>view {
margin-right: 4px;
}
}
}
.style2,.style3 {
.style2,
.style3 {
display: flex;
flex-direction: column;
color: #CC3333;
font-weight: 500;
.rent-and-cost {
text {
margin-right: 26rpx;
font-size: 24rpx;
}
margin-top: 5px;
padding-top: 5px;
padding-bottom: 6px;
}
.cart-and-pos {
>view {
margin-right: 50rpx;
display: flex;
}
display: flex;
border-top: 1px solid #f7f7f7;
padding-top: 5px;
margin-bottom: 5px;
justify-content: start;
font-weight: 500;
text {
color: #CC3333;
line-height: 12px;
font-size: 24rpx;
}
}
}
.sqr-and-lx {
justify-content: space-between;
display: flex;
// justify-content: space-between;
margin-top: 5px;
padding-bottom: 6px;
text {
color: #359867;
line-height: 12px;
font-size: 24rpx;
}
.style3 {
color: #696969;
}
>view {
flex:1;
display: flex;
// flex: 1;
// display: flex;
>view {
margin-right: 4px;
// margin-right: 4px;
}
}
}
.cart-and-date {
display: flex;
border-top: 1px solid #f7f7f7;
padding-top: 5px;
justify-content: space-between;
font-weight: 500;
text {
color: #CC3333;
line-height: 12px;
margin-right: 48rpx;
// margin-right: 48rpx;
}
}
}

View File

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

View File

@@ -2,10 +2,10 @@
<view class="list-border">
<view class="list-container" @click="enterDetail()">
<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 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>
<view>
@@ -17,7 +17,7 @@
<view>
<u-image src="/static/shoplist/sy_icon_lbpm.png" width="12px" height="15px"></u-image>
</view>
<text>{{shopInfo.mianji}}m2</text>
<text>{{shopInfo.mianji}}m²</text>
</view>
</view>
<view v-else class="pos-and-sqr pos-only">
@@ -25,13 +25,14 @@
<view>
<u-image src="/static/shoplist/dp_icon_hhhdw.png" width="12px" height="15px"></u-image>
</view>
<text>{{shopInfo.area2}}</text>
<text>{{shopInfo.area1}}-{{shopInfo.adress}}</text>
</view>
</view>
<view class="rent-and-date">
<text>租金{{shopInfo.zujin}}/</text>
<text v-if="showStyle == 0">发布日期{{shopInfo.create_time}}</text>
<text v-if="showStyle == 1">转让费{{shopInfo.zhuanrangfei}}</text>
<text v-if="showStyle == 0">发布日期{{$u.timeFormat(shopInfo.pub_time,'yyyy-mm-dd')}}</text>
<text v-if="showStyle == 1">转让费{{shopInfo.zhuanrangfei}}</text>
<!-- bug -->
</view>
</view>
</view>
@@ -41,7 +42,7 @@
<view>
<u-image src="/static/shoplist/sy_icon_lbpm.png" width="12px" height="15px"></u-image>
</view>
<text>{{shopInfo.mianji}}m2</text>
<text>{{shopInfo.mianji}}m²</text>
</view>
<view>
<view>
@@ -63,15 +64,10 @@
</view>
</view>
<view
v-if="isADShow"
class="list-ads bottom-common"
style="font-size: 11px;"
@click="handleAD"
>
<view v-if="isADShow" class="list-ads bottom-common" style="font-size: 11px;" @click="handleAD">
<view>
<text>已将该店推给</text>
<text style="color:#ce3b3b;margin: 0 4px;"> {{shopInfo.promotionNum}} </text>
<text style="color:#ce3b3b;margin: 0 4px;"> {{shopInfo.num}} </text>
<text> 位潜在客户</text>
</view>
<text style="color:#ce3b3b">我也要推广>></text>
@@ -136,22 +132,25 @@
return false
}
},
},
data() {
return {
delshopid: 0,
leftImage: ''
}
},
computed: {
},
created() {
this.leftImage = this.$api.imgUrl + this.shopInfo.pics.split(',')[0]
},
methods: {
handleEdit(shopid) {
// TODO 完成页面跳转
console.log("点击了编辑ID为", shopid);
this.$emit('updateItem', shopid)
},
handleDel(shopid) {
// 需完善删除请求
@@ -163,7 +162,7 @@
id: this.shopInfo.id,
type: this.shopInfo.type
})
// console.log("query",query);
console.log("query", query);
uni.navigateTo({
url: '/pages/detail/detail' + `${query}`
})
@@ -193,39 +192,47 @@
border-radius: 7px;
box-shadow: 0 1px 2px 0 rgba(224, 224, 224, 0.50);
font-size: 12px;
.list-container {
display: flex;
height: 80px;
margin-bottom: 10px;
}
.text-area {
margin-left: 10px;
display: flex;
flex-direction: column;
justify-content: space-between;
> text {
>text, >u-text {
font-size: 14px;
}
.pos-and-sqr {
display: flex;
text {
color: #359867;
line-height: 12px;
}
>view {
margin-right: 24px;
display: flex;
>view {
margin-right: 4px;
}
}
}
.pos-only {
text {
color: #A0A0A0;
}
}
.rent-and-date {
text {
font-weight: 500;
@@ -239,42 +246,51 @@
border-top: 1px solid #f7f7f7;
padding-top: 5px;
display: flex;
>view {
display: flex;
}
}
.cart-and-date {
margin-bottom: 6px;
justify-content: space-between;
font-weight: 500;
text {
color: #359867;
line-height: 12px;
}
>view {
flex: 1;
>view {
margin-right: 4px;
}
}
}
.del-and-edit {
margin-top: 6px;
justify-content: flex-end;
>view {
margin-left: 38rpx;
}
text {
margin-left: 4px;
color: #666666;
}
}
.list-ads {
justify-content: space-between;
text {
color: #359867;
}
}
}
</style>

View File

@@ -36,7 +36,7 @@
"navigationBarTitleText": "店铺转让",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#339967",
"enablePullDownRefresh": false
"enablePullDownRefresh": true
}
},
{
@@ -45,7 +45,7 @@
"navigationBarTitleText": "找店地址",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#339967",
"enablePullDownRefresh": false
"enablePullDownRefresh": true
}
},
{
@@ -60,7 +60,7 @@
{
"path": "pages/detail/detail",
"style": {
"navigationBarTitleText": "商详情",
"navigationBarTitleText": "商详情",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#339967",
"enablePullDownRefresh": false
@@ -127,7 +127,7 @@
"navigationBarTitleText": "转让信息",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#339967",
"enablePullDownRefresh": false
"enablePullDownRefresh": true
}
},
{
@@ -136,7 +136,7 @@
"navigationBarTitleText": "找店信息",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#339967",
"enablePullDownRefresh": false
"enablePullDownRefresh": true
}
},
{
@@ -145,7 +145,7 @@
"navigationBarTitleText": "出租信息",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#339967",
"enablePullDownRefresh": false
"enablePullDownRefresh": true
}
},
{
@@ -154,7 +154,7 @@
"navigationBarTitleText": "项目招商",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#339967",
"enablePullDownRefresh": false
"enablePullDownRefresh": true
}
},
{

View File

@@ -1,7 +1,7 @@
<template>
<view class="detail" ref="viewref">
<view class="swiper">
<u-swiper :list="shopInfo.pics" keyName="pics" height="500rpx" radius="0"></u-swiper>
<view class="swiper" v-if="search">
<u-swiper :list="shopInfo.pics" height="500rpx" radius="0"></u-swiper>
</view>
<view class="sub-detail u-flex">
<view class="title">
@@ -13,9 +13,10 @@
<view class="grid-textup">{{shopInfo.zujin}}/</view>
<view class="grid-text">租金</view>
</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-text">转让费</view>
<view v-if="search" class="grid-text">转让费</view>
<view v-else class="grid-text">预计投资</view>
</u-grid-item>
<u-grid-item>
<view class="grid-textup">{{shopInfo.mianji}}</view>
@@ -30,14 +31,14 @@
<view class="location-detail">
<text>行业{{shopInfo.trade1}}</text>
<text>区域{{shopInfo.area1}}</text>
<text>地址{{shopInfo.adress}}</text>
<text v-if="search">地址{{shopInfo.adress}}</text>
</view>
<view class="bgc">
</view>
<view class="seller-shop-detail">
<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>
</view>
<u-divider :height="5"></u-divider>
@@ -68,7 +69,7 @@
</u-modal>
</view>
</view>
<view class="bug-figure">
<view v-if="search" class="bug-figure">
</view>
</view>
@@ -79,11 +80,19 @@
data() {
return {
shopInfo: {},
showM: false
showM: false,
search: true,
type: ''
}
},
onLoad: function(options) {
console.log('detail', options);
this.type = options.type
if (options.search == "1") {
this.search = false
} else {
this.search = true
}
//点击轮播图跳转详情, 传递的参数id, type
if (options.id !== undefined && options.type !== undefined) {
this.getDetail(options.type, options.id)
@@ -100,7 +109,18 @@
this.$api.getShopDetail(type, id).then(res => {
const data = res.data.data
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
}
})

View File

@@ -1,15 +1,10 @@
<template>
<view class="marginLR10">
<view class="head-img">
<u-image
:src="headimg"
width=100%
height=200rpx
radius="10px"
></u-image>
</view>
<!-- <view class="head-img">
<u-image :src="headimg" width=100% height=200rpx radius="10px"></u-image>
</view> -->
<view>
<SearchShopList :show-style="2"></SearchShopList>
<SearchShopList :show-style="2" :searchInfoList="shopInfoList"></SearchShopList>
</view>
</view>
</template>
@@ -19,10 +14,20 @@
data() {
return {
headimg: "https://alifei01.cfp.cn/creative/vcg/800/new/VCG41175510742.jpg",
shopInfoList: [],
}
},
onLoad() {
this.getInfo()
},
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>
@@ -31,14 +36,15 @@
page {
background-color: #f8f8f8;
}
.marginLR10 {
margin: 0 10px;
}
.head-img {
margin-top: 10rpx;
width: 100%;
height: 200rpx;
border-radius: 10px;
}
</style>

View File

@@ -4,31 +4,130 @@
<view class="bug-fix"></view>
<view class="search-box">
<view class="search-box-input">
<u-input placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true">
<u-input v-model="keyword" placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput">
</u-input>
</view>
</view>
</view>
<view>
<DropDown></DropDown>
<DropDown @getQueryInfo="getShopList"></DropDown>
</view>
<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>
</template>
<script>
import DropDownItem from "@/components/DropDown/DropDownItem.vue"
export default {
components: {
DropDownItem
},
data() {
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>
@@ -37,25 +136,38 @@
page {
background-color: #F8F8F8;
}
.showNull {
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
color: darkgray;
}
.marginLR10 {
margin: 0 10px;
}
.search-box-bg {
width: 100%;
position: relative;
z-index: 3;
background-color: #F8F8F8;
.bug-fix {
transform: translateY(-20rpx);
width: 100%;
height: 20rpx;
}
.search-box {
position: relative;
z-index: 2;
left: 50%;
width: 84.6%;
transform: translateX(-50%);
.search-box-input {
border-radius: 12rpx;
background-color: #fff;
@@ -77,5 +189,4 @@
}
}
}
</style>

View File

@@ -4,31 +4,130 @@
<view class="bug-fix"></view>
<view class="search-box">
<view class="search-box-input">
<u-input placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true">
<u-input v-model="keyword" placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput">
</u-input>
</view>
</view>
</view>
<view>
<DropDown></DropDown>
<DropDown @getQueryInfo="getShopList"></DropDown>
</view>
<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>
</template>
<script>
import DropDownItem from "@/components/DropDown/DropDownItem.vue"
export default {
components: {
DropDownItem
},
data() {
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>
@@ -37,25 +136,38 @@
page {
background-color: #F8F8F8;
}
.showNull {
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
color: darkgray;
}
.marginLR10 {
margin: 0 10px;
}
.search-box-bg {
width: 100%;
position: relative;
z-index: 3;
background-color: #F8F8F8;
.bug-fix {
transform: translateY(-20rpx);
width: 100%;
height: 20rpx;
}
.search-box {
position: relative;
z-index: 2;
left: 50%;
width: 84.6%;
transform: translateX(-50%);
.search-box-input {
border-radius: 12rpx;
background-color: #fff;
@@ -77,5 +189,4 @@
}
}
}
</style>

View File

@@ -4,31 +4,129 @@
<view class="bug-fix"></view>
<view class="search-box">
<view class="search-box-input">
<u-input placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true">
<u-input v-model="keyword" placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput">
</u-input>
</view>
</view>
</view>
<view>
<DropDown></DropDown>
<DropDown @getQueryInfo="getShopList"></DropDown>
</view>
<view class="marginLR10">
<SearchShopList :showStyle="1"/>
<SearchShopList :showStyle="1" :searchInfoList="searchInfoList" />
</view>
<view v-if="showNull" class="showNull">
<text>没有符合条件的数据, 请下拉刷新重置数据~
</text>
</view>
</view>
</template>
<script>
import DropDownItem from "@/components/DropDown/DropDownItem.vue"
export default {
components: {
DropDownItem
},
data() {
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>
@@ -37,25 +135,38 @@
page {
background-color: #F8F8F8;
}
.showNull {
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
color: darkgray;
}
.marginLR10 {
margin: 0 10px;
}
.search-box-bg {
width: 100%;
position: relative;
z-index: 3;
background-color: #F8F8F8;
.bug-fix {
transform: translateY(-20rpx);
width: 100%;
height: 20rpx;
}
.search-box {
position: relative;
z-index: 2;
left: 50%;
width: 84.6%;
transform: translateX(-50%);
.search-box-input {
border-radius: 12rpx;
background-color: #fff;
@@ -77,5 +188,4 @@
}
}
}
</style>

View File

@@ -4,31 +4,129 @@
<view class="bug-fix"></view>
<view class="search-box">
<view class="search-box-input">
<u-input placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true">
<u-input v-model="keyword" placeholder="请输入店铺名称进行搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput">
</u-input>
</view>
</view>
</view>
<view>
<DropDown></DropDown>
<DropDown @getQueryInfo="getShopList"></DropDown>
</view>
<view class="marginLR10">
<ShowShopList :showStyle="1"/>
<ShowShopList :showStyle="1" :shopInfoList="shopInfoList" />
</view>
<view v-if="showNull" class="showNull">
<text>没有符合条件的数据, 请下拉刷新重置数据~
</text>
</view>
</view>
</template>
<script>
import DropDownItem from "@/components/DropDown/DropDownItem.vue"
export default {
components: {
DropDownItem
},
data() {
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>
@@ -37,25 +135,38 @@
page {
background-color: #F8F8F8;
}
.showNull {
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
color: darkgray;
}
.marginLR10 {
margin: 0 10px;
}
.search-box-bg {
width: 100%;
position: relative;
z-index: 3;
background-color: #F8F8F8;
.bug-fix {
transform: translateY(-20rpx);
width: 100%;
height: 20rpx;
}
.search-box {
position: relative;
z-index: 2;
left: 50%;
width: 84.6%;
transform: translateX(-50%);
.search-box-input {
border-radius: 12rpx;
background-color: #fff;
@@ -77,5 +188,4 @@
}
}
}
</style>

View File

@@ -3,7 +3,7 @@
<InputAndSwiper type='0' :bannerURL="swiperList"></InputAndSwiper>
<view class="home-content">
<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>
</view>
@@ -18,8 +18,8 @@
<text>找店列表</text>
</view>
</view>
<SearchShopList v-if="chooseIndex" />
<ShowShopList v-else />
<SearchShopList v-if="chooseIndex" :searchInfoList="searchInfoList" />
<ShowShopList v-else :shopInfoList="shopInfoList" />
</view>
<TabBar :current-page="0"></TabBar>
</view>
@@ -43,15 +43,63 @@
chooseIndex: 0,
statNum: {},
swiperList: [],
shopInfoList: [],
searchInfoList: [],
shopPageSize: 5,
searchPageSize: 5,
shopPageNum: 1,
searchPageNum: 1,
shopListLength: '',
shopSearchListLength: '',
isAuth: false,
}
},
onLoad() {
this.getBanner()
this.getNotice()
this.getStat()
this.getShopList()
this.getSearchList()
this.open()
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: {
getBanner() {
this.$api.getBanner().then(res => {
@@ -72,6 +120,33 @@
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() {
this.$api.getClassList().then(res => {
let data = res.data.data
@@ -132,6 +207,32 @@
},
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()
}
}
})
},
});
},
@@ -142,20 +243,78 @@
success: function(res) {
if (res.authSetting['scope.userFuzzyLocation']) {
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 {
console.log('用户未授权定位权限');
uni.authorize({
scope: 'scope.userFuzzyLocation',
success: function() {
this.isAuth = true
console.log('授权成功');
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() {
console.log('授权失败');
uni.showModal({
content: '检测到您没打开获取信息功能权限,是否去设置打开?',
content: '检测到您没打开手机系统定位权限,请确保手机系统定位已开启',
confirmText: "确认",
cancelText: '取消',
showCancel: false,
success: (res) => {
if (res.confirm) {
uni.openSetting({

View File

@@ -162,6 +162,7 @@
watch: {
scale(newVal, oldVal) {
console.log('thisscale', newVal, Math.round(newVal));
this.showShop = false
let ra = ''
this.scaleM.forEach(item => {
if (item.scale == Math.round(newVal)) {
@@ -268,10 +269,12 @@
this.getDetail(1, markerId)
this.marker.forEach(item => {
if (markerId === item.id) {
console.log('变红');
item.iconPath = "../../../static/map/sp_icon_hdw.png"
item.width = '58rpx'
item.height = '72rpx'
} else {
console.log('变绿');
item.iconPath = "../../../static/map/sp_icon_dw.png"
item.width = '58rpx'
item.height = '72rpx'

View File

@@ -7,7 +7,7 @@
</u-form-item>
<u-form-item label="区域" label-position="top" border-bottom="true" right-icon="arrow-right" prop="region"
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>
<view class="arrow-icon">
@@ -16,13 +16,9 @@
<u-picker :columns="regionColumns" :show="show1" :closeOnClickOverlay="true" @close="show1 = false"
v-model="form.region" @confirm="regionConfirm"></u-picker>
</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"
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>
<view class="arrow-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"
:columns="[Classcolumns]" v-model="form.business" @confirm="tradeConfirm"></u-picker>
</u-form-item>
<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="show3 = true" class="checktext" v-else>请选择业态</text>
<u-form-item label="业态" label-position="top" border-bottom="true" label-width="auto" prop="commercialForm">
<text @click="choosecommercialForm" class="checkedtext"
v-if="form.commercialForm">{{form.commercialForm}}</text>
<text @click="choosecommercialForm" class="checktext" v-else>请选择业态</text>
<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>
<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 label="预计投资" label-position="top" border-bottom="true" label-width="auto" prop="transferFee">
<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-input v-model="form.rent" placeholder="请输入店铺租金" placeholder-class="input-class" border="none"></u-input>
</u-form-item>
<u-form-item label="联系人" label-position="top" border-bottom="true" label-width="auto" prop="contact">
<u-input v-model="form.contact" placeholder="请输入联系人姓名" placeholder-class="input-class" border="none"></u-input>
<u-form-item label="联系人" label-position="top" border-bottom="true" label-width="auto" prop="contactPerson">
<u-input v-model="form.contactPerson" placeholder="请输入联系人姓名" placeholder-class="input-class"
border="none"></u-input>
</u-form-item>
<u-form-item label="手机号码" label-position="top" border-bottom="true" label-width="auto" prop="mobile">
<u-input v-model="form.mobile" placeholder="请输入联系人手机号码" placeholder-class="input-class" border="none"></u-input>
<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"></u-input>
</u-form-item>
<u-form-item label="详情介绍" label-position="top" border-bottom="true" label-width="auto" prop="content">
<u-input v-model="form.content" placeholder="请输入介绍详情" placeholder-class="input-class" border="none"></u-input>
<u-form-item label="详情介绍" label-position="top" border-bottom="true" label-width="auto" prop="details">
<u-input v-model="form.details" placeholder="请输入介绍详情" placeholder-class="input-class" border="none"></u-input>
</u-form-item>
</u-form>
<view class="bug-figure"></view>
@@ -67,26 +68,19 @@
export default {
data() {
return {
imageLength: '0',
fileList1: [],
regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [],
regionColumns: [],
form: {
title: '',
region: '',
address: '',
business: '',
commercial: '',
commercialForm: '',
area: '',
transferFee: '',
rent: '',
contact:'',
mobile: '',
content: '',
// images: [],
longitude: '',
latitude: '',
contactPerson: '',
phone: '',
details: '',
id: '',
},
Classcolumns: [],
ClassCheckId: '',
@@ -111,22 +105,27 @@
message: '请选择地区',
trigger: ['change']
}],
'commercial': [{
'commercialForm': [{
required: true,
message: '请选择业态',
trigger: ['change']
}],
'area': [{
required: true,
message: '请输入面积',
trigger: ['change', 'blur']
}],
'transferFee': [{
required: true,
message: '请输入转让金',
trigger: ['change', 'blur']
}],
'contact': [{
'contactPerson': [{
required: true,
message: '请输入姓名',
trigger: ['change', 'blur']
}],
'content': [{
'details': [{
required: true,
message: '请输入介绍',
trigger: ['change', 'blur']
@@ -141,12 +140,7 @@
message: '请输入租金',
trigger: ['change', 'blur']
}],
'address': [{
required: true,
message: '请输入地址',
trigger: ['change', 'blur']
}],
'mobile': [{
'phone': [{
required: true,
message: '请输入电话号码',
},
@@ -162,101 +156,74 @@
trigger: ['change', 'blur'],
}
]
},
}
},
methods: {
// 删除图片
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
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,
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) {
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() {
uni.navigateTo({
url: '/pages/publish/chooseAddress/chooseAddress'
})
},
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 => {
console.log("提交表单信息:" + JSON.stringify(this.form))
uni.$u.toast('发布成功')
console.log("提交表单信息:", this.form, this.form.id)
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 => {
console.log("失败信息:" + JSON.stringify(errors))
console.log("失败信息:", JSON.stringify(errors))
// uni.$u.toast('校验失败')
})
},
changeAddress(e) {
// console.log('changeAddress', e);
this.getAddressList(e)
choosecommercialForm() {
if (!this.form.business) {
uni.$u.toast('请先选择行业')
return false
} else {
this.show3 = true
}
},
getAddressList(value) {
getRegionList() {
var that = this
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,
success(res) {
console.log('diz', res.data.result.location);
// 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
that.regionColumns = [res.data.result[0].map(item => item.fullname)]
},
fail(err) {
console.log('请求区域失败:', err);
@@ -276,7 +243,7 @@
},
karmaConfirm(e) {
this.show3 = false
this.form.commercial = e.value[0]
this.form.commercialForm = e.value[0]
},
regionConfirm(e) {
this.show1 = false
@@ -287,7 +254,17 @@
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 => {
// console.log(res.data.data.length);
this.Classcolumns = res.data.data.map((item) => {
@@ -336,6 +313,7 @@
.count {
margin-bottom: 30px;
}
// margin-right: 20px;
}

View File

@@ -25,8 +25,8 @@
v-model="form.region" @confirm="regionConfirm"></u-picker>
</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-input v-model="form.address" placeholder="请输入项目地址" placeholder-class="input-class" border="none"
@focus="changeAddressFocus" @blur="changeAddress"></u-input>
</u-form-item>
<u-form-item label="项目行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
prop="business">
@@ -44,8 +44,9 @@
<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-form-item>
<u-form-item label="详情介绍" label-position="top" border-bottom="true" label-width="auto" prop="content">
<u-input v-model="form.content" placeholder="请输入介绍详情" placeholder-class="input-class" border="none"></u-input>
<u-form-item label="联系人" label-position="top" border-bottom="true" label-width="auto" prop="contactPerson">
<u-input v-model="form.contactPerson" placeholder="请输入联系人姓名" placeholder-class="input-class"
border="none"></u-input>
</u-form-item>
<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>
@@ -65,18 +66,19 @@
export default {
data() {
return {
imageLength: '0',
imageLength: 0,
fileList1: [],
regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [],
regionColumns: [],
form: {
title: '',
region: '',
address: '',
business: '',
mobile: '',
contact:'',
content: '',
area: '',
rent: '',
phone: '',
contactPerson: '',
details: '',
images: [],
longitude: '',
latitude: '',
@@ -106,12 +108,22 @@
message: '请选择地区',
trigger: ['change']
}],
'contact': [{
'area': [{
required: true,
message: '请输入面积',
trigger: ['change', 'blur']
}],
'rent': [{
required: true,
message: '请输入租金',
trigger: ['change', 'blur']
}],
'contactPerson': [{
required: true,
message: '请输入姓名',
trigger: ['change', 'blur']
}],
'content': [{
'details': [{
required: true,
message: '请输入介绍',
trigger: ['change', 'blur']
@@ -121,7 +133,7 @@
message: '请输入地址',
trigger: ['change', 'blur']
}],
'mobile': [{
'phone': [{
required: true,
message: '请输入电话号码',
},
@@ -198,40 +210,79 @@
})
},
submit() {
this.$refs.uForm.validate().then(res => {
const temp = []
if (this.fileList1.length > 0) {
this.fileList1.map(item => {
const url = item.url
temp.push(url.replace(this.imgUrl + '/', ''))
temp.push(url.replace(this.$api.imgUrl, ''))
})
}
console.log('images---', temp.join(','));
this.$refs.uForm.validate().then(res => {
console.log("提交表单信息:" + JSON.stringify(this.form))
uni.$u.toast('发布成功')
this.$api.publishInvestment(this.form).then(res => {
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);
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 => {
console.log("失败信息:" + JSON.stringify(errors))
// uni.$u.toast('校验失败')
})
},
changeAddressFocus() {
if (!this.form.region) {
uni.$u.toast('请先选择区域')
return false
}
},
changeAddress(e) {
// console.log('changeAddress', 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) {
var that = this
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,
success(res) {
console.log('diz', res.data.result.location);
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) {
console.log('请求区域失败:', err);
@@ -257,12 +308,59 @@
this.show1 = false
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() {
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 => {
// console.log(res.data.data.length);
this.Classcolumns = res.data.data.map((item) => {
@@ -311,6 +409,7 @@
.count {
margin-bottom: 30px;
}
// margin-right: 20px;
}

View File

@@ -26,7 +26,7 @@
</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>
@focus="changeAddressFocus" @blur="changeAddress"></u-input>
</u-form-item>
<u-form-item label="适合行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
prop="business">
@@ -38,15 +38,15 @@
<u-picker mode="region" :show="show2" :closeOnClickOverlay="true" @close="show2 = false"
:columns="[Classcolumns]" v-model="form.business" @confirm="tradeConfirm"></u-picker>
</u-form-item>
<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="show3 = true" class="checktext" v-else>请选择店铺业态</text>
<!-- <u-form-item label="业态" label-position="top" border-bottom="true" label-width="auto" prop="commercial">
<text @click="chooseCommercial" class="checkedtext" v-if="form.commercial.length>0">{{form.commercial}}</text>
<text @click="chooseCommercial" class="checktext" v-else>请选择店铺业态</text>
<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>
<u-picker mode="region" :show="show3" :closeOnClickOverlay="true" @close="show3 = false"
: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-input v-model="form.area" placeholder="请输入店铺面积" placeholder-class="input-class" border="none" type="number"></u-input>
</u-form-item>
@@ -225,40 +225,78 @@
})
},
submit() {
this.$refs.uForm.validate().then(res => {
const temp = []
if (this.fileList1.length > 0) {
this.fileList1.map(item => {
const url = item.url
temp.push(url.replace(this.imgUrl + '/', ''))
temp.push(url.replace(this.$api.imgUrl, ''))
})
}
console.log('images---', temp.join(','));
this.$refs.uForm.validate().then(res => {
console.log("提交表单信息:" + JSON.stringify(this.form))
uni.$u.toast('发布成功')
this.$api.publishRent(this.form).then(res => {
console.log(res);
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 => {
console.log("失败信息:" + JSON.stringify(errors))
// 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) {
// console.log('changeAddress', e);
this.getAddressList(e)
},
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=' + value + '&key=' +
url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=' + that.form.region + value + '&key=' +
that.$api.key,
success(res) {
console.log('diz', res.data.result.location);
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) {
console.log('请求区域失败:', err);
@@ -284,12 +322,61 @@
this.show1 = false
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() {
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 => {
// console.log(res.data.data.length);
this.Classcolumns = res.data.data.map((item) => {
@@ -338,6 +425,7 @@
.count {
margin-bottom: 30px;
}
// margin-right: 20px;
}

View File

@@ -4,7 +4,7 @@
<view class="upload">
<view style="padding-left: 20rpx;margin-top: 20rpx;">
<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>
<!-- <u-upload max-count="5" upload-icon="photo"></u-upload> -->
<text class="count">发布房源图片({{imageLength}}/5})</text>
@@ -15,9 +15,8 @@
</u-form-item>
<u-form-item label="区域" label-position="top" border-bottom="true" right-icon="arrow-right" prop="region"
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>
<view class="arrow-icon">
<u-icon name="arrow-right" size="30px" @click="show1 = true"></u-icon>
</view>
@@ -26,11 +25,11 @@
</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>
@focus="changeAddressFocus" @blur="changeAddress"></u-input>
</u-form-item>
<u-form-item label="行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
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>
<view class="arrow-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>
</u-form-item>
<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="show3 = true" class="checktext" v-else>请选择店铺业态</text>
<text @click="chooseCommercial" class="checkedtext" v-if="form.commercial">{{form.commercial}}</text>
<text @click="chooseCommercial" class="checktext" v-else>请选择店铺业态</text>
<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>
<u-picker mode="region" :show="show3" :closeOnClickOverlay="true" @close="show3 = false"
:columns="[Karmacolumns]" v-model="form.commercial" @confirm="karmaConfirm"></u-picker>
@@ -77,9 +76,9 @@
export default {
data() {
return {
imageLength: '0',
imageLength: 0,
fileList1: [],
regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [],
regionColumns: [],
form: {
title: '',
@@ -197,9 +196,7 @@
})
})
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',
@@ -233,40 +230,95 @@
})
},
submit() {
this.$refs.uForm.validate().then(res => {
const temp = []
if (this.fileList1.length > 0) {
this.fileList1.map(item => {
const url = item.url
temp.push(url.replace(this.imgUrl + '/', ''))
console.log('url', url, this.$api.imgUrl);
temp.push(url.replace(this.$api.imgUrl, ''))
})
}
console.log('images---', temp.join(','));
this.$refs.uForm.validate().then(res => {
console.log("提交表单信息:" + JSON.stringify(this.form))
uni.$u.toast('发布成功')
this.$api.publishTransfer(this.form).then(res => {
console.log(res);
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 => {
console.log("失败信息:" + JSON.stringify(errors))
// 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) {
// console.log('changeAddress', e);
this.getAddressList(e)
},
getAddressList(value) {
getRegionList() {
var that = this
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,
success(res) {
console.log('diz', res.data.result.location);
that.regionColumns = [res.data.result[0].map(item => item.fullname)]
},
fail(err) {
console.log('请求区域失败:', err);
}
})
},
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) {
console.log('请求区域失败:', err);
@@ -292,12 +344,61 @@
this.show1 = false
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() {
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 => {
// console.log(res.data.data.length);
this.Classcolumns = res.data.data.map((item) => {

View File

@@ -8,11 +8,16 @@
</view>
</view>
<view class="content">
<ShowShopList v-if="listId == 0" class="list" :isEdit="true" :showStyle="1"></ShowShopList>
<SearchShopList v-if="listId == 1" class="list" :is-edit="true" :showStyle="1"></SearchShopList>
<ShowShopList v-if="listId == 2" class="list" :is-edit="true" :showStyle="2"></ShowShopList>
<ShowShopList v-if="listId == 3" class="list" :is-edit="true" :showStyle="2"></ShowShopList>
<ShowShopList v-if="listId == 4" class="list" :showStyle="0"></ShowShopList>
<ShowShopList v-if="listId == 0" :isEdit="true" :showStyle="1" :shopInfoList="searchInfoList" @delItem="handleDel"
@updateItem="handleUpdate1"></ShowShopList>
<SearchShopList v-if="listId == 1" :searchInfoList="searchInfoList" :is-edit="true" :showStyle="1"
@delItem="handleDel" @updateItem="handleUpdate2">
</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>
</template>
@@ -23,36 +28,138 @@
return {
titletext: '',
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: {
getMatch(){
this.$api.getMyMatch().then(res => {
this.macthList = res.data.data
console.log(res);
handleUpdate1(searchid) {
console.log('页面更新');
uni.navigateTo({
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
}
if(this.titletext == '发布的项目招商'){
this.listId = 2
this.getMyPublished(2, this.pageSize, this.pageNum)
}
if (this.titletext == '发布的店铺出租') {
this.listId = 3
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()
@@ -94,6 +201,7 @@
}
}
}
page {
background-color: #F8F8F8;
}

View File

@@ -1,19 +1,22 @@
<template>
<view class="root">
<InputAndSwiper></InputAndSwiper>
<InputAndSwiper @getQueryInfo="getInput" :bannerURL="swiperList" :refresh="isRefresh"></InputAndSwiper>
<view>
<view class="dropdown-bug">
</view>
<view class="marginLR10">
<DropDown></DropDown>
<DropDown @getQueryInfo="getShopList"></DropDown>
</view>
<view class="marginLR10">
<SearchShopList :showStyle="1"/>
<SearchShopList :showStyle="1" :searchInfoList="searchInfoList" />
</view>
</view>
<view v-if="showNull" class="showNull">
<text>没有符合条件的数据, 请下拉刷新重置数据~
</text>
</view>
<TabBar :current-page="3"></TabBar>
</view>
</template>
@@ -26,22 +29,133 @@
},
data() {
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>
<style lang="scss" scoped>
.showNull {
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
color: darkgray;
}
page {
background-color: $uni-bg-color-grey;
}
.root {
position: relative;
}
.dropdown-bug {
position: absolute;
background-color: $uni-bg-color-grey;
@@ -50,8 +164,8 @@
transform: translateY(-20rpx);
z-index: 2;
}
.marginLR10 {
margin: 0 10px;
}
</style>

View File

@@ -1,19 +1,23 @@
<template>
<view class="root">
<InputAndSwiper></InputAndSwiper>
<InputAndSwiper @getQueryInfo="getInput" :bannerURL="swiperList" :refresh="isRefresh">
</InputAndSwiper>
<view>
<view class="dropdown-bug">
</view>
<view class="marginLR10">
<DropDown></DropDown>
<DropDown @getQueryInfo="getShopList"></DropDown>
</view>
<view class="marginLR10">
<ShowShopList :showStyle="1"></ShowShopList>
<ShowShopList :showStyle="1" :shopInfoList="shopInfoList"></ShowShopList>
</view>
</view>
<view v-if="showNull" class="showNull">
<text>没有符合条件的数据, 请下拉刷新重置数据~
</text>
</view>
<TabBar :current-page="1"></TabBar>
</view>
</template>
@@ -26,11 +30,110 @@
},
data() {
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>
@@ -39,9 +142,19 @@
page {
background-color: $uni-bg-color-grey;
}
.showNull {
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
color: darkgray;
}
.root {
position: relative;
}
.dropdown-bug {
position: absolute;
background-color: $uni-bg-color-grey;
@@ -50,8 +163,8 @@
transform: translateY(-20rpx);
z-index: 2;
}
.marginLR10 {
margin: 0 10px;
}
</style>

View File

@@ -1,4 +1,17 @@
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 = {
get(url, data) {
const header = {}
@@ -12,8 +25,11 @@ const service = {
header: header,
success: res => {
resolve(res)
console.log('res===',res);
isOutTime(res);
},
fail: err => {
console.log('错误',err);
reject(err)
}
})
@@ -31,6 +47,7 @@ const service = {
header: header,
success: res => {
resolve(res)
isOutTime(res);
},
fail: err => {
try {
@@ -55,6 +72,7 @@ const service = {
header: header,
success: res => {
resolve(res)
isOutTime(res);
},
fail: err => {
reject(err)
@@ -74,6 +92,7 @@ const service = {
header: header,
success: res => {
resolve(res)
isOutTime(res);
},
fail: err => {
reject(err)
@@ -93,6 +112,7 @@ const service = {
header: header,
success: res => {
resolve(res)
isOutTime(res);
},
fail: err => {
reject(err)
@@ -128,7 +148,7 @@ const toast = {
const apiService = {
serverHost,
imgUrl: 'https://spsp.feashow.com/',
key: 'ZRKBZ-Q7FWL-GVZPK-MCRBU-4XFB5-ATBDB',
key: 'XR3BZ-SHJKJ-VK6FR-DOYXJ-C3F7Z-Y5BY6',
uploadImgUrl: serverHost + '/upload/image/',
//登录接口
login(data) {
@@ -225,10 +245,10 @@ const apiService = {
})
},
//获取我的匹配
getMyMatch() {
getMyMatch(data) {
const url = `/center/match/`
return new Promise((resolve, reject) => {
resolve(service.get(url))
resolve(service.get(url, data))
})
},
//获取行业和业态
@@ -281,6 +301,29 @@ const apiService = {
resolve(service.post(url, data))
})
},
// 获得成交案例
getSuccList(type) {
if (!type) {
type = 1
}
const url = `/shop/succ/?type=${type}`
return new Promise((resolve, reject) => {
resolve(service.get(url))
})
},
//获取个人发布过的信息
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 {
apiService,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB