chengjie 6 years ago
parent
commit
19764b093f
79 changed files with 1357 additions and 718 deletions
  1. 6 1
      app.js
  2. 15 14
      app.json
  3. 111 0
      pages/index/accredit.js
  4. 6 0
      pages/index/accredit.json
  5. 17 0
      pages/index/accredit.wxml
  6. 67 0
      pages/index/accredit.wxss
  7. 218 45
      pages/index/index.js
  8. 1 1
      pages/index/index.json
  9. 4 13
      pages/index/index.wxml
  10. 13 16
      pages/index/index.wxss
  11. 46 35
      pages/miaoguo/add.js
  12. 0 0
      pages/main/add.json
  13. 1 1
      pages/miaoguo/add.wxml
  14. 0 0
      pages/main/add.wxss
  15. 27 20
      pages/miaoguo/addItem.js
  16. 0 0
      pages/main/addItem.json
  17. 0 0
      pages/main/addItem.wxml
  18. 0 0
      pages/main/addItem.wxss
  19. 8 1
      pages/miaoguo/cardInfo.js
  20. 0 0
      pages/main/cardInfo.json
  21. 0 0
      pages/main/cardInfo.wxml
  22. 0 0
      pages/main/cardInfo.wxss
  23. 83 0
      pages/main/default.js
  24. 1 1
      pages/miaoguo/default.json
  25. 3 8
      pages/miaoguo/default.wxml
  26. 4 1
      pages/miaoguo/default.wxss
  27. 145 86
      pages/miaoguo/detail.js
  28. 9 0
      pages/main/detail.json
  29. 181 0
      pages/main/detail.wxml
  30. 182 103
      pages/miaoguo/detail.wxss
  31. 15 2
      pages/miaoguo/preview.js
  32. 0 0
      pages/main/preview.json
  33. 1 1
      pages/miaoguo/preview.wxml
  34. 0 0
      pages/main/preview.wxss
  35. 7 1
      pages/miaoguo/searchCard.js
  36. 0 0
      pages/main/searchCard.json
  37. 2 2
      pages/miaoguo/searchCard.wxml
  38. 4 0
      pages/miaoguo/searchCard.wxss
  39. 8 1
      pages/miaoguo/searchCard1.js
  40. 0 0
      pages/main/searchCard1.json
  41. 0 0
      pages/main/searchCard1.wxml
  42. 0 0
      pages/main/searchCard1.wxss
  43. 8 1
      pages/miaoguo/searchCardList.js
  44. 0 0
      pages/main/searchCardList.json
  45. 0 0
      pages/main/searchCardList.wxml
  46. 0 0
      pages/main/searchCardList.wxss
  47. 7 0
      pages/miaoguo/searchWeb.js
  48. 0 0
      pages/main/searchWeb.json
  49. 0 0
      pages/main/searchWeb.wxml
  50. 0 0
      pages/main/searchWeb.wxss
  51. 8 1
      pages/miaoguo/searchWeb1.js
  52. 0 0
      pages/main/searchWeb1.json
  53. 0 0
      pages/main/searchWeb1.wxml
  54. 0 0
      pages/main/searchWeb1.wxss
  55. 8 1
      pages/miaoguo/searchWeb2.js
  56. 0 0
      pages/main/searchWeb2.json
  57. 0 0
      pages/main/searchWeb2.wxml
  58. 0 0
      pages/main/searchWeb2.wxss
  59. 7 0
      pages/miaoguo/setting.js
  60. 0 0
      pages/main/setting.json
  61. 0 0
      pages/main/setting.wxml
  62. 0 0
      pages/main/setting.wxss
  63. 0 77
      pages/miaoguo/default.js
  64. 0 5
      pages/miaoguo/detail.json
  65. 0 156
      pages/miaoguo/detail.wxml
  66. BIN
      pages/sounds/1.mp3
  67. BIN
      pages/sounds/10.mp3
  68. BIN
      pages/sounds/11.mp3
  69. BIN
      pages/sounds/2.mp3
  70. BIN
      pages/sounds/3.mp3
  71. BIN
      pages/sounds/4.mp3
  72. BIN
      pages/sounds/5.mp3
  73. BIN
      pages/sounds/6.mp3
  74. BIN
      pages/sounds/7.mp3
  75. BIN
      pages/sounds/8.mp3
  76. BIN
      pages/sounds/9.mp3
  77. BIN
      pages/sounds/short2.mp3
  78. 132 122
      utils/main.js
  79. 2 2
      utils/util.js

+ 6 - 1
app.js

