|
|
@ -1,30 +1,71 @@ |
|
|
|
// pages/topics/attract/index.js
|
|
|
|
import { |
|
|
|
TopicModel |
|
|
|
} from '../../../models/topic' |
|
|
|
let topicModel = new TopicModel() |
|
|
|
Component({ |
|
|
|
/** |
|
|
|
* 组件的属性列表 |
|
|
|
*/ |
|
|
|
properties: { |
|
|
|
list:{ |
|
|
|
type:Array, |
|
|
|
value:[], |
|
|
|
}, |
|
|
|
spaceList:{ |
|
|
|
type:Array, |
|
|
|
value:[], |
|
|
|
}, |
|
|
|
}, |
|
|
|
properties: {}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 组件的初始数据 |
|
|
|
*/ |
|
|
|
data: { |
|
|
|
|
|
|
|
//促招引的列表
|
|
|
|
oceanList: [], |
|
|
|
spaceList: [], |
|
|
|
}, |
|
|
|
attached: function () { |
|
|
|
this.fetchAttractList() |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 组件的方法列表 |
|
|
|
*/ |
|
|
|
methods: { |
|
|
|
//促招引
|
|
|
|
fetchAttractList() { |
|
|
|
var th = this; |
|
|
|
var page = 1; |
|
|
|
var pageSize = 3 |
|
|
|
topicModel.getAttractList('sc-hyrcfnzx', page, pageSize, res => { |
|
|
|
console.log('海洋人才赋能中心-->', res) |
|
|
|
const datas = res.list |
|
|
|
let tempDatas = [] |
|
|
|
datas.forEach(item => { |
|
|
|
tempDatas.push({ |
|
|
|
id: item.id, |
|
|
|
title: item.title, |
|
|
|
image: item.titlePic, |
|
|
|
showTop: item.isTop == 1 ? true : false, |
|
|
|
time: item.createTime, |
|
|
|
readed: item.isRead == 0 ? false : true |
|
|
|
}) |
|
|
|
}) |
|
|
|
th.setData({ |
|
|
|
oceanList: tempDatas, |
|
|
|
}) |
|
|
|
}) |
|
|
|
topicModel.getAttractList('sc-ztkj', page, pageSize, res => { |
|
|
|
console.log('折腾空间-->', res) |
|
|
|
const datas = res.list |
|
|
|
let tempDatas = [] |
|
|
|
datas.forEach(item => { |
|
|
|
tempDatas.push({ |
|
|
|
id: item.id, |
|
|
|
title: item.title, |
|
|
|
image: item.titlePic, |
|
|
|
showTop: item.isTop == 1 ? true : false, |
|
|
|
time: item.createTime, |
|
|
|
readed: item.isRead == 0 ? false : true |
|
|
|
}) |
|
|
|
}) |
|
|
|
th.setData({ |
|
|
|
spaceList:tempDatas, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
//海洋人才赋能中心详情
|
|
|
|
clickListItem(e) { |
|
|
|
//console.log(e.detail)
|
|
|
@ -33,7 +74,17 @@ Component({ |
|
|
|
index |
|
|
|
} = e.detail |
|
|
|
this.setData({ |
|
|
|
[`list[${index}].readed`]: true |
|
|
|
[`oceanList[${index}].readed`]: true |
|
|
|
}) |
|
|
|
this.goOceanDetail(id) |
|
|
|
}, |
|
|
|
clickListItemSpace(e) { |
|
|
|
const { |
|
|
|
id, |
|
|
|
index |
|
|
|
} = e.detail |
|
|
|
this.setData({ |
|
|
|
[`oceanList[${index}].readed`]: true |
|
|
|
}) |
|
|
|
this.goOceanDetail(id) |
|
|
|
}, |
|
|
@ -43,7 +94,7 @@ Component({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
//海洋人才赋能中心更多
|
|
|
|
goOceanMore(){ |
|
|
|
goOceanMore() { |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/pages/topics/attract/ocean/index`, |
|
|
|
|
|
|
@ -67,7 +118,7 @@ Component({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
//折腾空间中心更多
|
|
|
|
goSpaceMore(){ |
|
|
|
goSpaceMore() { |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/pages/topics/attract/space/index`, |
|
|
|
}) |
|
|
|