Commit 2c00052c by TengFengLian

畅玩banner跳转

parent b75b92d0
...@@ -44,8 +44,11 @@ Page({ ...@@ -44,8 +44,11 @@ Page({
// this.queryBanner() // this.queryBanner()
// this.queryStrategy() // this.queryStrategy()
this.setNavigationLogo() this.setNavigationLogo()
},
// onShow: function() {
this.setData({
pageNo: 1
})
var that = this var that = this
app.login({ app.login({
success: function(token) { success: function(token) {
......
import iUtils from '../../utils/utils.js' import iUtils from '../../utils/utils.js'
import deviceUtil from "../../miniprogram_npm/lin-ui/utils/device-util.js" import deviceUtil from "../../miniprogram_npm/lin-ui/utils/device-util.js"
const app = getApp()
let logicData = { let logicData = {
pageScrollLock: false, pageScrollLock: false,
pageScrollTimer: 0, pageScrollTimer: 0,
...@@ -57,9 +59,12 @@ Page({ ...@@ -57,9 +59,12 @@ Page({
}) })
this.setNavigationLogo() this.setNavigationLogo()
this.queryBanner() // this.queryBanner()
this.queryDetail() this.queryDetail()
}, },
onShow: function () {
this.getActivityList(1)
},
queryBanner: function () { queryBanner: function () {
let response = [ let response = [
'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/play/banner-0.png', 'https://image-1256588539.cos.ap-shanghai.myqcloud.com/miniapp/play/banner-0.png',
...@@ -196,10 +201,10 @@ Page({ ...@@ -196,10 +201,10 @@ Page({
}, },
onActivityDetail: function (funcItem) { onActivityDetail: function (funcItem) {
console.log(funcItem) // console.log(funcItem)
// wx.navigateTo({ wx.navigateTo({
// url: '/pages/activity-detail/activity-detail' url: '/pages/activity-detail/activity-detail?id='+funcItem.currentTarget.dataset.id
// }) })
}, },
onTabSelection: function (funcEvent) { onTabSelection: function (funcEvent) {
...@@ -269,13 +274,14 @@ Page({ ...@@ -269,13 +274,14 @@ Page({
listType: type, listType: type,
pageSize: 20, pageSize: 20,
pageNo: 1, pageNo: 1,
tagId: '3c95ab1afb3a4d899ac25242c3d089ea',
}, },
success: function(res) { success: function(res) {
var tmpArr = []; var tmpArr = [];
res.data.list.forEach(item => { res.data.list.forEach(item => {
var tmpItem = { var tmpItem = {
id: item.id, id: item.id,
cover: item.cover, cover: item.playImg,
title: item.name, title: item.name,
date: item.activeDate + ' ' + item.activeTime,//'6月30日-7月12日 10:00-12:00', date: item.activeDate + ' ' + item.activeTime,//'6月30日-7月12日 10:00-12:00',
describe: item.summary, describe: item.summary,
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<swiper autoplay circular interval="2000" next-margin="64rpx" bindchange="eventBannerChange"> <swiper autoplay circular interval="2000" next-margin="64rpx" bindchange="eventBannerChange">
<block wx:for="{{banner}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <block wx:for="{{banner}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<swiper-item> <swiper-item>
<image src="{{item}}" class="{{bannerIndex !== index ? 'banner-content': 'banner-content-active'}}" data-item="{{item}}" bindtap="onActivityDetail"/> <image src="{{item.cover}}" class="{{bannerIndex !== index ? 'banner-content': 'banner-content-active'}}" data-item="{{item}}" bindtap="onActivityDetail"/>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment