首页加入广告位,侧边栏换offer入口
This commit is contained in:
parent
02950ad9ea
commit
c0bdfa102f
@ -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",
|
||||
|
@ -34,12 +34,12 @@
|
||||
</view>
|
||||
|
||||
<!-- 不在 找飞友 笔记出现 -->
|
||||
<view class="sidebar-item offerBtn flexcenter" wx:if="{{ sidebarType != 'find' && sidebarType != 'note' && ishongkongoffer }}" bind:tap="sidebarShowHide" data-type="gx">
|
||||
<view class="offerBtn-icon flexcenter">
|
||||
<image class="zufang-img" src="https://app.gter.net/image/miniApp/offer/renting-icon.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="offerBtn-text">港校</view>
|
||||
<view class="offerBtn-text">租房</view>
|
||||
<view class="sidebar-item offerBtn flexcenter" wx:if="{{ sidebarType != 'find' && sidebarType != 'note' && ishongkongoffer }}" bind:tap="sidebarShowHide" data-type="offer">
|
||||
<!-- <view class="offerBtn-icon flexcenter"> -->
|
||||
<image class="offerBtn-icon" mode="widthFix" src="https://app.gter.net/image/miniApp/project/offer-icon.png" mode="widthFix"></image>
|
||||
<!-- </view> -->
|
||||
<view class="offerBtn-text">Offer</view>
|
||||
<view class="offerBtn-text">榜</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
@ -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,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -728,3 +728,35 @@ view {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +1,21 @@
|
||||
<!--pages/projectLibrary/projectLibrary.wxml-->
|
||||
<view class="container">
|
||||
<block wx:if="{{ banner.length != 0 }}">
|
||||
<header-nav bgcolor="{{ isFirstPattern ? 'transparent' : '#f5f5f5' }}" user="{{ user }}" isIndexPage="{{ true }}">港校项目库</header-nav>
|
||||
<view class="slideshow-box">
|
||||
<swiper wx:if="{{ swiperState }}" class="swiper" autoplay="{{ true }}" circular style="height: {{(swiperHeightList[swiperCurrent] + 5) || 124 }}px;" current="{{ swiperCurrent || 0 }}" bindchange="bindchangeSwiper">
|
||||
<swiper-item class="swiper-item" wx:for="{{ banner }}" wx:key="index">
|
||||
<image class="slideshow-img" src="{{ item.imageurl }}" mode="widthFix" bindload="loadHeadSwiper" bind:tap="handleSwiper" data-index="{{ index }}" show-menu-by-longpress="{{ true }}"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view wx:else class="" style="height: {{(swiperHeightList[swiperCurrent] + 5) || 124 }}px;">1</view>
|
||||
<view class="indication-point flexcenter" wx:if="{{ banner.length > 1 }}">
|
||||
<view class="indication-point-item {{ index == swiperCurrent ? 'pitch' : '' }}" wx:for="{{ banner }}" wx:key="index"></view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<header-nav class="header-nav" bgcolor="{{ isFirstPattern ? 'transparent' : '#f5f5f5' }}" user="{{ user }}" isIndexPage="{{ true }}">{{ isFirstPattern ? '' : '港校项目库' }}</header-nav>
|
||||
|
||||
<view class="header-box" style="padding-top: {{ totalTopHeight }}px;">
|
||||
<view class="header-left">
|
||||
<view class="header-title">
|
||||
@ -13,8 +27,9 @@
|
||||
<image class="header-right-icon" mode="widthFix" src="https://app.gter.net/image/miniApp/offer/xg-project-list-icon.svg"></image>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<view class="search-box flexacenter">
|
||||
<view class="search-box flexacenter" style="margin-top: {{ banner.length == 0 ? '-100rpx' : 0 }};">
|
||||
<image class="icon" mode="widthFix" bind:tap="goPage" data-url="/pages/search/search?type=xg" src="https://app.gter.net/image/miniApp/offer/search-fine.png"></image>
|
||||
<input class="input flex1" bind:tap="goPage" data-url="/pages/search/search?type=xg" disabled placeholder="搜索项目" />
|
||||
<view class="btn flexacenter" bind:tap="goPage" data-url="/pages/projectMy/projectMy">
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user