From c0bdfa102fcb7a3c162223d4472aa9406846ac92 Mon Sep 17 00:00:00 2001 From: A1300399510 Date: Thu, 26 Dec 2024 17:22:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=8A=A0=E5=85=A5=E5=B9=BF?= =?UTF-8?q?=E5=91=8A=E4=BD=8D=EF=BC=8C=E4=BE=A7=E8=BE=B9=E6=A0=8F=E6=8D=A2?= =?UTF-8?q?offer=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/indexSidebar/indexSidebar.js | 12 +++ component/indexSidebar/indexSidebar.wxml | 12 +-- pages/projectLibrary/projectLibrary.js | 105 ++++++++++++++++++++++- pages/projectLibrary/projectLibrary.less | 32 +++++++ pages/projectLibrary/projectLibrary.wxml | 37 +++++--- pages/projectLibrary/projectLibrary.wxss | 22 +++++ 6 files changed, 202 insertions(+), 18 deletions(-) diff --git a/component/indexSidebar/indexSidebar.js b/component/indexSidebar/indexSidebar.js index 5a7e188..b7d225d 100644 --- a/component/indexSidebar/indexSidebar.js +++ b/component/indexSidebar/indexSidebar.js @@ -123,6 +123,18 @@ Component({ return } + if (type == 'offer') { + wx.navigateToMiniProgram({ + appId: "wxa9296b07391c2bc7", + page: "/pages/victoryList/victoryList" + }) + + util.statistics({ + name: "side-offer" + }) + return + } + if (type == 'gx') { wx.navigateToMiniProgram({ appId: "wxcf0a799771cf2ae6", diff --git a/component/indexSidebar/indexSidebar.wxml b/component/indexSidebar/indexSidebar.wxml index 9cef76b..f97b9a1 100644 --- a/component/indexSidebar/indexSidebar.wxml +++ b/component/indexSidebar/indexSidebar.wxml @@ -34,12 +34,12 @@ - - - - - 港校 - 租房 + + + + + Offer + diff --git a/pages/projectLibrary/projectLibrary.js b/pages/projectLibrary/projectLibrary.js index bc92157..481df19 100644 --- a/pages/projectLibrary/projectLibrary.js +++ b/pages/projectLibrary/projectLibrary.js @@ -29,6 +29,13 @@ Page({ isloginBtnState: false, isInitFinish: false, user: {}, + swiperState: false, + + banner: [], + + swiperHeightList: {}, // 轮播图高度 + swiperCurrent: 0, // 轮播图下标 + }, /** @@ -72,6 +79,7 @@ Page({ this.getAdmission() this.addRandom() this.getProjectData() + this.bannerData() const fateProject = (this.data.fateProject || []).map(element => ({ ...element, @@ -84,6 +92,94 @@ Page({ }) }, + bannerData() { + util.wxget("/api/project.banner").then(res => { + if (res.code != 200) return + const data = res.data || [] + this.setData({ + banner: data + }) + }) + }, + + + // 新 轮播图 点击事件 + handleSwiper(e) { + const banner = this.data.banner + const index = e.currentTarget.dataset.index + const target = banner[index] || {} + + // 跳转视频号 + if ((target.type == 5) || (target.type == 'adv' && target.advtype == "videofeed_5")) { + wx.openChannelsActivity({ + finderUserName: target.finderusername, + feedId: target.feedid + }) + return false + } + + // 跳转直播 + if ((target.type == 4) || (target.type == 'adv' && target.advtype == "videofeed_4")) { + wx.openChannelsLive({ + finderUserName: target.finderusername + }) + return false + } + + // 判断跳转小程序 + if (target.appid) { + if (target.url.charAt(0) !== '/') target.url = "/" + target.url + wx.navigateToMiniProgram({ + appId: target.appid, + path: target.url + }) + return false; + } + + // 判断是否是h5页面的 + if (target.url && target.url.indexOf('http') != -1) { + wx.navigateTo({ + url: `/pages/webview/webview?url=${ target.url }`, + }) + return false; + } + + if (target.url) { + if (target.url.charAt(0) !== '/') target.url = "/" + target.url + wx.navigateTo({ + url: target.url + }) + return false; + } + }, + + // 新 轮播图 自动滑动事件,修改下标 + bindchangeSwiper(e) { + let current = e.detail.current + // this.startCountdown(this.data.urls[current]['timestamp']) // 6天 06:28:54 + + this.setData({ + swiperCurrent: current + }) + }, + + swiperHighest: 0, + // 轮播图的加载事件 + loadHeadSwiper(e) { + const index = e.target.dataset.index + let ratio = app.globalData.screen_data['windowWidth'] / 750 + let originalWidth = e.detail.width; + let originalHeight = e.detail.height; + let height = originalHeight / originalWidth * 690 * ratio + let swiperHeightList = this.data.swiperHeightList + swiperHeightList[index] = height + if (height > this.swiperHighest) this.swiperHighest = height + + this.setData({ + swiperHeightList + }) + }, + addRandom() { let list = this.data.list || [] list.forEach(element => { @@ -626,13 +722,20 @@ Page({ contrastcount: app.globalData.basicData['contrastcount'], }) } + + + this.setData({ + swiperState: true, + }) }, /** * 生命周期函数--监听页面隐藏 */ onHide() { - + this.setData({ + swiperState: false, + }) }, /** diff --git a/pages/projectLibrary/projectLibrary.less b/pages/projectLibrary/projectLibrary.less index badbddd..b20d154 100644 --- a/pages/projectLibrary/projectLibrary.less +++ b/pages/projectLibrary/projectLibrary.less @@ -727,4 +727,36 @@ view { .index-sidebar { position: relative; z-index: 100; +} + + +.slideshow-box { + padding: 12rpx 22.5rpx 0; + margin-bottom: 33rpx; + + .swiper { + transition: all 0.3s; + margin-bottom: 18rpx; + + .swiper-item { + .slideshow-img { + width: 100%; + border-radius: 15rpx; + } + } + } + + .indication-point { + .indication-point-item { + width: 15rpx; + height: 6rpx; + background-color: rgba(215, 215, 215, 1); + border-radius: 30rpx; + margin-right: 6rpx; + + &.pitch { + background-color: rgba(250, 107, 17, 1); + } + } + } } \ No newline at end of file diff --git a/pages/projectLibrary/projectLibrary.wxml b/pages/projectLibrary/projectLibrary.wxml index 414503f..f889598 100644 --- a/pages/projectLibrary/projectLibrary.wxml +++ b/pages/projectLibrary/projectLibrary.wxml @@ -1,20 +1,35 @@ - {{ isFirstPattern ? '' : '港校项目库' }} - - - - - + + 港校项目库 + + + + + + + 1 + + - 700+项目轻松查 快速比 - - + + + {{ isFirstPattern ? '' : '港校项目库' }} + + + + + + 700+项目轻松查 快速比 + + + + - + - + diff --git a/pages/projectLibrary/projectLibrary.wxss b/pages/projectLibrary/projectLibrary.wxss index e80cf2e..d1d8ae9 100644 --- a/pages/projectLibrary/projectLibrary.wxss +++ b/pages/projectLibrary/projectLibrary.wxss @@ -594,3 +594,25 @@ view { position: relative; z-index: 100; } +.slideshow-box { + padding: 12rpx 22.5rpx 0; + margin-bottom: 33rpx; +} +.slideshow-box .swiper { + transition: all 0.3s; + margin-bottom: 18rpx; +} +.slideshow-box .swiper .swiper-item .slideshow-img { + width: 100%; + border-radius: 15rpx; +} +.slideshow-box .indication-point .indication-point-item { + width: 15rpx; + height: 6rpx; + background-color: #d7d7d7; + border-radius: 30rpx; + margin-right: 6rpx; +} +.slideshow-box .indication-point .indication-point-item.pitch { + background-color: #fa6b11; +}