Browse Source

签到页面修改

chengjunhui 1 month ago
parent
commit
a8e4bedcaf
4 changed files with 15 additions and 5 deletions
  1. 7 0
      app.json
  2. 2 0
      pages/checkin/index.js
  3. 4 2
      pages/checkin/index.json
  4. 2 3
      pages/checkin/index.wxml

+ 7 - 0
app.json

@@ -141,6 +141,13 @@
       "desc": "您的位置信息将用于获取定位"
     }
   },
+  "plugins": {
+    "uni-ad": {
+      "version": "1.3.7",
+      "provider": "wxf72d316417b6767f"
+    }
+    
+  },
   "functionalPages": {
     "independent": true
   },

+ 2 - 0
pages/checkin/index.js

@@ -349,6 +349,7 @@ Page({
         
         break;
       case '观看广告':
+        this.showRewardedVideoAd();
         break;
     }
     if (taskName.indexOf('观看广告') != -1) {
@@ -417,6 +418,7 @@ Page({
    * 查看广告
    * */ 
   showRewardedVideoAd: function (e) {
+    console.log('showRewardedVideoAd')
     this.selectComponent('.uni-rewarded-video-ad').show();
   },
   onadload: function (e) {

+ 4 - 2
pages/checkin/index.json

@@ -1,9 +1,11 @@
 {
-  "usingComponents": {},
   "navigationBarTitleText": "每日签到",
   "navigationBarBackgroundColor": "#f8f9fc",
   "navigationBarTextStyle": "black",
   "backgroundColor": "#f8f9fc",
   "enablePullDownRefresh": true,
-  "backgroundTextStyle": "dark"
+  "backgroundTextStyle": "dark",
+  "usingComponents": {
+    "uni-ad": "plugin://uni-ad/ad"
+  }
 }

+ 2 - 3
pages/checkin/index.wxml

@@ -75,7 +75,6 @@
       </view>
     </view>
   </view>
+  <!-- 广告 -->
+  <uni-ad adpid="1204664147" class="uni-rewarded-video-ad" bind:load="onadload" bind:close="onadclose" bind:error="onaderror"></uni-ad>
 </view>
-
-<!--广告-->
-<!--<uni-ad adpid="" class="uni-rewarded-video-ad" bind:load="onadload" bind:close="onadclose" bind:error="onaderror"></uni-ad>-->