init
This commit is contained in:
25
pages/subpages/downloadLog/downloadLog.js
Normal file
25
pages/subpages/downloadLog/downloadLog.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import userArticleApi from "../../../api/userArticleApi"
|
||||
|
||||
|
||||
Page({
|
||||
data: {
|
||||
articles: []
|
||||
},
|
||||
goback(){
|
||||
wx.navigateBack(1)
|
||||
},
|
||||
|
||||
onLoad(){
|
||||
userArticleApi.getUserDownloadArticleList().then(res=>{
|
||||
if (res.data.length>0) {
|
||||
res.data.forEach(item=>{
|
||||
item.tags = JSON.parse(item.tags)
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
articles: res.data
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
10
pages/subpages/downloadLog/downloadLog.json
Normal file
10
pages/subpages/downloadLog/downloadLog.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-nav-bar": "@vant/weapp/nav-bar/index",
|
||||
"van-tag": "@vant/weapp/tag/index",
|
||||
"article-card": "/components/articlecard/articlecard",
|
||||
"van-sticky": "@vant/weapp/sticky/index",
|
||||
"van-empty": "@vant/weapp/empty/index"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
13
pages/subpages/downloadLog/downloadLog.wxml
Normal file
13
pages/subpages/downloadLog/downloadLog.wxml
Normal file
@@ -0,0 +1,13 @@
|
||||
<van-sticky>
|
||||
<van-nav-bar
|
||||
title="下载记录"
|
||||
left-text="返回"
|
||||
left-arrow
|
||||
bind:click-left="goback"
|
||||
/>
|
||||
</van-sticky>
|
||||
|
||||
<view class="card" wx:for="{{articles}}" wx:key="index">
|
||||
<article-card data="{{item}}" />
|
||||
</view>
|
||||
<van-empty wx:if="{{articles.length==0}}" description="暂时没有下载记录~" />
|
||||
0
pages/subpages/downloadLog/downloadLog.wxss
Normal file
0
pages/subpages/downloadLog/downloadLog.wxss
Normal file
Reference in New Issue
Block a user