Commit fed352b1 by TengFengLian

update

parent 3effb392
...@@ -101,6 +101,8 @@ Page({ ...@@ -101,6 +101,8 @@ Page({
['formInto.quantity']: 0 ['formInto.quantity']: 0
}) })
this.inspectForm()
}, },
onServic: function () { onServic: function () {
...@@ -167,6 +169,10 @@ Page({ ...@@ -167,6 +169,10 @@ Page({
errorSession: '该场次已没剩余名额', errorSession: '该场次已没剩余名额',
}) })
return false return false
} else {
this.setData({
errorSession: '',
})
} }
...@@ -223,38 +229,8 @@ Page({ ...@@ -223,38 +229,8 @@ Page({
if (!this.inspectForm()) { if (!this.inspectForm()) {
return return
} }
// var activityTime = this.data.activityTimes[this.data.activityIndex] var activityTime = this.data.activityTimes[this.data.activityIndex]
// console.log(activityTime) let formInto = this.data.formInto
// if (activityTime.residue*1 == 0) {
// wx.lin.showToast({
// title: '该场次已没剩余名额',
// icon: 'error',
// })
// return
// }
// let formInto = this.data.formInto
// if (formInto.name == ''){
// wx.lin.showToast({
// title: '请输入名字',
// icon: 'error',
// })
// return
// }
// if (formInto.phone == ''){
// wx.lin.showToast({
// title: '请输入手机号',
// icon: 'error',
// })
// return
// }
// if (formInto.quantity == 0){
// wx.lin.showToast({
// title: '请设置报名人数',
// icon: 'error',
// })
// return
// }
wx.lin.showToast({ wx.lin.showToast({
icon: 'loading', icon: 'loading',
title: '提交中', title: '提交中',
......
...@@ -41,11 +41,12 @@ Page({ ...@@ -41,11 +41,12 @@ Page({
}, },
onLoad: function (options) { onLoad: function (options) {
this.queryBanner() // this.queryBanner()
// this.queryStrategy() // this.queryStrategy()
this.setNavigationLogo() this.setNavigationLogo()
// //
this.getBanner()
this.loadVisiterPlanList() this.loadVisiterPlanList()
}, },
...@@ -219,6 +220,23 @@ Page({ ...@@ -219,6 +220,23 @@ Page({
}, 40) }, 40)
}, },
bannerClick(e) {
console.log(e.currentTarget.dataset.item)
},
getBanner() {
var that = this
app.wxRequest({
url: '/api/v1/banner/getList',
success: function(res) {
that.setData({
banner: res.data
})
}
})
},
// 游客攻略列表 // 游客攻略列表
loadVisiterPlanList() { loadVisiterPlanList() {
this.data.loading = true this.data.loading = true
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<view id="banner" class="banner"> <view id="banner" class="banner">
<swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="2000" duration="500" bindchange="onSwiperChange"> <swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="2000" duration="500" bindchange="onSwiperChange">
<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 class="banner-swiper-item"> <swiper-item class="banner-swiper-item" data-item="{{item}}" bindtap="bannerClick">
<image class="banner-swiper-image" src="{{item}}"></image> <image class="banner-swiper-image" src="{{item.img}}"></image>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
......
import iRequest from '../../utils/request/corvus.js' import iRequest from '../../utils/request/corvus.js'
const app = getApp()
Page({ Page({
...@@ -18,7 +19,9 @@ Page({ ...@@ -18,7 +19,9 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
},
onShow: function () {
this.getMyActivityList()
}, },
getUserInfo: function (funcEvent) { getUserInfo: function (funcEvent) {
console.log(funcEvent) console.log(funcEvent)
...@@ -56,5 +59,18 @@ Page({ ...@@ -56,5 +59,18 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: '../myInfo/myInfo', url: '../myInfo/myInfo',
}) })
} },
// 我的活动
getMyActivityList() {
var that = this
app.wxRequest({
url: '/api/v1/activity/getMyActivityList',
data: { activeState: '0,1', pageSize: 10, pageNo: 1 },
success: function(res) {
}
})
},
}) })
\ No newline at end of file
...@@ -196,9 +196,10 @@ Page({ ...@@ -196,9 +196,10 @@ Page({
}, },
onActivityDetail: function (funcItem) { onActivityDetail: function (funcItem) {
wx.navigateTo({ console.log(funcItem)
url: '/pages/activity-detail/activity-detail' // wx.navigateTo({
}) // url: '/pages/activity-detail/activity-detail'
// })
}, },
onTabSelection: function (funcEvent) { onTabSelection: function (funcEvent) {
...@@ -258,4 +259,46 @@ Page({ ...@@ -258,4 +259,46 @@ Page({
bannerIndex: event.detail.current bannerIndex: event.detail.current
}) })
}, },
//主题活动列表 type 1 近期 0 往期
getActivityList(type){
var that = this
app.wxRequest({
url: '/api/v1/activity/getList',
data: {
listType: type,
pageSize: 20,
pageNo: 1,
},
success: function(res) {
var tmpArr = [];
res.data.list.forEach(item => {
var tmpItem = {
id: item.id,
cover: item.cover,
title: item.name,
date: item.activeDate + ' ' + item.activeTime,//'6月30日-7月12日 10:00-12:00',
describe: item.summary,
beginDate: item.activeDate.split('-')[0],
}
tmpArr.push(tmpItem)
})
// 活动开始时间倒序排序
tmpArr.sort(function(a,b) {
return new Date(b.beginDate.replace(/月/g,"\/").replace(/日/g,"\/")) - new Date(a.beginDate.replace(/月/g,"\/").replace(/日/g,"\/"))
})
if (type == 1) {
that.setData({
banner: tmpArr
})
} else {
that.setData({
other: tmpArr
})
}
}
})
}
}) })
\ No newline at end of file
...@@ -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'}}" bindtap="onActivityDetail"/> <image src="{{item}}" 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