123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- <template name="community">
- <view class="home" @touchstart="Dever.slide" @touchend="end">
- <view class="card-bottom">
- <!-- 顶部分页栏 -->
- <view class="top-tab">
- <view :class="['tab-item flex-center', activeTab == index ? 'active' : '']" @tap="handleTab(index)" v-for="(item, index) in tabList" :key="index">{{ item.title }}</view>
- </view>
- <view class="scroll-wrapper">
- <!-- 漂流瓶 -->
- <view v-if="activeTab == 0">
- <view class="margin-bottom" v-for="(item, index) in cardList" :key="index">
- <y-DiaryItem :obj="item" />
- </view>
- </view>
- <!-- 聚集岛 -->
- <view v-else>
- <view class="margin-bottom" v-for="(item, index) in rightList" :key="item.id">
- <y-DiaryItem :obj="item" />
- </view>
- </view>
- <y-LoadMore :status="loadMoreStatus" />
- </view>
- <!-- 右下角按钮 -->
- <y-Fab :bottom="140" :right="40" :btnList="fabList" @click="handleFab" />
- </view>
- </view>
- </template>
- <script>
- export default {
- name: "community",
- props: {
- info_id : {
- type : String,
- value : null
- },
- page_id : {
- type : String,
- value : null
- },
- parent_page_id : {
- type : String,
- value : null
- },
- index : 0
- },
- data() {
- return {
- startNum: 0,
- activeTab: 0,
- // tab的名称
- tabList: [
- {
- title: '漂流瓶'
- },
- {
- title: '聚集岛'
- }
- ],
- cardList: [{
- id: 2,
- time: '06-17',
- avatarUrl: 'https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/cat.jpg',
- nickName: '小黄鸭',
- title: '洛稚喜欢盛淮南谁也不知道',
- follow: false,
- isLike: false,
- likeNum: '24',
- commentNum: '0',
- imgList: [
- 'https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/tree.jpg'
- ]
- },
- {
- id: 2,
- time: '06-17',
- avatarUrl: 'https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/cat.jpg',
- nickName: '小黄鸭',
- title: '洛稚喜欢盛淮南谁也不知道',
- follow: false,
- isLike: false,
- likeNum: '24',
- commentNum: '0',
- imgList: [
- 'https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/tree.jpg'
- ]
- }],
- rightList: [{
- id: 2,
- time: '06-17',
- avatarUrl: 'https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/cat.jpg',
- nickName: '小黄鸭1',
- title: '洛稚喜欢盛淮南谁也不知道2222',
- follow: false,
- isLike: false,
- likeNum: '24',
- commentNum: '0',
- imgList: [
- 'https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/tree.jpg'
- ]
- }],
- loadMoreStatus: 1, //0加载前,1加载中,2没有更多了
- //fab的设置
- fabList: [
- {
- bgColor: '#16C2C2',
- text: '发布',
- fontSize: 28,
- color: '#fff'
- },
- {
- bgColor: '#37b59d',
- text: '分享',
- fontSize: 28,
- color: '#fff'
- }
- ]
- };
- },
- created() {
- this.getData('add');
- //this.rightList = this.$store.state.diary.rightList;
- },
- onReachBottom() {
- this.startNum++;
- //上滑加载
- this.getData('add');
- },
- methods:{
- toDetails : function(id){
- uni.navigateTo({
- url: '../diary/details/details?id=' + id
- })
- },
- toOther : function(id){
- uni.navigateTo({
- url: '../mine/other/other?id=' + id
- })
- },
- getData : function(type) {
-
- },
- //下拉刷新
- onPulldownReresh : function() {
- console.info(222)
- this.getData('refresh');
- },
- handleTab : function(index) {
- this.activeTab = index;
- },
- //点击右下角tab按钮
- handleFab : function(e) {
- let index = e.index;
- switch (index) {
- case 0:
- uni.navigateTo({
- url: '../push/push'
- });
- break;
- case 1:
- console.log(1);
- break;
- }
- },
- end : function(e) {
- var type = this.Dever.slideEnd(e);
- if (type == 3 || type == 4) {
- this.$emit('goIndex', this.index);
- }
- }
- },
- }
- </script>
- <style lang="less" scoped>
- page {
- --mainColor: #435257;
- --activeColor: #36b39b;
- }
- view {
- box-sizing: border-box;
- }
- .flex-center {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .mainColor {
- color: var(--mainColor);
- }
- .aColor {
- color: var(--activeColor);
- }
- .color-nine{
- color: #999999;
- }
- .main-btn {
- border-radius: 40upx;
- display: flex;
- align-items: center;
- justify-content: center;
- color: var(--mainColor);
- border: 1upx solid var(--mainColor);
- padding: 10rpx 40rpx;
- }
- .active-btn {
- color: #FFFFFF !important;
- background-color: var(--activeColor) !important;
- border: 1upx solid var(--activeColor) !important;
- }
- /* 点赞和评论 */
- .margin-bottom {
- margin-bottom: 14px;
- }
- .home {
- padding-top: 120rpx;
- .top-barrage {
- width: 100%;
- height: 320rpx;
- overflow: hidden;
- }
- .card-bottom {
- width: 100%;
- .top-tab {
- display: flex;
- height: 120rpx;
- position: fixed;
- top: 0;
- width: 100%;
- z-index: 100;
- background-color: #ffffff;
- .tab-item {
- flex: 1;
- color: #999;
- border-bottom: 4rpx solid #ececec;
- }
- .active {
- color: var(--mainColor);
- border-bottom: 4rpx solid var(--mainColor);
- }
- }
- }
- }
- </style>
|