@@ -15,13 +15,18 @@ App({
15 15
   globalData: {
16 16
     Version: "1.0.0",
17 17
     IsProduction: false,
18
-    ShareTitle: "秒过",
18
+    ShareTitle: "可以用来记忆一切的工具",
19
+    SharePath: "pages/index/index",
20
+    ShareImage: '',
21
+    
19 22
     ProgramID: 166,
20 23
     serverUrl: "https://www.kylx365.com/apiData/",
21 24
     serverUrlServer: "https://www.kylx365.com/apiData/",
22 25
     serverUrlLocalhost: "http://localhost:3020/apiData/",
23 26
     audioUrlBaidu: "https://tsn.baidu.com/text2audio?lan=zh&ctp=1&cuid=abcdxxx&tok=[token]&tex=[word]&vol=9&per=0&spd=3&pit=5",
24 27
     audioUrlYoudao: "https://dict.youdao.com/dictvoice?rate=5&le=auto&audio=",
28
+    
29
+    
25 30
     BaiduToken: "",//百度开发平台token
26 31
     systemInfo: null,
27 32
     userInfo: null,

+ 15 - 14
app.json

@@ -1,19 +1,20 @@
1 1
 {
2 2
   "pages": [
3
-    "pages/miaoguo/default",
4
-    "pages/miaoguo/cardInfo",
5
-    "pages/miaoguo/preview",
6
-    "pages/miaoguo/searchCardList",
7
-    "pages/miaoguo/searchCard1",
8
-    "pages/miaoguo/searchCard",
9
-    "pages/miaoguo/add",
10
-    "pages/miaoguo/addItem",
11
-    "pages/miaoguo/searchWeb2",
12
-    "pages/miaoguo/searchWeb1",
13
-    "pages/miaoguo/searchWeb",
14
-    "pages/miaoguo/detail",
15
-    "pages/miaoguo/setting",
16
-    "pages/index/index"
3
+    "pages/index/index",
4
+    "pages/index/accredit",
5
+    "pages/main/default",
6
+    "pages/main/cardInfo",
7
+    "pages/main/preview",
8
+    "pages/main/searchCardList",
9
+    "pages/main/searchCard1",
10
+    "pages/main/searchCard",
11
+    "pages/main/add",
12
+    "pages/main/addItem",
13
+    "pages/main/searchWeb2",
14
+    "pages/main/searchWeb1",
15
+    "pages/main/searchWeb",
16
+    "pages/main/detail",
17
+    "pages/main/setting"
17 18
   ],
18 19
   "window": {
19 20
     "navigationBarBackgroundColor": "#fff",

+ 111 - 0
pages/index/accredit.js

@@ -0,0 +1,111 @@
1
+import common from '../../utils/util';
2
+import server from '../../utils/main';
3
+
4
+const app = getApp();
5
+var urlRedirectTo = "";
6
+
7
+Page({
8
+  data: {
9
+  },
10
+  onLoad: function (options) {
11
+    urlRedirectTo = options.url;
12
+    this.setData({
13
+      Containnerheight: common.getSystemHeight(),
14
+    });
15
+  },
16
+  onUnload: function () {
17
+
18
+  },
19
+  goto: function () {
20
+    var that = this;
21
+    wx.getSetting({
22
+      success(res) {
23
+        if (!res.authSetting['scope.userInfo']) {
24
+          wx.authorize({
25
+            scope: 'scope.userInfo',
26
+            success() {
27
+              that.getUserInfo();
28
+            },
29
+            fail() {
30
+              
31
+            }
32
+          })
33
+        }
34
+        else {
35
+          that.getUserInfo();
36
+        }
37
+      }
38
+    });
39
+  },
40
+  //得到用户信息
41
+  getUserInfo: function () {
42
+    var that = this
43
+    //调用登录接口
44
+    wx.login({
45
+      success: function (res0) {
46
+        wx.getUserInfo({
47
+          withCredentials: true,
48
+          success: function (res) {
49
+            app.globalData.userInfo.Code = res0.code;
50
+            app.globalData.userInfo.iv = res.iv;
51
+            app.globalData.userInfo.encryptedData = res.encryptedData;
52
+
53
+            app.globalData.userInfo.NickName = res.userInfo.nickName;
54
+            app.globalData.userInfo.AvatarUrl = res.userInfo.avatarUrl;
55
+
56
+            that.login(app.globalData.userInfo, res.userInfo);
57
+          },
58
+          fail: function (res) {
59
+            wx.navigateBack({
60
+              delta: 1
61
+            });
62
+          }
63
+        });
64
+      },
65
+      fail: function () {
66
+
67
+      }
68
+    });
69
+  },
70
+  login: function (param, param2) {
71
+    var that = this;
72
+    var url = "MiaoguoLogin";
73
+    server.postData(url, {
74
+      Code: param.Code,
75
+      NickName: param2.nickName,
76
+      AvatarUrl: param2.avatarUrl,
77
+      Language: param2.language,
78
+      Gender: param2.gender,
79
+      City: param2.city,
80
+      Province: param2.province,
81
+      Country: param2.country,
82
+      ProgramVersion: app.globalData.Version,
83
+      Introducer: app.globalData.introducer,
84
+      UserSource: app.globalData.userSource,
85
+      SourceID: app.globalData.SourceID,
86
+      LastUserSource: app.globalData.userSource,
87
+      iv: param.iv,
88
+      encryptedData: param.encryptedData,
89
+    }, function (data) {
90
+      app.globalData.userInfo.NickName = data.NickName;
91
+      app.globalData.userInfo.AvatarUrl = data.AvatarUrl;
92
+      app.globalData.userInfo.Language = data.Language;
93
+      app.globalData.userInfo.Gender = data.Gender;
94
+      app.globalData.userInfo.City = data.City;
95
+      app.globalData.userInfo.Province = data.Province;
96
+      app.globalData.userInfo.Country = data.Country;
97
+      
98
+      wx.navigateBack({
99
+        delta: 1
100
+      });
101
+
102
+    });
103
+  },
104
+  onShareAppMessage: function () {
105
+    return {
106
+      title: app.globalData.ShareTitle,
107
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
108
+      imageUrl: app.globalData.ShareImage,
109
+    }
110
+  },
111
+})

+ 6 - 0
pages/index/accredit.json

@@ -0,0 +1,6 @@
1
+{
2
+  "navigationBarTitleText": "登录",
3
+  "navigationBarBackgroundColor": "#ffffff",
4
+  "navigationBarTextStyle": "black",
5
+  "backgroundColor": "#ffffff"
6
+}

+ 17 - 0
pages/index/accredit.wxml

@@ -0,0 +1,17 @@
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
+  <image src="../images/universalpic_face_default_green_240x240.png" class="universalpic_face_default_green_240x240" />
3
+
4
+  <text class="text0">请登录</text>
5
+
6
+  <view class="btn">
7
+    <button open-type="getUserInfo" bindgetuserinfo="goto" class="btn1 FlexRow">
8
+    <image src="../images/universalpic_share_white_52x40.png" class="universalpic_share_white_52x40" />
9
+
10
+    <view>用微信一键登录</view>
11
+    
12
+    </button>
13
+  </view>
14
+
15
+  <view class="text3">本产品仅对受邀用户开放
16
+  </view>
17
+</view>

+ 67 - 0
pages/index/accredit.wxss

@@ -0,0 +1,67 @@
1
+.container {
2
+  background-color: #fff;
3
+  font-weight: 500;
4
+  position: fixed;
5
+  top:0;
6
+  justify-content: flex-start;
7
+}
8
+
9
+.universalpic_face_default_green_240x240{
10
+  width: 240rpx;
11
+  height:240rpx;
12
+  border-radius: 50%;
13
+  margin-top: 60rpx;
14
+}
15
+
16
+.text0{
17
+  font-size:54rpx;
18
+  text-align: center;
19
+  margin-top: 30rpx;
20
+  z-index: 10;
21
+  color:#03AF69;
22
+}
23
+
24
+.text1{
25
+  font-size:36rpx;
26
+  text-align: center;
27
+  margin-top: 0rpx;
28
+  z-index: 10;
29
+  color:#fff;
30
+}
31
+
32
+
33
+.btn {
34
+  width: 520rpx;
35
+  height: 100rpx;
36
+  background-color:#13925C;
37
+  border-radius: 14rpx;
38
+  margin-top: 60rpx;
39
+  z-index: 10;
40
+}
41
+
42
+.btn1 {
43
+  width: 100%;
44
+  height: 90rpx;
45
+  background-color: #03AF69;
46
+  border-radius: 10rpx;
47
+  position:relative;
48
+  top:0;
49
+  font-size: 36rpx;
50
+  text-align: center;
51
+  line-height: 90rpx;
52
+  color:#fff;
53
+}
54
+
55
+.universalpic_share_white_52x40{
56
+  width: 52rpx;
57
+  height: 41rpx;
58
+  margin-right: 20rpx;
59
+}
60
+
61
+.text3{
62
+  font-size:24rpx;
63
+  margin-top: 30rpx;
64
+  z-index: 10;
65
+  font-weight: 400;
66
+  color:#000;
67
+}

+ 218 - 45
pages/index/index.js

@@ -1,54 +1,227 @@
1
-//index.js
2
-//获取应用实例
3
-const app = getApp()
1
+import common from '../../utils/util';
2
+import server from '../../utils/main';
3
+
4
+const app = getApp();
4 5
 
5 6
 Page({
6 7
   data: {
7
-    motto: 'Hello World',
8
-    userInfo: {},
9
-    hasUserInfo: false,
10
-    canIUse: wx.canIUse('button.open-type.getUserInfo')
11
-  },
12
-  //事件处理函数
13
-  bindViewTap: function() {
14
-    wx.navigateTo({
15
-      url: '../logs/logs'
16
-    })
17 8
   },
18
-  onLoad: function () {
19
-    if (app.globalData.userInfo) {
20
-      this.setData({
21
-        userInfo: app.globalData.userInfo,
22
-        hasUserInfo: true
23
-      })
24
-    } else if (this.data.canIUse){
25
-      // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
26
-      // 所以此处加入 callback 以防止这种情况
27
-      app.userInfoReadyCallback = res => {
9
+  onLoad: function (options) {
10
+    if (options) {
11
+      if (options.UserID) {
12
+        console.log("UserID:" + options.UserID);
13
+        app.globalData.introducer = options.UserID;
14
+
15
+        if (options.QuestionTypeID)
16
+          questionTypeID = options.QuestionTypeID;
17
+      }
18
+      if (options.goto) {
19
+        console.log("goto:" + options.goto);
20
+        app.globalData.goto = options.goto;
21
+      }
22
+      if (options.SourceID) {
23
+        console.log("SourceID:" + options.SourceID);
24
+        app.globalData.SourceID = options.SourceID;
25
+      }
26
+      // 扫码介绍人
27
+      if (options.scene) {
28
+        var scene = decodeURIComponent(options.scene);
29
+        console.log("scene:" + scene);
30
+        var introducer = 0;
31
+        if (scene.indexOf("UserID") >= 0)
32
+          introducer = scene.substr(scene.indexOf("UserID") + 7);
33
+        console.log("introducer:" + introducer);
34
+        app.globalData.introducer = scene;
35
+      }
36
+
37
+      if (options.ProductID) {
38
+        this.setData({
39
+          ProductID: options.ProductID,
40
+          ProductUserID: options.ProductUserID,
41
+        });
42
+      }
43
+
44
+      if (options.GiftID) {
28 45
         this.setData({
29
-          userInfo: res.userInfo,
30
-          hasUserInfo: true
31
-        })
46
+          GiftID: options.GiftID,
47
+        });
48
+      }
49
+    }
50
+    this.setData({
51
+      Containnerheight: common.getSystemHeight(),
52
+    });
53
+
54
+    this.updateProgram();
55
+
56
+    this.getUserInfo();
57
+
58
+  },
59
+  //得到用户信息
60
+  getUserInfo: function (cb) {
61
+    var that = this
62
+    //调用登录接口
63
+    wx.login({
64
+      success: function (res0) {
65
+        app.globalData.userInfo = {};
66
+        app.globalData.userInfo.Code = res0.code;
67
+        //console.log("Code:" + res0.code);
68
+
69
+        wx.getSetting({
70
+          scope: "scope.userInfo",
71
+          success(res) {
72
+            if (!res.authSetting['scope.userInfo']) {
73
+              app.globalData.userInfo.nickName = "陌生用户";
74
+              app.globalData.userInfo.language = "";
75
+              app.globalData.userInfo.gender = "0";
76
+              app.globalData.userInfo.city = "";
77
+              app.globalData.userInfo.province = "";
78
+              app.globalData.userInfo.country = "";
79
+              app.globalData.userInfo.avatarUrl = "../images/universalpic_face_default_blue_120x120.png";
80
+              that.login(app.globalData.userInfo);
81
+            }
82
+            else {
83
+              wx.getUserInfo({
84
+                withCredentials: false,
85
+                success: function (res) {
86
+                  app.globalData.userInfo = res.userInfo;
87
+
88
+                  app.globalData.userInfo.NickName = app.globalData.userInfo.nickName;
89
+                  app.globalData.userInfo.AvatarUrl = app.globalData.userInfo.avatarUrl;
90
+
91
+                  app.globalData.userInfo.Code = res0.code;
92
+                  that.login(app.globalData.userInfo);
93
+
94
+                },
95
+                fail: function (res) {
96
+                  that.login(app.globalData.userInfo);
97
+                }
98
+              });
99
+
100
+            }
101
+          }
102
+        });
103
+      },
104
+      fail: function () {
105
+
32 106
       }
33
-    } else {
34
-      // 在没有 open-type=getUserInfo 版本的兼容处理
35
-      wx.getUserInfo({
36
-        success: res => {
37
-          app.globalData.userInfo = res.userInfo
38
-          this.setData({
39
-            userInfo: res.userInfo,
40
-            hasUserInfo: true
41
-          })
107
+    });
108
+  },
109
+
110
+  login: function (param) {
111
+    var that = this;
112
+
113
+    server.getLocalHost(function () {
114
+      server.postData('MiaoguoLogin', {
115
+        Code: param.Code,
116
+        NickName: param.nickName,
117
+        Language: param.language,
118
+        Gender: param.gender,
119
+        City: param.city,
120
+        Province: param.province,
121
+        Country: param.country,
122
+        AvatarUrl: param.avatarUrl,
123
+        Introducer: app.globalData.introducer,
124
+        UserSource: app.globalData.userSource,
125
+        SourceID: app.globalData.SourceID,
126
+        LastUserSource: app.globalData.userSource,
127
+        Brand: app.globalData.systemInfo.brand,
128
+        Model: app.globalData.systemInfo.model,
129
+        PixelRatio: app.globalData.systemInfo.pixelRatio,
130
+        ScreenWidth: app.globalData.systemInfo.screenWidth,
131
+        ScreenHeight: app.globalData.systemInfo.screenHeight,
132
+        WindowWidth: app.globalData.systemInfo.windowWidth,
133
+        WindowHeight: app.globalData.systemInfo.windowHeight,
134
+        WXLanguage: app.globalData.systemInfo.language,
135
+        WXVersion: app.globalData.systemInfo.version,
136
+        System: app.globalData.systemInfo.system,
137
+        Platform: app.globalData.systemInfo.platform,
138
+        SDKVersion: app.globalData.systemInfo.SDKVersion,
139
+        ProgramVersion: app.globalData.Version,
140
+      }, function (data) {
141
+        if (!data) {
142
+          timeout3 = setTimeout(function () {
143
+            that.getUserInfo();
144
+            console.log("reboot:" + new Date().getTime());
145
+          }, 2000);
146
+        }
147
+        else {
148
+          app.globalData.userInfo = data;
149
+
150
+          var isShow = data.IsShow;
151
+          if (isShow == -1) {
152
+            isShow = 0;
153
+          }
154
+          else {
155
+            var systemInfo = wx.getSystemInfoSync();
156
+            if (isShow == 0 && systemInfo.system && systemInfo.system.indexOf("Android") >= 0) {
157
+              isShow = 1;
158
+            }
159
+          }
160
+
161
+          app.globalData.IsShow = isShow;
162
+          if (app.globalData.userInfo.IsMember == 1)
163
+            app.globalData.IsLocked = 0;
164
+
165
+          //测试
166
+          //var url = '../../package4/main/giftcard?GiftID=89542&UserID=1';
167
+          //var url = '../main/share';
168
+          // var url = '../../package4/main/share';
169
+          // wx.redirectTo({
170
+          //   url: url,
171
+          // });
172
+
173
+          var url = '../main/default';
174
+
175
+          setTimeout(function () {
176
+            wx.redirectTo({
177
+              url: url,
178
+            });
179
+          }, 2000);
180
+
181
+          that.getBaiduToken();
42 182
         }
43
-      })
183
+      });
184
+
185
+    });
186
+  },
187
+  getBaiduToken: function () {
188
+    server.getLocalHost(function () {
189
+      server.getData('GetBaiduToken', function (data) {
190
+        if (data) {
191
+          app.globalData.BaiduToken = data;
192
+        }
193
+      });
194
+    });
195
+  },
196
+
197
+  updateProgram: function () {
198
+    const updateManager = wx.getUpdateManager();
199
+
200
+    updateManager.onCheckForUpdate(function (res) {
201
+      // 请求完新版本信息的回调
202
+      console.log(res.hasUpdate)
203
+    });
204
+
205
+    updateManager.onUpdateReady(function () {
206
+      wx.showModal({
207
+        title: '更新提示',
208
+        content: '新版本已经准备好,是否重启应用?',
209
+        success: function (res) {
210
+          if (res.confirm) {
211
+            // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
212
+            updateManager.applyUpdate()
213
+          }
214
+        }
215
+      });
216
+
217
+    });
218
+  },
219
+
220
+  onShareAppMessage: function () {
221
+    return {
222
+      title: app.globalData.ShareTitle,
223
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
224
+      imageUrl: app.globalData.ShareImage,
44 225
     }
45 226
   },
46
-  getUserInfo: function(e) {
47
-    console.log(e)
48
-    app.globalData.userInfo = e.detail.userInfo
49
-    this.setData({
50
-      userInfo: e.detail.userInfo,
51
-      hasUserInfo: true
52
-    })
53
-  }
54
-})
227
+})

+ 1 - 1
pages/index/index.json

@@ -1,3 +1,3 @@
1 1
 {
2
-  "usingComponents": {}
2
+  "navigationBarTitleText": "秒过"
3 3
 }

+ 4 - 13
pages/index/index.wxml

@@ -1,13 +1,4 @@
1
-<!--index.wxml-->
2
-<view class="container">
3
-  <view class="userinfo">
4
-    <button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
5
-    <block wx:else>
6
-      <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
7
-      <text class="userinfo-nickname">{{userInfo.nickName}}</text>
8
-    </block>
9
-  </view>
10
-  <view class="usermotto">
11
-    <text class="user-motto">{{motto}}</text>
12
-  </view>
13
-</view>
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
+  <image src='../images/program_start_footer.png' class="program_start_footer" />
3
+  <view class="text1">可以用来记忆一切的工具</view>  
4
+</view>

+ 13 - 16
pages/index/index.wxss

@@ -1,21 +1,18 @@
1
-/**index.wxss**/
2
-.userinfo {
3
-  display: flex;
4
-  flex-direction: column;
5
-  align-items: center;
1
+.container {
2
+  justify-content: flex-start;
3
+  font-weight: 500;
4
+  color: #1e1e1e;
5
+  background-color: #fff;
6 6
 }
7 7
 
8
-.userinfo-avatar {
9
-  width: 128rpx;
10
-  height: 128rpx;
11
-  margin: 20rpx;
12
-  border-radius: 50%;
8
+.program_start_footer{
9
+  position: fixed;
10
+  bottom:0;
11
+  width:100%;
12
+  height:590rpx;
13 13
 }
14 14
 
15
-.userinfo-nickname {
16
-  color: #aaa;
17
-}
18
-
19
-.usermotto {
20
-  margin-top: 200px;
15
+.text1{
16
+  font-size:26rpx;
17
+  margin-top: 130rpx;
21 18
 }

+ 46 - 35
pages/miaoguo/add.js

@@ -22,29 +22,13 @@ Page({
22 22
   },
23 23
   onShow: function () {
24 24
     var that = this;
25
-    var card = {};
26
-    var list = wx.getStorageSync("CardList");
25
+    
27 26
     if (that.data.UpdateType == "add") {
28
-      
29
-      
30
-      card.MiaoguoCardID = 0;
31
-      card.Content = [];
32
-      for (var i = 0; i < 4; i++) {
33
-        var obj = {};
34
-        obj.ContentType = i;
35
-        obj.Content = [];
36
-        card.Content.push(obj);
37
-      }
38
-      wx.setStorageSync("CardList", [card]);
39
-      that.setData({
40
-        MiaoguoCardID: 0,
41
-        Field: [[], [], [], []],
42
-        Tags: [],
43
-        UpdateType:"add2",
44
-      });
27
+      that.initAddCard();
45 28
     }
46 29
     else {
47 30
       var card = {};
31
+      var list = wx.getStorageSync("CardList");
48 32
       for (var i = 0; i < list.length; i++) {
49 33
         if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
50 34
           card = main.changeStringToView(list[i].Content);
@@ -138,7 +122,7 @@ Page({
138 122
             str = "[图]" + item.Content + "[/图]";
139 123
           }
140 124
           else if (item.Type == "line") {
141
-            str = "[线]" + item.Content + "[/线]";
125
+            str = item.Content[0] + "[线]" + item.Content[1] + "[/线]" + item.Content[2];
142 126
           }
143 127
           else if (item.Type == "sound") {
144 128
             if (item.SoundMark)
@@ -161,22 +145,25 @@ Page({
161 145
       //   param: common.Encrypt(JSON.stringify(param1))
162 146
       // }
163 147
       main.postData('AddMiaoguoCard?Type=' + that.data.UpdateType + '&UserID=' + userid, param1, function (data) {
164
-        that.setData({
165
-          IsShowRemind2: true,
166
-        });
167
-        setTimeout(function () {
168
-          that.setData({
169
-            IsShowRemind2: false,
170
-          });
171
-        }, 2000);
172
-        if (that.data.UpdateType == "add") {
148
+        if (that.data.UpdateType == "edit") {
149
+          that.saveNewData();
150
+          that.onClose();
151
+        }
152
+        else{
173 153
           that.setData({
174
-            Field: [[], [], [], []],
175
-            MiaoguoCardID: 0,
176
-            Tags: [],
154
+            IsShowRemind2: true,
177 155
           });
156
+          setTimeout(function () {
157
+            that.setData({
158
+              IsShowRemind2: false,
159
+            });
160
+          }, 2000);
161
+          
162
+          if (that.data.UpdateType == "add2") {
163
+            that.initAddCard();
164
+          }
165
+          that.saveNewData();
178 166
         }
179
-        that.saveNewData();
180 167
       });
181 168
     }
182 169
   },
@@ -188,6 +175,30 @@ Page({
188 175
         break;
189 176
       }
190 177
     }
191
-
192
-  }
178
+  },
179
+  initAddCard:function(){
180
+    var card = {};
181
+    card.MiaoguoCardID = 0;
182
+    card.Content = [];
183
+    for (var i = 0; i < 4; i++) {
184
+      var obj = {};
185
+      obj.ContentType = i;
186
+      obj.Content = [];
187
+      card.Content.push(obj);
188
+    }
189
+    wx.setStorageSync("CardList", [card]);
190
+    this.setData({
191
+      MiaoguoCardID: 0,
192
+      Field: [[], [], [], []],
193
+      Tags: [],
194
+      UpdateType: "add2",
195
+    });
196
+  },
197
+  onShareAppMessage: function () {
198
+    return {
199
+      title: app.globalData.ShareTitle,
200
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
201
+      imageUrl: app.globalData.ShareImage,
202
+    }
203
+  },
193 204
 })

pages/miaoguo/add.json → pages/main/add.json


+ 1 - 1
pages/miaoguo/add.wxml

@@ -47,7 +47,7 @@
47 47
   </block>
48 48
   <view class='lineFooter'></view>
49 49
 
50
-  <view class="panelItem3 FlexRow" wx:if="{{UpdateType=='add'}}">
50
+  <view class="panelItem3 FlexRow" wx:if="{{UpdateType=='add' || UpdateType=='add2'}}">
51 51
     <view class="panelItem1">
52 52
       今天练
53 53
     </view>

pages/miaoguo/add.wxss → pages/main/add.wxss


+ 27 - 20
pages/miaoguo/addItem.js

@@ -16,28 +16,28 @@ Page({
16 16
   onLoad: function (options) {
17 17
     var id = options.id;
18 18
     var fieldid = options.fieldid;
19
-    var card={};
20
-    var list = wx.getStorageSync("CardList");
21
-    for (var i = 0; i < list.length; i++) {
22
-      if (id == list[i].MiaoguoCardID) {
23
-        card=list[i];
24
-        break;
25
-      }
26
-    }
27
-    var content=card.Content[fieldid].Content;
28
-    content = main.changeViewToString(content);
29
-    content = main.encryptUrl(content);
19
+    // var card={};
20
+    // var list = wx.getStorageSync("CardList");
21
+    // for (var i = 0; i < list.length; i++) {
22
+    //   if (id == list[i].MiaoguoCardID) {
23
+    //     card=list[i];
24
+    //     break;
25
+    //   }
26
+    // }
27
+    // var content=card.Content[fieldid].Content;
28
+    // content = main.changeViewToString(content);
29
+    // content = main.decryptUrl(content);
30 30
     
31 31
     var that = this;
32 32
     that.setData({
33 33
       MiaoguoCardID:id,
34 34
       Focus: true,
35 35
       FieldNumber: fieldid,
36
-      Field: content,
36
+      // Field: content,
37 37
       Containnerheight: main.getWindowHeight(),
38 38
     });
39 39
     wx.setNavigationBarTitle({
40
-      title: '编辑 段落' + id,
40
+      title: '编辑 段落' + fieldid,
41 41
     });
42 42
   },
43 43
   onShow: function () {
@@ -47,8 +47,9 @@ Page({
47 47
     var card = {};
48 48
     for (var i = 0; i < list.length; i++) {
49 49
       if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
50
+        var content = main.encryptUrl(list[i].Content[this.data.FieldNumber].Content);
50 51
         this.setData({
51
-          Field: list[i].Content[this.data.FieldNumber].Content,
52
+          Field: content,
52 53
         });
53 54
         break;
54 55
       }
@@ -74,9 +75,9 @@ Page({
74 75
     }
75 76
   },
76 77
   onBindblur: function (e) {
77
-    console.log(e);
78
+    //console.log(e);
78 79
     tempCursor = e.detail.cursor;
79
-    console.log("tempCursor:" + tempCursor);
80
+    //console.log("tempCursor:" + tempCursor);
80 81
 
81 82
     if (tempCursor == undefined)
82 83
       tempCursor = this.data["Field"].length;
@@ -85,8 +86,8 @@ Page({
85 86
       str1 = this.data.Field.substr(0, tempCursor);
86 87
       str2 = this.data.Field.substring(tempCursor, this.data.Field.length);
87 88
     }
88
-    console.log("str1:" + str1);
89
-    console.log("str2:" + str2);
89
+    //console.log("str1:" + str1);
90
+    //console.log("str2:" + str2);
90 91
     var cur = 1;
91 92
     if (btnName == "[读]") {
92 93
       cur = 3;
@@ -99,7 +100,6 @@ Page({
99 100
     }
100 101
     this.setData({
101 102
       Field: str1 + btnName + str2,
102
-      Focus: true,
103 103
       Cursor: tempCursor + cur,
104 104
     });
105 105
 
@@ -144,5 +144,12 @@ Page({
144 144
     wx.navigateBack({
145 145
       delta: 1,
146 146
     });
147
-  }
147
+  },
148
+  onShareAppMessage: function () {
149
+    return {
150
+      title: app.globalData.ShareTitle,
151
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
152
+      imageUrl: app.globalData.ShareImage,
153
+    }
154
+  },
148 155
 })

pages/miaoguo/addItem.json → pages/main/addItem.json


pages/miaoguo/addItem.wxml → pages/main/addItem.wxml


pages/miaoguo/addItem.wxss → pages/main/addItem.wxss


+ 8 - 1
pages/miaoguo/cardInfo.js

@@ -32,5 +32,12 @@ Page({
32 32
     that.setData({
33 33
       CardInfo: card
34 34
     });
35
-  }
35
+  },
36
+  onShareAppMessage: function () {
37
+    return {
38
+      title: app.globalData.ShareTitle,
39
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
40
+      imageUrl: app.globalData.ShareImage,
41
+    }
42
+  },
36 43
 })

pages/miaoguo/cardInfo.json → pages/main/cardInfo.json


pages/miaoguo/cardInfo.wxml → pages/main/cardInfo.wxml


pages/miaoguo/cardInfo.wxss → pages/main/cardInfo.wxss


+ 83 - 0
pages/main/default.js

@@ -0,0 +1,83 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+
4
+const app = getApp();
5
+
6
+Page({
7
+  data: {
8
+  },
9
+  onLoad: function () {
10
+    var that = this;
11
+    that.setData({
12
+      Containnerheight: main.getWindowHeight(),
13
+    });
14
+  },
15
+  onShow: function () {
16
+    var that = this;
17
+
18
+    common.getStorageValue(that, "CardMaxNumberNew", 10, function () {
19
+      common.getStorageValue(that, "CardMaxNumberHistory", 30, function () {
20
+        that.getList();
21
+        wx.stopPullDownRefresh();
22
+      });
23
+    });
24
+
25
+    wx.getSetting({
26
+      success(res) {
27
+        if (res.authSetting['scope.userInfo']) {
28
+          that.setData({
29
+            IsAccredit: true,
30
+          });
31
+        }
32
+        else {
33
+          wx.navigateTo({
34
+            url: '../index/accredit',
35
+          });
36
+        }
37
+      }
38
+    })
39
+  },
40
+  onPullDownRefresh: function () {
41
+    this.onShow();
42
+  },
43
+  goto: function (e) {
44
+    var url = e.currentTarget.dataset.url;
45
+    wx.navigateTo({
46
+      url: './' + url,
47
+    })
48
+  },
49
+  getList: function () {
50
+    var that = this;
51
+    var url = 'GetMiaoguoCardToday?UserID=' + app.globalData.userInfo.UserID;
52
+    url += "&New=" + this.data.CardMaxNumberNew;
53
+    url += "&History=" + this.data.CardMaxNumberHistory;
54
+
55
+    main.getData(url, function (data) {
56
+      if (data) {
57
+        var TodayTaskNumber = data.ListNew.length + data.ListReview.length + data.ListHistory.length;
58
+        that.setData({
59
+          List: data,
60
+          DayNumber: data.DayNumber,
61
+          TodayTaskNumber: TodayTaskNumber,
62
+        });
63
+
64
+        wx.setStorageSync("TaskToday", data);
65
+        main.getData("GetBaiduToken", function (data) {
66
+          app.globalData.BaiduToken = data;
67
+        });
68
+      }
69
+    });
70
+  },
71
+  gotoCard: function () {
72
+    wx.redirectTo({
73
+      url: './searchCard',
74
+    })
75
+  },
76
+  onShareAppMessage: function () {
77
+    return {
78
+      title: app.globalData.ShareTitle,
79
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
80
+      imageUrl: app.globalData.ShareImage,
81
+    }
82
+  },
83
+})

+ 1 - 1
pages/miaoguo/default.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "navigationBarBackgroundColor": "#3157BA",
3 3
   "navigationBarTextStyle": "white",
4
-  "navigationBarTitleText": "第1天",
4
+  "navigationBarTitleText": "秒过",
5 5
   "backgroundColor": "#3157BA",
6 6
   "enablePullDownRefresh": true
7 7
 }

+ 3 - 8
pages/miaoguo/default.wxml

@@ -1,6 +1,6 @@
1 1
 <view class="container FlexColumn" style='height:{{Containnerheight}}rpx;'>
2 2
   <view class='panel1 FlexColumn'>
3
-    <view class='text1'>今日任务</view>
3
+    <view class='text1'>练习第{{DayNumber}}天</view>
4 4
     <view class='panel11 FlexRow' bindtap="goto" data-url="setting">
5 5
       <view class='universalpic_setup_gray_40x40'></view>
6 6
       <view class='text2'>{{TodayTaskNumber}}</view>
@@ -23,19 +23,14 @@
23 23
       <view class='line1'></view>
24 24
       <view class='panelBottom11 FlexColumn' bindtap="goto" data-url="add?type=add&id=0">
25 25
         <image class="program_tabbar_task_default" src='../images/program_tabbar_add_default.png' />
26
-        <view class='text5'>添加</view>
26
+        <view>添加</view>
27 27
       </view>
28 28
       <view class='line1'></view>
29 29
       <view class='panelBottom11 FlexColumn' bindtap='gotoCard'>
30 30
         <image class="program_tabbar_task_default" src='../images/program_tabbar_note_default.png' />
31
-        <view class='text5'>笔记</view>
31
+        <view>笔记</view>
32 32
       </view>
33 33
 
34 34
     </view>
35 35
   </view>
36
-  <!-- <view class='panelBtn' bindtap="goto" data-url="detail">今日任务</view>
37
-  <view class='panelBtn' bindtap="goto" data-url="search">题库</view>
38
-  <view class='panelBtn' bindtap="goto" data-url="add?type=add">新增</view>
39
-  <view class='panelBtn'>统计</view>
40
-  <view class='panelBtn' bindtap="goto" data-url="setting">设置</view> -->
41 36
 </view>

+ 4 - 1
pages/miaoguo/default.wxss

@@ -52,13 +52,16 @@
52 52
   font-size:20rpx;
53 53
   color:#787878;
54 54
   height:98rpx;
55
-
56 55
 }
57 56
 .panelBottom1 .line1{
58 57
   height:98rpx;
59 58
   width:2rpx;
60 59
 }
61 60
 
61
+.text5{
62
+  color:#000000;
63
+}
64
+
62 65
 .program_tabbar_task_default {
63 66
   width: 54rpx;
64 67
   height: 54rpx;

+ 145 - 86
pages/miaoguo/detail.js

@@ -3,12 +3,15 @@ import main from '../../utils/main';
3 3
 
4 4
 const app = getApp();
5 5
 
6
+const arrFontSize=[46,68,108];
7
+
6 8
 var innerAudioContext1;
7 9
 
8 10
 var listTaskFinished = []; //完成的任务
9 11
 var listTaskReview = []; //需重新复习的任务
10 12
 var timeStart; //计算时长
11 13
 
14
+
12 15
 Page({
13 16
   data: {
14 17
     NumberNew: 0,
@@ -21,6 +24,7 @@ Page({
21 24
     that.setData({
22 25
       Containnerheight: main.getWindowHeight(),
23 26
       IsShowAnswer: [0, 0],
27
+      CanUndo: 1,
24 28
     });
25 29
 
26 30
     innerAudioContext1 = wx.createInnerAudioContext();
@@ -31,53 +35,58 @@ Page({
31 35
   },
32 36
   onShow: function () {
33 37
     var that = this;
34
-
35
-    if (wx.getStorageSync("CardUpdateOK")) {
36
-      var item = wx.getStorageSync("CardEditItem");
37
-      this.data.TaskList[0].Content = item.Content;
38
-      this.setData({
39
-        TaskList: this.data.TaskList,
40
-      });
41
-      wx.removeStorageSync("CardUpdateOK");
42
-    }
43
-
44 38
     if (that.data.NumberNew == 0 &&
45 39
       that.data.NumberReview == 0 &&
46 40
       that.data.NumberHistory == 0) {
47 41
 
48 42
       listTaskFinished = [];
49
-      that.setBackColor(1);
43
+      that.setSoundFile(1);
50 44
     }
51
-    else
52
-      that.setBackColor(-1);
45
+    else{
46
+      that.setSoundFile(-1);
47
+
48
+      
49
+      var list = wx.getStorageSync("CardList");
50
+      if (list && list.length>0){
51
+        for (var i = 0; i < list.length; i++) {
52
+          if (that.data.TaskList[0].MiaoguoCardID == list[i].MiaoguoCardID) {
53
+            var card = {};
54
+            that.data.TaskList[0].Content = list[i].Content;
55
+            that.data.TaskList[0].ContentNew = main.changeStringToView(list[i].Content);
56
+            that.setData({
57
+              TaskList:that.data.TaskList,
58
+            });
59
+            wx.removeStorageSync("CardList");
60
+            break;
61
+          }
62
+        }
63
+      }
64
+      
65
+    }
66
+  },
67
+  onPullDownRefresh: function () {
68
+    this.gotoEdit(1);
53 69
   },
54
-  setBackColor: function (isFinish) {//isFinish=1 结束 =0正常 =-1开始
70
+  setSoundFile: function (isFinish) {//isFinish=1 结束 =0正常 =-1开始
55 71
     var that = this;
56 72
     var url = "/pages/sounds/";
57 73
     if (isFinish == 1) {
58
-      wx.setNavigationBarColor({
59
-        frontColor: '#ffffff',
60
-        backgroundColor: '#47413D',
61
-      });
74
+      url += "end.mp3";
62 75
       if (wx.canIUse('setBackgroundColor')) {
63 76
         wx.setBackgroundColor({
64
-          backgroundColor: '#47413D',
77
+          backgroundColor: "#a5656e",
65 78
         });
66 79
       }
67
-      url += "end.mp3";
80
+      that.getTaskTime();
68 81
     }
69 82
     else {
70
-      wx.setNavigationBarColor({
71
-        frontColor: '#ffffff',
72
-        backgroundColor: "#A5656E",
73
-      });
74
-      if (wx.canIUse('setBackgroundColor')) {
75
-        wx.setBackgroundColor({
76
-          backgroundColor: "#A5656E",
77
-        });
78
-      }
83
+      url += "short2.mp3";
79 84
     }
80
-
85
+    if (isFinish>=0){
86
+      innerAudioContext1.src = url;
87
+      innerAudioContext1.play();
88
+    }
89
+    
81 90
     wx.pageScrollTo({
82 91
       scrollTop: 0,
83 92
     });
@@ -134,19 +143,20 @@ Page({
134 143
     listTaskReview = updateNumberStr(listTaskReview);
135 144
 
136 145
 
137
-    wx.setStorageSync("CardEditItem", list[0]);
138
-
139 146
     //处理列表
140 147
     list = formatList(list);
141 148
     listTaskReview = formatList(listTaskReview);
142 149
 
150
+    var fontSize=0;
151
+    if (list.length>0)
152
+      fontSize = list[0].FontSize;
143 153
 
144 154
     that.setData({
145 155
       NumberNew: arrNew.length,
146 156
       NumberReview: that.data.NumberReview,
147 157
       NumberHistory: arrHistory.length,
148 158
       TaskList: list,
149
-      FontSize:list[0].FontSize,
159
+      FontSize: fontSize,
150 160
       CanUndo: 0,
151 161
     });
152 162
 
@@ -155,7 +165,7 @@ Page({
155 165
 
156 166
     function formatList(list) {
157 167
       for (var i = 0; i < list.length; i++) {
158
-        list[i].Content = main.changeStringToView(list[i].Content);
168
+        list[i].ContentNew = main.changeStringToView(list[i].Content);
159 169
       }
160 170
       return list;
161 171
     }
@@ -211,7 +221,7 @@ Page({
211 221
       else {
212 222
         if (!that.data.IsShowAnswer[0] && !that.data.IsShowAnswer[1]) {
213 223
           that.data.IsShowAnswer[0] = 1;
214
-          if (that.data.TaskList[0].Content.Field[3].length == 0) {
224
+          if (that.data.TaskList[0].ContentNew.Field[3].length == 0) {
215 225
             that.data.IsShowAnswer[1] = 1;
216 226
           }
217 227
         }
@@ -233,48 +243,50 @@ Page({
233 243
   onMore: function () {
234 244
     var that = this;
235 245
     wx.showActionSheet({
236
-      itemList: ["详细信息", "编辑笔记", "字体紧凑", "字体标准", "字体宽松"],
246
+      itemList: ["详细信息", "编辑笔记"],
237 247
       success(res) {
238
-        console.log(res.tapIndex);
239
-
240
-        wx.setStorageSync("CardEditItem", that.data.TaskList[0]);
241
-
242
-        if (res.tapIndex == 0) {
243
-          wx.navigateTo({
244
-            url: './cardInfo',
245
-          });
246
-        }
247
-        else if (res.tapIndex == 1) {
248
-          wx.navigateTo({
249
-            url: './add?type=edit'
250
-          });
251
-        }
252
-        else if (res.tapIndex == 2) {
253
-          that.data.TaskList[0].FontSize=46;
254
-          that.setData({
255
-            TaskList: that.data.TaskList,
256
-          });
257
-        }
258
-        else if (res.tapIndex == 3) {
259
-          that.data.TaskList[0].FontSize = 68;
260
-          that.setData({
261
-            TaskList: that.data.TaskList,
262
-          });
263
-        }
264
-        else if (res.tapIndex == 4) {
265
-          that.data.TaskList[0].FontSize = 108;
266
-          that.setData({
267
-            TaskList: that.data.TaskList,
268
-          });
269
-        }
270
-
248
+        that.gotoEdit(res.tapIndex);
271 249
       },
272 250
     })
273 251
   },
252
+  gotoEdit:function(tapIndex){
253
+    var that = this;
254
+    //console.log(res.tapIndex);
255
+    var list = [];
256
+    that.data.TaskList[0].MiaoguoCardID = that.data.TaskList[0].ID;
257
+    list.push(that.data.TaskList[0]);
258
+    wx.setStorageSync("CardList", list);
259
+
260
+    if (tapIndex == 0) {
261
+      wx.navigateTo({
262
+        url: './cardInfo?id=' + that.data.TaskList[0].MiaoguoCardID,
263
+      });
264
+    }
265
+    else if (tapIndex == 1) {
266
+      wx.navigateTo({
267
+        url: './add?type=edit&id=' + that.data.TaskList[0].MiaoguoCardID,
268
+      });
269
+    }
270
+  },
271
+  onFontSize:function(){
272
+    for(var i=0;i<arrFontSize.length;i++){
273
+      if (arrFontSize[i] == this.data.TaskList[0].FontSize){
274
+        i++;
275
+        if (i==arrFontSize.length)
276
+          i=0;
277
+        this.data.TaskList[0].FontSize = arrFontSize[i];
278
+        break;
279
+      }
280
+    }
281
+    
282
+    this.setData({
283
+      TaskList: this.data.TaskList,
284
+    });
285
+  },
274 286
   gotoPrev: function () {
275 287
     if (listTaskFinished.length > 0) {
276 288
       var card = listTaskFinished.pop();
277
-      console.log(card);
289
+      //console.log(card);
278 290
 
279 291
       var that = this;
280 292
       var url = "UndoMiaoguoCard?";
@@ -303,7 +315,6 @@ Page({
303 315
         if (card.NumberReview < that.data.NumberReview) {
304 316
           listTaskReview.pop();
305 317
         }
306
-        wx.setStorageSync("CardEditItem", card.Card);
307 318
         that.data.TaskList.unshift(card.Card);
308 319
         var canUndo = 1;
309 320
         if (listTaskFinished.length == 0)
@@ -318,12 +329,21 @@ Page({
318 329
           CanUndo: canUndo,
319 330
         });
320 331
       });
332
+
333
+      wx.showToast({
334
+        title: '已返回',
335
+        icon:'none',
336
+      });
321 337
     }
322
-    that.setBackColor(0);
338
+    that.setSoundFile(0);
323 339
   },
324 340
   gotoNext: function (e) {
325 341
     var that = this;
326 342
 
343
+    wx.showLoading({
344
+      title: '请稍候',
345
+    });
346
+
327 347
     var btnnumber = e.currentTarget.dataset.btnnumber;
328 348
     var time = e.currentTarget.dataset.time;
329 349
 
@@ -391,6 +411,12 @@ Page({
391 411
       }
392 412
 
393 413
     }
414
+    else{
415
+      wx.showToast({
416
+        title: '已搁置',
417
+        icon: 'none',
418
+      });
419
+    }
394 420
 
395 421
     //修改学习任务个数
396 422
     var learningType = 0;
@@ -427,6 +453,8 @@ Page({
427 453
     }
428 454
     this.saveCard(obj, function () {
429 455
 
456
+      wx.hideLoading();
457
+      
430 458
       //添加完成列表,去掉任务列表数据
431 459
       listTaskFinished.push(finishCard);
432 460
       that.data.TaskList.shift();
@@ -438,9 +466,7 @@ Page({
438 466
         that.data.TaskList.unshift(listTaskReview.shift());
439 467
       }
440 468
 
441
-      console.log(JSON.stringify(that.data.TaskList[0]));
442
-
443
-      wx.setStorageSync("CardEditItem", that.data.TaskList[0]);
469
+      //console.log(JSON.stringify(that.data.TaskList[0]));
444 470
 
445 471
       if (that.data.NumberNew == 0 &&
446 472
         that.data.NumberReview == 0 &&
@@ -452,7 +478,7 @@ Page({
452 478
           NumberHistory: 0,
453 479
           CanUndo: 1,
454 480
         });
455
-        that.setBackColor(1);
481
+        that.setSoundFile(1);
456 482
       } else {
457 483
         //任务没有完成,下一张卡片
458 484
         that.setData({
@@ -464,10 +490,11 @@ Page({
464 490
           FontSize: that.data.TaskList[0].FontSize,
465 491
           CanUndo: 1,
466 492
         });
467
-        that.setBackColor(0);
493
+        that.setSoundFile(0);
468 494
       }
469 495
     });
470 496
 
497
+    
471 498
   },
472 499
   saveCard: function (obj, callback) {
473 500
     var url = "UpdateMiaoguoCardToday?";
@@ -491,6 +518,7 @@ Page({
491 518
     });
492 519
   },
493 520
   playSound: function (e) {
521
+    var that=this;
494 522
     var str = e.currentTarget.dataset.content;
495 523
     var url;
496 524
     if (str.indexOf("英 [") >= 0 || str.indexOf("美 [") >= 0) {
@@ -505,6 +533,42 @@ Page({
505 533
     }
506 534
     this.audioCtx.setSrc(url);
507 535
     this.audioCtx.play();
536
+
537
+    var fieldid = e.currentTarget.dataset.fieldid;
538
+    var content = that.data.TaskList[0].ContentNew.Field[fieldid];
539
+    var selectIndex=0;
540
+    for (var i = 0; i < content.length;i++){
541
+      if (content[i].Type == 'sound'){
542
+        if (content[i].Content == e.currentTarget.dataset.content) {
543
+          content[i].SoundImageName="gif";
544
+          selectIndex=i;
545
+          break;
546
+        }
547
+      }
548
+    }
549
+    that.setData({
550
+      TaskList: that.data.TaskList,
551
+    });
552
+    setTimeout(function(){
553
+      content[selectIndex].SoundImageName = "png";
554
+      that.data.TaskList[0].ContentNew.Field[fieldid]=content;
555
+      that.setData({
556
+        TaskList: that.data.TaskList,
557
+      });
558
+    },2000);
559
+  },
560
+  getTaskTime: function () {
561
+    var that=this;
562
+    var url = "GetMiaoguoTaskTime?";
563
+    url += "UserID=" + app.globalData.userInfo.UserID;
564
+    main.getData(url, function (data) {
565
+      if (data){
566
+        data = common.getMinuteSecond(data);
567
+        that.setData({
568
+          TodayTime: data,
569
+        });
570
+      }
571
+    });
508 572
   },
509 573
   showNumberContainner: function () {
510 574
     this.setData({
@@ -518,15 +582,10 @@ Page({
518 582
   },
519 583
   onShareAppMessage: function () {
520 584
     return {
521
-      title: '',
522
-      path: 'pages/miaoguo/default',
523
-      success: function (res) { },
524
-      fail: function (err) {
525
-        console.log(err);
526
-      },
527
-      complete: function (res) {
528
-        console.log(res);
529
-      },
585
+      title: app.globalData.ShareTitle,
586
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
587
+      imageUrl: app.globalData.ShareImage,
530 588
     }
531 589
   },
590
+
532 591
 });

+ 9 - 0
pages/main/detail.json

@@ -0,0 +1,9 @@
1
+{
2
+  "navigationBarBackgroundColor": "#a5656e",
3
+  "navigationBarTextStyle": "white",
4
+  "navigationBarTitleText": "练习",
5
+  "backgroundColor": "#3157BA",
6
+  "backgroundColorTop": "#a5656e",
7
+  "backgroundColorBottom": "#362738",
8
+  "enablePullDownRefresh": true
9
+}

+ 181 - 0
pages/main/detail.wxml

@@ -0,0 +1,181 @@
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight-50}}rpx;'>
2
+  <view class='panelTop FlexRow'>
3
+    <view class='panelCancel' wx:if="{{CanUndo==0}}">
4
+    </view>
5
+    <view class='panelCancel FlexRow' bindtap='gotoPrev' wx:if="{{CanUndo==1}}">
6
+      <image src="../images/universalpic_undo_white_20x28.png" class='universalpic_undo_white_20x28' />
7
+    </view>
8
+    <view class='panelCancel1 panelCancel FlexRow' bindtap='gotoNext' data-time="1d" data-btnnumber="1" wx:if="{{NumberNew+NumberReview+NumberHistory>0}}">
9
+      <image src="../images/universalpic_shelve_white_30x14.png" class='universalpic_shelve_white_30x14' />
10
+    </view>
11
+    <view class='panelNumber FlexRow' bindtap='showNumberContainner'>
12
+      <view class="panelNumber1">{{NumberNew}}</view>
13
+      <view class="panelNumber1">{{NumberHistory}}</view>
14
+      <view class="panelNumber1">{{NumberReview}}</view>
15
+      <view class="panelNumber2 panelNumber1">{{NumberNew+NumberReview+NumberHistory}}</view>
16
+    </view>
17
+    <view class='panelCancel2 panelCancel FlexRow' bindtap='onFontSize' wx:if="{{NumberNew+NumberReview+NumberHistory>0}}">
18
+      <image src="../images/universalpic_typesize_white_30x18.png" class='universalpic_typesize_white_30x18' />
19
+    </view>
20
+    <view class='panelCancel FlexRow' bindtap='onMore' wx:if="{{NumberNew+NumberReview+NumberHistory>0}}">
21
+      <image src="../images/universalpic_more_white_32x8.png" class='universalpic_more_white_32x8' />
22
+    </view>
23
+
24
+    <view class='panelCancel' wx:if="{{NumberNew+NumberReview+NumberHistory==0}}">
25
+    </view>
26
+  </view>
27
+  <view class="panelTop0"></view>
28
+
29
+  <!-- 练习页 -->
30
+  <block wx:if="{{(NumberNew+NumberReview+NumberHistory)>0}}">
31
+
32
+    <view class="panelField10"></view>
33
+    <view class="panelField1 FlexColumn" bindtap="onShowAnswer">
34
+      <view class="panelField11 panelItem FlexRow" style="font-size:{{TaskList[0].FontSize}}rpx;">
35
+        <block wx:for="{{TaskList[0].ContentNew.Field[1]}}" wx:key="index">
36
+          <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
37
+
38
+          <text class="textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
39
+
40
+          <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
41
+            <text>{{item.Content[0]}}</text>
42
+          <text class="textLine">{{item.Content[1]}}</text>
43
+          <text>{{item.Content[2]}}</text>
44
+          </text>
45
+
46
+          <view class="panelSound FlexRow" wx:if="{{item.Type=='sound'}}" bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">
47
+            <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.{{item.SoundImageName}}' />
48
+          </view>
49
+
50
+          <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">{{item.Content}}</text>
51
+
52
+          <image class="imageBishun" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' />
53
+        </block>
54
+      </view>
55
+
56
+    </view>
57
+    <view class="panelTag FlexRow" bindtap="onShowAnswer">
58
+      <view wx:if="{{!TaskList[0].ContentNew.Tags || TaskList[0].ContentNew.Tags.length==0}}"></view>
59
+      <view class="panelTag1 FlexRow" wx:if="{{TaskList[0].ContentNew.Tags && TaskList[0].ContentNew.Tags.length>0}}">
60
+        <view class="tag" wx:for="{{TaskList[0].ContentNew.Tags}}" wx:key="index">{{item}}</view>
61
+      </view>
62
+
63
+      <view class='right2 FlexRow' catchtap='onShowAnswer' data-start="true" wx:if="{{IsShowAnswer[0]==1}}">
64
+        <view class="line1"></view>
65
+        <image class="universalpic_restore_black_34x34" src='../images/universalpic_restore_white_34x34.png' />
66
+      </view>
67
+
68
+    </view>
69
+
70
+    <view class="panelField20 FlexColumn" style='min-height:{{Containnerheight-480}}rpx;' bindtap="onShowAnswer">
71
+      <view class="panelField2 FlexColumn" wx:for="{{[2,3]}}" wx:key="indexParent" wx:for-index="indexParent" wx:for-item="itemParent" wx:if="{{TaskList[0].ContentNew.Field[itemParent].length>0 && IsShowAnswer[itemParent-2]}}">
72
+
73
+        <view class="panelField21 panelItem FlexRow">
74
+          <block wx:for="{{TaskList[0].ContentNew.Field[itemParent]}}" wx:key="index">
75
+            <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
76
+
77
+            <text class="textNormal2 textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
78
+
79
+            <text class="textNormal2 textNormal FlexRow" wx:if="{{item.Type=='line'}}">
80
+              <text>{{item.Content[0]}}</text>
81
+            <text class="textLine">{{item.Content[1]}}</text>
82
+            <text>{{item.Content[2]}}</text>
83
+            </text>
84
+
85
+            <view class="panelSound FlexRow" wx:if="{{item.Type=='sound'}}" bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">
86
+              <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.{{item.SoundImageName}}' />
87
+            </view>
88
+
89
+            <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">{{item.Content}}</text>
90
+
91
+            <image class="imageBishun" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' />
92
+
93
+          </block>
94
+        </view>
95
+      </view>
96
+    </view>
97
+  </block>
98
+
99
+  <!-- 最后一页 -->
100
+  <view class='panelLast FlexColumn' wx:if="{{NumberNew+NumberReview+NumberHistory==0}}" style='height:{{Containnerheight-50}}rpx;'>
101
+    <view class='text1'>做完了</view>
102
+
103
+    <view class="panelLastTime FlexColumn">
104
+      <view>今日用时</view>
105
+      <view class="time">{{TodayTime}}</view>
106
+    </view>
107
+
108
+    <image src="../images/practice_introduction_marks_a.png" class='practice_introduction_marks_a' />
109
+    <text class='text2'>君子曰:学不可以已\n——意指求学不可以让它停止,即学习是无止\n境的。</text>
110
+    <image src="../images/practice_introduction_marks_b.png" class='practice_introduction_marks_b' />
111
+    
112
+    <text class='text3'>我是荀子,战国末期赵国人\n思想家、文学家、政治家\n约公元前313年-公元前238年</text>
113
+    
114
+  </view>
115
+
116
+  <view class='footer' wx:if="{{NumberNew+NumberReview+NumberHistory>0}}"></view>
117
+  <view class='footer1 footer' wx:if="{{NumberNew+NumberReview+NumberHistory==0}}"></view>
118
+
119
+  <block wx:if="{{IsShowAnswer[1]}}">
120
+    <view class="panelBottomAnswer0"></view>
121
+    <view class='panelBottomAnswer panelBottom FlexRow'>
122
+      <view class="Answer FlexColumn" hover-class="AnswerHover" catchtap='gotoNext' data-time="{{TaskList[0].Number0}}" data-btnnumber="0">
123
+        <view class="Answer0 btnColor"></view>
124
+        <view class="btnTime">
125
+          {{TaskList[0].Number0Str}}
126
+        </view>
127
+      </view>
128
+      <view class="Answer FlexColumn" hover-class="AnswerHover" catchtap='gotoNext' data-time="{{TaskList[0].Number1}}" data-btnnumber="3" wx:if="{{TaskList[0].Number1}}">
129
+        <view class="Answer1 btnColor"></view>
130
+        <view class="btnTime">
131
+          {{TaskList[0].Number1Str}}
132
+        </view>
133
+      </view>
134
+      <view class="Answer FlexColumn" hover-class="AnswerHover" catchtap='gotoNext' data-time="{{TaskList[0].Number2}}" data-btnnumber="4">
135
+        <view class="Answer2 btnColor"></view>
136
+        <view class="btnTime">
137
+          {{TaskList[0].Number2Str}}
138
+        </view>
139
+      </view>
140
+      <view class="Answer FlexColumn" hover-class="AnswerHover" catchtap='gotoNext' data-time="{{TaskList[0].Number3}}" data-btnnumber="5" wx:if="{{TaskList[0].Number3}}">
141
+        <view class="Answer3 btnColor"></view>
142
+        <view class="btnTime">
143
+          {{TaskList[0].Number3Str}}
144
+        </view>
145
+      </view>
146
+    </view>
147
+  </block>
148
+</view>
149
+
150
+<view wx:if="{{IsShowNumberInfo}}" catchtap='closeNumberContainner' class="numberContainer container FlexColumn" style='height:{{Containnerheight}}rpx;'>
151
+  <view class='numberContainer1 FlexColumn'>
152
+    <view class="numberContainer11 FlexRow">
153
+      <view class='left'>剩余任务</view>
154
+      <view class='numberContainer111 right'>今天还剩{{NumberNew+NumberReview+NumberHistory}}条</view>
155
+    </view>
156
+    <view class="numberContainer12 FlexRow">
157
+      <view class='left'>新笔记</view>
158
+      <view class='right'>{{NumberNew}}条</view>
159
+    </view>
160
+    <view class="lineWidthAll FlexRow">
161
+      <view class="lineWidth700"></view>
162
+    </view>
163
+    <view class="numberContainer12 FlexRow">
164
+      <view class='left'>旧笔记</view>
165
+      <view class='right'>{{NumberHistory}}条</view>
166
+    </view>
167
+    <view class="lineWidthAll FlexRow">
168
+      <view class="lineWidth700"></view>
169
+    </view>
170
+    <view class="numberContainer12 FlexRow">
171
+      <view class='left'>重练</view>
172
+      <view class='right'>{{NumberReview}}条</view>
173
+    </view>
174
+    <view class='lineFooter'></view>
175
+    <view class="numberContainer13 FlexRow">
176
+      <view>知道了</view>
177
+    </view>
178
+  </view>
179
+</view>
180
+
181
+<audio hidden='true' id="playAudio"></audio>

+ 182 - 103
pages/miaoguo/detail.wxss

@@ -1,8 +1,7 @@
1 1
 .container {
2 2
   justify-content: flex-start;
3 3
   font-weight: 500;
4
-  color: #1e1e1e;
5
-  background-color: #362738;
4
+  background-color: #a5656e;
6 5
 }
7 6
 
8 7
 /* 工具栏 */
@@ -15,6 +14,19 @@
15 14
   font-size: 20rpx;
16 15
   z-index: 10;
17 16
   background-color: #a5656e;
17
+  justify-content: space-between;
18
+}
19
+
20
+.panelTop0 {
21
+  width: 100%;
22
+  height: 30rpx;
23
+  position: fixed;
24
+  top: 110rpx;
25
+  z-index: 10;
26
+  background:-webkit-linear-gradient(#a5656e,rgba(165,101,110,0));
27
+  background:-o-linear-gradient(#a5656e,rgba(165,101,110,0));
28
+  background:-moz-linear-gradient(#a5656e,rgba(165,101,110,0));
29
+  background:linear-gradient(#a5656e,rgba(165,101,110,0));
18 30
 }
19 31
 
20 32
 .panelCancel {
@@ -34,7 +46,10 @@
34 46
   width: 17rpx;
35 47
   height: 24rpx;
36 48
 }
37
-
49
+.universalpic_typesize_white_30x18{
50
+  width: 29rpx;
51
+  height: 18rpx;
52
+}
38 53
 .universalpic_shelve_white_30x14 {
39 54
   width: 36rpx;
40 55
   height: 20rpx;
@@ -73,12 +88,16 @@
73 88
 }
74 89
 
75 90
 /* 段落 */
91
+.panelField10{
92
+  width: 100%;
93
+  background-color: #a5656e;
94
+  height: 110rpx;
95
+}
76 96
 
77 97
 .panelField1 {
78 98
   width: 100%;
79 99
   background-color: #a5656e;
80 100
   min-height: 320rpx;
81
-  margin-top: 110rpx;
82 101
   justify-content: flex-start;
83 102
 }
84 103
 
@@ -89,48 +108,15 @@
89 108
   margin: 60rpx 0 80rpx 0;
90 109
 }
91 110
 
92
-.panelItem {
93
-  width: 650rpx;
94
-  font-weight: 400;
95
-  flex-wrap: wrap;
96
-  justify-content: flex-start;
97
-  color: #fff;
98
-}
99
-
100
-.panelItem .universalpic_read_gray_40x40 {
101
-  width: 40rpx;
102
-  height: 40rpx;
103
-  margin: 0 10rpx 0 10rpx;
104
-}
105
-
106
-.panelItem .textLine {
107
-  text-decoration: underline;
108
-}
109
-
110
-.panelItem .textPinyin {
111
-  text-decoration: underline;
112
-  margin-right: 10rpx;
113
-}
114
-
115
-.panelItem .imageBishun {
116
-  width: 360rpx;
117
-  height: 360rpx;
118
-  margin: 30rpx 0;
119
-}
120
-
121
-.panelItem .textReturn {
122
-  width: 100%;
123
-}
124
-
125
-.panelItem .textReturn2 {
126
-  width: 100%;
127
-  height: 30rpx;
128
-}
129 111
 
130 112
 .panelTag {
131 113
   width: 100%;
132 114
   justify-content: space-between;
133
-  margin: 60rpx 0 20rpx 0;
115
+  align-items: flex-end;
116
+  height:110rpx;
117
+  padding-bottom: 20rpx;
118
+  position: relative;
119
+  background-color: #362738;
134 120
 }
135 121
 
136 122
 .panelTag1 {
@@ -148,19 +134,31 @@
148 134
 }
149 135
 
150 136
 .right2 {
151
-  margin-right: 50rpx;
137
+  position: absolute;
138
+  top:0;
139
+  right:0;
140
+  width:134rpx;
141
+  height:150rpx;
142
+  align-items: flex-start;
152 143
 }
153 144
 
154 145
 .line1 {
155 146
   width: 4rpx;
156 147
   height: 30rpx;
157
-  background-color: #d2d2d2;
148
+  background-color: rgba(255,255,255,0.2);
149
+  margin-top: 66rpx;
158 150
 }
159 151
 
160 152
 .universalpic_restore_black_34x34 {
161 153
   width: 26rpx;
162 154
   height: 26rpx;
163
-  margin-left: 50rpx;
155
+  margin: 68rpx 50rpx 0 50rpx;
156
+}
157
+
158
+.panelField20 {
159
+  width: 100%;
160
+  justify-content: flex-start;
161
+  background-color: #362738;
164 162
 }
165 163
 
166 164
 .panelField2 {
@@ -172,14 +170,81 @@
172 170
   width: 650rpx;
173 171
   font-size: 36rpx;
174 172
   margin: 40rpx 30rpx 0 30rpx;
175
-  color:#fff;
173
+  min-height: 50rpx;
174
+}
175
+
176
+.panelItem {
177
+  width: 650rpx;
178
+  font-weight: 400;
179
+  flex-wrap: wrap;
180
+  justify-content: flex-start;
181
+  color: #fff;
182
+  z-index: 5;
183
+}
184
+
185
+.panelItem .panelSound {
186
+  width: 40rpx;
187
+  height: 40rpx;
188
+  margin: 0 10rpx 0 0;
189
+  background-color: #fff;
190
+  border-radius: 50%;
191
+}
192
+
193
+.panelItem .universalpic_read_mark_black_20x20 {
194
+  width: 21rpx;
195
+  height: 20rpx;
196
+}
197
+
198
+.panelItem .textLine {
199
+  text-decoration: underline;
200
+}
201
+
202
+.panelItem .textNormal{
203
+  min-height:50rpx;
204
+}
205
+
206
+.panelItem .textNormal2{
207
+  font-size:36rpx;
208
+}
209
+
210
+.panelItem .textPinyin {
211
+  text-decoration: underline;
212
+  margin-right: 10rpx;
213
+}
214
+
215
+.panelItem .imageBishun {
216
+  width: 360rpx;
217
+  height: 360rpx;
218
+  margin: 30rpx 0;
219
+}
220
+
221
+.panelItem .textReturn {
222
+  width: 100%;
223
+}
224
+
225
+.panelItem .textReturn2 {
226
+  width: 100%;
227
+  height: 30rpx;
176 228
 }
177 229
 
230
+
178 231
 /* 底部记忆选择 */
179 232
 
233
+.panelBottomAnswer0 {
234
+  height: 30rpx;
235
+  background:-webkit-linear-gradient(rgba(54,39,56,0),#362738);
236
+  background:-o-linear-gradient(rgba(54,39,56,0),#362738);
237
+  background:-moz-linear-gradient(rgba(54,39,56,0),#362738);
238
+  background:linear-gradient(rgba(54,39,56,0),#362738);
239
+  width: 100%;
240
+  position: fixed;
241
+  bottom: 120rpx;
242
+  z-index: 10;
243
+}
244
+
180 245
 .panelBottomAnswer {
181 246
   height: 120rpx;
182
-  background-color: #eee;
247
+  background-color: #362738;
183 248
   width: 100%;
184 249
   position: fixed;
185 250
   bottom: 0;
@@ -192,13 +257,8 @@
192 257
   flex: 1;
193 258
   height: 120rpx;
194 259
   font-size: 24rpx;
195
-  color: #1e1e1e;
260
+  color: #F8F8F8;
196 261
   justify-content: flex-start;
197
-  background-color: #fff;
198
-}
199
-
200
-.AnswerHover {
201
-  background-color: #f0f0f0;
202 262
 }
203 263
 
204 264
 .Answer .btnColor {
@@ -213,11 +273,11 @@
213 273
 }
214 274
 
215 275
 .Answer0 {
216
-  background-color: #fe6659;
276
+  background-color: #FE6659;
217 277
 }
218 278
 
219 279
 .Answer1 {
220
-  background-color: #ffbc00;
280
+  background-color: #FFBC00;
221 281
 }
222 282
 
223 283
 .Answer2 {
@@ -225,54 +285,7 @@
225 285
 }
226 286
 
227 287
 .Answer3 {
228
-  background-color: #0a60be;
229
-}
230
-
231
-.panelLast {
232
-  background-color: #47413d;
233
-  width: 100%;
234
-  justify-content: flex-start;
235
-}
236
-
237
-.practice_report_bg {
238
-  width: 100%;
239
-  height: 290rpx;
240
-  margin-top: 50rpx;
241
-}
242
-
243
-.Avatar {
244
-  width: 260rpx;
245
-  height: 260rpx;
246
-  border-radius: 50%;
247
-  background-color: #9b9b9b;
248
-  margin-top: -100rpx;
249
-}
250
-
251
-.text1 {
252
-  margin-top: 60rpx;
253
-  color: #f0f0f0;
254
-  font-size: 64rpx;
255
-}
256
-
257
-.text2 {
258
-  margin-top: 10rpx;
259
-  color: #9b9b9b;
260
-  font-size: 28rpx;
261
-  font-weight: 400;
262
-  text-align: center;
263
-}
264
-
265
-.panelLastTime {
266
-  font-size: 28rpx;
267
-  font-weight: 400;
268
-  color: #f0f0f0;
269
-  margin-top: 80rpx;
270
-}
271
-
272
-.panelLastTime .time {
273
-  font-size: 36rpx;
274
-  color: #f0f0f0;
275
-  font-family: 'Roboto-Black';
288
+  background-color: #0A60BE;
276 289
 }
277 290
 
278 291
 .numberContainer {
@@ -334,3 +347,69 @@
334 347
   text-align: center;
335 348
   font-weight: 500;
336 349
 }
350
+
351
+.footer{
352
+  background-color: #362738;
353
+  height:180rpx;
354
+  width: 100%;
355
+}
356
+.footer1{
357
+  background-color: #a5656e;
358
+}
359
+
360
+.panelLast {
361
+  width: 100%;
362
+  justify-content: flex-start;
363
+  background-color: #a5656e;
364
+  position: fixed;
365
+  top:0;
366
+}
367
+
368
+.text1 {
369
+  margin-top: 350rpx;
370
+  font-size: 64rpx;
371
+  color: #fff;
372
+}
373
+
374
+.panelLastTime {
375
+  font-size: 28rpx;
376
+  font-weight: 400;
377
+  color: #f0f0f0;
378
+  margin-top: 60rpx;
379
+}
380
+
381
+.panelLastTime .time {
382
+  font-size: 36rpx;
383
+  color: #f0f0f0;
384
+  font-family: 'Roboto-Black';
385
+}
386
+
387
+
388
+.practice_introduction_marks_a{
389
+  width: 22rpx;
390
+  height: 16rpx;
391
+  margin-top: 208rpx;
392
+}
393
+
394
+.text2 {
395
+  margin-top: 30rpx;
396
+  color: #f0f0f0;
397
+  font-size: 28rpx;
398
+  font-weight: 400;
399
+  text-align: center;
400
+}
401
+
402
+.practice_introduction_marks_b{
403
+  width: 22rpx;
404
+  height: 16rpx;
405
+  margin-top: 30rpx;
406
+}
407
+
408
+
409
+.text3 {
410
+  margin-top: 60rpx;
411
+  color: #f0f0f0;
412
+  font-size: 20rpx;
413
+  font-weight: 500;
414
+  text-align: center;
415
+}

+ 15 - 2
pages/miaoguo/preview.js

@@ -41,6 +41,7 @@ Page({
41 41
         card = main.changeStringToView(list[i].Content);
42 42
         card.MiaoguoCardID = list[i].MiaoguoCardID;
43 43
         card.LimitTime = list[i].LimitTime;
44
+        card.FontSize=list[i].FontSize;
44 45
         break;
45 46
       }
46 47
     }
@@ -50,6 +51,7 @@ Page({
50 51
       Tags: card.Tags,
51 52
       PrevID:prevId,
52 53
       NextID:nextId,
54
+      FontSize:card.FontSize,
53 55
       LimitTimeStr: common.formatDateCHS(card.LimitTime),
54 56
     });
55 57
   },
@@ -79,6 +81,10 @@ Page({
79 81
               }
80 82
             }
81 83
             wx.setStorageSync("CardList", list);
84
+            wx.showToast({
85
+              title: '改为今天练',
86
+              icon: 'none',
87
+            });
82 88
           });
83 89
         }
84 90
         else if (res.cancel) {
@@ -119,7 +125,7 @@ Page({
119 125
     wx.showActionSheet({
120 126
       itemList: ["详细信息", "编辑笔记", "删除笔记"],
121 127
       success(res) {
122
-        console.log(res.tapIndex);
128
+        //console.log(res.tapIndex);
123 129
         if (res.tapIndex == 0) {
124 130
           wx.navigateTo({
125 131
             url: './cardInfo?id=' + that.data.MiaoguoCardID,
@@ -172,5 +178,12 @@ Page({
172 178
     wx.navigateBack({
173 179
       delta: 1,
174 180
     });
175
-  }
181
+  },
182
+  onShareAppMessage: function () {
183
+    return {
184
+      title: app.globalData.ShareTitle,
185
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
186
+      imageUrl: app.globalData.ShareImage,
187
+    }
188
+  },
176 189
 })

pages/miaoguo/preview.json → pages/main/preview.json


+ 1 - 1
pages/miaoguo/preview.wxml

@@ -11,7 +11,7 @@
11 11
   </view>
12 12
   <view class='lineFooter'></view>
13 13
   <view class="panelField1 FlexColumn">
14
-    <view class="panelField11 panelItem FlexRow">
14
+    <view class="panelField11 panelItem FlexRow" style="font-size:{{FontSize}}rpx;">
15 15
       <block wx:for="{{Field[1]}}" wx:key="index">
16 16
         <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
17 17
 

pages/miaoguo/preview.wxss → pages/main/preview.wxss


+ 7 - 1
pages/miaoguo/searchCard.js

@@ -43,6 +43,12 @@ Page({
43 43
         })
44 44
       }
45 45
     });
46
-    
46
+  },
47
+  onShareAppMessage: function () {
48
+    return {
49
+      title: app.globalData.ShareTitle,
50
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
51
+      imageUrl: app.globalData.ShareImage,
52
+    }
47 53
   },
48 54
 })

pages/miaoguo/searchCard.json → pages/main/searchCard.json


+ 2 - 2
pages/miaoguo/searchCard.wxml

@@ -21,12 +21,12 @@
21 21
     <view class='panelBottom1 FlexRow'>
22 22
       <view class='panelBottom11 FlexColumn' bindtap="gotoDefault">
23 23
         <image class="program_tabbar_task_default" src='../images/program_tabbar_task_default.png' />
24
-        <view class='text5'>练习</view>
24
+        <view>练习</view>
25 25
       </view>
26 26
       <view class='line1'></view>
27 27
       <view class='panelBottom11 FlexColumn' bindtap="goto" data-url="add?type=add&id=0">
28 28
         <image class="program_tabbar_task_default" src='../images/program_tabbar_add_default.png' />
29
-        <view class='text5'>添加</view>
29
+        <view>添加</view>
30 30
       </view>
31 31
       <view class='line1'></view>
32 32
       <view class='panelBottom11 FlexColumn'>

+ 4 - 0
pages/miaoguo/searchCard.wxss

@@ -79,4 +79,8 @@
79 79
   width: 54rpx;
80 80
   height: 54rpx;
81 81
   margin-bottom: 4rpx;
82
+}
83
+
84
+.text5{
85
+  color:#000000;
82 86
 }

+ 8 - 1
pages/miaoguo/searchCard1.js

@@ -48,5 +48,12 @@ Page({
48 48
     wx.navigateBack({
49 49
       delta: 1,
50 50
     });
51
-  }
51
+  },
52
+  onShareAppMessage: function () {
53
+    return {
54
+      title: app.globalData.ShareTitle,
55
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
56
+      imageUrl: app.globalData.ShareImage,
57
+    }
58
+  },
52 59
 })

pages/miaoguo/searchCard1.json → pages/main/searchCard1.json


pages/miaoguo/searchCard1.wxml → pages/main/searchCard1.wxml


pages/miaoguo/searchCard1.wxss → pages/main/searchCard1.wxss


+ 8 - 1
pages/miaoguo/searchCardList.js

@@ -85,7 +85,7 @@ Page({
85 85
       str = str.replace(str2, "");
86 86
       str = str.replace(/\[线]/g, "");
87 87
       str = str.replace(/\[\/线\]/g, "");
88
-      str = main.decryptUrl(str);
88
+      str = main.encryptUrl(str);
89 89
       return str;
90 90
     }
91 91
   },
@@ -95,4 +95,11 @@ Page({
95 95
       url: './preview?type=show&id='+id,
96 96
     })
97 97
   },
98
+  onShareAppMessage: function () {
99
+    return {
100
+      title: app.globalData.ShareTitle,
101
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
102
+      imageUrl: app.globalData.ShareImage,
103
+    }
104
+  },
98 105
 })

pages/miaoguo/searchCardList.json → pages/main/searchCardList.json


pages/miaoguo/searchCardList.wxml → pages/main/searchCardList.wxml


pages/miaoguo/searchCardList.wxss → pages/main/searchCardList.wxss


+ 7 - 0
pages/miaoguo/searchWeb.js

@@ -48,4 +48,11 @@ Page({
48 48
       url: './searchWeb2?back=2&search=' + search+'&type=1',
49 49
     });
50 50
   },
51
+  onShareAppMessage: function () {
52
+    return {
53
+      title: app.globalData.ShareTitle,
54
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
55
+      imageUrl: app.globalData.ShareImage,
56
+    }
57
+  },
51 58
 })

pages/miaoguo/searchWeb.json → pages/main/searchWeb.json


pages/miaoguo/searchWeb.wxml → pages/main/searchWeb.wxml


pages/miaoguo/searchWeb.wxss → pages/main/searchWeb.wxss


+ 8 - 1
pages/miaoguo/searchWeb1.js

@@ -86,5 +86,12 @@ Page({
86 86
     wx.navigateBack({
87 87
       delta: 1,
88 88
     });
89
-  }
89
+  },
90
+  onShareAppMessage: function () {
91
+    return {
92
+      title: app.globalData.ShareTitle,
93
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
94
+      imageUrl: app.globalData.ShareImage,
95
+    }
96
+  },
90 97
 })

pages/miaoguo/searchWeb1.json → pages/main/searchWeb1.json


pages/miaoguo/searchWeb1.wxml → pages/main/searchWeb1.wxml


pages/miaoguo/searchWeb1.wxss → pages/main/searchWeb1.wxss


+ 8 - 1
pages/miaoguo/searchWeb2.js

@@ -218,5 +218,12 @@ Page({
218 218
         title: '请选择内容',
219 219
       })
220 220
     }
221
-  }
221
+  },
222
+  onShareAppMessage: function () {
223
+    return {
224
+      title: app.globalData.ShareTitle,
225
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
226
+      imageUrl: app.globalData.ShareImage,
227
+    }
228
+  },
222 229
 })

pages/miaoguo/searchWeb2.json → pages/main/searchWeb2.json


pages/miaoguo/searchWeb2.wxml → pages/main/searchWeb2.wxml


pages/miaoguo/searchWeb2.wxss → pages/main/searchWeb2.wxss


+ 7 - 0
pages/miaoguo/setting.js

@@ -49,4 +49,11 @@ Page({
49 49
     });
50 50
     wx.setStorageSync("CardMaxNumberHistory", this.data.CardNumber[this.data.CardMaxNumberHistoryIndex]);
51 51
   },
52
+  onShareAppMessage: function () {
53
+    return {
54
+      title: app.globalData.ShareTitle,
55
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
56
+      imageUrl: app.globalData.ShareImage,
57
+    }
58
+  },
52 59
 });

pages/miaoguo/setting.json → pages/main/setting.json


pages/miaoguo/setting.wxml → pages/main/setting.wxml


pages/miaoguo/setting.wxss → pages/main/setting.wxss


+ 0 - 77
pages/miaoguo/default.js

@@ -1,77 +0,0 @@
1
-import common from '../../utils/util';
2
-import main from '../../utils/main';
3
-
4
-const app = getApp();
5
-
6
-Page({
7
-  data: {
8
-  },
9
-  onLoad: function () {
10
-    app.globalData.userInfo={};
11
-    app.globalData.userInfo.UserID=1;
12
-
13
-    var that = this;
14
-    that.setData({
15
-      Containnerheight: main.getWindowHeight(),
16
-    });
17
-  },
18
-  onShow:function(){
19
-    var that = this;
20
-    main.getLocalHost(function () {
21
-      common.getStorageValue(that, "CardMaxNumberNew", 10, function () {
22
-        common.getStorageValue(that, "CardMaxNumberHistory", 30, function () {
23
-          that.getList();
24
-          wx.stopPullDownRefresh();
25
-        });
26
-      });
27
-    });
28
-  },
29
-  onPullDownRefresh:function(){
30
-    this.onShow();
31
-  },
32
-  goto:function(e){
33
-    var url=e.currentTarget.dataset.url;
34
-    wx.navigateTo({
35
-      url: './'+url,
36
-    })
37
-  },
38
-  getList: function () {
39
-    var that = this;
40
-    var url = 'GetMiaoguoCardToday?UserID=' + app.globalData.userInfo.UserID;
41
-    url += "&New=" + this.data.CardMaxNumberNew;
42
-    url += "&History=" + this.data.CardMaxNumberHistory;
43
-
44
-    main.getData(url, function (data) {
45
-      if (data) {
46
-        var TodayTaskNumber=data.ListNew.length+data.ListReview.length+data.ListHistory.length;
47
-        that.setData({
48
-          List: data,
49
-          TodayTaskNumber: TodayTaskNumber
50
-        });
51
-        wx.setStorageSync("TaskToday", data);
52
-        main.getData("GetBaiduToken",function(data){
53
-          app.globalData.BaiduToken = data;
54
-        });
55
-      }
56
-    });
57
-  },
58
-  gotoCard: function () {
59
-    wx.redirectTo({
60
-      url: './searchCard',
61
-    })
62
-  },
63
-  onShareAppMessage: function () {
64
-    return {
65
-      title: '',
66
-      path: 'pages/miaoguo/default',
67
-      success: function (res) {
68
-      },
69
-      fail: function (err) {
70
-        console.log(err);
71
-      },
72
-      complete: function (res) {
73
-        console.log(res);
74
-      },
75
-    }
76
-  },
77
-})

+ 0 - 5
pages/miaoguo/detail.json

@@ -1,5 +0,0 @@
1
-{
2
-  "navigationBarTextStyle": "white",
3
-  "navigationBarTitleText": "练习",
4
-  "enablePullDownRefresh": false
5
-}

+ 0 - 156
pages/miaoguo/detail.wxml

@@ -1,156 +0,0 @@
1
-<view class="container FlexColumn" style='min-height:{{Containnerheight-50}}rpx;background-color:{{CurrentColor.BackColor}}' bindtap="onShowAnswer">
2
-  <block wx:if="{{(NumberNew+NumberReview+NumberHistory)>0}}">
3
-    <view class='panelTop FlexRow' style="background-color:{{CurrentColor.BackColor}}">
4
-      <view class='panelCancel' wx:if="{{CanUndo==0}}">
5
-      </view>
6
-      <view class='panelCancel FlexRow' catchtap='gotoPrev' wx:if="{{CanUndo==1}}">
7
-        <image src="../images/universalpic_undo_white_20x28.png" class='universalpic_undo_white_20x28' />
8
-      </view>
9
-      <view class='panelCancel1 panelCancel FlexRow' catchtap='gotoNext' data-time="1d" data-btnnumber="1" wx:if="{{NumberNew+NumberReview+NumberHistory>0}}">
10
-        <image src="../images/universalpic_shelve_white_30x14.png" class='universalpic_shelve_white_30x14' />
11
-      </view>
12
-      <view class='panelNumber FlexRow' catchtap='showNumberContainner'>
13
-        <view class="panelNumber1">{{NumberNew}}</view>
14
-        <view class="panelNumber1">{{NumberHistory}}</view>
15
-        <view class="panelNumber1">{{NumberReview}}</view>
16
-        <view class="panelNumber2 panelNumber1">{{NumberNew+NumberReview+NumberHistory}}</view>
17
-      </view>
18
-      <view class='panelCancel2 panelCancel FlexRow' catchtap='onShowAnswer' data-start="true" wx:if="{{NumberNew+NumberReview+NumberHistory>0}}">
19
-        <image src="../images/universalpic_restore_white_34x34.png" class='universalpic_restore_white_34x34' />
20
-      </view>
21
-      <view class='panelCancel FlexRow' catchtap='onMore' wx:if="{{NumberNew+NumberReview+NumberHistory>0}}">
22
-        <image src="../images/universalpic_more_white_32x8.png" class='universalpic_more_white_32x8' />
23
-      </view>
24
-
25
-    </view>
26
-    <view class="panelField1 FlexColumn">
27
-      <view class="panelField11 panelItem FlexRow">
28
-        <block wx:for="{{TaskList[0].Content.Field[1]}}" wx:key="index">
29
-          <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
30
-
31
-          <text class="textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
32
-
33
-          <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
34
-          <text>{{item.Content[0]}}</text>
35
-          <text class="textLine">{{item.Content[1]}}</text>
36
-          <text>{{item.Content[2]}}</text>
37
-          </text>
38
-
39
-          <image class="universalpic_read_gray_40x40" wx:if="{{item.Type=='sound'}}" src='../images/universalpic_read_gray_40x40.png' bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" />
40
-          <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}">{{item.Content}}</text>
41
-
42
-          <image class="imageBishun" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' />
43
-        </block>
44
-      </view>
45
-
46
-    </view>
47
-    <view class="panelTag FlexRow">
48
-      <view wx:if="{{!TaskList[0].Content.Tags || TaskList[0].Content.Tags.length==0}}"></view>
49
-      <view class="panelTag1 FlexRow" wx:if="{{TaskList[0].Content.Tags && TaskList[0].Content.Tags.length>0}}">
50
-        <view class="tag" wx:for="{{TaskList[0].Content.Tags}}" wx:key="index">{{item}}</view>
51
-      </view>
52
-
53
-      <view class='right2 FlexRow' catchtap='onShowAnswer' data-start="true" wx:if="{{IsShowAnswer[0]==1}}">
54
-        <view class="line1"></view>
55
-        <image class="universalpic_restore_black_34x34" src='../images/universalpic_restore_white_34x34.png' />
56
-      </view>
57
-
58
-    </view>
59
-    <view class="panelField2 FlexRow" wx:for="{{[2,3]}}" wx:key="indexParent" wx:for-index="indexParent" wx:for-item="itemParent" wx:if="{{TaskList[0].Content.Field[itemParent].length>0 && IsShowAnswer[itemParent-2]}}">
60
-
61
-      <view class="panelField21 panelItem FlexRow">
62
-        <block wx:for="{{TaskList[0].Content.Field[itemParent]}}" wx:key="index">
63
-          <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
64
-
65
-          <text class="textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
66
-
67
-          <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
68
-          <text>{{item.Content[0]}}</text>
69
-          <text class="textLine">{{item.Content[1]}}</text>
70
-          <text>{{item.Content[2]}}</text>
71
-          </text>
72
-
73
-          <image class="universalpic_read_gray_40x40" wx:if="{{item.Type=='sound'}}" src='../images/universalpic_read_gray_40x40.png' bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" />
74
-          <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}">{{item.Content}}</text>
75
-
76
-          <image class="imageBishun" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' />
77
-
78
-        </block>
79
-      </view>
80
-    </view>
81
-  </block>
82
-
83
-  <!-- 最后一页 -->
84
-  <view class='panelLast FlexColumn' wx:if="{{NumberNew+NumberReview+NumberHistory==0}}" style='min-height:{{Containnerheight}}rpx;'>
85
-    <image class="practice_report_bg" src='../images/practice_report_bg.png' />
86
-    <view class="Avatar"></view>
87
-    <view class='text1'>嗨,第0天</view>
88
-    <text class='text2'>君子曰:学不可以已\n——学习是不可以停止的,语出荀子</text>
89
-    <view class="panelLastTime FlexColumn">
90
-      <view>用时</view>
91
-      <view class="time">00:35:00</view>
92
-    </view>
93
-  </view>
94
-
95
-  <view style='height:180rpx;'></view>
96
-
97
-  <view class='panelBottomAnswer panelBottom FlexRow' wx:if="{{IsShowAnswer[1]}}">
98
-    <view class="Answer FlexColumn" hover-class="AnswerHover" catchtap='gotoNext' data-time="{{TaskList[0].Number0}}" data-btnnumber="0">
99
-      <view class="Answer0 btnColor"></view>
100
-      <view class="btnTime">
101
-        {{TaskList[0].Number0Str}}
102
-      </view>
103
-    </view>
104
-    <view class="Answer FlexColumn" hover-class="AnswerHover" catchtap='gotoNext' data-time="{{TaskList[0].Number1}}" data-btnnumber="3" wx:if="{{TaskList[0].Number1}}">
105
-      <view class="Answer1 btnColor"></view>
106
-      <view class="btnTime">
107
-        {{TaskList[0].Number1Str}}
108
-      </view>
109
-    </view>
110
-    <view class="Answer FlexColumn" hover-class="AnswerHover" catchtap='gotoNext' data-time="{{TaskList[0].Number2}}" data-btnnumber="4">
111
-      <view class="Answer2 btnColor"></view>
112
-      <view class="btnTime">
113
-        {{TaskList[0].Number2Str}}
114
-      </view>
115
-    </view>
116
-    <view class="Answer FlexColumn" hover-class="AnswerHover" catchtap='gotoNext' data-time="{{TaskList[0].Number3}}" data-btnnumber="5" wx:if="{{TaskList[0].Number3}}">
117
-      <view class="Answer3 btnColor"></view>
118
-      <view class="btnTime">
119
-        {{TaskList[0].Number3Str}}
120
-      </view>
121
-    </view>
122
-  </view>
123
-</view>
124
-
125
-<view wx:if="{{IsShowNumberInfo}}" catchtap='closeNumberContainner' class="numberContainer container FlexColumn" style='height:{{Containnerheight}}rpx;'>
126
-  <view class='numberContainer1 FlexColumn'>
127
-    <view class="numberContainer11 FlexRow">
128
-      <view class='left'>剩余任务</view>
129
-      <view class='numberContainer111 right'>今天还剩{{NumberNew+NumberReview+NumberHistory}}条</view>
130
-    </view>
131
-    <view class="numberContainer12 FlexRow">
132
-      <view class='left'>新笔记</view>
133
-      <view class='right'>{{NumberNew}}条</view>
134
-    </view>
135
-    <view class="lineWidthAll FlexRow">
136
-      <view class="lineWidth700"></view>
137
-    </view>
138
-    <view class="numberContainer12 FlexRow">
139
-      <view class='left'>旧笔记</view>
140
-      <view class='right'>{{NumberHistory}}条</view>
141
-    </view>
142
-    <view class="lineWidthAll FlexRow">
143
-      <view class="lineWidth700"></view>
144
-    </view>
145
-    <view class="numberContainer12 FlexRow">
146
-      <view class='left'>重练</view>
147
-      <view class='right'>{{NumberReview}}条</view>
148
-    </view>
149
-    <view class='lineFooter'></view>
150
-    <view class="numberContainer13 FlexRow">
151
-      <view>知道了</view>
152
-    </view>
153
-  </view>
154
-</view>
155
-
156
-<audio hidden='true' id="playAudio"></audio>

BIN
pages/sounds/1.mp3


BIN
pages/sounds/10.mp3


BIN
pages/sounds/11.mp3


BIN
pages/sounds/2.mp3


BIN
pages/sounds/3.mp3


BIN
pages/sounds/4.mp3


BIN
pages/sounds/5.mp3


BIN
pages/sounds/6.mp3


BIN
pages/sounds/7.mp3


BIN
pages/sounds/8.mp3


BIN
pages/sounds/9.mp3


BIN
pages/sounds/short2.mp3


+ 132 - 122
utils/main.js

@@ -278,6 +278,138 @@ function getProgramList() {
278 278
   ];
279 279
 }
280 280
 
281
+
282
+
283
+function gotoFeedback() {
284
+  wx.navigateToMiniProgram({
285
+    appId: "wx80059777521b897c",
286
+    path: "pages/index/feedback",
287
+    extraData: {
288
+    },
289
+    success(res) {
290
+      // 打开成功
291
+    }
292
+  });
293
+}
294
+function changeViewToString(content) {
295
+  var str = content;
296
+  if (str.constructor == Array){
297
+    if (str.length>0)
298
+      str=str.join(",");
299
+    else
300
+      str="";
301
+  }
302
+
303
+  if (!str)
304
+    str = ""
305
+  else{
306
+    str = str.replace(/\n\n/g, "\n");
307
+    if (str.indexOf("\n") == 0) {
308
+      str = str.substr(1);
309
+    }
310
+    if (str.lastIndexOf("\n") == str.length - 1) {
311
+      str = str.substr(0, str.length - 1);
312
+    }
313
+  }
314
+  return str;
315
+}
316
+
317
+function EncryptUrl(str) {
318
+  str = str.replace(/baidu.com/g, "#####1#####");
319
+  str = str.replace(/iciba.com/g, "#####2#####");
320
+  return str;
321
+}
322
+function DecryptUrl(str) {
323
+  str = str.replace(/#####1#####/g, "baidu.com");
324
+  str = str.replace(/#####2#####/g, "iciba.com");
325
+  return str;
326
+}
327
+
328
+function changeStringToView(field) {
329
+  var result = {};
330
+  result.Field = [[]];
331
+  for (var j = 0; j < field.length; j++) {
332
+    if (j == 0) {
333
+      if (field[j].ContentType == 0 && field[j].Content && field[j].Content.length > 0) {
334
+        result.Tags = field[j].Content.toString().split(",");
335
+      }
336
+      else {
337
+        result.Tags = [];
338
+      }
339
+    }
340
+    else {
341
+      if (field[j].ContentType == j && field[j].Content && field[j].Content.length > 0) {
342
+
343
+        var arrResult = [], arrSoundMark = [];
344
+        var str = field[j].Content.toString();
345
+
346
+        str = DecryptUrl(str);
347
+
348
+        str = str.replace(/\[读/g, "\n[读");
349
+        str = str.replace(/\[图/g, "\n[图");
350
+        str = str.replace(/\[\/读\]/g, "[\/读]\n");
351
+        str = str.replace(/\[\/图\]/g, "[\/图]\n");
352
+        str = str.replace(/\n\n/g, "\n");
353
+
354
+        var arr = str.split("\n");
355
+        for (var k = 0; k < arr.length; k++) {
356
+          if (arr[k].indexOf("[图]") >= 0 && arr[k].indexOf("[/图]") > 0) {
357
+            var obj = {};
358
+            obj.Type = "image";
359
+            obj.Content = arr[k].substring(arr[k].indexOf("[图]") + 3, arr[k].indexOf("[/图]"));
360
+            arrResult.push(obj);
361
+          }
362
+          else if (arr[k].indexOf("[线]") >= 0 && arr[k].indexOf("[/线]") > 0) {
363
+            var obj;
364
+            var content = ["", "", ""];
365
+            if (arr[k].indexOf("[线]") > 0) {
366
+              content[0] = arr[k].substring(0, arr[k].indexOf("[线]"));
367
+            }
368
+            content[1] = arr[k].substring(arr[k].indexOf("[线]") + 3, arr[k].indexOf("[/线]"));
369
+            if (arr[k].length > arr[k].indexOf("[/线]") + 4) {
370
+              content[2] = arr[k].substring(arr[k].indexOf("[/线]") + 4);
371
+            }
372
+            obj = {};
373
+            obj.Type = "line";
374
+            obj.Content = content;
375
+            arrResult.push(obj);
376
+          }
377
+          else if (arr[k].indexOf("[读") >= 0 && arr[k].indexOf("[/读]") > 0) {
378
+            var obj = {};
379
+            obj.Type = "sound";
380
+            if (arr[k].indexOf("[读]") >= 0) {
381
+              obj.Content = arr[k].substring(arr[k].indexOf("[读]") + 3, arr[k].indexOf("[/读]"));
382
+              obj.SoundImageName = "png";
383
+            }
384
+            else {
385
+              var tempIndex = arr[k].indexOf("\']") + 2;
386
+              obj.Content = arr[k].substring(tempIndex, arr[k].indexOf("[/读]"));
387
+              obj.SoundMark = arr[k].substring(arr[k].indexOf("src='") + 5, arr[k].indexOf("']"));;
388
+              obj.SoundImageName = "png";
389
+            }
390
+            arrResult.push(obj);
391
+          }
392
+          else if (arr[k] != "") {
393
+            var obj = {};
394
+            obj.Type = "normal";
395
+            obj.Content = arr[k];
396
+            arrResult.push(obj);
397
+          }
398
+          var obj = {};
399
+          obj.Type = "return";
400
+          arrResult.push(obj);
401
+        }
402
+        result.Field.push(arrResult);
403
+
404
+      }
405
+      else {
406
+        result.Field.push([]);
407
+      }
408
+    }
409
+  }
410
+  return result;
411
+}
412
+
281 413
 function getDetailColor() {
282 414
   var arr = [
283 415
     {//配色1
@@ -458,128 +590,6 @@ function getDetailColor() {
458 590
   ];
459 591
   return arr;
460 592
 }
461
-
462
-function gotoFeedback() {
463
-  wx.navigateToMiniProgram({
464
-    appId: "wx80059777521b897c",
465
-    path: "pages/index/feedback",
466
-    extraData: {
467
-    },
468
-    success(res) {
469
-      // 打开成功
470
-    }
471
-  });
472
-}
473
-function changeViewToString(content) {
474
-  var str = content;
475
-  if (!str)
476
-    str=""
477
-  else{
478
-    str = str.replace(/\n\n/g, "\n");
479
-    if (str.indexOf("\n") == 0) {
480
-      str = str.substr(1);
481
-    }
482
-    if (str.lastIndexOf("\n") == str.length - 1) {
483
-      str = str.substr(0, str.length - 1);
484
-    }
485
-  }
486
-  return str;
487
-}
488
-
489
-function EncryptUrl(str) {
490
-  str = str.replace(/baidu.com/g, "#####1#####");
491
-  str = str.replace(/iciba.com/g, "#####2#####");
492
-  return str;
493
-}
494
-function DecryptUrl(str) {
495
-  str = str.replace(/#####1#####/g, "baidu.com");
496
-  str = str.replace(/#####2#####/g, "iciba.com");
497
-  return str;
498
-}
499
-
500
-function changeStringToView(field) {
501
-  var result = {};
502
-  result.Field = [[]];
503
-  for (var j = 0; j < field.length; j++) {
504
-    if (j == 0) {
505
-      if (field[j].ContentType == 0 && field[j].Content && field[j].Content.length > 0) {
506
-        result.Tags = field[j].Content.toString().split(",");
507
-      }
508
-      else {
509
-        result.Tags = [];
510
-      }
511
-    }
512
-    else {
513
-      if (field[j].ContentType == j && field[j].Content && field[j].Content.length > 0) {
514
-
515
-        var arrResult = [], arrSoundMark = [];
516
-        var str = field[j].Content.toString();
517
-
518
-        str = DecryptUrl(str);
519
-
520
-        str = str.replace(/\[读/g, "\n[读");
521
-        str = str.replace(/\[图/g, "\n[图");
522
-        str = str.replace(/\[\/读\]/g, "[\/读]\n");
523
-        str = str.replace(/\[\/图\]/g, "[\/图]\n");
524
-        str = str.replace(/\n\n/g, "\n");
525
-
526
-        var arr = str.split("\n");
527
-        for (var k = 0; k < arr.length; k++) {
528
-          if (arr[k].indexOf("[图]") >= 0 && arr[k].indexOf("[/图]") > 0) {
529
-            var obj = {};
530
-            obj.Type = "image";
531
-            obj.Content = arr[k].substring(arr[k].indexOf("[图]") + 3, arr[k].indexOf("[/图]"));
532
-            arrResult.push(obj);
533
-          }
534
-          else if (arr[k].indexOf("[线]") >= 0 && arr[k].indexOf("[/线]") > 0) {
535
-            var obj;
536
-            var content = ["", "", ""];
537
-            if (arr[k].indexOf("[线]") > 0) {
538
-              content[0] = arr[k].substring(0, arr[k].indexOf("[线]"));
539
-            }
540
-            content[1] = arr[k].substring(arr[k].indexOf("[线]") + 3, arr[k].indexOf("[/线]"));
541
-            if (arr[k].length > arr[k].indexOf("[/线]") + 4) {
542
-              content[2] = arr[k].substring(arr[k].indexOf("[/线]") + 4);
543
-            }
544
-            obj = {};
545
-            obj.Type = "line";
546
-            obj.Content = content;
547
-            arrResult.push(obj);
548
-          }
549
-          else if (arr[k].indexOf("[读") >= 0 && arr[k].indexOf("[/读]") > 0) {
550
-            var obj = {};
551
-            obj.Type = "sound";
552
-            if (arr[k].indexOf("[读]") >= 0) {
553
-              obj.Content = arr[k].substring(arr[k].indexOf("[读]") + 3, arr[k].indexOf("[/读]"));
554
-            }
555
-            else {
556
-              var tempIndex = arr[k].indexOf("\']") + 2;
557
-              obj.Content = arr[k].substring(tempIndex, arr[k].indexOf("[/读]"));
558
-              obj.SoundMark = arr[k].substring(arr[k].indexOf("src='") + 5, arr[k].indexOf("']"));;
559
-            }
560
-            arrResult.push(obj);
561
-          }
562
-          else if (arr[k] != "") {
563
-            var obj = {};
564
-            obj.Type = "normal";
565
-            obj.Content = arr[k];
566
-            arrResult.push(obj);
567
-          }
568
-          var obj = {};
569
-          obj.Type = "return";
570
-          arrResult.push(obj);
571
-        }
572
-        result.Field.push(arrResult);
573
-
574
-      }
575
-      else {
576
-        result.Field.push([]);
577
-      }
578
-    }
579
-  }
580
-  return result;
581
-}
582
-
583 593
 module.exports = {
584 594
   getData: getData,
585 595
   postData: postData,

+ 2 - 2
utils/util.js

@@ -48,8 +48,8 @@ function addZero(str, length) {
48 48
 function getMinuteSecond(second, chs) {
49 49
   if (!second)
50 50
     second = 0;
51
-  var secondUnit = "\"";
52
-  var minuteUnit = "'";
51
+  var secondUnit = "";
52
+  var minuteUnit = ":";
53 53
   var hourUnit = ":";
54 54
   if (chs) {
55 55
     secondUnit = "秒";