提交 07eeb384 编写于 作者: DCloud_JSON's avatar DCloud_JSON

压缩图片大小

上级 bddca522
......@@ -83,18 +83,7 @@
<style>
/*每个页面公共css */
.border-test {
/* #ifdef APP-NVUE */
border-width: 1rpx;
border-color: #DD524D;
/* #endif */
/* #ifndef APP-NVUE */
border: 1px solid #DD524D;
box-sizing: border-box;
/* #endif */
}
/* #ifndef APP-NVUE */
/* #ifndef APP-NVUE */
view,
scroll-view,
text,
......@@ -109,5 +98,5 @@
scroll-view {
-webkit-overflow-scrolling: touch;
}
/* #endif */
/* #endif */
</style>
......@@ -64,6 +64,7 @@
<style scoped>
.box{
flex: 1;
margin:100rpx 0;
flex-direction: column;
align-items: center;
......
......@@ -63,7 +63,7 @@
// 数据表名
collection: 'opendb-news-articles,uni-id-users',
// 查询字段,多个字段用 , 分割
field: 'user_id{username, _id},_id,avatar,excerpt,last_modify_date, comment_count, like_count,title,content',
field: 'user_id{username,_id},avatar,excerpt,last_modify_date,comment_count,like_count,title,content',
formData: {
noData: '<p style="text-align:center;color:#666">详情加载中...</p>'
},
......@@ -114,7 +114,7 @@
},
methods: {
setFavorite() {
if (!this.has) return
if (!this.hasLogin) return
newsFavoriteTable.where({
article_id: this.id,
user_id: this.userInfo._id
......
......@@ -10,23 +10,23 @@
field="avatar,title,last_modify_date,user_id{username}">
<!-- 基于 uni-list 的页面布局 -->
<uni-list class="uni-list" :border="false" :bounce="true" :alwaysScrollableVertical="true" :style="{height:listHight}">
<cell v-if="error">
<uni-list-item v-if="error">
<template slot="body">
<!-- 设置网络 -->
<uni-network @change="refresh" @retry="refresh"></uni-network>
</template>
</cell>
</uni-list-item>
<template v-else>
<cell class="get-data-state" v-if="data.length===0&&pagination.current===1">
<!-- 数据为空 当前页码为1,且正在加载中;这里为了演示,更加直观的表达内部逻辑。商用项目建议将这部分封装为组件,更好的让业务逻辑与功能分离-->
<uni-load-more v-if="loading" status="loading"></uni-load-more>
<template v-else>
<image class="get-data-state-img" src="@/static/getDataState/nodata.png" mode="widthFix">
</image>
<text class="get-data-state-text">内容为空</text>
<uni-list-item class="get-data-state" v-if="data.length===0&&pagination.current===1">
<template slot="body">
<!-- 数据为空 当前页码为1,且正在加载中;这里为了演示,更加直观的表达内部逻辑。商用项目建议将这部分封装为组件,更好的让业务逻辑与功能分离-->
<uni-load-more v-if="loading" status="loading"></uni-load-more>
<template v-else>
<text class="get-data-state-text">内容为空</text>
</template>
</template>
</cell>
</uni-list-item>
<uni-list-item :to="'./detail?id='+item._id+'&title='+item.title"
v-for="(item,index) in data" :key="index">
<!-- 通过header插槽定义列表左侧图片 -->
......@@ -45,14 +45,11 @@
</uni-list-item>
<!-- 存在下一页数据 && 不是正在加载中 && 已经满一页; 通过 loadMore 组件实现上拉加载效果,如需自定义显示内容,可参考:https://ext.dcloud.net.cn/plugin?id=29 -->
<template v-if="!loading&&data.length>10">
<cell v-if="hasMore">
<uni-load-more status="more"></uni-load-more>
</cell>
<cell v-else>
<uni-load-more status="noMore"></uni-load-more>
</cell>
</template>
<uni-list-item v-if="!loading&&data.length>10">
<template slot="body">
<uni-load-more :status="hasMore ? 'more' : 'noMore'"></uni-load-more>
</template>
</uni-list-item>
</template>
</uni-list>
</unicloud-db>
......
......@@ -67,11 +67,12 @@
title: '去评分',
event: 'gotoMarket'
},
// #endif
//#endif
{
title: '阅读过的文章',
to: '/uni_modules/uni-news-favorite/pages/uni-news-favorite/list',
}, {
},
{
title: '我的积分',
to: '',
event: 'getScore'
......
static/uni-network/disconnection.png

39.0 KB | W: | H:

static/uni-network/disconnection.png

19.0 KB | W: | H:

static/uni-network/disconnection.png
static/uni-network/disconnection.png
static/uni-network/disconnection.png
static/uni-network/disconnection.png
  • 2-up
  • Swipe
  • Onion skin
<template>
<view class="container">
<unicloud-db ref="udb" v-slot:default="{data, pagination, loading, hasMore, error}" where="user_id == $env.uid"
orderby="update_date desc" collection="opendb-news-favorite" @load="isLoading == false" @error="isLoading == false">
orderby="update_date desc" collection="opendb-news-favorite" @load="isLoading == false" @error="isLoading == false" :page-size="10">
<view v-if="data && data.length">
<uni-list>
<uni-list-item v-for="(item, index) in data" :key="index" :clickable="true"
......@@ -15,7 +15,7 @@
</uni-list>
</view>
<uni-nodata v-else :isLoading="isLoading" @retry="refreshData"></uni-nodata>
<uni-load-more :status="loading?'loading':(hasMore ? 'more' : 'noMore')"></uni-load-more>
<uni-load-more v-if="data.length>10" :status="loading?'loading':(hasMore ? 'more' : 'noMore')"></uni-load-more>
</unicloud-db>
</view>
</template>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册