<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ### 設置和獲取緩存演示 ~~~javascript wx.setStorageSync('bizzbee', '就是我'); wx.setStorageSync('小程序班級', { '同學1':'袁嘉晨', '同學2':'季炎' }) ~~~ ~~~javascript onCollectionTap:function(event){ var students = wx.getStorageSync('小程序班級'); console.log(students); }, ~~~ ### 收藏功能 `post-detail.wxml` ~~~html <image wx:if="{{collected}}" catchtap="onCollectionTap" src='/images/icon/collection.png'></image> <image wx:else catchtap="onCollectionTap" src="/images/icon/collection-anti.png"></image> ~~~ onload中把當前id放入data,初始化收藏狀態 ~~~javascript onLoad: function (options) { var postId = options.id; this.setData({ currentPostId : postId }); var postData = postsData.postList[postId]; console.log(postData); this.setData(postData); var postsCollected = wx.getStorageSync('posts_collected'); if(postsCollected){ var postCollected = postsCollected[postId]; this.setData({ collected:postCollected }); }else{ var postsCollected = {}; postsCollected[postId] = false; wx.setStorageSync('posts_collected', postsCollected); } }, onCollectionTap:function(event){ var postsCollected = wx.getStorageSync('posts_collected'); var postCollected = postsCollected[this.data.currentPostId]; postCollected = !postCollected; postsCollected[this.data.currentPostId] = postCollected; wx.setStorageSync('posts_collected', postsCollected); this.setData({ collected:postCollected }); // var students = wx.getStorageSync('小程序班級'); // console.log(students); }, ~~~ 收藏彈窗 ~~~javascript wx.showToast({ title:postCollected?'收藏成功':'取消成功', duration:1000, icon:"success" }) ~~~ ### 使用模態彈出框 ~~~javascript onCollectionTap:function(event){ var postsCollected = wx.getStorageSync('posts_collected'); var postCollected = postsCollected[this.data.currentPostId]; postCollected = !postCollected; postsCollected[this.data.currentPostId] = postCollected; this.showModal(postsCollected,postCollected); }, showModal:function(postsCollected,postCollected){ var that = this; wx.showModal({ title: '收藏', content:postCollected?"收藏該文章?":"取消收藏該文章", showCancel:"true", cancelText:"取消", confirmText:"確認", confirmColor:"#405f80", success:function(res){ if(res.confirm){ wx.setStorageSync('posts_collected', postsCollected); that.setData({ collected: postCollected }); } } }) }, ~~~ ### 使用ActionSheet模擬分享 ~~~javascript onShareTap:function(){ var itemList = [ "分享給微信好友", "分享到朋友圈", "分享到陌陌", "分享到探探" ]; wx.showActionSheet({ itemList: itemList, itemColor:"#405f80", success:function(res){ wx.showModal({ title: '用戶'+itemList[res.tapIndex], content: '用戶是否取消?'+res.cancel }) } }) }, ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看