Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mini-program-wepy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
mini-program-wepy
Commits
1461df43
Commit
1461df43
authored
May 29, 2020
by
薛智杰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/activity' into 'master'
活动信息不用跑马灯 See merge request
!27
parents
64720397
497ed01e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
5 deletions
+31
-5
index.wpy
src/pages/index.wpy
+31
-5
No files found.
src/pages/index.wpy
View file @
1461df43
...
@@ -189,8 +189,15 @@
...
@@ -189,8 +189,15 @@
</view>
</view>
<view class="content">
<view class="content">
<view class="leftcont">
<view class="leftcont">
<swiper class="list-wrapper" vertical="true" circular="true" display-multiple-items="2" autoplay="true" interval="1500">
<swiper
<swiper-item wx:for="{{adlist}}" wx:key="index" catch:touchmove>
class="list-wrapper"
vertical="{{true}}"
circular="{{false}}"
display-multiple-items="{{activityDisplayItems}}"
bindchange="onActivityChange"
autoplay="{{autoplayActivity}}"
interval="1500">
<swiper-item wx:for="{{activityList}}" wx:key="index" catch:touchmove>
<view class="imgwrap">
<view class="imgwrap">
<image class="img" src="{{item.avatarUrl}}"></image>
<image class="img" src="{{item.avatarUrl}}"></image>
<view class="text">{{item.content}}</view>
<view class="text">{{item.content}}</view>
...
@@ -256,7 +263,11 @@
...
@@ -256,7 +263,11 @@
data: {
data: {
list: [], // 商品list
list: [], // 商品list
adlist: [],
// 活动信息
activityList: [],
activityDisplayItems: 2,
current: 5, // 商品列表初次展示第几个
current: 5, // 商品列表初次展示第几个
// userInfo: {},
// userInfo: {},
swiperItem: 2,
swiperItem: 2,
...
@@ -280,7 +291,9 @@
...
@@ -280,7 +291,9 @@
showShareModal: false,
showShareModal: false,
showAwardsModal: false,
showAwardsModal: false,
awardsInfo: {},
awardsInfo: {},
isReceive: false
isReceive: false,
autoplayActivity: false
},
},
computed: {
computed: {
...
@@ -572,6 +585,18 @@
...
@@ -572,6 +585,18 @@
await register(params);
await register(params);
wx.setStorageSync('isRegister', true);
wx.setStorageSync('isRegister', true);
}
}
},
async showActivity() {
// 1期方案先一次取50
const list = await getActivityFeed({ count: 50 });
this.activityList = list;
this.autoplayActivity = true;
},
onActivityChange(e) {
const lastIndex = this.activityList.length - this.activityDisplayItems;
if (e.$wx.detail.current === lastIndex) {
this.autoplayActivity = false;
}
}
}
},
},
async onLoad (options) {
async onLoad (options) {
...
@@ -603,8 +628,9 @@
...
@@ -603,8 +628,9 @@
}
}
await this.getMainInfo();
await this.getMainInfo();
this.videoList = await getPrizeList();
this.videoList = await getPrizeList();
this.
adlist = await getActivityFeed({ count: 50 }
);
this.
showActivity(
);
}
}
});
});
</script>
</script>
<config>
<config>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment