[水感应客户端最新]
This commit is contained in:
71
pages/health/praise/praise.js
Normal file
71
pages/health/praise/praise.js
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
categories : [], // 分类
|
||||
articlesArr : [], // 列表
|
||||
page : {}, // 分页信息
|
||||
lodingStats : false, // 加载状态
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
// 获取列表
|
||||
this.articlesInfo();
|
||||
},
|
||||
|
||||
// 列表
|
||||
articlesInfo(page){
|
||||
wx.$api.health.mySubscribe({
|
||||
page : page || 1
|
||||
}).then(res => {
|
||||
let listArr = this.data.articlesArr,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) listArr = []
|
||||
newData = listArr.concat(res.data.subscriptions.data)
|
||||
this.setData({
|
||||
articlesArr : newData,
|
||||
page : res.data.subscriptions.page,
|
||||
lodingStats : false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
// 获取列表
|
||||
this.articlesInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
// 获取列表
|
||||
this.articlesInfo(pageNumber);
|
||||
}
|
||||
}
|
||||
})
|
||||
4
pages/health/praise/praise.json
Normal file
4
pages/health/praise/praise.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "我的点赞"
|
||||
}
|
||||
24
pages/health/praise/praise.wxml
Normal file
24
pages/health/praise/praise.wxml
Normal file
@@ -0,0 +1,24 @@
|
||||
<!-- 健康知识 -->
|
||||
<view class="article">
|
||||
<view class="wiki" wx:if="{{articlesArr.length > 0}}">
|
||||
<navigator hover-class="none" url="../article/article?id={{item.subscribable.article_id}}" class="wiki-label" wx:for="{{articlesArr}}" wx:key="listsArr">
|
||||
<image class="wiki-label-img" mode="aspectFill" src="{{item.subscribable.cover}}"></image>
|
||||
<view class="wiki-label-cont">
|
||||
<view class="nowrap wiki-label-name"><text>水感应</text> | {{item.subscribable.title}}</view>
|
||||
<view class="nowrap-multi wiki-label-text">{{item.subscribable.description}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
||||
<block wx:if="{{page.has_more}}">
|
||||
<image class="pagesLoding-icon" src="/static/icons/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||
</block>
|
||||
<block wx:else>
|
||||
没有更多了~
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pack-center pages-hint" wx:else>
|
||||
<image src="/static/imgs/text_null.png"></image>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
62
pages/health/praise/praise.wxss
Normal file
62
pages/health/praise/praise.wxss
Normal file
@@ -0,0 +1,62 @@
|
||||
page {
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
|
||||
/* 健康知识 */
|
||||
.article {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.wiki {
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
|
||||
.wiki-label {
|
||||
background-color: #fff;
|
||||
margin-bottom: 70rpx;
|
||||
position: relative;
|
||||
height: 200rpx;
|
||||
box-shadow: 0 4rpx 30rpx 2rpx rgba(0, 0, 0, .05);
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.wiki-label:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.wiki-label-img {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
position: absolute;
|
||||
top: -30rpx;
|
||||
left: 30rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.wiki-label-cont {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
padding: 30rpx 25rpx 0 270rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.wiki-label-name {
|
||||
font-size: 32rpx;
|
||||
color: #3b7cff;
|
||||
}
|
||||
|
||||
.wiki-label-name text {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.wiki-label-text {
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
margin-top: 20rpx;
|
||||
line-height: 40rpx;
|
||||
font-weight: 200;
|
||||
}
|
||||
Reference in New Issue
Block a user