From 10136f43f703166e6fad94afa99da37c5a1b0461 Mon Sep 17 00:00:00 2001 From: LuoShijie Date: Thu, 16 Nov 2023 22:26:18 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E7=BD=97=E4=B8=96=E6=9D=B0=EF=BC=9A?= =?UTF-8?q?=E4=BF=AE=E6=94=B9Dropdown.vue=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/DropDown/DropDown.vue | 3 ++- components/ShowShopList/ShowShopList.vue | 3 --- pages/Partnerships/Partnerships.vue | 14 ++++++++++++-- pages/index/index.vue | 9 +++++++-- service/request.js | 8 ++++++++ 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/components/DropDown/DropDown.vue b/components/DropDown/DropDown.vue index d53355f..12c017a 100644 --- a/components/DropDown/DropDown.vue +++ b/components/DropDown/DropDown.vue @@ -55,7 +55,8 @@ } }, created() { - this.postlist[1]=JSON.parse(uni.getStorageSync('regionList')) + this.postlist[0]=JSON.parse(uni.getStorageSync('classList')) + // this.postlist[1]=JSON.parse(uni.getStorageSync('regionList')) }, methods: { changeActiveIndex(index) { diff --git a/components/ShowShopList/ShowShopList.vue b/components/ShowShopList/ShowShopList.vue index eab12e1..42a1bc4 100644 --- a/components/ShowShopList/ShowShopList.vue +++ b/components/ShowShopList/ShowShopList.vue @@ -82,9 +82,6 @@ ] } } - }, - computed: { - }, methods: { handleDel(shopid){ diff --git a/pages/Partnerships/Partnerships.vue b/pages/Partnerships/Partnerships.vue index 9c1d2eb..e9c6783 100644 --- a/pages/Partnerships/Partnerships.vue +++ b/pages/Partnerships/Partnerships.vue @@ -29,15 +29,25 @@ diff --git a/pages/index/NavBarPages/czxx/czxx.vue b/pages/index/NavBarPages/czxx/czxx.vue index 686559b..a740948 100644 --- a/pages/index/NavBarPages/czxx/czxx.vue +++ b/pages/index/NavBarPages/czxx/czxx.vue @@ -15,7 +15,7 @@ - + @@ -24,7 +24,7 @@ export default { data() { return { - + adlinkPath: "/pages/publish/publishRent/publishRent" } }, methods: { diff --git a/pages/index/NavBarPages/xmzs/xmzs.vue b/pages/index/NavBarPages/xmzs/xmzs.vue index 686559b..6bd7122 100644 --- a/pages/index/NavBarPages/xmzs/xmzs.vue +++ b/pages/index/NavBarPages/xmzs/xmzs.vue @@ -15,7 +15,7 @@ - + @@ -24,7 +24,7 @@ export default { data() { return { - + adlinkPath: "/pages/publish/publishInvestment/publishInvestment" } }, methods: { diff --git a/service/request.js b/service/request.js index 0e75a9c..1973f88 100644 --- a/service/request.js +++ b/service/request.js @@ -239,6 +239,14 @@ const apiService = { console.log(data); resolve(service.post(url,data)) }) + }, + //获取商铺列表 + getShopList(data){ + const type = data.type + const url = `shop/alllist/?type=${type}` + return new Promise((resolve,reject) => { + resolve(service.get(url)) + }) } } export { From c6553909417108050f080404f88c6f9c0761c41d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Fri, 17 Nov 2023 22:08:19 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E9=82=93=E6=B4=81=20:=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/my/my.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pages/my/my.vue b/pages/my/my.vue index b3583a0..5fbf821 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -45,8 +45,8 @@ data() { return { src: 'https://cdn.uviewui.com/uview/album/2.jpg', - account: '123', - username: '用户名', + account: '', + username: '', isLoad: true } }, @@ -56,6 +56,7 @@ return } this.isLoad = true + this.getInfo() }, methods: { reOnLoad() { @@ -65,7 +66,7 @@ return } this.isLoad = true - if(this.isLoad){ + if (this.isLoad) { this.getInfo() } }, From 022da2f0d0b055785449e2a782624c4da698638e Mon Sep 17 00:00:00 2001 From: LuoShijie Date: Fri, 17 Nov 2023 22:36:02 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E7=BD=97=E4=B8=96=E6=9D=B0=EF=BC=9A?= =?UTF-8?q?=E5=95=86=E9=93=BA=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=E7=BB=91?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ShowShopList/ShowShopList.vue | 83 ++++++++++++++++--- .../ShowShopListItem/ShowShopListItem.vue | 34 ++++---- service/request.js | 5 +- 3 files changed, 92 insertions(+), 30 deletions(-) diff --git a/components/ShowShopList/ShowShopList.vue b/components/ShowShopList/ShowShopList.vue index 92b477d..8c28097 100644 --- a/components/ShowShopList/ShowShopList.vue +++ b/components/ShowShopList/ShowShopList.vue @@ -52,11 +52,32 @@ return false } }, + //获取列表类型传递参数部分 + listType:{ + type: Number, + default() { + return 1 + } + }, + pageSize: { + type: Number, + default() { + return 5 + } + }, + pageNum: { + type: Number, + default() { + return 1 + } + }, shopInfoList: { type: Array, default() { return [ { + id: 1, + type: 1, shopid: 1, imageUrl: 'https://alifei01.cfp.cn/creative/vcg/800/new/VCG41175510742.jpg', title: '琴行铺面转让', @@ -72,19 +93,41 @@ phoneNum: 13348946108, }, { - shopid: 2, - imageUrl: 'https://alifei01.cfp.cn/creative/vcg/800/new/VCG41175510742.jpg', - title: '琴行铺面转让', - promotionNum: 23, - price: 5000, - date: '2023-11-02', - pos: '锦江区', - exactPos: '锦江区-汇源南路366号', - sqr: 200, - zrfText: "转让费:20000万", - category: '餐饮美食', - uname: "王先生", - phoneNum: 13348946108, + "id": "1", + "pic": "3", + "tt": "333", + "type": "0", + "adress": "", + "trade1": "啊", + "trade2": "餐馆", + "btype1": "", + "btype2": "", + "area1": "青羊区", + "area2": "", + "mianji": "33", + "zhuanrangfei": "44", + "zujin": "44", + "hits": "0", + "58url": "", + "personurl": "", + "kw": "", + "remark": "", + "content": "44vv", + "pics": "", + "user_level_id": "1", + "lianxiren": "3333", + "mobile": "44444", + "status": "1", + "shangpulx": "1", + "zhuangtai": "1", + "lng": "2222.00000000", + "lat": "3333.00000000", + "pub_time": "0", + "create_time": "1699973131", + "update_time": "1699973131", + "delete_time": "0", + "userid": "1", + "success": "2" } ] } @@ -97,7 +140,21 @@ // TODO:不能直接修改 // if(delindex !== -1) this.shopInfoList = this.shopInfoList.slice(delindex,1) // console.log(this.shopInfoList); + }, + getList() { + const query = this.$u.queryParams({ + type: this.listType, + pageSize: this.pageSize, + pageNum: this.pageNum + }) + this.$api.getShopList(query).then(res => { + console.log("shoplist",res.data.data); + + }) } + }, + created() { + this.getList() } } diff --git a/components/ShowShopListItem/ShowShopListItem.vue b/components/ShowShopListItem/ShowShopListItem.vue index 0ec72ac..4392766 100644 --- a/components/ShowShopListItem/ShowShopListItem.vue +++ b/components/ShowShopListItem/ShowShopListItem.vue @@ -2,7 +2,7 @@ - + {{shopInfo.title}} @@ -11,13 +11,13 @@ - {{shopInfo.pos}} + {{shopInfo.area1}} - {{shopInfo.sqr}}m2 + {{shopInfo.mianji}}m2 @@ -25,13 +25,13 @@ - {{shopInfo.exactPos}} + {{shopInfo.area2}} - 租金:{{shopInfo.price}}元/月 - 发布日期:{{shopInfo.date}} - {{shopInfo.zrfText}} + 租金:{{shopInfo.zujin}}元/月 + 发布日期:{{shopInfo.create_time}} + 转让费:{{shopInfo.zhuanrangfei}} @@ -41,25 +41,25 @@ - {{shopInfo.sqr}}m2 + {{shopInfo.mianji}}m2 - {{shopInfo.category}} + {{shopInfo.trade1}} - {{shopInfo.uname}} + {{shopInfo.lianxiren}} - {{shopInfo.phoneNum}} + {{shopInfo.mobile}} @@ -78,11 +78,11 @@ - + 编辑 - + 删除 @@ -158,8 +158,14 @@ this.$emit('delItem', shopid) }, enterDetail(){ + // console.log("进入详情页面"); + const query=this.$u.queryParams({ + id: this.shopInfo.id, + type: this.shopInfo.type + }) + // console.log("query",query); uni.navigateTo({ - url: '/pages/detail/detail' + url: '/pages/detail/detail' + `${query}` }) }, handleAD(){ diff --git a/service/request.js b/service/request.js index c41bcba..727a26b 100644 --- a/service/request.js +++ b/service/request.js @@ -248,9 +248,8 @@ const apiService = { }) }, //获取商铺列表 - getShopList(data){ - const type = data.type - const url = `shop/alllist/?type=${type}` + getShopList(query){ + const url = `/shop/alllist${query}` return new Promise((resolve,reject) => { resolve(service.get(url)) }) From b055905bc432041d7e0116db1f962c8786b945cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Sat, 18 Nov 2023 14:42:53 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E9=82=93=E6=B4=81=20:=20=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/map/map.vue | 132 ++++++++++++++++++++++++++++------------ 1 file changed, 94 insertions(+), 38 deletions(-) diff --git a/pages/index/map/map.vue b/pages/index/map/map.vue index d77f9d3..b2f59ce 100644 --- a/pages/index/map/map.vue +++ b/pages/index/map/map.vue @@ -8,12 +8,12 @@ --> - + - + @@ -22,6 +22,7 @@ data() { return { radius: '', + showShop: false, scaleM: [{ scale: 3, milo: 1000000 @@ -82,29 +83,40 @@ } ], scale: '', - lat: '30.48772', //纬度 - lng: '104.080145', //经度 - marker: [{ //用户当前位置 - id: 1, - latitude: 30.48772, - longitude: 104.080145, - iconPath: '../../../static/map/sp_icon_dw.png', - width: '58rpx', - height: '72rpx', - rotate: 0, - alpha: 1 - }, - //周围标记点 - { - id: 2, - latitude: 30.488573, - longitude: 104.081248, - // iconPath: '../../../static/map/sp_icon_dw.png', - width: '58rpx', - height: '72rpx', - rotate: 0, - alpha: 1 - } + lat: uni.getStorageSync('latitude'), //纬度 + lng: uni.getStorageSync('longitude'), //经度 + marker: [ + // { //用户当前位置 + // id: 1, + // latitude: uni.getStorageSync('latitude'), + // longitude: uni.getStorageSync('longitude'), + // // iconPath: '../../../static/map/sp_icon_hdw.png', + // width: '58rpx', + // height: '72rpx', + // rotate: 0, + // alpha: 1 + // }, + // { //用户当前位置 + // id: 2, + // latitude: 30.48772, + // longitude: 104.080145, + // iconPath: '../../../static/map/sp_icon_dw.png', + // width: '58rpx', + // height: '72rpx', + // rotate: 0, + // alpha: 1 + // }, + // //周围标记点 + // { + // id: 2, + // latitude: 30.488573, + // longitude: 104.081248, + // // iconPath: '../../../static/map/sp_icon_dw.png', + // width: '58rpx', + // height: '72rpx', + // rotate: 0, + // alpha: 1 + // } ], shopList: { shopid: 1, @@ -149,9 +161,9 @@ }, watch: { scale(newVal, oldVal) { - console.log('thisscale',newVal, Math.round(newVal)); - let ra='' - this.scaleM.forEach(item => { + console.log('thisscale', newVal, Math.round(newVal)); + let ra = '' + this.scaleM.forEach(item => { if (item.scale == Math.round(newVal)) { ra = item.milo } @@ -168,35 +180,62 @@ } }, created() { - this.getMapList() + // this.getMapList() }, methods: { + getDetail(type, id) { + this.$api.getShopDetail(type, id).then(res => { + console.log('详情', res); + const data = res.data.data + if (res.data.code == 1) { + this.shopList = { + shopid: 1, + imageUrl: this.$api.imgUrl + data.pics, + title: data.tt, + promotionNum: data.num, + price: data.zujin, + date: '2023-11-02', + pos: data.area1, + exactPos: data.address, + sqr: data.mianji, + zrfText: "转让费:" + data.zhuanrangfei, + category: data.trade, + uname: data.lianxiren, + phoneNum: data.mobile, + } + // data.pics = [this.$api.imgUrl + data.pics] + // this.shopInfo = data + } + }) + }, handleRegionChange(e) { console.log('地图缩放层级变化, 只能监听拖拽, 不能监听缩放', e); }, getMapList(radius) { - console.log('this.radius',radius); + console.log('longitude', uni.getStorageSync('longitude')); + console.log('latitude', uni.getStorageSync('latitude')); const realData = { longitude: uni.getStorageSync('longitude'), latitude: uni.getStorageSync('latitude'), - radius: 100 + radius: radius * 1000 } + console.log('realData.radius', realData.radius); const mockData = { longitude: 23.40, latitude: 116.38, radius: 1111111111 } - this.$api.getMap(mockData).then(res => { + this.$api.getMap(realData).then(res => { console.log('getMap', res); let obj = {} let arr = [] - if (res.statusCode === 200) { + if (res.data.code == 1) { res.data.data.forEach(item => { obj = { id: parseInt(item.id), latitude: item.lat, longitude: item.lng, - // iconPath: '../../../static/map/sp_icon_dw.png', + iconPath: '../../../static/map/sp_icon_dw.png', width: '58rpx', height: '72rpx', rotate: 0, @@ -204,7 +243,18 @@ } arr.push(obj) }) - // this.marker=arr + this.marker = [{ //用户当前位置 + id: 1, + latitude: realData.latitude, + longitude: realData.longitude, + iconPath: '../../../static/map/sp_icon_hdw.png', + width: '58rpx', + height: '72rpx', + rotate: 0, + alpha: 1 + }, + ...arr, + ] console.log('this.marker', this.marker); } }) @@ -212,12 +262,18 @@ // 图标点击 markerClick(e) { console.log('标记点击', e); + this.showShop = true let markerId = e.markerId; //点击标记点, 获取id, 查询店铺详情, 展示在下方 + this.getDetail(1, markerId) this.marker.forEach(item => { if (markerId === item.id) { - item.iconPath = "" + item.iconPath = "../../../static/map/sp_icon_hdw.png" + item.width = '58rpx' + item.height = '72rpx' } else { item.iconPath = "../../../static/map/sp_icon_dw.png" + item.width = '58rpx' + item.height = '72rpx' } }) }, From bfc5ce65656f292178fc7013b91d1e64da0a4fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Sat, 18 Nov 2023 14:55:02 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E9=82=93=E6=B4=81=20:=20=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E5=95=86=E9=93=BA=E5=B1=95=E7=A4=BA=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/map/map.vue | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/pages/index/map/map.vue b/pages/index/map/map.vue index b2f59ce..dcb29b4 100644 --- a/pages/index/map/map.vue +++ b/pages/index/map/map.vue @@ -188,21 +188,22 @@ console.log('详情', res); const data = res.data.data if (res.data.code == 1) { - this.shopList = { - shopid: 1, - imageUrl: this.$api.imgUrl + data.pics, - title: data.tt, - promotionNum: data.num, - price: data.zujin, - date: '2023-11-02', - pos: data.area1, - exactPos: data.address, - sqr: data.mianji, - zrfText: "转让费:" + data.zhuanrangfei, - category: data.trade, - uname: data.lianxiren, - phoneNum: data.mobile, - } + this.shopList = data + // { + // shopid: 1, + // pics: this.$api.imgUrl + data.pics, + // tt: data.tt, + // num: data.num, + // zujin: data.zujin, + // date: data.update_time, + // area1: data.area1, + // address: data.address, + // mianji: data.mianji, + // zhuanrangfei: "转让费:" + data.zhuanrangfei, + // trade: data.trade, + // lianxiren: data.lianxiren, + // mobile: data.mobile, + // } // data.pics = [this.$api.imgUrl + data.pics] // this.shopInfo = data }