You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.0 KiB
52 lines
1.0 KiB
//index.js
|
|
import { HomeModel} from '../../models/home.js'
|
|
let homeModel = new HomeModel()
|
|
Page({
|
|
data: {
|
|
list: [
|
|
{
|
|
id: '1',
|
|
title: '啦啦啦量阿拉蕾阿拉啦',
|
|
showTop: true,
|
|
time: '刚刚'
|
|
},
|
|
{
|
|
id: '2',
|
|
title: '一条大河,向东流',
|
|
showTop: false,
|
|
time: '1分钟前'
|
|
},
|
|
{
|
|
id: '3',
|
|
title: '啦啦啦量阿拉蕾阿拉啦',
|
|
showTop: false,
|
|
time: '1小时前'
|
|
},
|
|
]
|
|
},
|
|
onLoad: function () {
|
|
homeModel.getHomeList((res) => {
|
|
console.log(res)
|
|
})
|
|
},
|
|
tapSwiperItem (e) {
|
|
console.log(e.detail)
|
|
this.gotoArticePage(e.detail.id)
|
|
},
|
|
tapFocusItem (e) {
|
|
console.log(e.detail)
|
|
this.gotoArticePage(e.detail.id)
|
|
},
|
|
clickListItem (e) {
|
|
console.log(e.detail)
|
|
this.gotoArticePage(e.detail.id)
|
|
// wx.redirectTo({
|
|
// url: '/pages/register/index',
|
|
// })
|
|
},
|
|
gotoArticePage (id) {
|
|
wx.navigateTo({
|
|
url: `/pages/article/index?id=${id}`,
|
|
})
|
|
}
|
|
})
|
|
|