chengjie 8 ヶ月 前
コミット
272e278f21
共有5 個のファイルを変更した128 個の追加41 個の削除を含む
  1. 2 1
      pages/index/index.js
  2. 4 2
      pages/main/default.wxml
  3. 85 24
      pages/main/detail.js
  4. 9 6
      pages/main/detail.wxml
  5. 28 8
      pages/main/detail.wxss

+ 2 - 1
pages/index/index.js

@@ -118,7 +118,8 @@ Page({
118
           // app.globalData.userInfo.IsShow = isShow;
118
           // app.globalData.userInfo.IsShow = isShow;
119
           app.globalData.userInfo.IsShow = data.IsShow;
119
           app.globalData.userInfo.IsShow = data.IsShow;
120
 
120
 
121
-          app.globalData.IsLocked = data.IsLocked;
121
+          //app.globalData.IsLocked = data.IsLocked;
122
+          app.globalData.IsLocked = 0;
122
 
123
 
123
           //app.globalData.userInfo.AvatarUrl = param.avatarUrl;
124
           //app.globalData.userInfo.AvatarUrl = param.avatarUrl;
124
           that.getQuestionType(function () {
125
           that.getQuestionType(function () {

+ 4 - 2
pages/main/default.wxml

@@ -62,8 +62,8 @@
62
                 </view>
62
                 </view>
63
               </view>
63
               </view>
64
             </view>
64
             </view>
65
-            <view class="panel00201 FlexRow" bindtap="gotoMemberCenter">
66
-              <image wx:if="{{!IsAccredit}}" class="universalpic_face_default_black_size01" src="../images/universalpic_face_default_black_size01.png" bindtap='gotoBindGetUserInfo' />
65
+            <view class="panel00201 FlexRow" bindtap="gotoMemberCenter0">
66
+              <image wx:if="{{!IsAccredit}}" class="universalpic_face_default_black_size01" src="../images/universalpic_face_default_black_size01.png" bindtap='gotoBindGetUserInfo0' />
67
               <image wx:if="{{IsAccredit}}" class="universalpic_face_default_black_size01" src="{{AvatarUrl}}" />
67
               <image wx:if="{{IsAccredit}}" class="universalpic_face_default_black_size01" src="{{AvatarUrl}}" />
68
               <image wx:if="{{IsRemind}}" src='../images/message_home_01.png' class="message_home_01" />
68
               <image wx:if="{{IsRemind}}" src='../images/message_home_01.png' class="message_home_01" />
69
 
69
 
@@ -101,11 +101,13 @@
101
             <image src="../images/cpxl_logo_03.png" class="cpxl_logo_01"></image>
101
             <image src="../images/cpxl_logo_03.png" class="cpxl_logo_01"></image>
102
             <view class="panelProduct111">练口算</view>
102
             <view class="panelProduct111">练口算</view>
103
             <view class="panelProduct112">好玩的口算敏捷训练</view>
103
             <view class="panelProduct112">好玩的口算敏捷训练</view>
104
+            <view class="panelProduct113">免费</view>
104
           </view>
105
           </view>
105
           <view class="panelProduct11 FlexColumn" bind:tap="switchProgram" data-appid="wx1fef080f74481cbd">
106
           <view class="panelProduct11 FlexColumn" bind:tap="switchProgram" data-appid="wx1fef080f74481cbd">
106
             <image src="../images/cpxl_logo_04.png" class="cpxl_logo_01"></image>
107
             <image src="../images/cpxl_logo_04.png" class="cpxl_logo_01"></image>
107
             <view class="panelProduct111">练笔算</view>
108
             <view class="panelProduct111">练笔算</view>
108
             <view class="panelProduct112">竖式计算题出题+打印</view>
109
             <view class="panelProduct112">竖式计算题出题+打印</view>
110
+            <view class="panelProduct113">免费</view>
109
           </view>
111
           </view>
110
         </view>
112
         </view>
111
         <view class="panelProduct1 FlexRow">
113
         <view class="panelProduct1 FlexRow">

+ 85 - 24
pages/main/detail.js

@@ -43,6 +43,7 @@ Page({
43
       Containnerheight: server.getWindowHeight(),
43
       Containnerheight: server.getWindowHeight(),
44
       ID: id,
44
       ID: id,
45
       ShowAndroidNotice: isAndroid,
45
       ShowAndroidNotice: isAndroid,
46
+      IsMember:app.globalData.userInfo.IsMember,
46
     });
47
     });
47
     var systemInfo = wx.getSystemInfoSync();
48
     var systemInfo = wx.getSystemInfoSync();
48
     if (systemInfo.system && systemInfo.system.indexOf("Android") >= 0) {
49
     if (systemInfo.system && systemInfo.system.indexOf("Android") >= 0) {
@@ -61,17 +62,17 @@ Page({
61
       });
62
       });
62
     }
63
     }
63
 
64
 
64
-    common.getStorageValue(this, "IsShare", 0, function () {
65
-      if (that.data.IsShare == 0 &&
66
-        app.globalData.userInfo.IsMember == 0 &&
67
-        app.globalData.userInfo.IsShow == 1 &&
68
-        app.globalData.IsLocked == 1
69
-      ) {
70
-        wx.navigateTo({
71
-          url: '../../package4/main/share',
72
-        })
73
-      }
74
-    });
65
+    // common.getStorageValue(this, "IsShare", 0, function () {
66
+    //   if (that.data.IsShare == 0 &&
67
+    //     app.globalData.userInfo.IsMember == 0 &&
68
+    //     app.globalData.userInfo.IsShow == 1 &&
69
+    //     app.globalData.IsLocked == 1
70
+    //   ) {
71
+    //     wx.navigateTo({
72
+    //       url: '../../package4/main/share',
73
+    //     })
74
+    //   }
75
+    // });
75
 
76
 
76
   },
77
   },
77
   onShow: function () {
78
   onShow: function () {
@@ -134,22 +135,82 @@ Page({
134
   },
135
   },
135
   getFinish: function () {
136
   getFinish: function () {
136
     server.playSound("/sounds/click.mp3");
137
     server.playSound("/sounds/click.mp3");
138
+    var that=this;
137
 
139
 
138
-    this.setData({
139
-      ShowLoading: true,
140
-      BtnText: "全部保存到相册",
141
-    });
142
-    wx.hideLoading();
143
-    arrAnswerID = [];
144
-    tempAnswerList = [];
145
-    this.getAnswerID();
146
-    if (this.data.ID > 0) {
147
-      this.getList(this.data.ID);
148
-    } else {
149
-      this.getErrorList();
140
+    if (app.globalData.userInfo.IsMember==1){
141
+      that.setData({
142
+        ShowLoading: true,
143
+        BtnText: "全部保存到相册",
144
+      });
145
+      wx.hideLoading();
146
+      arrAnswerID = [];
147
+      tempAnswerList = [];
148
+      that.getAnswerID();
149
+      if (that.data.ID > 0) {
150
+        that.getList(that.data.ID);
151
+      } else {
152
+        that.getErrorList();
153
+      }
154
+  
155
+      that.closeHelp();
150
     }
156
     }
157
+    else{
158
+      // 若在开发者工具中无法预览广告,请切换开发者工具中的基础库版本
159
+      // 在页面中定义激励视频广告
160
+      let videoAd = null;
161
+
162
+      // 在页面onLoad回调事件中创建激励视频广告实例
163
+      if (wx.createRewardedVideoAd) {
164
+        videoAd = wx.createRewardedVideoAd({
165
+          adUnitId: 'adunit-5cc4270e78bbcf35'
166
+        });
167
+        videoAd.onLoad(() => {
168
+          
169
+        });
170
+        videoAd.onError((err) => {
171
+          console.error('激励视频光告加载失败', err)
172
+        });
173
+        videoAd.onClose((res) => {
174
+          console.log(res);
175
+          if (res.isEnded){
176
+            that.setData({
177
+              ShowLoading: true,
178
+              BtnText: "全部保存到相册",
179
+            });
180
+            wx.hideLoading();
181
+            arrAnswerID = [];
182
+            tempAnswerList = [];
183
+            that.getAnswerID();
184
+            if (that.data.ID > 0) {
185
+              that.getList(that.data.ID);
186
+            } else {
187
+              that.getErrorList();
188
+            }
189
+        
190
+            that.closeHelp();
191
+          }
192
+          else{
193
+            wx.showToast({
194
+              title: '请播放完广告',
195
+            });
196
+          }
197
+        });
198
+      }
151
 
199
 
152
-    this.closeHelp();
200
+      // 用户触发广告后,显示激励视频广告
201
+      if (videoAd) {
202
+        videoAd.show().catch(() => {
203
+          // 失败重试
204
+          videoAd.load()
205
+            .then(() => videoAd.show())
206
+            .catch(err => {
207
+              console.error('激励视频 广告显示失败', err)
208
+            });
209
+        });
210
+      }
211
+    }
212
+
213
+    
153
   },
214
   },
154
   //重新生成试卷
215
   //重新生成试卷
155
   ResetFinish: function () {
216
   ResetFinish: function () {

+ 9 - 6
pages/main/detail.wxml

@@ -59,6 +59,9 @@
59
 
59
 
60
       <view class="text5">每张含 {{PageCount}} 道题目</view>
60
       <view class="text5">每张含 {{PageCount}} 道题目</view>
61
 
61
 
62
+      <view class="panel11 FlexColumn" wx:if="{{IsMember==0}}">
63
+        <view>说明:看15秒广告免费出题一次。</view>
64
+      </view>
62
       <view class="btnStart" bindtap='getFinish'>
65
       <view class="btnStart" bindtap='getFinish'>
63
         <view class="btnStart1">
66
         <view class="btnStart1">
64
           出题
67
           出题
@@ -71,11 +74,11 @@
71
 
74
 
72
       <image class="error2 universalpic_indicator_cell_size01" src="../images/universalpic_indicator_cell_size01.png" />
75
       <image class="error2 universalpic_indicator_cell_size01" src="../images/universalpic_indicator_cell_size01.png" />
73
       <view class="panel10 FlexRow" bindtap='gotoError'>
76
       <view class="panel10 FlexRow" bindtap='gotoError'>
74
-          <view class="error3 btnSelect">
75
-            {{QuestionTypeItem.ErrorList.length}}道
76
-          </view>
77
-          <view class="btnAddSub"></view>
77
+        <view class="error3 btnSelect">
78
+          {{QuestionTypeItem.ErrorList.length}}道
78
         </view>
79
         </view>
80
+        <view class="btnAddSub"></view>
81
+      </view>
79
       
82
       
80
       <view class="btnStart0 btnStart" bindtap='getFinish'>
83
       <view class="btnStart0 btnStart" bindtap='getFinish'>
81
         <view class="btnStart1">
84
         <view class="btnStart1">
@@ -83,7 +86,8 @@
83
         </view>
86
         </view>
84
       </view>
87
       </view>
85
     </view>
88
     </view>
86
-    <view style='height:230rpx'></view>
89
+    <view class="panel3"></view>
90
+    <ad-custom class="ad_02" unit-id="adunit-b54dfbcc0a0197c0" bindload="adLoad" binderror="adError" bindclose="adClose"></ad-custom>
87
   </block>
91
   </block>
88
 
92
 
89
   <block wx:if="{{IsFinished}}">
93
   <block wx:if="{{IsFinished}}">
@@ -147,7 +151,6 @@
147
       <view class="panel FlexRow" bindtap='closeMenu'>
151
       <view class="panel FlexRow" bindtap='closeMenu'>
148
         <view>取消</view>
152
         <view>取消</view>
149
       </view>
153
       </view>
150
-
151
     </view>
154
     </view>
152
   </view>
155
   </view>
153
 </view>
156
 </view>

+ 28 - 8
pages/main/detail.wxss

@@ -88,7 +88,6 @@
88
 
88
 
89
 .panel1 {
89
 .panel1 {
90
   width: 680rpx;
90
   width: 680rpx;
91
-  height: 782rpx;
92
   background-color: #262626;
91
   background-color: #262626;
93
   margin-top: -30rpx;
92
   margin-top: -30rpx;
94
   z-index: 10;
93
   z-index: 10;
@@ -136,12 +135,12 @@
136
   color:#D2D2D2;
135
   color:#D2D2D2;
137
   text-align: center;
136
   text-align: center;
138
   line-height: 90rpx;
137
   line-height: 90rpx;
139
-  margin-top: 15rpx;
138
+  margin-top: -10rpx;
140
 }
139
 }
141
 .universalpic_line_dashed_size01{
140
 .universalpic_line_dashed_size01{
142
   width:634rpx;
141
   width:634rpx;
143
   height:4rpx;
142
   height:4rpx;
144
-  margin-top: 52rpx;
143
+  margin-top: 45rpx;
145
 }
144
 }
146
 
145
 
147
 .panel1 .text4{
146
 .panel1 .text4{
@@ -192,12 +191,12 @@
192
 .panel1 .Number{
191
 .panel1 .Number{
193
   color:#D2D2D2;
192
   color:#D2D2D2;
194
   font-size: 36rpx;
193
   font-size: 36rpx;
195
-  margin-top: 10rpx;
194
+  margin-top: -30rpx;
196
 }
195
 }
197
 
196
 
198
 .panel1 .text5{
197
 .panel1 .text5{
199
   font-size:24rpx;
198
   font-size:24rpx;
200
-  margin-top: 30rpx;
199
+  margin-top: 10rpx;
201
   color:#868686;
200
   color:#868686;
202
   font-weight: 400;
201
   font-weight: 400;
203
 }
202
 }
@@ -205,15 +204,15 @@
205
 
204
 
206
 .btnStart {
205
 .btnStart {
207
   width: 680rpx;
206
   width: 680rpx;
208
-  height: 200rpx;
207
+  height:150rpx;
209
   background-color: #7D2B25;
208
   background-color: #7D2B25;
210
   border-bottom-left-radius: 40rpx;
209
   border-bottom-left-radius: 40rpx;
211
   border-bottom-right-radius: 40rpx;
210
   border-bottom-right-radius: 40rpx;
212
   position: relative;
211
   position: relative;
213
-  margin-top: 80rpx;
212
+  margin-top: 30rpx;
214
 }
213
 }
215
 .btnStart0 {
214
 .btnStart0 {
216
-  height: 170rpx;
215
+  height: 150rpx;
217
 }
216
 }
218
 
217
 
219
 .btnStart1 {
218
 .btnStart1 {
@@ -574,3 +573,24 @@
574
   bottom: 0rpx;
573
   bottom: 0rpx;
575
   z-index: 100;
574
   z-index: 100;
576
 }
575
 }
576
+
577
+.panel11{
578
+  width: 640rpx;
579
+  height:92rpx;
580
+  margin: 60rpx 0 0 0;
581
+  background: #4D4D4D;
582
+  border-radius: 20rpx;
583
+  font-size: 28rpx;
584
+  color: #D2D2D2;
585
+}
586
+
587
+.panel3{
588
+  width: 100%;
589
+  height:20rpx;
590
+  background-color: #262626;
591
+  margin: 80rpx 0 0 0;
592
+}
593
+
594
+.ad_02{
595
+  width:750rpx;
596
+}