// pages/talkingmore/talkingmore.js var talksInfo = require('../../data/talkInfo.js'); Page({ data: { collected: false, history:[] }, onLoad: function (options) { var postId = options.id; this.data.currentPostId = postId; var talkInfo= talksInfo.postList[postId]; this.setData({ talkInfo: talkInfo }) var postsCollected = wx.getStorageSync("posts_collected2"); if (postsCollected) { var postCollected = postsCollected[postId] this.setData({ collected: postCollected }) } else { var postsCollected = {}; postsCollected[postId] = false; wx.setStorageSync("posts_collected2", postsCollected) } // 历史 var historyslist = wx.getStorageSync("historys_list2"); if(!historyslist){ var history=this.data.history; wx.setStorageSync('historys_list2', history); } for(var i=0;i