私域通

This commit is contained in:
老叶
2022-02-10 10:25:16 +08:00
parent d030e780d7
commit 4096d72bfc
2 changed files with 49 additions and 42 deletions
+36 -15
View File
@@ -17,6 +17,11 @@ Page({
},
swiperCurrent: 0,
list: [],
pageNo: 1,
noData: false,
end: false,
load: true,
loading: false,
},
//生命周期函数--监听页面加载
@@ -49,13 +54,29 @@ Page({
//活动列表
getAppSytactivityList(){
this.setData({
load: false,
loading: true,
})
let params = {};
params['page'] = 1;
params['size'] = 100;
params['page'] = this.data.pageNo;
params['size'] = 10;
_.apiQuery.getAppSytactivityList(params).then(res => {
this.setData({
list: this.getIconByGroup(res.data.list),
pageNo: this.data.pageNo + 1,
list: this.data.list.concat(res.data.list),
load: true,
loading: false,
})
if (res.data.total == 0) {
this.setData({
noData: true
})
} else if (this.data.list.length>10&&this.data.list.length == res.data.total) {
this.setData({
end: true
})
}
wx.stopPullDownRefresh()
});
},
@@ -88,23 +109,23 @@ Page({
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function () {
onPullDownRefresh(){
this.setData({
swiperOptions: {
indicatorDots: false,
vertical: false,
autoplay: false,
interval: 4000,
duration: 1000,
items: 1,
circular: false,
current: 0
},
swiperCurrent: 0,
list: [],
pageNo: 1,
noData: false,
end: false,
load: true,
loading: false,
})
this.getAppSytactivityTabs()
this.getAppSytactivityList()
},
//页面上拉触底事件的处理函数
onReachBottom(){
if (this.data.noData || this.data.end||!this.data.load) return;
this.getAppSytactivityList()
},
})
+13 -27
View File
@@ -1,4 +1,4 @@
<view class="container img-top-cover" style="background-image:url({{bg_img}}?v=220206);">
<view class="container img-top-cover" style="background-image:url({{bg_img}});">
<view class="relative" style="height:630rpx;"></view>
<view class="pl30 pr30 pb30">
<view class="syt-panel box-shadow-000-10-10 ulib-r20">
@@ -10,35 +10,21 @@
</view>
</block>
</view> -->
<view class="inner30 bg-fff ulib-r10">
<view class="inner30 bg-fff ulib-r10" style="min-height:700rpx">
<view class="mt10 text-center"><image style="width:300rpx;height:40rpx;" lazy-load="{{true}}" mode="aspectFill" src="{{imgUrl}}siyutong/ac-tt-1.png?v=220207"></image></view>
<view>
<swiper style="height:370rpx;" indicator-dots="{{swiperOptions.indicatorDots}}"
autoplay="{{swiperOptions.autoplay}}" current="{{swiperOptions.current}}"
interval="{{swiperOptions.interval}}" duration="{{swiperOptions.duration}}"
display-multiple-items="{{swiperOptions.items}}" circular="{{swiperOptions.circular}}"
bindchange="swiperChange">
<block wx:for="{{list}}" wx:key="index">
<swiper-item>
<block wx:for="{{item}}" wx:for-item="it" wx:key="index">
<view class="mt20 inner30 relative bg-f0f4ff pr150 ulib-r10 {{it.color!='#ff842d'?'opacity-50':''}}" bindtap="pushLink" data-url="/pages/siyutong/activityDetail/index?id={{it.id}}">
<view class="text-nowrap font-32 color-333">{{it.title}}</view>
<view class="absolute right-0 box-middle mr20">
<text class="inline-block pl10 pr10 text-middle font-20 color-fff ulib-r750" style="background-color:{{it.color}};" >{{it.type_name}}</text>
<i class="iconfont icon-gengduo text-middle font-32 color-666"></i>
</view>
</view>
</block>
</swiper-item>
</block>
</swiper>
<view class="dots mt20" wx:if="{{list.length>1}}">
<block wx:for="{{list}}" wx:key="unique">
<view class="dot{{index == swiperCurrent ? ' active' : ''}}"></view>
</block>
<block wx:for="{{list}}" wx:key="index">
<view class="mt20 inner30 relative bg-f0f4ff pr150 ulib-r10 {{item.color!='#ff842d'?'opacity-50':''}}" bindtap="pushLink" data-url="/pages/siyutong/activityDetail/index?id={{item.id}}">
<view class="text-nowrap font-32 color-333">{{item.title}}</view>
<view class="absolute right-0 box-middle mr20">
<text class="inline-block pl10 pr10 text-middle font-20 color-fff ulib-r750" style="background-color:{{item.color}};" >{{item.type_name}}</text>
<i class="iconfont icon-gengduo text-middle font-32 color-666"></i>
</view>
</view>
</view>
</block>
<lcb-listmore isLoading='{{loading}}' isEnd='{{end}}' isNoData='{{noData}}'></lcb-listmore>
</view>
</view>
</view>
</view>