chengjie лет назад: 6
Родитель
Сommit
dcf022184a

+ 2 - 2
app.js

@@ -26,8 +26,8 @@ App({
26
     }
26
     }
27
   },
27
   },
28
   globalData: {
28
   globalData: {
29
-    version: "1.1.9",
30
-    IsProduction: false,
29
+    version: "1.1.10",
30
+    IsProduction: true,
31
     ProgramID: 105,
31
     ProgramID: 105,
32
     AppID: "wx1fef080f74481cbd",
32
     AppID: "wx1fef080f74481cbd",
33
     ProgramName: "数学计算题",
33
     ProgramName: "数学计算题",

+ 1 - 0
app.json

@@ -17,6 +17,7 @@
17
     "navigationBarTitleText": "数学计算题",
17
     "navigationBarTitleText": "数学计算题",
18
     "navigationBarTextStyle": "black",
18
     "navigationBarTextStyle": "black",
19
     "backgroundColor": "#000000",
19
     "backgroundColor": "#000000",
20
+    "resizable": false,
20
     "enablePullDownRefresh": false
21
     "enablePullDownRefresh": false
21
   },
22
   },
22
   "navigateToMiniProgramAppIdList": [
23
   "navigateToMiniProgramAppIdList": [

BIN
pages/images/02024.png


BIN
pages/images/home_banner_footer600.png


BIN
pages/images/home_banner_header_jst.png


BIN
pages/images/home_banner_window.png


+ 38 - 0
pages/main/default.js

@@ -6,6 +6,7 @@ var code;
6
 var imageIndex = 0;
6
 var imageIndex = 0;
7
 var arrBuildImageSource = [];
7
 var arrBuildImageSource = [];
8
 var arrBuildImageTarget = [];
8
 var arrBuildImageTarget = [];
9
+var isMiaoguoADShow = false;
9
 
10
 
10
 Page({
11
 Page({
11
   data: {
12
   data: {
@@ -16,6 +17,8 @@ Page({
16
     AvatarUrl: "",
17
     AvatarUrl: "",
17
     IsAccredit: false,
18
     IsAccredit: false,
18
     IsExit: false,
19
     IsExit: false,
20
+    IsMiaoguoAD: false,
21
+    IsMiaoguoAD2: 0,
19
   },
22
   },
20
   onLoad: function () {
23
   onLoad: function () {
21
     var that = this;
24
     var that = this;
@@ -39,6 +42,7 @@ Page({
39
       }
42
       }
40
     }
43
     }
41
 
44
 
45
+    isMiaoguoADShow = false;
42
   },
46
   },
43
   onUnload: function () {
47
   onUnload: function () {
44
 
48
 
@@ -86,6 +90,21 @@ Page({
86
       }
90
       }
87
     });
91
     });
88
 
92
 
93
+    common.getStorageValue(this, "IsMiaoguoAD", true, function () { });
94
+
95
+    var miaoguoADTime = wx.getStorageSync("miaoguoADTime");
96
+    if (miaoguoADTime) {
97
+      if (this.data.IsShow == 1 && this.data.IsMember == 1 && isMiaoguoADShow && common.formatTime(new Date()) >= miaoguoADTime) {
98
+        this.setData({
99
+          IsMiaoguoAD2: 1,
100
+        });
101
+      }
102
+    }
103
+    else {
104
+      wx.setStorageSync("miaoguoADTime", common.formatTime(common.addDate("d", 1, new Date())));
105
+    }
106
+
107
+    isMiaoguoADShow = true;
89
   },
108
   },
90
   downloadUserAvatar: function () {
109
   downloadUserAvatar: function () {
91
     var avatar = wx.getStorageSync("Avatar");
110
     var avatar = wx.getStorageSync("Avatar");
@@ -118,6 +137,14 @@ Page({
118
     wx.navigateTo({
137
     wx.navigateTo({
119
       url: url
138
       url: url
120
     });
139
     });
140
+
141
+    if (e.currentTarget.dataset.id == "topAD") {
142
+      this.setData({
143
+        IsMiaoguoAD2: 0,
144
+      });
145
+      wx.setStorageSync('IsMiaoguoAD', false);
146
+      wx.setStorageSync("miaoguoADTime", common.formatTime(common.addDate("d", 15, new Date())));
147
+    }
121
   },
148
   },
122
   gotoHelp: function () {
149
   gotoHelp: function () {
123
     wx.redirectTo({
150
     wx.redirectTo({
@@ -220,6 +247,17 @@ Page({
220
     });
247
     });
221
 
248
 
222
   },
249
   },
250
+  close: function (e) {
251
+    this.setData({
252
+      IsMiaoguoAD2: 0,
253
+    });
254
+    var num = e.currentTarget.dataset.num;
255
+    if (num > 0) {
256
+      var time = common.addDate("d", Number(num), new Date());
257
+      time = common.formatTime(time);
258
+      wx.setStorageSync("miaoguoADTime", time);
259
+    }
260
+  },
223
   onShareAppMessage: function () {
261
   onShareAppMessage: function () {
224
     return {
262
     return {
225
       title: app.globalData.ShareTitle,
263
       title: app.globalData.ShareTitle,

+ 34 - 15
pages/main/default.wxml

@@ -1,11 +1,13 @@
1
 <view class="container FlexColumn" style="min-height:{{Containnerheight}}rpx;">
1
 <view class="container FlexColumn" style="min-height:{{Containnerheight}}rpx;">
2
-  <scroll-view class="scroll-view_H" scroll-x>
3
-    <image class="homepage_headline_illus" src="../images/homepage_headline_illus.png" />
4
-    <scroll-view scroll-y class="scrollview">
5
-      <image class="homepage_headline_info" src="../images/homepage_headline_info.png" />
2
+  <view class="index0 FlexColumn">
3
+    <image src='../images/home_banner_header_jst.png' class="home_banner_header_sz" bindtap='goto' data-id="topAD" data-url='../../package4/main/newuser' wx:if="{{IsMiaoguoAD && IsMember==1 && IsShow==1}}" />
4
+    <scroll-view class="scroll-view_H" scroll-x>
5
+      <image class="homepage_headline_illus" src="../images/homepage_headline_illus.png" />
6
+      <scroll-view scroll-y class="scrollview">
7
+        <image class="homepage_headline_info" src="../images/homepage_headline_info.png" />
8
+      </scroll-view>
6
     </scroll-view>
9
     </scroll-view>
7
-  </scroll-view>
8
-
10
+  </view>
9
   <view class="panel FlexColumn">
11
   <view class="panel FlexColumn">
10
 
12
 
11
     <view class="line1"></view>
13
     <view class="line1"></view>
@@ -49,14 +51,14 @@
49
               </view>
51
               </view>
50
               <view class="line4 line3"></view>
52
               <view class="line4 line3"></view>
51
               <view class="panel002000 FlexRow">
53
               <view class="panel002000 FlexRow">
52
-                <view class="btn" bindtap='gotoErrorList'>
53
-                  <view class="btn1">
54
+                <view class="btn0" bindtap='gotoErrorList'>
55
+                  <view class="btn10">
54
                     错题集
56
                     错题集
55
                   </view>
57
                   </view>
56
                 </view>
58
                 </view>
57
 
59
 
58
-                <view class="btn2 btn" bindtap='gotoAnswer'>
59
-                  <view class="btn3 btn1">
60
+                <view class="btn20 btn0" bindtap='gotoAnswer'>
61
+                  <view class="btn3 btn10">
60
                     对答案
62
                     对答案
61
                   </view>
63
                   </view>
62
                 </view>
64
                 </view>
@@ -75,9 +77,6 @@
75
 
77
 
76
         </view>
78
         </view>
77
         <image class="universalpic_line_zigzag_brown_down" src="../images/universalpic_line_zigzag_brown_down.png" />
79
         <image class="universalpic_line_zigzag_brown_down" src="../images/universalpic_line_zigzag_brown_down.png" />
78
-
79
-        <image wx:if="{{IsShow==1}}" src='../images/homepage_banner.png' class="homepage_banner" bindtap='goto' data-url="../../package4/main/newuser" />
80
-
81
         <image class="universalpic_line_zigzag_brown_up" src="../images/universalpic_line_zigzag_brown_up.png" />
80
         <image class="universalpic_line_zigzag_brown_up" src="../images/universalpic_line_zigzag_brown_up.png" />
82
         <view class="panel003 circularBottom FlexColumn">
81
         <view class="panel003 circularBottom FlexColumn">
83
           <view class="panel0030 FlexRow">
82
           <view class="panel0030 FlexRow">
@@ -91,8 +90,8 @@
91
                 <view bindtap='gotoFeedback'>合作</view>
90
                 <view bindtap='gotoFeedback'>合作</view>
92
               </view>
91
               </view>
93
             </view>
92
             </view>
94
-            <button class="btn4 btn" open-type="share">
95
-              <view class="btn5 btn1 FlexColumn">
93
+            <button class="btn4 btn0" open-type="share">
94
+              <view class="btn5 btn10 FlexColumn">
96
                 <image class="universalpic_share_size01" src="../images/universalpic_share_size01.png" />
95
                 <image class="universalpic_share_size01" src="../images/universalpic_share_size01.png" />
97
                 <view>分享</view>
96
                 <view>分享</view>
98
               </view>
97
               </view>
@@ -116,14 +115,34 @@
116
               <view class="line"></view>
115
               <view class="line"></view>
117
 
116
 
118
             </block>
117
             </block>
118
+            <view class="index5 FlexColumn" wx:if="{{IsShow==1}}">
119
+              <image src='../images/home_banner_footer600.png' class="home_banner" bindtap='goto' data-url='../../package4/main/newuser' />
120
+            </view>
119
           </view>
121
           </view>
120
         </view>
122
         </view>
123
+
124
+        <view style="height:100rpx;width:100%"></view>
121
       </view>
125
       </view>
122
     </view>
126
     </view>
123
   </view>
127
   </view>
124
 </view>
128
 </view>
125
 <image hidden="{{HelpHidden1}}" bindtap='closeHelp' class="Help_aside_homepage" src="../images/Help_aside_homepage.png" />
129
 <image hidden="{{HelpHidden1}}" bindtap='closeHelp' class="Help_aside_homepage" src="../images/Help_aside_homepage.png" />
126
 
130
 
131
+<view class="HelpInfo2 FlexColumn" style='height:{{Containnerheight}}rpx;' wx:if="{{IsMiaoguoAD2==1}}">
132
+  <view class="btn" bindtap='goto' data-url='../../package4/main/newuser' data-id="topAD">
133
+    <view class="btn1 FlexColumn">
134
+      <image src='../images/home_banner_window.png' class="home_banner_window" />
135
+      <view class="btn2">了解一下</view>
136
+    </view>
137
+  </view>
138
+  <view class="close2 FlexColumn" bindtap='close' data-num="1">
139
+    以后再看
140
+  </view>
141
+  <view class="close FlexColumn" bindtap='close' data-num="0">
142
+    <image src='../images/02024.png' class="closeImage" />
143
+  </view>
144
+</view>
145
+
127
 <audio hidden='true' id="myAudio"></audio>
146
 <audio hidden='true' id="myAudio"></audio>
128
 <canvas class='Canvas' canvas-id="MyCanvas"></canvas>
147
 <canvas class='Canvas' canvas-id="MyCanvas"></canvas>
129
 
148
 

+ 101 - 8
pages/main/default.wxss

@@ -1,9 +1,20 @@
1
+page{
2
+  background-color: #583027;
3
+}
1
 .container {
4
 .container {
2
   background-color: #583027;
5
   background-color: #583027;
3
   justify-content: flex-start;
6
   justify-content: flex-start;
4
   font-weight: 500;
7
   font-weight: 500;
5
 }
8
 }
6
 
9
 
10
+.index0{
11
+  width:100%;
12
+}
13
+.home_banner_header_sz{
14
+  width:100%;
15
+  height:150rpx;
16
+}
17
+
7
 .scroll-view_H {
18
 .scroll-view_H {
8
   width: 100%;
19
   width: 100%;
9
   height: 460rpx;
20
   height: 460rpx;
@@ -31,7 +42,6 @@
31
 .panel {
42
 .panel {
32
   width: 100%;
43
   width: 100%;
33
   background-color: #583027;
44
   background-color: #583027;
34
-  height: 2654rpx;
35
   justify-content: flex-start;
45
   justify-content: flex-start;
36
 }
46
 }
37
 
47
 
@@ -58,7 +68,6 @@
58
 
68
 
59
 .panel00 {
69
 .panel00 {
60
   width: 680rpx;
70
   width: 680rpx;
61
-  height: 2534rpx;
62
   justify-content: flex-start;
71
   justify-content: flex-start;
63
 }
72
 }
64
 
73
 
@@ -220,7 +229,7 @@
220
   font-weight: 600;
229
   font-weight: 600;
221
 }
230
 }
222
 
231
 
223
-.btn {
232
+.btn0 {
224
   width: 208rpx;
233
   width: 208rpx;
225
   height: 90rpx;
234
   height: 90rpx;
226
   background-color: #98492F;
235
   background-color: #98492F;
@@ -231,11 +240,11 @@
231
 }
240
 }
232
 
241
 
233
 
242
 
234
-.btn::after {
243
+.btn0::after {
235
   border: 0px;
244
   border: 0px;
236
 }
245
 }
237
 
246
 
238
-.btn1 {
247
+.btn10 {
239
   width: 100%;
248
   width: 100%;
240
   height: 70rpx;
249
   height: 70rpx;
241
   background-color: #D0603B;
250
   background-color: #D0603B;
@@ -246,7 +255,7 @@
246
   font-size: 32rpx;
255
   font-size: 32rpx;
247
 }
256
 }
248
 
257
 
249
-.btn2 {
258
+.btn20 {
250
   background-color: #315982;
259
   background-color: #315982;
251
   margin-left: 14rpx;
260
   margin-left: 14rpx;
252
 }
261
 }
@@ -291,7 +300,6 @@
291
 
300
 
292
 .panel003 {
301
 .panel003 {
293
   width: 100%;
302
   width: 100%;
294
-  height: 1050rpx;
295
   background-color: #723c30;
303
   background-color: #723c30;
296
   box-shadow: 0px 10px 0px rgba(0, 0, 0, 0.10);
304
   box-shadow: 0px 10px 0px rgba(0, 0, 0, 0.10);
297
   color: #edc1b4;
305
   color: #edc1b4;
@@ -489,4 +497,89 @@
489
   width:100rpx;
497
   width:100rpx;
490
   font-size:36rpx;
498
   font-size:36rpx;
491
   text-align: center;
499
   text-align: center;
492
-}
500
+}
501
+
502
+
503
+.index5{
504
+  width:100%;
505
+  justify-content: flex-start;
506
+}
507
+
508
+.home_banner{
509
+   width:600rpx;
510
+   height:320rpx;
511
+   margin: 40rpx 0 50rpx 0;
512
+}
513
+
514
+.HelpInfo2 {
515
+  position: fixed;
516
+  left: 0;
517
+  top: 0;
518
+  width: 100%;
519
+  background-color: rgba(185, 220, 93, 0.95);
520
+  justify-content: flex-start;
521
+  z-index: 100;
522
+}
523
+
524
+.HelpInfo2 .btn {
525
+  width: 600rpx;
526
+  height: 640rpx;
527
+  background-color: #D2D2D2;
528
+  border-radius: 40rpx;
529
+  margin: 15rpx;
530
+  position: relative;
531
+  margin-top: 222rpx;
532
+  box-shadow: 0 0 30rpx rgba(0, 0, 0, 0.5);
533
+}
534
+
535
+.HelpInfo2 .btn1 {
536
+  width: 100%;
537
+  height: 640rpx;
538
+  border-radius: 40rpx;
539
+  color: #1e1e1e;
540
+  text-align: center;
541
+  font-size: 36rpx;
542
+  justify-content: flex-start;
543
+}
544
+
545
+.HelpInfo2 .home_banner_window {
546
+  width: 600rpx;
547
+  height: 500rpx;
548
+  border-top-left-radius: 40rpx;
549
+  border-top-right-radius: 40rpx;
550
+}
551
+
552
+.HelpInfo2 .btn2 {
553
+  width: 100%;
554
+  height: 120rpx;
555
+  line-height: 120rpx;
556
+  background-color: #F0F0F0;
557
+  color: #1e1e1e;
558
+  text-align: center;
559
+  font-size: 48rpx;
560
+  font-weight: 500;
561
+  border-bottom-left-radius: 40rpx;
562
+  border-bottom-right-radius: 40rpx;
563
+}
564
+.HelpInfo2 .close2 {
565
+  position: fixed;
566
+  bottom:207rpx;
567
+  font-size:26rpx;
568
+  color: #1e1e1e;
569
+  text-decoration: underline;
570
+  font-weight: 500;
571
+  z-index: 100;
572
+  width:100%;
573
+  height:50rpx;
574
+}
575
+.HelpInfo2 .close {
576
+  width: 100%;
577
+  height: 235rpx;
578
+  position: fixed;
579
+  bottom:0;
580
+}
581
+
582
+.HelpInfo2 .closeImage{
583
+  width:33rpx;
584
+  height:33rpx;
585
+}

+ 47 - 0
utils/util.js

@@ -303,6 +303,51 @@ function FormatMoney(money) {
303
   return result;
303
   return result;
304
 }
304
 }
305
 
305
 
306
+
307
+function addDate(interval, number, date) {
308
+  switch (interval.toLowerCase()) {
309
+    case "y":
310
+      return new Date(date.setFullYear(date.getFullYear() + number));
311
+    case "m":
312
+      return new Date(date.setMonth(date.getMonth() + number));
313
+    case "d":
314
+      return new Date(date.setDate(date.getDate() + number));
315
+    case "w":
316
+      return new Date(date.setDate(date.getDate() + 7 * number));
317
+    case "h":
318
+      return new Date(date.setHours(date.getHours() + number));
319
+    case "n":
320
+      return new Date(date.setMinutes(date.getMinutes() + number));
321
+    case "s":
322
+      return new Date(date.setSeconds(date.getSeconds() + number));
323
+    case "l":
324
+      return new Date(date.setMilliseconds(date.getMilliseconds() + number));
325
+  }
326
+}
327
+
328
+function diffDate(interval, date1, date2) {
329
+  var long = date2.getTime() - date1.getTime(); //相差毫秒
330
+  switch (interval.toLowerCase()) {
331
+    case "y":
332
+      return parseInt(date2.getFullYear() - date1.getFullYear());
333
+    case "m":
334
+      return parseInt((date2.getFullYear() - date1.getFullYear()) * 12 + (date2.getMonth() - date1.getMonth()));
335
+    case "d":
336
+      return parseInt(long / 1000 / 60 / 60 / 24);
337
+    case "w":
338
+      return parseInt(long / 1000 / 60 / 60 / 24 / 7);
339
+    case "h":
340
+      return parseInt(long / 1000 / 60 / 60);
341
+    case "n":
342
+      return parseInt(long / 1000 / 60);
343
+    case "s":
344
+      return parseInt(long / 1000);
345
+    case "l":
346
+      return parseInt(long);
347
+  }
348
+}
349
+
350
+
306
 module.exports = {
351
 module.exports = {
307
   formatTime: formatTime,
352
   formatTime: formatTime,
308
   formatDateCHS: formatDateCHS,
353
   formatDateCHS: formatDateCHS,
@@ -323,4 +368,6 @@ module.exports = {
323
   getStorageValue: getStorageValue,
368
   getStorageValue: getStorageValue,
324
   getSystemHeight: getSystemHeight,
369
   getSystemHeight: getSystemHeight,
325
   FormatMoney: FormatMoney,
370
   FormatMoney: FormatMoney,
371
+  addDate: addDate,
372
+  diffDate: diffDate,
326
 }
373
 }