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 @@
-
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 @@
-
-
-