chengjie преди 3 години
родител
ревизия
961940c2f2

Файловите разлики са ограничени, защото са твърде много
+ 2 - 1
app.js


+ 2 - 3
app.json

@@ -1,6 +1,5 @@
1 1
 {
2 2
   "pages": [
3
-
4 3
     "pages/index/index",
5 4
 
6 5
     "pages/share/cardlist",
@@ -40,8 +39,8 @@
40 39
 
41 40
     "pages/plan/studyplan",
42 41
     "pages/plan/studyplandetail",
43
-    
44
-    
42
+        
43
+    "pages/other/family",
45 44
     "pages/other/recover",
46 45
     "pages/other/video",
47 46
     "pages/other/menu",

BIN
pages/images/icon_fold_3.png


BIN
pages/images/icon_fold_4.png


+ 13 - 4
pages/index/index.js

@@ -5,7 +5,7 @@ const app = getApp();
5 5
 
6 6
 var timeout1 = 0, timeout3=0;
7 7
 var timeoutRedirect=0;
8
-var UserAssociatedID=0;
8
+var UserFamilyID=0;
9 9
 
10 10
 Page({
11 11
   data: {
@@ -24,8 +24,8 @@ Page({
24 24
         console.log("UserID:" + options.UserID);
25 25
         app.globalData.introducer = options.UserID;
26 26
       }
27
-      if (options.UserAssociatedID)
28
-      UserAssociatedID=options.UserAssociatedID;
27
+      if (options.UserFamilyID)
28
+      UserFamilyID=options.UserFamilyID;
29 29
 
30 30
       if (options.SourceID) {
31 31
         console.log("SourceID:" + options.SourceID);
@@ -64,6 +64,15 @@ Page({
64 64
           gotoUrl: "../other/binding?type=bebound&ParentUserID=" + options.ParentUserID + "&NickName=" + options.NickName + "&AvatarUrl=" + options.AvatarUrl + "&BindTime=" + options.BindTime,
65 65
         });
66 66
       }
67
+      else if (options.type == "family") {
68
+        var url="../other/family";
69
+        if (options.PanelType==1)
70
+          url="../other/family?PanelType=1&Time="+options.Time+"&MainUserID="+options.MainUserID+ "&NickName=" + options.NickName + "&AvatarUrl=" + options.AvatarUrl;
71
+        this.setData({
72
+          gotoType: "other",
73
+          gotoUrl: url,
74
+        });
75
+      }
67 76
       else if (options.type == "lesson" || options.type == "video") {
68 77
         app.globalData.LessonID = options.LessonID;
69 78
         if (options.LessonPage)
@@ -203,7 +212,7 @@ Page({
203 212
     main.getLocalHost(function () {
204 213
       main.postData('MiaoguoLogin', {
205 214
         Code: param.Code,
206
-        UserAssociatedID:UserAssociatedID,
215
+        UserFamilyID:UserFamilyID,
207 216
         NickName: param.nickName,
208 217
         Language: param.language,
209 218
         Gender: param.gender,

+ 57 - 56
pages/main/default.js

@@ -18,7 +18,7 @@ Page({
18 18
     AwardDayNumber: 0,
19 19
     IsShowRemind: false,
20 20
     IsShowHelp: false,
21
-    IsShowUserAssociated: 0,
21
+    IsShowUserFamily: 0,
22 22
   },
23 23
   onPullDownRefresh: function () {
24 24
     wx.redirectTo({
@@ -43,7 +43,7 @@ Page({
43 43
       menus: ['shareAppMessage', 'shareTimeline']
44 44
     });
45 45
 
46
-    that.getUserAssociatedInfo(app.globalData.userInfo.UserID, function (data) {});
46
+    that.getUserFamilyInfo(app.globalData.userInfo.UserID, function (data) {});
47 47
   },
48 48
   onHide: function () {
49 49
     wx.hideLoading();
@@ -120,9 +120,7 @@ Page({
120 120
             } else if (res.authSetting['scope.record'] === false) {
121 121
               app.globalData.IsRecorderAccredit = -1;
122 122
             }
123
-
124 123
           }
125
-
126 124
         }
127 125
       });
128 126
     }
@@ -346,49 +344,49 @@ Page({
346 344
   },
347 345
   setSelectUser: function (e) {
348 346
     var that = this;
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;
365 347
 
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
-          }
381
-
382
-          that.getUserAssociatedInfo(app.globalData.userInfo.UserID, function (data) {});
348
+    if (app.globalData.userInfo.UserID == 1 ||
349
+      app.globalData.userInfo.UserID == 2 ||
350
+      app.globalData.userInfo.UserID == 3 ||
351
+      app.globalData.userInfo.UserID == 4) {
352
+      var userid = that.data.ChangeUserID;
353
+      wx.setStorageSync("UserID", userid);
383 354
 
355
+      app.globalData.userInfo.UserID = userid;
356
+      var fieldStr = "";
357
+      that.getUserInfo(userid, fieldStr, function (data) {
358
+        wx.setNavigationBarTitle({
359
+          title: data.NickName
384 360
         });
361
+        main.getUserConfig();
362
+        app.globalData.userInfo.ProductServiceTime = data.ProductServiceTime;
363
+
364
+        if (app.globalData.userInfo.UserID != 2) {
365
+          app.globalData.userInfo.NickName = data.NickName;
366
+          app.globalData.userInfo.AvatarUrl = data.AvatarUrl;
367
+        }
368
+        if (data.IsPromoter > 0) {
369
+          app.globalData.userInfo.IsPromoter = data.IsPromoter;
370
+          app.globalData.userInfo.PromotionLimitDays = data.PromotionLimitDays;
371
+          app.globalData.userInfo.PromotionLimitTime = data.PromotionLimitTime;
372
+          app.globalData.userInfo.WXServiceCharge = data.WXServiceCharge;
373
+          app.globalData.userInfo.IndividualIncomeTax = data.IndividualIncomeTax;
374
+          app.globalData.userInfo.WXAccount = data.WXAccount;
375
+          app.globalData.userInfo.RealName = data.RealName;
376
+          app.globalData.userInfo.IntroducerNickName = data.IntroducerNickName;
377
+          app.globalData.userInfo.IntroducerAvatarUrl = data.IntroducerAvatarUrl;
378
+        }
379
+
380
+        that.getUserFamilyInfo(app.globalData.userInfo.UserID, function (data) {});
381
+
382
+      });
383
+
384
+      that.setData({
385
+        IsShowUserID: false,
386
+      });
387
+      that.onShow();
388
+    }
385 389
 
386
-        that.setData({
387
-          IsShowUserID: false,
388
-        });
389
-        that.onShow();
390
-      }
391
-    
392 390
   },
393 391
   getUserInfoFunction: function (e) {
394 392
     var that = this;
@@ -423,18 +421,21 @@ Page({
423 421
     });
424 422
   },
425 423
   //得到用户关联列表
426
-  getUserAssociatedInfo: function (userID, callback) {
424
+  getUserFamilyInfo: function (userID, callback) {
427 425
     var that = this;
428
-    var url = "GetUserAssociated?UserID=" + userID+"&IsWeb=false";
426
+    var url = "GetUserFamily?UserID=" + userID + "&IsWeb=false";
429 427
     main.getData(url, function (data) {
430 428
       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
-        });
429
+        if (data.length > 0) {
430
+          that.setData({
431
+            IsShowUserFamily: 1,
432
+            UserFamilyNickName: common.getStringMaxLength(app.globalData.userInfo.NickName, 12),
433
+            UserFamilyAvatar: app.globalData.userInfo.AvatarUrl,
434
+            UserFamily: data,
435
+            ChildUserID: app.globalData.userInfo.ChildUserID,
436
+          });
437
+          app.globalData.FamilyUsers = data;
438
+        }
438 439
       }
439 440
     });
440 441
   },
@@ -505,14 +506,14 @@ Page({
505 506
     //判断每30天是否是高级模式
506 507
     wx.removeStorageSync('IsShowPatternMenu');
507 508
   },
508
-  showUserAssociated: function () {
509
+  showUserFamily: function () {
509 510
     this.setData({
510
-      IsShowUserAssociated: 2,
511
+      IsShowUserFamily: 2,
511 512
     });
512 513
   },
513
-  closeUserAssociated: function () {
514
+  closeUserFamily: function () {
514 515
     this.setData({
515
-      IsShowUserAssociated: 1,
516
+      IsShowUserFamily: 1,
516 517
     });
517 518
   },
518 519
   setVersionStart: function (e) {

+ 11 - 12
pages/main/default.wxml

@@ -10,9 +10,9 @@
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>
13
+  <view wx:if="{{IsShowUserFamily>=1 && !ChildUserID}}" class="UserFamily{{IsIPad}} FlexRow" bindtap="showUserFamily">
14
+    <image class="UserFamilyAvatar" src="{{UserFamilyAvatar}}" ></image>
15
+    <view class="UserFamilyNickName">{{UserFamilyNickName}}</view>
16 16
     <image class="icon_nextpage_2" src="../images/icon_nextpage_2.png" ></image>
17 17
   </view>
18 18
 
@@ -131,22 +131,21 @@
131 131
   </view>
132 132
 </view>
133 133
 
134
-<view wx:if="{{IsShowUserAssociated==2}}" class="IsRemindContainer container FlexColumn" style='height:{{Containnerheight}}rpx;'>
134
+<view wx:if="{{IsShowUserFamily==2}}" class="IsRemindContainer container FlexColumn" style='height:{{Containnerheight}}rpx;'>
135 135
   <view class="IsRemindPanel2{{IsIPad}} FlexColumn">
136
-    <view class="text7">切换续费主帐户</view>
136
+    <view class="text7">切换「家庭用户」</view>
137 137
     <view class="IsRemindPanel20 FlexRow">
138 138
       <view class="IsRemindPanel201 FlexColumn">
139
-        <image class="UserAssociatedAvatar2" src="{{UserAssociatedAvatar}}"></image>
140
-        <text class="text8">{{UserAssociatedNickName}}</text>
141
-
139
+        <image class="UserFamilyAvatar2" src="{{UserFamilyAvatar}}"></image>
140
+        <text class="text8">{{UserFamilyNickName}}</text>
142 141
         <view class="text10">使用中</view>
143 142
       </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>
143
+      <view class="IsRemindPanel201 FlexColumn" wx:for="{{UserFamily}}" wx:key="*this" catchtap="gotoReLaunch" data-url="../index/index?UserFamilyID={{item.UserID}}">
144
+        <image class="UserFamilyAvatar2" src="{{item.AvatarUrl}}"></image>
146 145
         <text class="text8">{{item.NickName}}</text>
147 146
       </view>
148 147
     </view>
149
-    <view class="text9">修改切换帐号请微信天乐 changyibzr</view>
150
-    <image class="practise_index_board_close" src="../images/practise_index_board_close.png" catchtap="closeUserAssociated"></image>
148
+    <view class="text9" catchtap="goto" data-url="../other/family">设置</view>
149
+    <image class="practise_index_board_close" src="../images/practise_index_board_close.png" catchtap="closeUserFamily"></image>
151 150
   </view>
152 151
 </view>

+ 12 - 9
pages/main/default.wxss

@@ -452,7 +452,7 @@ page{
452 452
   padding-left: 20rpx;
453 453
 }
454 454
 
455
-.UserAssociated{
455
+.UserFamily{
456 456
   position: fixed;
457 457
   top:397rpx;
458 458
   height: 80rpx;
@@ -461,7 +461,7 @@ page{
461 461
   justify-content: space-between;
462 462
 }
463 463
 
464
-.UserAssociated_iPad{
464
+.UserFamily_iPad{
465 465
   position: fixed;
466 466
   top:282rpx;
467 467
   height: 80rpx;
@@ -470,14 +470,14 @@ page{
470 470
   justify-content: space-between;
471 471
 }
472 472
 
473
-.UserAssociatedAvatar{
473
+.UserFamilyAvatar{
474 474
   width:60rpx;
475 475
   height:60rpx;
476 476
   margin-left: 10rpx;
477 477
   border-radius: 50%;
478 478
 }
479 479
 
480
-.UserAssociatedNickName{
480
+.UserFamilyNickName{
481 481
   color:#fff;
482 482
   font-size: 28rpx;
483 483
   margin: 0 20rpx;
@@ -492,7 +492,7 @@ page{
492 492
 
493 493
 .IsRemindPanel2{
494 494
   width:660rpx;
495
-  height:520rpx;
495
+  height:555rpx;
496 496
   margin-top: 270rpx;
497 497
   border-radius: 40rpx;
498 498
   background-color: #222D4C;
@@ -524,12 +524,12 @@ page{
524 524
 }
525 525
 
526 526
 .IsRemindPanel201{
527
-  height:300rpx;
527
+  height:285rpx;
528 528
   justify-content: flex-start;
529 529
   position: relative;
530 530
 }
531 531
 
532
-.UserAssociatedAvatar2{
532
+.UserFamilyAvatar2{
533 533
   width:120rpx;
534 534
   height:120rpx;
535 535
   border-radius: 50%;
@@ -545,10 +545,13 @@ page{
545 545
 }
546 546
 
547 547
 .text9{
548
-  font-size: 22rpx;
549
-  color: #5282FA;
548
+  font-size: 28rpx;
549
+  color: #FFFFFF;
550 550
   letter-spacing: 0;
551
+  border-top:1rpx solid #4d4d4d;
552
+  width:600rpx;
551 553
   text-align: center;
554
+  line-height:100rpx;
552 555
 }
553 556
 
554 557
 .text10{

+ 6 - 0
pages/main/systemsetting.wxml

@@ -4,6 +4,12 @@
4 4
     <view class="panelTitle1">通用</view>
5 5
     <view class="panelTitle2"></view>
6 6
   </view>
7
+  <view class="panelItem FlexRow" bindtap='goto' data-url="../other/family">
8
+    <view class="panelItem1">家庭用户</view>
9
+    <view class="panelItem2 FlexRow">
10
+      <image src='../images/universalpic_indicator_right_gray.png' class="Arrow" />
11
+    </view>
12
+  </view>
7 13
   <view class="panelItem FlexRow">
8 14
     <view class="panelItem1">按键音</view>
9 15
     <view class="panelItem2 FlexRow">

+ 267 - 0
pages/other/family.js

@@ -0,0 +1,267 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+import constant from '../../utils/constant';
4
+
5
+const app = getApp();
6
+
7
+Page({
8
+  data: {
9
+    HelpList:constant.arrFamilyHelpList,
10
+    PanelType:0,
11
+  },
12
+  onPullDownRefresh: function () {
13
+    var that = this;
14
+    if (that.data.PanelType==0){
15
+      app.globalData.FamilyUsers=[];
16
+      var url = "GetUserFamily?UserID=" + app.globalData.userInfo.UserID + "&IsWeb=false";
17
+      main.getData(url, function (data) {
18
+        if (data) {
19
+          if (data.length > 0) {
20
+            app.globalData.FamilyUsers = data;
21
+            wx.redirectTo({
22
+              url: 'family',
23
+            })
24
+          }
25
+        }
26
+      });
27
+    }
28
+    
29
+    wx.stopPullDownRefresh();
30
+  },
31
+  onShow: function (options) {
32
+    var that = this;
33
+    if (app.globalData.userInfo.IsShow == 1) {
34
+      var today=wx.getStorageSync("AccreditLimitTime");
35
+      if (common.formatTime(new Date(),"-")>today){
36
+        wx.navigateTo({
37
+          url: '../index/accredit',
38
+        });
39
+      }
40
+    }
41
+  },
42
+  onLoad: function (options) {
43
+    var that = this;
44
+
45
+    var panelType=0;
46
+    if (options.PanelType)
47
+      panelType=options.PanelType;
48
+
49
+    that.setData({
50
+      Containnerheight: main.getWindowHeight(),
51
+      FamilyUsers:app.globalData.FamilyUsers,
52
+      IsMember:app.globalData.userInfo.IsMember,
53
+      PanelType:panelType,
54
+    });
55
+
56
+    wx.setNavigationBarColor({
57
+      frontColor: "#000000",
58
+      backgroundColor: "#ffffff"
59
+    });
60
+
61
+    if (panelType==1){
62
+      that.setData({
63
+        MainUserID:options.MainUserID,
64
+        NickName:options.NickName,
65
+        HelpList:constant.arrFamilyHelpListAccept,
66
+        Time:options.Time,
67
+      });
68
+      that.download(options.AvatarUrl);
69
+      wx.setNavigationBarTitle({
70
+        title: '邀请函',
71
+      });
72
+    }
73
+  },
74
+  download: function (avatarUrl) {
75
+    var that = this;
76
+    wx.downloadFile({
77
+      url: avatarUrl,
78
+      success(res) {
79
+        if (res.statusCode === 200) {
80
+          that.setData({
81
+            AvatarUrl: res.tempFilePath,
82
+          });
83
+        }
84
+      }
85
+    });
86
+  },
87
+  showHelp:function(e){
88
+    var index=e.currentTarget.dataset.index;
89
+    var expand=e.currentTarget.dataset.expand;
90
+    this.data.HelpList[index].IsExpand=!this.data.HelpList[index].IsExpand;
91
+    this.setData({
92
+      HelpList:this.data.HelpList,
93
+    });
94
+  },
95
+  gotoReLaunch: function (e) {
96
+    var url = e.currentTarget.dataset.url;
97
+    wx.reLaunch({
98
+      url: url,
99
+    });
100
+  },
101
+  addUser:function(e){
102
+    var that=this;
103
+    if (!app.globalData.userInfo.IsMember){
104
+      wx.showModal({
105
+        title: '添加失败',
106
+        content: '只有秒过续费用户可使用。未续费和已过期的不能使用。',
107
+        showCancel: false,
108
+        confirmText: "知道了",
109
+        success(res) {},
110
+      });
111
+    }
112
+    else if (that.data.FamilyUsers.length>=2){
113
+      wx.showModal({
114
+        title: '添加失败',
115
+        content: '最多添加2名用户。如要替换请解除后重新添加。',
116
+        showCancel: false,
117
+        confirmText: "知道了",
118
+        success(res) {},
119
+      });
120
+    }
121
+  },
122
+  addUser2:function(e){    
123
+    setTimeout(function () {
124
+      wx.showModal({
125
+        title: '等待对方接受邀请',
126
+        content: '请尽快与对方联系确认邀请',
127
+        showCancel: false,
128
+        confirmText: "知道了",
129
+      });
130
+    }, 3000);
131
+  },
132
+  removeUser:function(e){
133
+    var that=this;
134
+    if (that.data.FamilyUsers.length==0){
135
+      wx.showModal({
136
+        title: '解除失败',
137
+        content: '尚未添加用户,不能解除。',
138
+        showCancel: false,
139
+        confirmText: "知道了",
140
+        success(res) {},
141
+      });
142
+    }
143
+    else{
144
+      wx.showModal({
145
+        title: '解除家庭用户吗',
146
+        content: '解除后重启小程序。对方不能再使用您的秒过。可重新添加用户。',
147
+        showCancel: true,
148
+        confirmText: "解除",
149
+        success(res) {
150
+          if (res.confirm) {
151
+            main.getData("updateMiaoguoFamily?UpdateType=delete&UserID=" + app.globalData.userInfo.UserID, function (data) {
152
+              app.globalData.FamilyUsers=[];
153
+              wx.reLaunch({
154
+                url: '../index/index?type=family',
155
+              });
156
+            });
157
+          }
158
+        },
159
+      });
160
+    }
161
+  },
162
+  accept:function(){
163
+    var that=this;
164
+    if (!app.globalData.userInfo.IsMember){
165
+      wx.showModal({
166
+        title: '接受失败',
167
+        content: '未续费的和有效期已过期的用户不能加入「家庭用户」。请先续费再接受邀请。',
168
+        showCancel: false,
169
+        confirmText: "知道了",
170
+        success(res) {},
171
+      });
172
+    }
173
+    else if (app.globalData.userInfo.ChildUserID>0){
174
+      wx.showModal({
175
+        title: '接受失败',
176
+        content: '「帐号绑定」的子账号不能加入「家庭用户」。只有有效期内的续费用户才能加入。',
177
+        showCancel: false,
178
+        confirmText: "知道了",
179
+        success(res) {},
180
+      });
181
+    }
182
+    else if (that.data.FamilyUsers.length>=2){
183
+      wx.showModal({
184
+        title: '接受失败',
185
+        content: '最多添加2名用户。如要替换请解除后重新添加。',
186
+        showCancel: false,
187
+        confirmText: "知道了",
188
+        success(res) {},
189
+      });
190
+    }
191
+    else if (that.data.MainUserID==app.globalData.userInfo.UserID){
192
+      wx.showModal({
193
+        title: '接受失败',
194
+        content: '不能自己和自己建立家庭帐号,请发给另外一个微信号。',
195
+        showCancel: false,
196
+        confirmText: "知道了",
197
+        success(res) {},
198
+      });
199
+    }
200
+    else{
201
+      wx.showModal({
202
+        title: '接受邀请吗',
203
+        content: '接受后重启小程序。对方可使用您的秒过。',
204
+        showCancel: true,
205
+        confirmText: "接受",
206
+        success(res) {
207
+          if (res.confirm) {
208
+            main.getData("updateMiaoguoFamily?UpdateType=add&Time="+that.data.Time+"&UserID=" + that.data.MainUserID+"&NewUserID=" + app.globalData.userInfo.UserID, function (data) {
209
+              if (data==0){
210
+                app.globalData.FamilyUsers=[];
211
+                wx.reLaunch({
212
+                  url: '../index/index?type=family',
213
+                });
214
+              }
215
+              else if (data<0){
216
+                var content="";
217
+                if (data==-1)
218
+                  content="本邀请已过期,请联系对方重新设置。";
219
+                else if (data==-2)
220
+                  content="您已经加入该「家庭用户」了。重启小程序后,在首页即可切换帐号。";
221
+                else if (data==-3)
222
+                  content="对方的「家庭用户」名额已满,请联系对方重新设置。";
223
+                
224
+                wx.showModal({
225
+                  title: '接受失败',
226
+                  content: content,
227
+                  showCancel: false,
228
+                  confirmText: "知道了",
229
+                  success(res) {
230
+                    if (data==-2){
231
+                      app.globalData.FamilyUsers=[];
232
+                      wx.reLaunch({
233
+                        url: '../index/index?type=family',
234
+                      });
235
+                    }
236
+                  },
237
+                });
238
+              }
239
+              
240
+            });
241
+          }
242
+        },
243
+      });
244
+    }
245
+  },
246
+  onShareAppMessage: function () {
247
+    if (this.data.PanelType==0 && this.data.FamilyUsers.length<2 && this.data.IsMember==1) {
248
+      var path=app.globalData.SharePath + '?type=family&PanelType=1&MainUserID=' + app.globalData.userInfo.UserID;
249
+      path += "&Time=" + common.formatTime(new Date(),"-");
250
+      path += "&NickName=" + app.globalData.userInfo.NickName;
251
+      path += "&AvatarUrl=" + app.globalData.userInfo.AvatarUrl;
252
+      
253
+      return {
254
+        title: app.globalData.ShareTitle,
255
+        path: path,
256
+        imageUrl: app.globalData.uploadImageUrl +"web/program_screenshot_jtyh.png",
257
+      }
258
+    }
259
+    else{
260
+      return {
261
+        title: app.globalData.ShareTitle,
262
+        path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
263
+        imageUrl: app.globalData.ShareImage,
264
+      }
265
+    }
266
+  },
267
+})

+ 6 - 0
pages/other/family.json

@@ -0,0 +1,6 @@
1
+{
2
+  "navigationBarTitleText": "家庭用户",
3
+  "navigationBarBackgroundColor": "#ffffff",
4
+  "navigationBarTextStyle": "black",
5
+  "enablePullDownRefresh": true
6
+}

+ 76 - 0
pages/other/family.wxml

@@ -0,0 +1,76 @@
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
+  <!-- 家庭用户主页 -->
3
+  <block wx:if="{{PanelType==0}}">
4
+    <view class="panel1 FlexRow">
5
+      <view class="panel11" >家庭用户</view>
6
+    </view>
7
+
8
+    <block wx:if="{{FamilyUsers.length>0}}">
9
+      <view class="panel20 panel2 FlexRow" wx:for="{{FamilyUsers}}" wx:key="*this">
10
+        <image class="avatar" src='{{item.AvatarUrl}}' />
11
+        <view class="panel21">{{item.NickName}}</view>
12
+      </view>
13
+      <view class="text1">务必再三确认对方身份。如加错人,请立即解除。</view>
14
+    </block>
15
+
16
+    <view class="panel2 FlexRow" bindtap="addUser" wx:if="{{FamilyUsers.length>=2 || IsMember==0}}">
17
+      <image class="universalpic_add_black_22x22" src='../images/universalpic_add_black_22x22.png' />
18
+      <view class="panel21">添加用户</view>
19
+    </view>
20
+
21
+    <button class="panel2_1 FlexRow" bindtap="addUser2" open-type='share' wx:if="{{FamilyUsers.length<2 && IsMember==1}}">
22
+      <image class="universalpic_add_black_22x22" src='../images/universalpic_add_black_22x22.png' />
23
+      <view class="panel21">添加用户</view>
24
+    </button>
25
+
26
+    <text class="panel3">可添加2名续费用户。\n建议仅在家人之间使用,不要添加陌生人或群聊。</text>
27
+
28
+    <view class="panel2 FlexRow" bindtap="removeUser">
29
+      <view class="panel22 panel21">解除并退出</view>
30
+    </view>
31
+  </block>
32
+
33
+  <!-- 邀请函 -->
34
+  <block wx:if="{{PanelType==1}}">
35
+    <view class="panel20 panel2 FlexRow" >
36
+      <image class="avatar" src='{{AvatarUrl}}' />
37
+      <view class="panel21">{{NickName}}</view>
38
+    </view>
39
+
40
+    <view class="panel1 FlexRow">
41
+      <text class="panel12" >以上用户邀请您加入Ta的秒过「家庭用户」。加入后你们可以在一个微信上切换彼此的秒过帐号。Ta可使用您的秒过,您也能使用Ta的。\n请务必核实对方身份,慎重接受邀请。</text>
42
+    </view>
43
+
44
+    <view class="panel41 FlexRow">
45
+      <view class="panel412 panel411">加入条件和风险提醒</view>
46
+      <view></view>
47
+    </view>
48
+
49
+    <text class="panel43">① 您的必须是秒过已续费并在有效期内的用户。\n\n② 您从未加入过其他「家庭用户」或加入的「家庭用户」额度未满2人。\n\n③ 加入后,对方可使用您的秒过,所有操作均视为您本人的行为,期间造成的隐私泄露、数据损失等问题,均由您自行承担。请务必在认真确认对方身份后再决定是否接受本邀请。</text>
50
+    
51
+    <view class="panelBottom FlexRow">
52
+      <view class="btn" catchtap="gotoReLaunch" data-url="../index/index">拒绝</view>
53
+      <view class="btn" catchtap="accept" >接受</view>
54
+    </view>
55
+  </block>
56
+
57
+  <view class="panel1 FlexRow">
58
+    <view class="panel11" >帮助</view>
59
+  </view>
60
+  <view class="panel4 FlexColumn">
61
+    <block wx:for="{{HelpList}}" wx:key="*this">
62
+      <view class="line" wx:if="{{index>0}}"></view>
63
+      <view class="panel41 FlexRow" bindtap="showHelp" data-index="{{index}}" data-expand="{{item.IsExpand}}">
64
+        <view class="panel411">{{item.Title}}</view>
65
+        <image class="icon_fold_3" src='../images/icon_fold_3.png' wx:if="{{!item.IsExpand}}" />
66
+        <image class="icon_fold_3" src='../images/icon_fold_4.png' wx:if="{{item.IsExpand}}" />
67
+      </view>
68
+      <text class="panel42" wx:if="{{item.IsExpand}}">{{item.Content}}</text>
69
+    </block>
70
+  </view>
71
+  <view style="height:60rpx;"></view>
72
+  <view style="height:100rpx;" wx:if="{{PanelType==1}}"></view>
73
+</view>
74
+
75
+
76
+

+ 151 - 0
pages/other/family.wxss

@@ -0,0 +1,151 @@
1
+.panel1{
2
+  width:100%;
3
+  justify-content: flex-start;
4
+}
5
+
6
+.panel11{
7
+  margin: 60rpx 0 0 30rpx;
8
+  font-size: 36rpx;
9
+  color: #4D4D4D;
10
+}
11
+
12
+.panel12{
13
+  margin: 30rpx 0 0 30rpx;
14
+  font-size: 36rpx;
15
+  color: #4D4D4D;
16
+  width: 690rpx;
17
+}
18
+
19
+.panel2{
20
+  background: #FFFFFF;
21
+  border-radius: 20rpx;
22
+  width:710rpx;
23
+  height:100rpx;
24
+  margin-top: 60rpx;
25
+  justify-content: flex-start;
26
+}
27
+
28
+.panel2_1{
29
+  background-color: #FFFFFF;
30
+  border-radius: 20rpx;
31
+  width:710rpx;
32
+  height:100rpx;
33
+  margin: 60rpx 0 0 0;
34
+  justify-content: flex-start;
35
+  padding: 0;
36
+  box-sizing:inherit;
37
+  outline: none;
38
+}
39
+
40
+button::after {
41
+  border: none;
42
+}
43
+
44
+
45
+.universalpic_add_black_22x22{
46
+  width:22rpx;
47
+  height: 22rpx;
48
+  margin-left: 39rpx;
49
+}
50
+
51
+.panel21{
52
+  margin-left: 20rpx;
53
+  font-size: 28rpx;
54
+  color: #4D4D4D;
55
+}
56
+.panel22{
57
+  margin-left: 30rpx;
58
+}
59
+
60
+.panel3{
61
+  width:690rpx;
62
+  text-align: start;
63
+  font-size:24rpx;
64
+  font-weight: 400;
65
+  color:#4D4D4D;
66
+  margin-top: 30rpx;
67
+}
68
+
69
+.panel4{
70
+  width: 690rpx;
71
+}
72
+.panel41{
73
+  width:690rpx;
74
+  justify-content: space-between;
75
+}
76
+.panel411{
77
+  font-size: 28rpx;
78
+  color: #4D4D4D;
79
+  margin: 30rpx 0;
80
+}
81
+
82
+.panel412{
83
+  margin: 60rpx 0 30rpx 0;
84
+}
85
+
86
+.icon_fold_3{
87
+  width:26rpx;
88
+  height:16rpx;
89
+}
90
+
91
+.line{
92
+  width:720rpx;
93
+  height:1rpx;
94
+  background-color: #D2D2D2;
95
+}
96
+
97
+.panel42{
98
+  font-size: 24rpx;
99
+  color: #4D4D4D;
100
+  font-weight: 400;
101
+  margin-bottom: 30rpx;
102
+}
103
+
104
+.panel20{
105
+  height:120rpx;
106
+  margin:30rpx 0 0 0;
107
+}
108
+
109
+.avatar{
110
+  border-radius: 30rpx;
111
+  width:60rpx;
112
+  height:60rpx;
113
+  margin-left:30rpx;
114
+}
115
+
116
+.text1{
117
+  width:690rpx;
118
+  font-weight: 400;
119
+  font-size: 24rpx;
120
+  color: #4D4D4D;
121
+  margin-top: 30rpx;
122
+}
123
+
124
+
125
+.panel43{
126
+  width:690rpx;
127
+  font-size: 24rpx;
128
+  color: #4D4D4D;
129
+  font-weight: 400;
130
+  margin-bottom: 30rpx;
131
+}
132
+
133
+.panelBottom{
134
+  position: fixed;
135
+  bottom:0;
136
+  width:100%;
137
+  height:120rpx;
138
+  border-top:1rpx solid #d2d2d2;
139
+  background-color: #fff;
140
+}
141
+
142
+.btn{
143
+  width:345rpx;
144
+  line-height:80rpx;
145
+  text-align: center;
146
+  background: #FFFFFF;
147
+  border: 1px solid #9B9B9B;
148
+  border-radius: 10rpx;
149
+  font-size: 32rpx;
150
+  margin: 0 10rpx;
151
+}

+ 10 - 0
pages/other/userbook.js

@@ -132,6 +132,16 @@ Page({
132 132
         PanelShow: panelShow,
133 133
       });
134 134
     }
135
+
136
+    if (that.data.IsLoseEfficacy==1 && that.data.MainUserID!=that.data.UserID){
137
+      wx.showModal({
138
+        title: '帐号过期',
139
+        content: '该帐号已过期,重启微信可回到您原本的秒过,「家庭用户」已自动解除。如想为该帐号续费,请使用该帐号原本对应的微信打开秒过就能续费了(其它微信不能代付)。',
140
+        showCancel: false,
141
+        confirmText: "知道了",
142
+        success(res) {},
143
+      });
144
+    }
135 145
   },
136 146
   onShow:function(){
137 147
     var that=this;

+ 2 - 2
pages/other/userbook.wxml

@@ -27,9 +27,9 @@
27 27
     </view>
28 28
     <view class="panel2 FlexRow" wx:if="{{IsShow==1 && ClassDayNumber>=0 && ((ClassDayNumber<ClassTotalDayNumber && IsPay==0) || IsPay==1)}}">
29 29
       
30
-      <view class="panel21 FlexColumn" bindtap="goto" data-url="../other/coupon" wx:if="{{IsPay==1}}">
30
+      <view class="panel21 FlexColumn" bindtap="goto" data-url="../other/coupon" wx:if="{{IsPay==1 && MainUserID==UserID}}">
31 31
         <image class="usermanual_index_handshake" src='../images/usermanual_index_coupon.png' />
32
-        <view>优惠券</view>
32
+        <view>优惠券</view>
33 33
       </view>
34 34
 
35 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 }}">

+ 1 - 1
project.private.config.json

@@ -12,7 +12,7 @@
12 12
         {
13 13
           "name": "pages/index/index",
14 14
           "pathName": "pages/index/index",
15
-          "query": "type=marketing",
15
+          "query": "type=family&PanelType=1&Time=2022-07-29 14:06:44&MainUserID=2&NickName=万戍仁&AvatarUrl=https://thirdwx.qlogo.cn/mmopen/vi_32/o7M9drMKflfW78mJrM9NX7hqPfyBaC4kic0IZ7Nw473oTlgERksibvlViauEiaiayIicT3cs7a5r9UcbKVSLnYhbCoNg/132",
16 16
           "launchMode": "default",
17 17
           "scene": 1007
18 18
         },

Файловите разлики са ограничени, защото са твърде много
+ 11 - 0
utils/constant.js