梁航:合并及数字键盘

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,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>
</style>

View File

@@ -4,71 +4,183 @@
<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: ''
}
},
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>
<style lang="scss">
page{
page {
background-color: #F8F8F8;
}
.marginLR10{
.showNull {
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
color: darkgray;
}
.marginLR10 {
margin: 0 10px;
}
.search-box-bg{
.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;
opacity: 0.85;
.u-border {
border: none;
.u-input__content {
height: 62rpx;
border-radius: 12rpx;
background-color: #fff;
.u-input__content__field-wrapper__field {
font-size: 26rpx !important;
}
@@ -77,5 +189,4 @@
}
}
}
</style>
</style>

View File

@@ -4,71 +4,183 @@
<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: ''
}
},
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>
<style lang="scss">
page{
page {
background-color: #F8F8F8;
}
.marginLR10{
.showNull {
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
color: darkgray;
}
.marginLR10 {
margin: 0 10px;
}
.search-box-bg{
.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;
opacity: 0.85;
.u-border {
border: none;
.u-input__content {
height: 62rpx;
border-radius: 12rpx;
background-color: #fff;
.u-input__content__field-wrapper__field {
font-size: 26rpx !important;
}
@@ -77,5 +189,4 @@
}
}
}
</style>
</style>

View File

@@ -4,71 +4,182 @@
<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: ''
}
},
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>
<style lang="scss">
page{
page {
background-color: #F8F8F8;
}
.marginLR10{
.showNull {
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
color: darkgray;
}
.marginLR10 {
margin: 0 10px;
}
.search-box-bg{
.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;
opacity: 0.85;
.u-border {
border: none;
.u-input__content {
height: 62rpx;
border-radius: 12rpx;
background-color: #fff;
.u-input__content__field-wrapper__field {
font-size: 26rpx !important;
}
@@ -77,5 +188,4 @@
}
}
}
</style>
</style>

View File

@@ -4,71 +4,182 @@
<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: ''
}
},
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>
<style lang="scss">
page{
page {
background-color: #F8F8F8;
}
.marginLR10{
.showNull {
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
color: darkgray;
}
.marginLR10 {
margin: 0 10px;
}
.search-box-bg{
.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;
opacity: 0.85;
.u-border {
border: none;
.u-input__content {
height: 62rpx;
border-radius: 12rpx;
background-color: #fff;
.u-input__content__field-wrapper__field {
font-size: 26rpx !important;
}
@@ -77,5 +188,4 @@
}
}
}
</style>
</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,20 +43,68 @@
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 => {
res.data.data.forEach(item=>{
item.img =this.$api.imgUrl + item.img
res.data.data.forEach(item => {
item.img = this.$api.imgUrl + item.img
})
this.swiperList = res.data.data
// .map(item => this.$api.imgUrl + item.img)
@@ -72,10 +120,37 @@
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
data.sort((a,b)=>{
data.sort((a, b) => {
return a.id - b.id
})
data = data.map(item => item.name)
@@ -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('授权成功');
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() {
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: '',
transferFee:'',
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() {
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('发布成功')
this.$api.publishInvestment(this.form).then(res => {
const temp = []
if (this.fileList1.length > 0) {
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);
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);
// 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
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>
@@ -86,7 +86,7 @@
commercial: '',
area: '',
rent: '',
contact:'',
contact: '',
mobile: '',
content: '',
images: [],
@@ -225,40 +225,78 @@
})
},
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('发布成功')
this.$api.publishRent(this.form).then(res => {
console.log(res);
const temp = []
if (this.fileList1.length > 0) {
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.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);
// 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
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() {
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('发布成功')
this.$api.publishTransfer(this.form).then(res => {
console.log(res);
const temp = []
if (this.fileList1.length > 0) {
this.fileList1.map(item => {
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 => {
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);
// 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);
}
})
},
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>
@@ -21,84 +26,187 @@
export default {
data() {
return {
titletext:'',
listId:'',
matchList:[]
titletext: '',
listId: '',
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) {
wx.setNavigationBarTitle({
title: option.titletext
})
onLoad: function(option) {
console.log('option', option.listId);
this.listId = option.listId
wx.setNavigationBarTitle({
title: option.titletext
})
this.titletext = option.titletext
if(this.titletext == '发布的店铺转让'){
if (this.titletext == '发布的店铺转让') {
this.listId = 0
this.getMyPublished(1, this.pageSize, this.pageNum)
}
if(this.titletext == '发布的找店选址'){
if (this.titletext == '发布的找店选址') {
this.listId = 1
this.getMyPublished(2, this.pageSize, this.pageNum)
}
if(this.titletext == '发布的项目招商'){
if (this.titletext == '发布的店铺出租') {
this.listId = 2
this.getMyPublished(3, this.pageSize, this.pageNum)
}
if(this.titletext == '发布的店铺出租'){
if (this.titletext == '发布的项目招商') {
this.listId = 3
this.getMyPublished(4, this.pageSize, this.pageNum)
}
if(this.titletext == '我的匹配'){
if (this.titletext == '我的匹配') {
this.listId = 4
this.getMatch()
}
},
computed:{
this.getMatch()
}
},
computed: {
}
}
</script>
<style lang="scss">
.search-box {
position: relative;
z-index: 1;
left: 50%;
width: 84.6%;
transform: translateX(-50%);
.search-box-input {
border-radius: 12rpx;
margin-top: 20rpx;
background-color: #fff;
opacity: 0.85;
.u-border {
border: none;
.u-input__content {
height: 62rpx;
border-radius: 12rpx;
background-color: #fff;
.u-input__content__field-wrapper__field {
font-size: 26rpx !important;
}
.search-box {
position: relative;
z-index: 1;
left: 50%;
width: 84.6%;
transform: translateX(-50%);
.search-box-input {
border-radius: 12rpx;
margin-top: 20rpx;
background-color: #fff;
opacity: 0.85;
.u-border {
border: none;
.u-input__content {
height: 62rpx;
border-radius: 12rpx;
background-color: #fff;
.u-input__content__field-wrapper__field {
font-size: 26rpx !important;
}
}
}
}
page{
background-color: #F8F8F8;
}
.content{
margin: 0 10px;
}
</style>
}
page {
background-color: #F8F8F8;
}
.content {
margin: 0 10px;
}
</style>

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
}
},
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{
.root {
position: relative;
}
.dropdown-bug {
position: absolute;
background-color: $uni-bg-color-grey;
@@ -50,8 +164,8 @@
transform: translateY(-20rpx);
z-index: 2;
}
.marginLR10{
.marginLR10 {
margin: 0 10px;
}
</style>
</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
}
},
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;
}
.root{
.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{
.marginLR10 {
margin: 0 10px;
}
</style>
</style>