//emlog博客小程序作者QQ：809666838，AIR娱乐网www.airzyw.com制作，请保留该版权！！
import util from '../../utils/util.js'
var appbox = null;
var interstitialAd = null;
const app = getApp()
Page({
    data: {
        setting:{}
    },
  onLoad: function () {
      this.chaping();
  },
  onReady: function () {
    app.getSetting(setting => {
      this.setData({
        setting: setting
      })
    })
  },
    chaping:function(){
     if (wx.createInterstitialAd) {
      interstitialAd = wx.createInterstitialAd({
       adUnitId: '8cc1f855e9b7438f99f2c57c5f72cd5a'  //这里是广告id
 })
      interstitialAd.onLoad(() => {
        console.log('onLoad event emit')
      })
      interstitialAd.onError((err) => {
        console.log('onError event emit', err)
      })
      interstitialAd.onClose((res) => {
        console.log('onClose event emit', res)
      })
    }
  },
    onShareAppMessage: function(n) {
        return {
            title: "他们都在用的小程序",
            path: "/pages/home/home",
            success: function(n) {},
            fail: function(n) {}
        };
    },
    ChangeStyle: function () {
        wx.navigateTo({
            url: "../home/me/me"
        });
    },
    box: function () {
            let appbox = qq.createAppBox({  
           adUnitId: '3136b12d1a06576616fc7b63c1eb8c08'  
                   })        
                       appbox.load().then(()=>{          
                               appbox.show()       
                                    })   
                                      qq.vibrateShort({
                    
                })       
    },
    viewPersonInfo: function() {
                wx.showActionSheet({
                    itemList: [ "清理缓存" ],
                    success(t) {
                        wx.showLoading({
                            title: "清理中"
                        }), wx.clearStorage(), wx.hideLoading(), wx.showToast({
                            title: "清理成功",
                            icon: "success",
                            duration: 2e3
                        }), setTimeout(function() {
                            wx.reLaunch({
                                url: "/pages/blog/blog"
                            });
                        }, 2e3);
                    }
                });
                qq.vibrateShort({
                    
                })
    },
    ishome: function() {
   UpdateManager.applyUpdate()
    },
    viewBanben: function() {
        var n = this;
        wx.showModal({
            title: "emlog博客",
            content: "【当前版本】\r\n2.0.0\r\n2020-4-3\r\n\r\n【本次更新日志】\r\n页面美化更改\r\n修复了若干bug\r\n【技术支持】\r\nHK工作室\r\n作者QQ：6283354\r\n",
            showCancel: !1,
            confirmText: "知道了",
        });
          qq.vibrateShort({
                    
                })
    }
});