市北人才赋能平台 --小程序端
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.

53 lines
1.0 KiB

6 years ago
//index.js
6 years ago
import { HomeModel} from '../../models/home.js'
let homeModel = new HomeModel()
6 years ago
Page({
data: {
6 years ago
list: [
{
id: '1',
6 years ago
title: '啦啦啦量阿拉蕾阿拉啦',
showTop: true,
time: '刚刚'
},
{
id: '2',
6 years ago
title: '一条大河,向东流',
showTop: false,
time: '1分钟前'
},
{
id: '3',
6 years ago
title: '啦啦啦量阿拉蕾阿拉啦',
showTop: false,
time: '1小时前'
},
]
6 years ago
},
onLoad: function () {
6 years ago
homeModel.getHomeList((res) => {
console.log(res)
})
6 years ago
},
6 years ago
tapSwiperItem (e) {
console.log(e.detail)
6 years ago
this.gotoArticePage(e.detail.id)
6 years ago
},
tapFocusItem (e) {
console.log(e.detail)
6 years ago
this.gotoArticePage(e.detail.id)
},
clickListItem (e) {
console.log(e.detail)
6 years ago
this.gotoArticePage(e.detail.id)
// wx.redirectTo({
// url: '/pages/register/index',
// })
6 years ago
},
gotoArticePage (id) {
wx.navigateTo({
url: `/pages/article/index?id=${id}`,
})
6 years ago
}
6 years ago
})