|
|
|
// pages/topics/interactive/index.js
|
|
|
|
const app = getApp()
|
|
|
|
Component({
|
|
|
|
/**
|
|
|
|
* 组件的属性列表
|
|
|
|
*/
|
|
|
|
properties: {
|
|
|
|
typeList:{
|
|
|
|
type:Array,
|
|
|
|
value:[],
|
|
|
|
},
|
|
|
|
nodes:String
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 组件的初始数据
|
|
|
|
*/
|
|
|
|
data: {
|
|
|
|
icon:[
|
|
|
|
{pic:'bank',color:'#03aefb',bg_color:'#d7f3ff'},
|
|
|
|
{pic:'balance-scale',color:'#4d9fff',bg_color:'#e9f6fc'},
|
|
|
|
{pic:'id-card',color:'#febc30',bg_color:'#fff3d9'},
|
|
|
|
{pic:'users',color:'#bea0fe',bg_color:'#f5f0ff'},
|
|
|
|
{pic:'globe',color:'#bea0fe',bg_color:'#f5f0ff'},
|
|
|
|
{pic:'heart',color:'#febc30',bg_color:'#fff3d9'},
|
|
|
|
{pic:'graduation-cap',color:'#bea0fe',bg_color:'#f5f0ff'},
|
|
|
|
{pic:'comments',color:'#4d9fff',bg_color:'#e9f6fc'},
|
|
|
|
],
|
|
|
|
dialogShow: false,
|
|
|
|
buttons: [{text: '不同意'}, {text: '同意并继续'}],
|
|
|
|
listShow:false,
|
|
|
|
height:app.globalData.windowHeight - 44
|
|
|
|
},
|
|
|
|
attached: function () {
|
|
|
|
console.log("center页面")
|
|
|
|
console.log(this.properties.list)
|
|
|
|
var flag = wx.getStorageSync('agreement');
|
|
|
|
// var flag = false;
|
|
|
|
if(!flag){
|
|
|
|
this.setData({
|
|
|
|
dialogShow:true
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
this.setData({
|
|
|
|
listShow:true
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 组件的方法列表
|
|
|
|
*/
|
|
|
|
methods: {
|
|
|
|
onTap(){
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `/pages/topics/interactive/submitTopic/index`,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
//点击列表cell
|
|
|
|
clickListItem(e) {
|
|
|
|
//获取文章id
|
|
|
|
const id = e.currentTarget.dataset.id
|
|
|
|
console.log("clickListItem")
|
|
|
|
// console.log(id)
|
|
|
|
console.log(e)
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `/pages/article/index?id=${id}`,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
deleteTopic(e){
|
|
|
|
this.triggerEvent('deleteTopic', { id: e.detail.id })
|
|
|
|
},
|
|
|
|
tapDialogButton(e) {
|
|
|
|
if(e.detail.index == 1){ //确认
|
|
|
|
wx.setStorageSync('agreement', '1');
|
|
|
|
this.setData({
|
|
|
|
dialogShow: false,
|
|
|
|
listShow:true
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
wx.switchTab({
|
|
|
|
url: '/pages/home/index',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
goDetail(item){
|
|
|
|
let typeCode=item.currentTarget.dataset.typecode
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `/pages/resource/index?typeCode=${typeCode}`,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
//报需求
|
|
|
|
goReportDemand(){
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `/pages/topics/reportDemand/index`,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|