|
@@ -1,196 +1,129 @@
|
|
|
<template>
|
|
|
<gui-page :customFooter="true" iphoneXButtomStyle="background:#F8F8F8"
|
|
|
- :footerSets="{height:150, zIndex:100, bg:'none'}">
|
|
|
+ :footerSets="{height:150, zIndex:100, bg:'none'}" :isLoading="pageLoading">
|
|
|
<!-- 页面主体 -->
|
|
|
- <view slot="gBody">
|
|
|
- <ourLoading isFullScreen :active="pageLoading" :text="pageLoadingText" />
|
|
|
+ <view slot="gBody">
|
|
|
<view class="gui-flex gui-rows gui-justify-content-center gui-margin-top">
|
|
|
<view style="width:500rpx;">
|
|
|
- <gui-segmented-control :items="cates" :current="0" borderRadius="50rpx" @change="change"></gui-segmented-control>
|
|
|
+ <gui-segmented-control :items="cate" :current="0" borderRadius="50rpx" @change="menu"></gui-segmented-control>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<block v-if="state == 1">
|
|
|
- <view class="gui-grids gui-flex gui-rows gui-wrap gui-margin-top gui-bg-gray demo-nav2">
|
|
|
- <gui-switch-navigation :items="fetch.cate" @change="navchange" activeDirection="center" textAlign="center" :margins="20" paddings="30rpx" activeLineHeight="4rpx" lineHeights="72rpx" activeLineWidth="100rpx" ></gui-switch-navigation>
|
|
|
+ <view class="gui-grids gui-flex gui-rows gui-wrap gui-margin-top gui-bg-gray menu">
|
|
|
+ <gui-switch-navigation :items="fetch.cate" :currentIndex="nav_index" @change="nav" activeDirection="center" textAlign="center" :margins="20" paddings="30rpx" activeLineHeight="4rpx" lineHeights="72rpx" activeLineWidth="100rpx" activeLineBg="linear-gradient(to right, #008AFF,#008AFF)" ></gui-switch-navigation>
|
|
|
</view>
|
|
|
<view class="gui-margin gui-card-list gui-flex gui-rows gui-wrap gui-space-between gui-margin-top">
|
|
|
- <view class="gui-card-item" hover-class="gui-tap">
|
|
|
- <view class="gui-card-img">
|
|
|
+ <view class="gui-card-item" hover-class="gui-tap" v-for="(v, k) in fetch.info" :key="k" @click="view(v.id_code)">
|
|
|
+ <view class="gui-card-img" style="height:100%">
|
|
|
<gui-image :width="330" :height="191"
|
|
|
- src="https://cmsuse.oss-cn-beijing.aliyuncs.com/g5/21.png"></gui-image>
|
|
|
- <text class="gui-card-mask-title gui-absolute-lb gui-bg-black-opacity5 gui-block-text gui-color-white gui-h6 gui-border-box gui-text-center">标题在图片上 · 居中</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="gui-card-item" hover-class="gui-tap">
|
|
|
- <view class="gui-card-img">
|
|
|
- <gui-image :width="330" :height="191"
|
|
|
- src="https://cmsuse.oss-cn-beijing.aliyuncs.com/g5/21.png"></gui-image>
|
|
|
- <text class="gui-card-mask-title gui-absolute-lb gui-bg-black-opacity5 gui-block-text gui-color-white gui-h6 gui-border-box gui-text-center">标题在图片上 · 居中</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="gui-card-item" hover-class="gui-tap">
|
|
|
- <view class="gui-card-img">
|
|
|
- <gui-image :width="330" :height="191"
|
|
|
- src="https://cmsuse.oss-cn-beijing.aliyuncs.com/g5/21.png"></gui-image>
|
|
|
- <text class="gui-card-mask-title gui-absolute-lb gui-bg-black-opacity5 gui-block-text gui-color-white gui-h6 gui-border-box gui-text-center">标题在图片上 · 居中</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="gui-card-item" hover-class="gui-tap">
|
|
|
- <view class="gui-card-img">
|
|
|
- <gui-image :width="330" :height="191"
|
|
|
- src="https://cmsuse.oss-cn-beijing.aliyuncs.com/g5/21.png"></gui-image>
|
|
|
- <text class="gui-card-mask-title gui-absolute-lb gui-bg-black-opacity5 gui-block-text gui-color-white gui-h6 gui-border-box gui-text-center">标题在图片上 · 居中</text>
|
|
|
+ :src="v.pic_cover"></gui-image>
|
|
|
+ <text class="gui-card-mask-title gui-absolute-lb gui-bg-black-opacity5 gui-block-text gui-color-white gui-h6 gui-border-box gui-text-center">{{v.name}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</block>
|
|
|
- <view v-if="state == 2" class="d-flex w-100 h-100 flex-column just-content-center align-items-center">
|
|
|
- <view class="tips d-flex flex-column align-items-center font-size-base text-color-assist">
|
|
|
- <view>您还没有任何阅览的小记</view>
|
|
|
- <view>小记可能就在你身边,快去寻找吧~</view>
|
|
|
- </view>
|
|
|
- <button type="primary" class="drink-btn" size="default" @tap="home">我的家园</button>
|
|
|
- <view class="font-size-sm text-color-primary" @tap="qun" style="display: none;">加入官方微信群</view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <dever-share ref="share" :data="fetch.share" v-if="fetch.share"></dever-share>
|
|
|
+
|
|
|
+ <gui-empty v-if="state == 2">
|
|
|
+ <view slot="img" class="gui-flex gui-rows gui-justify-content-center">
|
|
|
+ <image class="gui-empty-img" src="@/static/dreamland/img/kong.png"></image>
|
|
|
+ </view>
|
|
|
+ <text slot="text"
|
|
|
+ class="gui-text-small gui-block-text gui-text-center gui-margin-top" style="color:#9DABFF;">您还没有可以阅览的合小记</text>
|
|
|
+ </gui-empty>
|
|
|
</view>
|
|
|
|
|
|
- <!-- 边框使用 style 实现,可以根据自己项目实际情况修改 -->
|
|
|
- <view slot="gFooter" class="gui-flex gui-rows gui-nowrap gui-space-between gui-align-items-end"
|
|
|
- style="height:150rpx;">
|
|
|
- <view class="gui-footer-icon-buttons" @tap="navChang(0)">
|
|
|
- <text class="gui-footer-icon-buttons-icon gui-block-text gui-icons"
|
|
|
- :class="[navCurrent == 0 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']"></text>
|
|
|
- <text class="gui-footer-icon-buttons-text gui-block-text gui-nav-bottom-color"
|
|
|
- :class="[navCurrent == 0 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">首页</text>
|
|
|
- </view>
|
|
|
- <view class="gui-footer-icon-buttons" @tap="navChang(1)">
|
|
|
- <text class="gui-footer-icon-buttons-icon gui-block-text gui-icons"
|
|
|
- :class="[navCurrent == 1 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']"></text>
|
|
|
- <text class="gui-footer-icon-buttons-text gui-block-text gui-nav-bottom-color"
|
|
|
- :class="[navCurrent == 1 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">交流</text>
|
|
|
- </view>
|
|
|
- <!-- 凸出按钮占位 普通按钮 实现下面的 gui-footer-icon-buttons 即可 -->
|
|
|
- <view class="gui-footer-icon-buttons"></view>
|
|
|
- <view class="gui-footer-icon-buttons" @tap="navChang(3)">
|
|
|
- <text class="gui-footer-icon-buttons-icon gui-block-text gui-icons"
|
|
|
- :class="[navCurrent == 3 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']"></text>
|
|
|
- <text class="gui-footer-icon-buttons-text gui-block-text"
|
|
|
- :class="[navCurrent == 3 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">客服</text>
|
|
|
- </view>
|
|
|
- <view class="gui-footer-icon-buttons" @tap="navChang(4)">
|
|
|
- <text class="gui-footer-icon-buttons-icon gui-block-text gui-icons"
|
|
|
- :class="[navCurrent == 4 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']"></text>
|
|
|
- <text class="gui-footer-icon-buttons-text gui-block-text"
|
|
|
- :class="[navCurrent == 4 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">我的</text>
|
|
|
- </view>
|
|
|
- <!-- 使用定位方式实现凸出按钮 -->
|
|
|
- <view class="gui-footer-buttons-ab" @tap="navChang(2)">
|
|
|
- <text class="gui-footer-buttons-ab-icon gui-block-text gui-icons gui-bold"
|
|
|
- :class="[navCurrent == 2 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']"></text>
|
|
|
- <text class="gui-footer-icon-buttons-text gui-block-text"
|
|
|
- :class="[navCurrent == 2 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">合小记</text>
|
|
|
- </view>
|
|
|
+ <view slot="gPendant" style="display: none;">
|
|
|
+ <text class="gui-block-text pendant gui-color-white gui-bg-primary gui-icons">社区</text>
|
|
|
</view>
|
|
|
+
|
|
|
+ <foot ref="foot" slot="gFooter" :value="foot_value"></foot>
|
|
|
+ <dever-share ref="share" :data="fetch.share" v-if="fetch.share"></dever-share>
|
|
|
</gui-page>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import deverShare from '@/lib/dever/components/share.vue';
|
|
|
+import foot from '@/pages/index/foot.vue';
|
|
|
export default {
|
|
|
- components: {
|
|
|
-
|
|
|
- },
|
|
|
data() {
|
|
|
return {
|
|
|
- navCurrent: 2,
|
|
|
+ foot_value : 2,
|
|
|
state : 0,
|
|
|
fetch : {
|
|
|
cate : [],
|
|
|
info : [],
|
|
|
hot : [],
|
|
|
},
|
|
|
- height : 'height:100%',
|
|
|
+ cate : ["全部", "我的"],
|
|
|
cate_index: 0,//默认分类
|
|
|
- top: 0,
|
|
|
- view: '',
|
|
|
- cates : ["全部", "我的"],
|
|
|
+ nav_index : 0,
|
|
|
}
|
|
|
},
|
|
|
components:{
|
|
|
- deverShare
|
|
|
+ deverShare,foot
|
|
|
},
|
|
|
onLoad() {
|
|
|
-
|
|
|
- },
|
|
|
+ this.getInfo();
|
|
|
+ },
|
|
|
onShow() {
|
|
|
- this.navCurrent = 2;
|
|
|
- //this.Dever.checkLogin();
|
|
|
- this.getData();
|
|
|
+ this.$nextTick(function() {
|
|
|
+ this.$refs.foot.cur = this.foot_value;
|
|
|
+ });
|
|
|
},
|
|
|
// 重新加载
|
|
|
onPullDownRefresh: function() {
|
|
|
- this.getData();
|
|
|
+ this.getInfo();
|
|
|
},
|
|
|
//下拉加载
|
|
|
onReachBottom() {
|
|
|
- this.getData();
|
|
|
+ this.getData(1, false);
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
- navChang : function (index) {
|
|
|
- this.navCurrent = index;
|
|
|
-
|
|
|
- if (index == 0) {
|
|
|
- this.Dever.location('index/index');
|
|
|
- }
|
|
|
- },
|
|
|
- getData : function() {
|
|
|
- var self = this;
|
|
|
- this.Dever.get(this, 'app/collection/?l=api.getList', {id:-1}, function(t) {
|
|
|
+ getInfo : function() {
|
|
|
+ var self = this;
|
|
|
+ var data = {};
|
|
|
+ data.id = -1;
|
|
|
+ data.type = this.cate_index + 1;
|
|
|
+ this.nav_index = 0;
|
|
|
+ this.Dever.get(this, 'app/collection/?l=api.getList', data, function(t) {
|
|
|
if (t.cate.length > 0) {
|
|
|
self.state = 1;
|
|
|
} else {
|
|
|
self.state = 2;
|
|
|
}
|
|
|
- uni.getSystemInfo({
|
|
|
- success: function (res) {
|
|
|
- self.height = 'height:' + res.windowHeight + 'px';
|
|
|
- }
|
|
|
- })
|
|
|
});
|
|
|
- },
|
|
|
- home : function() {
|
|
|
- this.Dever.location('index/index');
|
|
|
- },
|
|
|
- location : function(id) {
|
|
|
- this.Dever.location('dream/index?id=' + id);
|
|
|
},
|
|
|
-
|
|
|
- go : function(e) {
|
|
|
- var link = e.currentTarget.dataset.url;
|
|
|
- if (link) {
|
|
|
- this.Dever.location(link);
|
|
|
+ getData : function(page, index) {
|
|
|
+ var self = this;
|
|
|
+ if (!index) {
|
|
|
+ index = this.nav_index;
|
|
|
}
|
|
|
+ var data = {};
|
|
|
+ data.id = -1;
|
|
|
+ data.type = this.cate_index + 1;
|
|
|
+ data.cate = this.fetch.cate[index].id;
|
|
|
+ this.Dever.page([page, 'info'], this, 'app/collection/?l=api.getListData', data);
|
|
|
},
|
|
|
-
|
|
|
- menu : function(index, id) {
|
|
|
- this.cate_index = index
|
|
|
+ view : function(id) {
|
|
|
+ this.Dever.location('dream/index?id=' + id);
|
|
|
+ },
|
|
|
+ menu : function(e) {
|
|
|
+ this.cate_index = e
|
|
|
+ this.getInfo();
|
|
|
},
|
|
|
+
|
|
|
+ nav : function(e) {
|
|
|
+ this.nav_index = e;
|
|
|
+ this.getData(1, e);
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
-.demo-nav{width:750rpx; padding:20rpx 30rpx; box-sizing: border-box;}
|
|
|
-.demo-nav2{width:750rpx; padding:15rpx 30rpx; box-sizing: border-box; padding-bottom:0;}
|
|
|
-.gui-text-small{font-size:20rpx;}
|
|
|
-.gui-footer-icon-buttons{width:130rpx; height:80rpx; padding:10rpx; flex:1; position:relative; margin:0; background-color:#F8F8F8;}
|
|
|
-.gui-footer-buttons-ab{position:absolute; z-index:101; left:325rpx; top:0rpx; width:110rpx; height:150rpx;}
|
|
|
-.gui-footer-buttons-ab-icon{width:110rpx; height:110rpx; line-height:120rpx; text-align:center; font-size:68rpx; background-color:#F7F8FA; border-radius:100rpx;}
|
|
|
+.pendant{width:88rpx; height:88rpx; border-radius:88rpx; text-align:center; line-height:88rpx; font-size:24rpx;margin-top: 10rpx;}
|
|
|
+.menu{width:750rpx; padding:15rpx 30rpx; box-sizing: border-box; padding-bottom:0;}
|
|
|
+.gui-text-small{font-size:20rpx;}
|
|
|
</style>
|