chengjie 7 years ago
parent
commit
18a2753248

+ 1 - 1
app.js

@@ -12,7 +12,7 @@ App({
12 12
   },
13 13
   globalData: {
14 14
     Version: "1.1.0",
15
-    IsProduction: false,
15
+    IsProduction: true,
16 16
     ProgramID: 106,
17 17
     AppID: "wx313a8f2c0741efe1",
18 18
     ShareTitle:"赢在阅读起跑线",

BIN
images/01001.png


BIN
images/06001.png


+ 1 - 0
pages/about/about.wxml

@@ -1,5 +1,6 @@
1 1
 <view class="container FlexColumn">
2 2
   <image src="../../images/06001.png" class="bg" />
3
+  <view style='height:100rpx;'></view>
3 4
 
4 5
   <view class="btn" wx:for="{{ListProgram}}" wx:key="index" style='left:{{item.left}}rpx;top:{{item.top}}rpx;' bindtap='switchProgram' data-appid="{{item.appId}}" data-path="{{item.path}}"></view>
5 6
   <view class="getAppID" bindtap='getAppID' ></view>

+ 2 - 2
pages/about/about.wxss

@@ -5,8 +5,8 @@
5 5
 }
6 6
 
7 7
 .bg{
8
-  width:100%;
9
-  height:3081rpx;
8
+  width:630rpx;
9
+  height:2683rpx;
10 10
   margin-top: 40rpx;
11 11
 }
12 12
 

+ 23 - 5
pages/about/membercenter.js

@@ -15,10 +15,8 @@ Page({
15 15
 
16 16
     this.setData({
17 17
       Height: common.getSystemHeight(),
18
-      Member:member,
18
+      Member: member,
19 19
     });
20
-    
21
-    
22 20
 
23 21
     this.init();
24 22
   },
@@ -26,6 +24,13 @@ Page({
26 24
     var that = this;
27 25
     server.getData('GetWXUsersAllTime?ProductID=' + app.globalData.ProgramID+'&UserID=' + app.globalData.userInfo.UserID, function (data) {
28 26
       if (data) {
27
+        for(var i=0;i<data.length;i++){
28
+            if (data[i].ID==app.globalData.ProgramID){
29
+              if (that.data.Member=="非会员"){
30
+                data[i].Time = common.formatDateCHS(app.globalData.userInfo.CreateTime);
31
+              }
32
+            }
33
+        }
29 34
         that.setData({
30 35
           ProductList: data,
31 36
         });
@@ -43,9 +48,20 @@ Page({
43 48
     });
44 49
   },
45 50
   gotoPaylist:function(){
46
-    wx.navigateTo({
47
-      url: '../about/paylist',
51
+    var that=this;
52
+    wx.getSetting({
53
+      success(res) {
54
+        if (res.authSetting['scope.userInfo']) {
55
+          wx.navigateTo({
56
+            url: '../about/paylist',
57
+          });
58
+        }
59
+        else{
60
+          that.getAccredit();
61
+        }
62
+      }
48 63
     });
64
+    
49 65
   },
50 66
   getAccredit: function () {
51 67
     if (!this.data.IsAccredit) {
@@ -80,7 +96,9 @@ Page({
80 96
         wx.getUserInfo({
81 97
           withCredentials: true,
82 98
           success: function (res) {
99
+            var userID = app.globalData.userInfo.UserID;
83 100
             app.globalData.userInfo = res.userInfo;
101
+            app.globalData.userInfo.UserID = userID;
84 102
 
85 103
             app.globalData.userInfo.NickName = app.globalData.userInfo.nickName;
86 104
             app.globalData.userInfo.AvatarUrl = app.globalData.userInfo.avatarUrl;

+ 25 - 15
pages/about/orderlist.js

@@ -50,8 +50,8 @@ Page({
50 50
     if (e) {
51 51
       id = e.currentTarget.dataset.id;
52 52
     }
53
-    var total = 0, totalFinal = 0, 
54
-    selectCount = 0, discounts = 0;
53
+    var total = 0, totalFinal = 0,
54
+      selectCount = 0, discounts = 0;
55 55
     for (var i = 0; i < this.data.ListProgram.length; i++) {
56 56
       if (this.data.ListProgram[i].ID == id) {
57 57
         this.data.ListProgram[i].IsSelect = !this.data.ListProgram[i].IsSelect;
@@ -78,15 +78,15 @@ Page({
78 78
     totalFinal = Math.round(totalFinal) / 100;
79 79
     discounts = Math.round(discounts) / 100;
80 80
 
81
-    var remark="一款原价,成套购买更划算";
82
-    if (discount<1)
83
-      remark = "套装购买现享 " + (discount * 10) + " 折,已优惠 " + discounts+" 元"
81
+    var remark = "一款原价,成套购买更划算";
82
+    if (discount < 1)
83
+      remark = "套装购买现享 " + (discount * 10) + " 折,已优惠 " + discounts + " 元"
84 84
 
85 85
     this.setData({
86 86
       ListProgram: this.data.ListProgram,
87 87
       TotalFinal: totalFinal,
88 88
       Remark: remark,
89
-      Total:total,
89
+      Total: total,
90 90
       Discount: discount,
91 91
     });
92 92
 
@@ -99,18 +99,28 @@ Page({
99 99
       isPaying = true;
100 100
       var that = this;
101 101
       var money = this.data.TotalFinal;
102
-      var detail="";
103
-      for (var i = 0; i < this.data.ListProgram.length;i++){
104
-        if (this.data.ListProgram[i].IsSelect){
105
-          detail += ","+this.data.ListProgram[i].ID + ":" + this.data.ListProgram[i].Price * this.data.Discount;
102
+      var detail = "";
103
+      for (var i = 0; i < this.data.ListProgram.length; i++) {
104
+        if (this.data.ListProgram[i].IsSelect) {
105
+          detail += "," + this.data.ListProgram[i].ID + ":" + this.data.ListProgram[i].Price * this.data.Discount;
106 106
         }
107 107
       }
108
-      detail=detail.substr(1);
109
-      server.payMoney(4,money,detail, function (data) {
110
-        wx.navigateTo({
111
-          url: '../about/payfinished?type=all',
108
+      detail = detail.substr(1);
109
+      var currentProductMoney = app.globalData.ProgramID + ":" + Math.round(100 * app.globalData.PayMoney).toString();
110
+      if (detail == currentProductMoney) {
111
+        server.payMoney(3, money, null, function () {
112
+          wx.navigateTo({
113
+            url: '../about/payfinished',
114
+          });
112 115
         });
113
-      });
116
+      }
117
+      else {
118
+        server.payMoney(4, money, detail, function (data) {
119
+          wx.navigateTo({
120
+            url: '../about/payfinished?type=all',
121
+          });
122
+        });
123
+      }
114 124
       setTimeout(function () {
115 125
         isPaying = false;
116 126
       }, 10000);

+ 6 - 0
pages/about/payfinished.js

@@ -12,6 +12,7 @@ Page({
12 12
     if (options && options.type=="all"){
13 13
       text1 = "套装产品必须逐个激活";
14 14
       text2 = "赶紧去激活";
15
+      wx.setStorageSync("IsShowActivty", true);
15 16
     }
16 17
 
17 18
     this.setData({
@@ -21,6 +22,11 @@ Page({
21 22
       OrderType: options.type,
22 23
     });
23 24
   },
25
+  onUnload: function () {
26
+    wx.reLaunch({
27
+      url: '../main/index'
28
+    });
29
+  },
24 30
   deblocking: function () {
25 31
     wx.reLaunch({
26 32
       url: '../index/index'

+ 5 - 0
pages/about/paylist.js

@@ -45,6 +45,11 @@ Page({
45 45
           PayList: data,
46 46
           IsShowActivty: isShowActivty,
47 47
         });
48
+
49
+        if (isShowActivty)
50
+          wx.setStorageSync("IsShowActivty", isShowActivty);
51
+        else
52
+          wx.removeStorageSync("IsShowActivty");
48 53
       }
49 54
       else {
50 55
         that.setData({

+ 1 - 1
pages/about/paylist.wxml

@@ -1,7 +1,7 @@
1 1
 <view class="container FlexColumn" style='min-height:{{Height}}rpx;'>
2 2
   <block wx:if="{{PayList.length>0}}">
3 3
     <view class="text0" wx:if="{{IsShowActivty}}">
4
-      您购买的产品未激活,请尽快处理!
4
+      有产品未激活,请立即处理!
5 5
     </view>
6 6
     <view class="text1" bindtap='gotoFeedback'>购买后如不能正常使用,请清理内存后重启微信并打开小程序,</view>
7 7
     <view class="text2 FlexRow" bindtap='gotoFeedback'>

+ 1 - 0
pages/index/activate.wxss

@@ -2,6 +2,7 @@
2 2
   background-color: #F5E2BE;
3 3
   justify-content: flex-start;
4 4
   color: #1e1e1e;
5
+  font-weight: 500;
5 6
 }
6 7
 
7 8
 .bg{

+ 7 - 2
pages/main/detail.js

@@ -120,8 +120,13 @@ Page({
120 120
       wx.setStorageSync('IsHelpPosition1', 2);
121 121
     }
122 122
 
123
-    if (app.globalData.userInfo.NickName == "陌生用户")
124
-      wx.setStorageSync('IsRemindAccredit', 1);
123
+    wx.getSetting({
124
+      success(res) {
125
+        if (!res.authSetting['scope.userInfo']) {
126
+          wx.setStorageSync('IsRemindAccredit', 1);
127
+        }
128
+      }
129
+    })
125 130
 
126 131
   },
127 132
   submitData: function (content) {

+ 13 - 4
pages/main/index.js

@@ -21,7 +21,7 @@ Page({
21 21
     NavClass1: "",
22 22
     NavClass2: "nav2",
23 23
     IsRemind: false,
24
-    IsMemberForeverRemind: false,
24
+    IsMemberForeverRemind: 0,
25 25
   },
26 26
   onReady: function (e) {
27 27
   },
@@ -71,6 +71,13 @@ Page({
71 71
       this.selectNav(obj);
72 72
       wx.removeStorageSync("indexNav");
73 73
     }
74
+
75
+    //如果未激活,请先去激活
76
+    if (wx.getStorageSync("IsShowActivty")) {
77
+      wx.navigateTo({
78
+        url: '../about/paylist',
79
+      });
80
+    }
74 81
   },
75 82
   getAccredit: function () {
76 83
     if (!this.data.IsAccredit) {
@@ -108,8 +115,9 @@ Page({
108 115
         wx.getUserInfo({
109 116
           withCredentials: true,
110 117
           success: function (res) {
118
+            var userID = app.globalData.userInfo.UserID;
111 119
             app.globalData.userInfo = res.userInfo;
112
-
120
+            app.globalData.userInfo.UserID=userID;
113 121
             app.globalData.userInfo.NickName = app.globalData.userInfo.nickName;
114 122
             app.globalData.userInfo.AvatarUrl = app.globalData.userInfo.avatarUrl;
115 123
             
@@ -234,7 +242,9 @@ Page({
234 242
         wx.setStorageSync("ReviewList", data.ReviewList);
235 243
 
236 244
         common.getStorageValue(that, "IsMemberForeverRemind", 0, function () {
237
-          if (that.data.IsMemberForeverRemind == 0 && that.data.NewUserNumber >= app.globalData.NewUserNumberMax) {
245
+          if (that.data.IsMemberForeverRemind == 0 
246
+            && that.data.NewUserNumber >= app.globalData.NewUserNumberMax 
247
+            && that.data.NewUserNumber<999999) {
238 248
             that.setData({
239 249
               IsMemberForeverRemind: 1,
240 250
             });
@@ -319,7 +329,6 @@ Page({
319 329
     });
320 330
   },
321 331
   gotoPayList: function () {
322
-
323 332
     if (this.data.IsMember == 0 && !this.data.IsFirstDay && this.data.NewUserNumber >= this.data.NewUserNumberMax){
324 333
       this.setData({
325 334
         IsMemberForeverRemind: 0,

+ 9 - 6
pages/main/index.wxml

@@ -137,9 +137,9 @@
137 137
       <image src='../../images/02028.png' class="img02028 img02025" wx:if="{{IsMember==1 && !IsFirstDay && NewUserNumber<NewUserNumberMax}}">
138 138
         <view class="getNewUser2 getNewUser" bindtap='gotoNewUser'></view>
139 139
       </image>
140
-      <view class="line"></view>
141
-      <view class="text">其它优惠</view>
142
-      <image src='../../images/02029.png' class="img02029" bindtap='selectNav' data-id="2"></image>
140
+      <view class="line" wx:if="{{IsMember==0}}"></view>
141
+      <view class="text" wx:if="{{IsMember==0}}">其它优惠</view>
142
+      <image  wx:if="{{IsMember==0}}" src='../../images/02029.png' class="img02029" bindtap='selectNav' data-id="2"></image>
143 143
 
144 144
       <view class="index10 index9 FlexRow">
145 145
         <image src='../../images/02016.png' class="imgWave" />
@@ -155,7 +155,7 @@
155 155
     <view class="index6 FlexColumn">
156 156
       <image src='../../images/{{item.ImageUrl}}' class="btn2" wx:for="{{ListProgram}}" wx:key="index" bindtap='switchProgram' data-appid='{{item.appId}}' data-path='{{item.path}}' />
157 157
     </view>
158
-    <view class="bottom FlexColumn" bindtap='gotoAllPay' wx:if="{{IsShow==1 && IsMember==0}}">
158
+    <view class="bottom FlexColumn" bindtap='gotoAllPay' wx:if="{{IsShow==1}}">
159 159
       <view class="bottom1 FlexRow">
160 160
         <view class="left FlexColumn">
161 161
           <view class="text">成套购买更划算</view>
@@ -186,13 +186,16 @@
186 186
 
187 187
 </view>
188 188
 
189
-<view class="IsMemberForever container FlexColumn" style='height:{{Height}}rpx;' wx:if="{{IsMemberForeverRemind==1}}">
189
+<view class="IsMemberForever container FlexColumn" style='height:{{Height}}rpx;' 
190
+wx:if="{{IsMemberForeverRemind==1}}">
190 191
   <view class="btn">
191 192
     <view class="btn1 FlexColumn" catchtap="gotoPayList">
192 193
       <view class="panel1 FlexColumn">
193 194
         <image src='../../images/02023.png' class="img" />
194 195
         <view class="text1">恭喜你</view>
195
-        <view class="text2">已获得永久有效期</view>
196
+        <view class="text2">获得永久有效期奖励</view>
197
+        <view class="line"></view>
198
+        <view class="text3">*购买本产品后自动生效</view>
196 199
       </view>
197 200
       <view class="panel2 FlexColumn">
198 201
         知道了

+ 15 - 3
pages/main/index.wxss

@@ -481,7 +481,7 @@
481 481
 
482 482
 .IsMemberForever .btn {
483 483
   width: 600rpx;
484
-  height: 640rpx;
484
+  height: 729rpx;
485 485
   background-color: #D2D2D2;
486 486
   border-radius: 40rpx;
487 487
   margin-top: 230rpx;
@@ -489,7 +489,7 @@
489 489
 }
490 490
 .IsMemberForever .btn1 {
491 491
   width: 100%;
492
-  height: 620rpx;
492
+  height: 709rpx;
493 493
   background-color: #F0F0F0;
494 494
   border-radius: 40rpx;
495 495
   position:relative;
@@ -498,7 +498,7 @@
498 498
 }
499 499
 .IsMemberForever .panel1 {
500 500
   width: 100%;
501
-  height: 500rpx;
501
+  height: 600rpx;
502 502
   background-color: #B3443B;
503 503
   border-top-left-radius: 40rpx;
504 504
   border-top-right-radius: 40rpx;
@@ -516,6 +516,18 @@
516 516
   font-size:36rpx;
517 517
   color:#fff;
518 518
 }
519
+.IsMemberForever .line {
520
+  width: 510rpx;
521
+  height: 2rpx;
522
+  background-color: #FC8D90;
523
+  margin-top: 20rpx;
524
+}
525
+.IsMemberForever .text3 {
526
+  font-size:24rpx;
527
+  color:#fff;
528
+  margin-top: 30rpx;
529
+  font-weight: 400;
530
+}
519 531
 .IsMemberForever .panel2 {
520 532
   width: 100%;
521 533
   height: 120rpx;

+ 1 - 1
project.config.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
 	"description": "项目配置文件。",
3 3
 	"setting": {
4
-		"urlCheck": false,
4
+		"urlCheck": true,
5 5
 		"es6": true,
6 6
 		"postcss": true,
7 7
 		"minified": true,