Commit 1473f1ea authored by xiaochenghua's avatar xiaochenghua

feat: 广告

parent a74a404f
...@@ -14,6 +14,25 @@ Page({ ...@@ -14,6 +14,25 @@ Page({
onLoad() { onLoad() {
this.echart =this.selectComponent('#mychart'); this.echart =this.selectComponent('#mychart');
// 在页面中定义插屏广告
let interstitialAd = null
// 在页面onLoad回调事件中创建插屏广告实例
if (wx.createInterstitialAd) {
interstitialAd = wx.createInterstitialAd({
adUnitId: 'adunit-a4fab2c7a6cb6510'
})
interstitialAd.onLoad(() => {})
interstitialAd.onError((err) => {})
interstitialAd.onClose(() => {})
}
// 在适合的场景显示插屏广告
if (interstitialAd) {
interstitialAd.show().catch((err) => {
console.error(err)
})
}
}, },
handleDate(e) { handleDate(e) {
......
...@@ -17,5 +17,7 @@ ...@@ -17,5 +17,7 @@
</view> </view>
</view> </view>
<button type="primary" class="button" bind:tap="handleScle">计算八字</button> <button type="primary" class="button" bind:tap="handleScle">计算八字</button>
<view style="position: absolute; bottom: 0;width: 100%;">
<ad unit-id="adunit-5d509a2d2926ec2a"></ad>
</view>
</view> </view>
\ No newline at end of file
...@@ -4,34 +4,42 @@ ...@@ -4,34 +4,42 @@
"ignore": [] "ignore": []
}, },
"setting": { "setting": {
"bundle": false,
"userConfirmedBundleSwitch": false,
"urlCheck": true, "urlCheck": true,
"scopeDataCheck": false,
"coverView": true,
"es6": true, "es6": true,
"enhance": true,
"postcss": true, "postcss": true,
"compileHotReLoad": true,
"lazyloadPlaceholderEnable": false,
"preloadBackgroundData": false, "preloadBackgroundData": false,
"minified": true, "minified": true,
"autoAudits": false,
"newFeature": false, "newFeature": false,
"uglifyFileName": false, "coverView": true,
"uploadWithSourceMap": true,
"useIsolateContext": true,
"nodeModules": false, "nodeModules": false,
"enhance": true, "autoAudits": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"showShadowRootInWxmlPanel": true, "showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": true,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": false,
"useApiHook": false,
"useApiHostProcess": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false, "packNpmManually": false,
"enableEngineNative": false,
"packNpmRelationList": [], "packNpmRelationList": [],
"minifyWXSS": true, "minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false, "showES6CompileOption": false,
"minifyWXML": true "useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.19.4", "libVersion": "2.19.4",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment