猿问

代码编译没错,点击能收藏,再点击取消收藏就没反应啦


    var postcoll = wx.getStorageInfoSync('post_coll');

    if (postcoll) {

      var dqhczt = postcoll[postId];

      this.setData({

        coll: dqhczt

      });

    }


    else {

      var postcoll = {};

      postcoll[postId] = false;

      wx.setStorageSync('post_coll', postcoll);


    }

  },

  //.........................以上是文章缓存状态的初始化....................................................................




  hcztan: function (evert) {

    var postcoll = wx.getStorageInfoSync('post_coll');

    var dqhczt = postcoll[this.data.jsidbl];

    dqhczt = !dqhczt;

    postcoll[this.data.jsidbl] = dqhczt;

    wx.setStorageSync('post_coll', postcoll);

    this.setData({

      coll: dqhczt

    })


  }


qq_房瓦上的雨声_04368736
浏览 1527回答 0
0回答
随时随地看视频慕课网APP
我要回答