Commit e5cc37fa by 陈超

A

parent d3d2511e
...@@ -40,7 +40,20 @@ ...@@ -40,7 +40,20 @@
</template> </template>
<template v-if="tab == 1"> <template v-if="tab == 1">
<div v-for="(item, index) in options[1].items" class="layout_h news_hire_info">
<van-image height="72" width="72" :src="item.cover" fit="cover" ></van-image>
<div class="layout_v_b weight_full" style="margin-left: 0.75rem;">
<div class="text_14_600 color_333333">{{item.title}}</div>
<div class="layout_h_b" style="align-items: flex-end;">
<div class="layout_h">
<span class="text_12_400 color_999999" style="margin-right: 0.75rem;">{{item.time}}</span>
</div>
<div class="layout_h_r weight_full">
<div @click="onItem(item)" class="news_see_button layout_center text_12_400 color_white">查看</div>
</div>
</div>
</div>
</div>
</template> </template>
<template v-if="tab == 2"> <template v-if="tab == 2">
...@@ -93,7 +106,10 @@ ...@@ -93,7 +106,10 @@
methods: { methods: {
onChange: function(tab) { onChange: function(tab) {
this.tab = tab this.tab = tab
this.onLoad() let opt = that.options[that.tab]
if(opt.items.length == 0) {
this.onLoad()
}
}, },
onLoad: function() { onLoad: function() {
let that = this let that = this
...@@ -108,13 +124,12 @@ ...@@ -108,13 +124,12 @@
let array = data.data.length > 0 ? data.data : [] let array = data.data.length > 0 ? data.data : []
if(array.length > 0) { if(array.length > 0) {
opt.page += 1 opt.page += 1
console.log(array)
opt.items = opt.items.concat(array.map( r => { opt.items = opt.items.concat(array.map( r => {
let d = new Date(r.dateline * 1000) let d = new Date(r.dateline * 1000)
console.log(d)
return { return {
id: r.id, id: r.id,
title: r.title, title: r.title,
cover: r.image,
time: d.format("yyyy-MM-dd") time: d.format("yyyy-MM-dd")
} }
})) }))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment