From 1259f1a4c8e082594ae4719fb15386332ac847bc Mon Sep 17 00:00:00 2001 From: dengj <209192278@qq.com> Date: Fri, 17 Nov 2023 13:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=93=E6=B4=81=20:=20=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E8=BD=AE=E6=92=AD=E5=9B=BE=E8=B7=B3=E8=BD=AC=E5=88=B0=E8=AF=A6?= =?UTF-8?q?=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/InputAndSwiper/InputAndSwiper.vue | 17 +++++++++++------ pages/detail/detail.vue | 18 +++++++++++++----- pages/index/index.vue | 6 +++++- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/components/InputAndSwiper/InputAndSwiper.vue b/components/InputAndSwiper/InputAndSwiper.vue index 0b1ba5f..478d6b2 100644 --- a/components/InputAndSwiper/InputAndSwiper.vue +++ b/components/InputAndSwiper/InputAndSwiper.vue @@ -13,7 +13,8 @@ - + @@ -38,19 +39,23 @@ }, data() { return { - position: uni.getStorageSync('city')+uni.getStorageSync('district').slice(0, 2) + position: uni.getStorageSync('city') + uni.getStorageSync('district').slice(0, 2), + currentNum: '' }; }, options: { styleIsolation: 'shared', // 解除样式隔离 }, created() { - if (this.type !== '0') { - // this.open() - } }, methods: { - + //点击轮播图 + handleSwiperList(currentNum, bannerURL) { + const item=bannerURL[currentNum] + uni.navigateTo({ + url: item.link+`?id=${item.param}&type=${item.type}` + }) + }, } } diff --git a/pages/detail/detail.vue b/pages/detail/detail.vue index 0c2aef0..9a909d1 100644 --- a/pages/detail/detail.vue +++ b/pages/detail/detail.vue @@ -94,9 +94,9 @@ }, data() { return { - shopInfo:{ + // shopInfo:{ - } + // } } }, @@ -112,9 +112,17 @@ } }, onLoad: function(options) { - const shopInfomation = JSON.parse(decodeURIComponent(options.shopInfo)) - console.log(shopInfomation); - this.shopInfo = shopInfomation + // const shopInfomation = JSON.parse(decodeURIComponent(options.shopInfo)) + // console.log(shopInfomation); + // this.shopInfo = shopInfomation + console.log('detail',options); + //点击轮播图跳转详情, 传递的参数id, type + if(options.id){ + + } + if(options.type){ + + } } } diff --git a/pages/index/index.vue b/pages/index/index.vue index bb38c7c..4d6255d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -55,7 +55,11 @@ methods: { getBanner() { this.$api.getBanner().then(res => { - this.swiperList = res.data.data.map(item => 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) }) }, getNotice() {