<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ~~~ const util = require('../../utils/util.js'); const api = require('../../config/api.js'); // components/ad-modal/ad.js Component({ /** * 組件的屬性列表 */ properties: { }, /** * 組件的初始數據 */ data: { show:false, tpl_id:"" }, created(){ this.getSub() }, /** * 組件的方法列表 */ methods: { cancle(){ this.setData({ show:false }) }, clickSub(event){ this.getAdd('post') }, getSub(){ let that=this; let token = wx.getStorageSync('token'); wx.login({ success:({code})=>{ util.request(api.Sub, {token:token,code:code}, 'get').then(function (res) { let result = res.result that.setData({ tpl_id:result.tpl_id, show:!result.is_sub }) }); } }) }, tongzhi(){ wx.showLoading() let that=this; let tpl_id = this.data.tpl_id; wx.getSetting({// 這里設置為true,下面才會返回mainSwitch withSubscriptions: true, success: (result) => { // 調起授權界面彈窗 if(result.subscriptionsSetting.mainSwitch){// 用戶打開了訂閱消息總開關 wx.requestSubscribeMessage({ tmplIds: [tpl_id], success (res) { console.log(res) let token = wx.getStorageSync('token'); if(res[tpl_id]==="accept" || res[tpl_id]==="acceptWithAlert"){ wx.login({ success:({code})=>{ util.request(api.Sub, {token:token,code:code}, 'post').then(function (res) { wx.hideLoading() that.setData({ show:false }) wx.showToast({ icon:"none", title:res.errormsg }) }); } }) }else if(res[tpl_id]==="reject"){ //console.log("拒絕消息推送"); //接受通知開著,但是此模板設置為不接受的時候。但是這個情況下也保存一下 wx.login({ success:({code})=>{ util.request(api.Sub, {token:token,code:code}, 'post').then(function (res) { wx.hideLoading() that.setData({ show:false }) }); } }) // wx.showToast({ // title: '????? ?????????? ??????????', // icon:"none" // }) //that.guideOpenSubscribeMessage(); }else if(res[tpl_id] === 'ban'){ console.log("已被后臺封禁"); wx.hideLoading() that.setData({ show:false }) }else{ wx.hideLoading() that.setData({ show:false }) } } }) } else{ wx.hideLoading() that.guideOpenSubscribeMessage(); } }, fail: (res) => {}, complete: (res) => { }, }) }, guideOpenSubscribeMessage() { var that = this; wx.showModal({ title: '?????????', content: '????? ???????? ?????? ????? ????????? ?????????', cancelText:"???", confirmText:"????", success: function (sm) { if (sm.confirm) {// 用戶點擊了確定 可以調用刪除方法了 wx.openSetting({ success (res) { if(res.subscriptionsSetting){ that.tongzhi() } } }) } else if (sm.cancel) { that.setData({ show:false }) } } }) }, } }) ~~~
                  <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>

                              哎呀哎呀视频在线观看