diff --git a/components/DropDown/DropDown.vue b/components/DropDown/DropDown.vue
index 12c017a..14f9dcb 100644
--- a/components/DropDown/DropDown.vue
+++ b/components/DropDown/DropDown.vue
@@ -1,21 +1,22 @@
-
+
{{item}}
-
+
-
+
-
+
@@ -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: {
@@ -55,8 +55,9 @@
}
},
created() {
- this.postlist[0]=JSON.parse(uni.getStorageSync('classList'))
- // this.postlist[1]=JSON.parse(uni.getStorageSync('regionList'))
+ this.postlist[0] = JSON.parse(uni.getStorageSync('classList'))
+ // 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
}
}
}
diff --git a/components/DropDown/DropDownItem.vue b/components/DropDown/DropDownItem.vue
index b8b9de2..3ecd3c0 100644
--- a/components/DropDown/DropDownItem.vue
+++ b/components/DropDown/DropDownItem.vue
@@ -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);
});
},
- },
-
+ }
}
diff --git a/components/InputAndSwiper/InputAndSwiper.vue b/components/InputAndSwiper/InputAndSwiper.vue
index 478d6b2..d1fc174 100644
--- a/components/InputAndSwiper/InputAndSwiper.vue
+++ b/components/InputAndSwiper/InputAndSwiper.vue
@@ -2,8 +2,8 @@
-
+
@@ -19,6 +19,7 @@
-
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 8e4147a..8c30514 100644
--- a/pages.json
+++ b/pages.json
@@ -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
}
},
{
diff --git a/pages/detail/detail.vue b/pages/detail/detail.vue
index 2089b20..2b4ce84 100644
--- a/pages/detail/detail.vue
+++ b/pages/detail/detail.vue
@@ -1,7 +1,7 @@
-
-
+
+
@@ -13,9 +13,10 @@
{{shopInfo.zujin}}元/月
租金
-
+
{{shopInfo.zhuanrangfei}}万元
- 转让费
+ 转让费
+ 预计投资
{{shopInfo.mianji}}m²
@@ -30,14 +31,14 @@
行业:{{shopInfo.trade1}}
区域:{{shopInfo.area1}}
- 地址:{{shopInfo.adress}}
+ 地址:{{shopInfo.adress}}
-
+
@@ -68,7 +69,7 @@
-
+
@@ -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
}
})
diff --git a/pages/index/NavBarPages/cjal/cjal.vue b/pages/index/NavBarPages/cjal/cjal.vue
index 3dd11a9..c2a1e19 100644
--- a/pages/index/NavBarPages/cjal/cjal.vue
+++ b/pages/index/NavBarPages/cjal/cjal.vue
@@ -1,15 +1,10 @@
-
-
-
+
-
+
@@ -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);
+ })
+ }
}
}
@@ -31,14 +36,15 @@
page {
background-color: #f8f8f8;
}
+
.marginLR10 {
margin: 0 10px;
}
+
.head-img {
margin-top: 10rpx;
width: 100%;
height: 200rpx;
border-radius: 10px;
}
-
-
+
\ No newline at end of file
diff --git a/pages/index/NavBarPages/czxx/czxx.vue b/pages/index/NavBarPages/czxx/czxx.vue
index a740948..62aaecb 100644
--- a/pages/index/NavBarPages/czxx/czxx.vue
+++ b/pages/index/NavBarPages/czxx/czxx.vue
@@ -4,71 +4,183 @@
-
+
-
+
-
+
-
+
+
+
+ 没有符合条件的数据, 请下拉刷新重置数据~
+
+
\ No newline at end of file
diff --git a/pages/index/NavBarPages/xmzs/xmzs.vue b/pages/index/NavBarPages/xmzs/xmzs.vue
index 6bd7122..9adb632 100644
--- a/pages/index/NavBarPages/xmzs/xmzs.vue
+++ b/pages/index/NavBarPages/xmzs/xmzs.vue
@@ -4,71 +4,183 @@
-
+
-
+
-
+
-
+
+
+
+ 没有符合条件的数据, 请下拉刷新重置数据~
+
+
\ No newline at end of file
diff --git a/pages/index/NavBarPages/zdxx/zdxx.vue b/pages/index/NavBarPages/zdxx/zdxx.vue
index ef1e820..60cbb52 100644
--- a/pages/index/NavBarPages/zdxx/zdxx.vue
+++ b/pages/index/NavBarPages/zdxx/zdxx.vue
@@ -4,71 +4,182 @@
-
+
-
+
-
+
-
+
+
+
+ 没有符合条件的数据, 请下拉刷新重置数据~
+
+
\ No newline at end of file
diff --git a/pages/index/NavBarPages/zrxx/zrxx.vue b/pages/index/NavBarPages/zrxx/zrxx.vue
index fafc32c..5cf9796 100644
--- a/pages/index/NavBarPages/zrxx/zrxx.vue
+++ b/pages/index/NavBarPages/zrxx/zrxx.vue
@@ -4,71 +4,182 @@
-
+
-
+
-
+
-
+
+
+
+ 没有符合条件的数据, 请下拉刷新重置数据~
+
+
\ No newline at end of file
diff --git a/pages/index/index.vue b/pages/index/index.vue
index f033d11..f39f003 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -3,7 +3,7 @@
-
+
@@ -18,8 +18,8 @@
找店列表
-
-
+
+
@@ -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({
diff --git a/pages/index/map/map.vue b/pages/index/map/map.vue
index dcb29b4..e3b429b 100644
--- a/pages/index/map/map.vue
+++ b/pages/index/map/map.vue
@@ -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'
diff --git a/pages/publish/publishAddress/publishAddress.vue b/pages/publish/publishAddress/publishAddress.vue
index 07e0219..603912f 100644
--- a/pages/publish/publishAddress/publishAddress.vue
+++ b/pages/publish/publishAddress/publishAddress.vue
@@ -7,7 +7,7 @@
- {{form.region}}
+ {{form.region}}
请选择所属区域
@@ -16,13 +16,9 @@
-
-
-
- {{form.business}}
+ {{form.business}}
请选择行业
@@ -30,14 +26,18 @@
-
- {{form.commercial}}
- 请选择业态
+
+ {{form.commercialForm}}
+ 请选择业态
-
+
+ :columns="[Karmacolumns]" v-model="form.commercialForm" @confirm="karmaConfirm">
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -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;
}
diff --git a/pages/publish/publishInvestment/publishInvestment.vue b/pages/publish/publishInvestment/publishInvestment.vue
index a3f402a..4055179 100644
--- a/pages/publish/publishInvestment/publishInvestment.vue
+++ b/pages/publish/publishInvestment/publishInvestment.vue
@@ -25,8 +25,8 @@
v-model="form.region" @confirm="regionConfirm">
-
+
@@ -44,8 +44,9 @@
-
-
+
+
@@ -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;
}
diff --git a/pages/publish/publishRent/publishRent.vue b/pages/publish/publishRent/publishRent.vue
index e97cf01..54097a9 100644
--- a/pages/publish/publishRent/publishRent.vue
+++ b/pages/publish/publishRent/publishRent.vue
@@ -26,7 +26,7 @@
+ @focus="changeAddressFocus" @blur="changeAddress">
@@ -38,15 +38,15 @@
-
- {{form.commercial}}
- 请选择店铺业态
+
@@ -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;
}
diff --git a/pages/publish/publishTransfer/publishTransfer.vue b/pages/publish/publishTransfer/publishTransfer.vue
index 41fbc37..cd94600 100644
--- a/pages/publish/publishTransfer/publishTransfer.vue
+++ b/pages/publish/publishTransfer/publishTransfer.vue
@@ -4,7 +4,7 @@
+ multiple :maxCount="5">
发布房源图片({{imageLength}}/5})
@@ -15,9 +15,8 @@
- {{form.region}}
+ {{form.region}}
请选择所属区域
-
@@ -26,11 +25,11 @@
+ @focus="changeAddressFocus" @blur="changeAddress">
- {{form.business}}
+ {{form.business}}
请选择店铺行业
@@ -39,10 +38,10 @@
:columns="[Classcolumns]" v-model="form.business" @confirm="tradeConfirm">
- {{form.commercial}}
- 请选择店铺业态
+ {{form.commercial}}
+ 请选择店铺业态
-
+
@@ -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) => {
diff --git a/pages/published/published.vue b/pages/published/published.vue
index 099a485..9cac92c 100644
--- a/pages/published/published.vue
+++ b/pages/published/published.vue
@@ -8,11 +8,16 @@
-
-
-
-
-
+
+
+
+
+
+
@@ -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: {
+
}
}
+ }
+
+ page {
+ background-color: #F8F8F8;
+ }
+
+ .content {
+ margin: 0 10px;
+ }
+
\ No newline at end of file
diff --git a/pages/shopAddress/shopAddress.vue b/pages/shopAddress/shopAddress.vue
index 9097933..7bcc871 100644
--- a/pages/shopAddress/shopAddress.vue
+++ b/pages/shopAddress/shopAddress.vue
@@ -1,19 +1,22 @@
-
-
+
+
-
+
-
+
-
+
-
+
+ 没有符合条件的数据, 请下拉刷新重置数据~
+
+
@@ -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
+ }
}
+
}
+
\ No newline at end of file
diff --git a/pages/shopTransfer/shopTransfer.vue b/pages/shopTransfer/shopTransfer.vue
index 11963f4..0bbb02f 100644
--- a/pages/shopTransfer/shopTransfer.vue
+++ b/pages/shopTransfer/shopTransfer.vue
@@ -1,19 +1,23 @@
-
-
+
+
+
-
+
-
+
-
+
-
+
+ 没有符合条件的数据, 请下拉刷新重置数据~
+
+
@@ -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
+ }
}
}
@@ -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;
}
-
-
+
\ No newline at end of file
diff --git a/service/request.js b/service/request.js
index fc49d84..2ba90a3 100644
--- a/service/request.js
+++ b/service/request.js
@@ -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) {
@@ -159,7 +179,7 @@ const apiService = {
})
},
// 获取详情
- getShopDetail(type,id) {
+ getShopDetail(type, id) {
const url = `/home/adetail/?type=${type}&id=${id}`
return new Promise((resolve, reject) => {
resolve(service.get(url))
@@ -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))
})
},
//获取行业和业态
@@ -239,48 +259,71 @@ const apiService = {
})
},
//招募合伙
- toBePartner(data){
+ toBePartner(data) {
const url = `/center/partner`
- return new Promise((resolve,reject) => {
+ return new Promise((resolve, reject) => {
console.log(data);
- resolve(service.post(url,data))
+ resolve(service.post(url, data))
})
},
//获取商铺列表
- getShopList(query){
+ getShopList(query) {
const url = `/shop/alllist${query}`
- return new Promise((resolve,reject) => {
+ return new Promise((resolve, reject) => {
resolve(service.get(url))
})
},
//发布店铺转让
- publishTransfer(data){
+ publishTransfer(data) {
const url = `/shop/transfer/`
return new Promise((resolve, reject) => {
resolve(service.post(url, data))
})
},
//发布店铺出租
- publishRent(data){
+ publishRent(data) {
const url = `/shop/rent/`
return new Promise((resolve, reject) => {
resolve(service.post(url, data))
})
},
//发布找店地址
- publishAddress(data){
+ publishAddress(data) {
const url = `/shop/selection/`
return new Promise((resolve, reject) => {
resolve(service.post(url, data))
})
},
//发布项目招商
- publishInvestment(data){
+ publishInvestment(data) {
const url = `/shop/investment/`
return new Promise((resolve, reject) => {
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,
diff --git a/static/cjal/anl_tu.png b/static/cjal/anl_tu.png
index ede9101..b4603aa 100644
Binary files a/static/cjal/anl_tu.png and b/static/cjal/anl_tu.png differ