chengjie 3 年之前
父節點
當前提交
6267e203aa
共有 9 個文件被更改,包括 250 次插入61 次删除
  1. 3 3
      app.js
  2. 6 13
      pages/index/index.js
  3. 69 35
      pages/main/default.js
  4. 26 1
      pages/main/default.wxml
  5. 123 0
      pages/main/default.wxss
  6. 4 0
      pages/main/detail.js
  7. 13 5
      pages/other/userbook.js
  8. 3 3
      pages/other/userbook.wxml
  9. 3 1
      utils/main.js

+ 3 - 3
app.js

@@ -1,8 +1,8 @@
1 1
 App({
2 2
   globalData: {
3
-    Version: "2.3.8",
4
-    //IsProduction: true,
5
-    IsProduction: false,
3
+    Version: "2.3.9",
4
+    IsProduction: true,
5
+    //IsProduction: false,
6 6
     ShareTitle: "高效学习从秒过开始",
7 7
     SharePath: "pages/index/index",
8 8
     ShareImage: '../images/program_screenshot_main.png',

+ 6 - 13
pages/index/index.js

@@ -5,8 +5,7 @@ const app = getApp();
5 5
 
6 6
 var timeout1 = 0, timeout3=0;
7 7
 var timeoutRedirect=0;
8
-
9
-
8
+var UserAssociatedID=0;
10 9
 
11 10
 Page({
12 11
   data: {
@@ -19,22 +18,15 @@ Page({
19 18
   },
20 19
   onLoad: function (options) {
21 20
 
22
-    // var interval=null;
23
-    // var index=0;
24
-    // interval = setInterval(function () {
25
-    //   index++;
26
-    //   console.log(index);
27
-    //   if (index>10) {
28
-    //     clearInterval(interval);
29
-    //   }
30
-    // },200);
31
-
32 21
     console.log("Time1:" + new Date().getTime());
33 22
     if (options) {
34 23
       if (options.UserID) {
35 24
         console.log("UserID:" + options.UserID);
36 25
         app.globalData.introducer = options.UserID;
37 26
       }
27
+      if (options.UserAssociatedID)
28
+      UserAssociatedID=options.UserAssociatedID;
29
+
38 30
       if (options.SourceID) {
39 31
         console.log("SourceID:" + options.SourceID);
40 32
         app.globalData.SourceID = options.SourceID;
@@ -211,6 +203,7 @@ Page({
211 203
     main.getLocalHost(function () {
212 204
       main.postData('MiaoguoLogin', {
213 205
         Code: param.Code,
206
+        UserAssociatedID:UserAssociatedID,
214 207
         NickName: param.nickName,
215 208
         Language: param.language,
216 209
         Gender: param.gender,
@@ -256,8 +249,8 @@ Page({
256 249
               isShow = 1;
257 250
             }
258 251
           }
259
-
260 252
           app.globalData.userInfo.IsShow = isShow;
253
+
261 254
           if (app.globalData.userInfo.IsMember == 1)
262 255
             app.globalData.IsLocked = 0;
263 256
 

+ 69 - 35
pages/main/default.js

@@ -18,6 +18,7 @@ Page({
18 18
     AwardDayNumber: 0,
19 19
     IsShowRemind: false,
20 20
     IsShowHelp: false,
21
+    IsShowUserAssociated: 0,
21 22
   },
22 23
   onPullDownRefresh: function () {
23 24
     wx.redirectTo({
@@ -41,6 +42,8 @@ Page({
41 42
       withShareTicket: true,
42 43
       menus: ['shareAppMessage', 'shareTimeline']
43 44
     });
45
+
46
+    that.getUserAssociatedInfo(app.globalData.userInfo.UserID, function (data) {});
44 47
   },
45 48
   onHide: function () {
46 49
     wx.hideLoading();
@@ -343,44 +346,49 @@ Page({
343 346
   },
344 347
   setSelectUser: function (e) {
345 348
     var that = this;
346
-    if (app.globalData.userInfo.UserID == 1 ||
347
-      app.globalData.userInfo.UserID == 2 ||
348
-      app.globalData.userInfo.UserID == 3 ||
349
-      app.globalData.userInfo.UserID == 4) {
350
-      var userid = that.data.ChangeUserID;
351
-      wx.setStorageSync("UserID", userid);
349
+    
350
+      if (app.globalData.userInfo.UserID == 1 ||
351
+        app.globalData.userInfo.UserID == 2 ||
352
+        app.globalData.userInfo.UserID == 3 ||
353
+        app.globalData.userInfo.UserID == 4) {
354
+        var userid = that.data.ChangeUserID;
355
+        wx.setStorageSync("UserID", userid);
356
+
357
+        app.globalData.userInfo.UserID = userid;
358
+        var fieldStr = "";
359
+        that.getUserInfo(userid, fieldStr, function (data) {
360
+          wx.setNavigationBarTitle({
361
+            title: data.NickName
362
+          });
363
+          main.getUserConfig();
364
+          app.globalData.userInfo.ProductServiceTime = data.ProductServiceTime;
352 365
 
353
-      app.globalData.userInfo.UserID = userid;
354
-      var fieldStr = "";
355
-      that.getUserInfo(userid, fieldStr, function (data) {
356
-        wx.setNavigationBarTitle({
357
-          title: data.NickName
358
-        });
359
-        main.getUserConfig();
360
-        app.globalData.userInfo.ProductServiceTime = data.ProductServiceTime;
366
+          if (app.globalData.userInfo.UserID != 2) {
367
+            app.globalData.userInfo.NickName = data.NickName;
368
+            app.globalData.userInfo.AvatarUrl = data.AvatarUrl;
369
+          }
370
+          if (data.IsPromoter > 0) {
371
+            app.globalData.userInfo.IsPromoter = data.IsPromoter;
372
+            app.globalData.userInfo.PromotionLimitDays = data.PromotionLimitDays;
373
+            app.globalData.userInfo.PromotionLimitTime = data.PromotionLimitTime;
374
+            app.globalData.userInfo.WXServiceCharge = data.WXServiceCharge;
375
+            app.globalData.userInfo.IndividualIncomeTax = data.IndividualIncomeTax;
376
+            app.globalData.userInfo.WXAccount = data.WXAccount;
377
+            app.globalData.userInfo.RealName = data.RealName;
378
+            app.globalData.userInfo.IntroducerNickName = data.IntroducerNickName;
379
+            app.globalData.userInfo.IntroducerAvatarUrl = data.IntroducerAvatarUrl;
380
+          }
361 381
 
362
-        if (app.globalData.userInfo.UserID != 2) {
363
-          app.globalData.userInfo.NickName = data.NickName;
364
-          app.globalData.userInfo.AvatarUrl = data.AvatarUrl;
365
-        }
366
-        if (data.IsPromoter > 0) {
367
-          app.globalData.userInfo.IsPromoter = data.IsPromoter;
368
-          app.globalData.userInfo.PromotionLimitDays = data.PromotionLimitDays;
369
-          app.globalData.userInfo.PromotionLimitTime = data.PromotionLimitTime;
370
-          app.globalData.userInfo.WXServiceCharge = data.WXServiceCharge;
371
-          app.globalData.userInfo.IndividualIncomeTax = data.IndividualIncomeTax;
372
-          app.globalData.userInfo.WXAccount = data.WXAccount;
373
-          app.globalData.userInfo.RealName = data.RealName;
374
-          app.globalData.userInfo.IntroducerNickName = data.IntroducerNickName;
375
-          app.globalData.userInfo.IntroducerAvatarUrl = data.IntroducerAvatarUrl;
376
-        }
377
-      });
382
+          that.getUserAssociatedInfo(app.globalData.userInfo.UserID, function (data) {});
378 383
 
379
-      that.setData({
380
-        IsShowUserID: false,
381
-      });
382
-      that.onShow();
383
-    }
384
+        });
385
+
386
+        that.setData({
387
+          IsShowUserID: false,
388
+        });
389
+        that.onShow();
390
+      }
391
+    
384 392
   },
385 393
   getUserInfoFunction: function (e) {
386 394
     var that = this;
@@ -414,6 +422,22 @@ Page({
414 422
       }
415 423
     });
416 424
   },
425
+  //得到用户关联列表
426
+  getUserAssociatedInfo: function (userID, callback) {
427
+    var that = this;
428
+    var url = "GetUserAssociated?UserID=" + userID+"&IsWeb=false";
429
+    main.getData(url, function (data) {
430
+      if (data) {
431
+        that.setData({
432
+          IsShowUserAssociated: 1,
433
+          UserAssociatedNickName: common.getStringMaxLength(app.globalData.userInfo.NickName,12),
434
+          UserAssociatedAvatar: app.globalData.userInfo.AvatarUrl,
435
+          UserAssociated: data,
436
+          ChildUserID:app.globalData.userInfo.ChildUserID,
437
+        });
438
+      }
439
+    });
440
+  },
417 441
   selectPayItem: function (e) {
418 442
     var that = this;
419 443
     var id = e.currentTarget.dataset.id;
@@ -481,6 +505,16 @@ Page({
481 505
     //判断每30天是否是高级模式
482 506
     wx.removeStorageSync('IsShowPatternMenu');
483 507
   },
508
+  showUserAssociated: function () {
509
+    this.setData({
510
+      IsShowUserAssociated: 2,
511
+    });
512
+  },
513
+  closeUserAssociated: function () {
514
+    this.setData({
515
+      IsShowUserAssociated: 1,
516
+    });
517
+  },
484 518
   setVersionStart: function (e) {
485 519
     var flag = e.currentTarget.dataset.flag;
486 520
     var versionid = e.currentTarget.dataset.versionid;

+ 26 - 1
pages/main/default.wxml

@@ -10,6 +10,12 @@
10 10
     </view>
11 11
   </view>
12 12
 
13
+  <view wx:if="{{IsShowUserAssociated>=1 && !ChildUserID}}" class="UserAssociated{{IsIPad}} FlexRow" bindtap="showUserAssociated">
14
+    <image class="UserAssociatedAvatar" src="{{UserAssociatedAvatar}}" ></image>
15
+    <view class="UserAssociatedNickName">{{UserAssociatedNickName}}</view>
16
+    <image class="icon_nextpage_2" src="../images/icon_nextpage_2.png" ></image>
17
+  </view>
18
+
13 19
   <image class="message_practise_index_01{{IsIPad}}" src='../images/message_practise_index_01.png' wx:if="{{IsShowSettingRemind}}" />
14 20
   <image wx:if="{{TodayTaskNumber>0 && IsStart==1}}" class="study_index_start{{IsIPad}}" src='../images/practise_index_start.png' bindtap="goto" data-url="./detail?CardType={{CardType}}" />
15 21
   <image wx:if="{{TodayTaskNumber>0 && IsStart==0}}" class="study_index_start{{IsIPad}}" src='../images/practise_index_goon.png' bindtap="goto" data-url="./detail?CardType={{CardType}}" />
@@ -98,7 +104,7 @@
98 104
     </view>
99 105
 </view>
100 106
 
101
-<view  wx:if="{{IsShowRemind}}" class="IsRemindContainer container FlexColumn" style='height:{{Containnerheight}}rpx;'>
107
+<view wx:if="{{IsShowRemind}}" class="IsRemindContainer container FlexColumn" style='height:{{Containnerheight}}rpx;'>
102 108
   <view class="IsRemindPanel FlexColumn">
103 109
     <text class="IsRemindText1">延长有效期\n的好办法</text>
104 110
     <text class="IsRemindText2">一口气增加120天\n上不封顶等您来拿</text>
@@ -125,3 +131,22 @@
125 131
   </view>
126 132
 </view>
127 133
 
134
+<view wx:if="{{IsShowUserAssociated==2}}" class="IsRemindContainer container FlexColumn" style='height:{{Containnerheight}}rpx;'>
135
+  <view class="IsRemindPanel2{{IsIPad}} FlexColumn">
136
+    <view class="text7">切换续费主帐户</view>
137
+    <view class="IsRemindPanel20 FlexRow">
138
+      <view class="IsRemindPanel201 FlexColumn">
139
+        <image class="UserAssociatedAvatar2" src="{{UserAssociatedAvatar}}"></image>
140
+        <text class="text8">{{UserAssociatedNickName}}</text>
141
+
142
+        <view class="text10">使用中</view>
143
+      </view>
144
+      <view class="IsRemindPanel201 FlexColumn" wx:for="{{UserAssociated}}" wx:key="*this" catchtap="gotoReLaunch" data-url="../index/index?UserAssociatedID={{item.UserID}}">
145
+        <image class="UserAssociatedAvatar2" src="{{item.AvatarUrl}}"></image>
146
+        <text class="text8">{{item.NickName}}</text>
147
+      </view>
148
+    </view>
149
+    <view class="text9">修改切换帐号请微信天乐 changyibzr</view>
150
+    <image class="practise_index_board_close" src="../images/practise_index_board_close.png" catchtap="closeUserAssociated"></image>
151
+  </view>
152
+</view>

+ 123 - 0
pages/main/default.wxss

@@ -452,3 +452,126 @@ page{
452 452
   padding-left: 20rpx;
453 453
 }
454 454
 
455
+.UserAssociated{
456
+  position: fixed;
457
+  top:397rpx;
458
+  height: 80rpx;
459
+  border-radius: 40rpx;
460
+  background-color: #2a4a9f;
461
+  justify-content: space-between;
462
+}
463
+
464
+.UserAssociated_iPad{
465
+  position: fixed;
466
+  top:282rpx;
467
+  height: 80rpx;
468
+  border-radius: 40rpx;
469
+  background-color: #2a4a9f;
470
+  justify-content: space-between;
471
+}
472
+
473
+.UserAssociatedAvatar{
474
+  width:60rpx;
475
+  height:60rpx;
476
+  margin-left: 10rpx;
477
+  border-radius: 50%;
478
+}
479
+
480
+.UserAssociatedNickName{
481
+  color:#fff;
482
+  font-size: 28rpx;
483
+  margin: 0 20rpx;
484
+}
485
+
486
+.icon_nextpage_2{
487
+  width:16rpx;
488
+  height:26rpx;
489
+  margin-right: 30rpx;
490
+}
491
+
492
+
493
+.IsRemindPanel2{
494
+  width:660rpx;
495
+  height:520rpx;
496
+  margin-top: 270rpx;
497
+  border-radius: 40rpx;
498
+  background-color: #222D4C;
499
+  justify-content: flex-start;
500
+  position: relative;
501
+}
502
+
503
+.IsRemindPanel2_iPad{
504
+  width:660rpx;
505
+  height:520rpx;
506
+  margin-top: 170rpx;
507
+  border-radius: 40rpx;
508
+  background-color: #222D4C;
509
+  justify-content: flex-start;
510
+  position: relative;
511
+}
512
+
513
+.text7{
514
+  font-size: 36rpx;
515
+  color: #F0F0F0;
516
+  letter-spacing: 0;
517
+  margin-top: 60rpx;
518
+}
519
+
520
+.IsRemindPanel20{
521
+  width:480rpx;
522
+  justify-content: space-around;
523
+  margin-top: 50rpx;
524
+}
525
+
526
+.IsRemindPanel201{
527
+  height:300rpx;
528
+  justify-content: flex-start;
529
+  position: relative;
530
+}
531
+
532
+.UserAssociatedAvatar2{
533
+  width:120rpx;
534
+  height:120rpx;
535
+  border-radius: 50%;
536
+  background-color: #fff;
537
+}
538
+
539
+.text8{
540
+  width:120rpx;
541
+  font-size: 24rpx;
542
+  color: #FFFFFF;
543
+  text-align: center;
544
+  margin-top: 25rpx;
545
+}
546
+
547
+.text9{
548
+  font-size: 22rpx;
549
+  color: #5282FA;
550
+  letter-spacing: 0;
551
+  text-align: center;
552
+}
553
+
554
+.text10{
555
+  background: #FE6659;
556
+  border-radius: 10rpx;
557
+  font-size: 20rpx;
558
+  color: #F0F0F0;
559
+  letter-spacing: 0;
560
+  width:80rpx;
561
+  height:40rpx;
562
+  border-radius: 10rpx;
563
+  position: absolute;
564
+  top:80rpx;
565
+  text-align: center;
566
+  line-height: 40rpx;
567
+  z-index: 20;
568
+}
569
+
570
+.practise_index_board_close{
571
+  width:70rpx;
572
+  height:70rpx;
573
+  position: absolute;
574
+  top:30rpx;
575
+  right:30rpx;
576
+  z-index: 10;
577
+}

+ 4 - 0
pages/main/detail.js

@@ -504,6 +504,8 @@ Page({
504 504
     if (listTaskFinished.length > 0) {
505 505
       var card = listTaskFinished.pop();
506 506
       wx.setStorageSync("ListTaskFinished", listTaskFinished);
507
+      wx.setStorageSync("ListTaskFinishedUserID", app.globalData.userInfo.UserID);
508
+      
507 509
 
508 510
       timeHistory = 0;
509 511
       that.timeCompute();
@@ -739,6 +741,8 @@ Page({
739 741
         }
740 742
 
741 743
         wx.setStorageSync("ListTaskFinished", listTaskFinished);
744
+        wx.setStorageSync("ListTaskFinishedUserID", app.globalData.userInfo.UserID);
745
+      
742 746
         TaskList.shift();
743 747
 
744 748
       }

+ 13 - 5
pages/other/userbook.js

@@ -71,8 +71,6 @@ Page({
71 71
     }
72 72
     that.setData({
73 73
       Containnerheight: main.getWindowHeight(),
74
-      NickName: app.globalData.userInfo.NickName,
75
-      AvatarUrl: app.globalData.userInfo.AvatarUrl,
76 74
       ProductServiceTime: productServiceTime,
77 75
       EndDate: endDate,
78 76
       ArrInformation: arr,
@@ -82,6 +80,7 @@ Page({
82 80
       IsLoseEfficacy: app.globalData.userInfo.IsLoseEfficacy,
83 81
       ClassTotalDayNumber: app.globalData.userInfo.ClassTotalDayNumber,
84 82
       ChildUserID: app.globalData.userInfo.ChildUserID,
83
+      MainUserID: app.globalData.userInfo.MainUserID,
85 84
       UserID:app.globalData.userInfo.UserID,
86 85
     });
87 86
 
@@ -134,6 +133,13 @@ Page({
134 133
       });
135 134
     }
136 135
   },
136
+  onShow:function(){
137
+    var that=this;
138
+    that.setData({
139
+      NickName: app.globalData.userInfo.NickName,
140
+      AvatarUrl: app.globalData.userInfo.AvatarUrl,
141
+    });
142
+  },
137 143
   goto: function (e) {
138 144
     var url = e.currentTarget.dataset.url;
139 145
     wx.navigateTo({
@@ -146,9 +152,11 @@ Page({
146 152
     })
147 153
   },
148 154
   updateMember: function () {
149
-    wx.navigateTo({
150
-      url: '../index/accredit',
151
-    });
155
+    if (!this.data.ChildUserID && this.data.UserID==this.data.MainUserID){
156
+      wx.navigateTo({
157
+        url: '../index/accredit',
158
+      });
159
+    }
152 160
   },
153 161
   onShareAppMessage: function () {
154 162
     return {

+ 3 - 3
pages/other/userbook.wxml

@@ -32,12 +32,12 @@
32 32
         <view>优惠券</view>
33 33
       </view>
34 34
 
35
-      <view class="panel21 FlexColumn" bindtap="goto" data-url="../other/pay?PayUserID={{UserID}}&PayType=6" wx:if="{{ClassDayNumber>=ClassTotalDayNumber && (IsPay==0 || IsLoseEfficacy==1) && !ChildUserID }}">
35
+      <view class="panel21 FlexColumn" bindtap="goto" data-url="../other/pay?PayUserID={{UserID}}&PayType=6" wx:if="{{ClassDayNumber>=ClassTotalDayNumber && (IsPay==0 || IsLoseEfficacy==1) && !ChildUserID && MainUserID==UserID }}">
36 36
         <image class="usermanual_index_handshake" src='../images/usermanual_index_wallet.png' />
37 37
         <view>去续费</view>
38 38
       </view>
39 39
       
40
-      <view class="panel21 FlexColumn" bindtap="goto" data-url="../other/pay?PayUserID={{UserID}}&PayType=6&EndDate={{EndDate}}" wx:if="{{ClassDayNumber>=ClassTotalDayNumber && (IsPay==1 && !IsLoseEfficacy) && !ChildUserID }}">
40
+      <view class="panel21 FlexColumn" bindtap="goto" data-url="../other/pay?PayUserID={{UserID}}&PayType=6&EndDate={{EndDate}}" wx:if="{{ClassDayNumber>=ClassTotalDayNumber && (IsPay==1 && !IsLoseEfficacy) && !ChildUserID && MainUserID==UserID }}">
41 41
         <image class="usermanual_index_handshake" src='../images/usermanual_index_wallet.png' />
42 42
         <view>去续费</view>
43 43
       </view>
@@ -52,7 +52,7 @@
52 52
         <view>推广计划</view>
53 53
       </view>
54 54
 
55
-      <view class="panel21 FlexColumn" bindtap="goto" data-url="./binding"  wx:if="{{!ChildUserID}}">
55
+      <view class="panel21 FlexColumn" bindtap="goto" data-url="./binding"  wx:if="{{!ChildUserID && MainUserID==UserID}}">
56 56
         <image class="usermanual_index_handshake" src='../images/usermanual_index_link.png' />
57 57
         <view>帐号绑定</view>
58 58
       </view>

+ 3 - 1
utils/main.js

@@ -625,7 +625,8 @@ function UpdateMiaoguoCardTodayAll(isShowLoading, callback) {
625 625
       obj.LastTime = list[i].LastTime;
626 626
       arr.push(obj);
627 627
     }
628
-    that.postData('UpdateMiaoguoCardTodayAll?UserID=' + app.globalData.userInfo.UserID, {
628
+    var userid=wx.getStorageSync("ListTaskFinishedUserID");
629
+    that.postData('UpdateMiaoguoCardTodayAll?UserID=' + userid, {
629 630
       List: arr,
630 631
     }, function (data) {
631 632
       if (isShowLoading) {
@@ -634,6 +635,7 @@ function UpdateMiaoguoCardTodayAll(isShowLoading, callback) {
634 635
       }
635 636
       if (data) {
636 637
         wx.removeStorageSync("ListTaskFinished");
638
+        wx.removeStorageSync("ListTaskFinishedUserID");
637 639
       }
638 640
       if (callback) {
639 641
         callback();