chengjie 6 years ago
parent
commit
a0cfe9bd83

+ 16 - 1
app.js

@@ -11,9 +11,21 @@ App({
11
   },
11
   },
12
   getSystemInfo: function () {
12
   getSystemInfo: function () {
13
     this.globalData.systemInfo = wx.getSystemInfoSync();
13
     this.globalData.systemInfo = wx.getSystemInfoSync();
14
+    if (this.globalData.systemInfo.system.indexOf("Android") >= 0) {
15
+      this.globalData.IsIOS =false;
16
+      this.globalData.IsAndroid=true;
17
+    }
18
+    else if (this.globalData.systemInfo.system.indexOf("iOS") >= 0) {
19
+      this.globalData.IsIOS = true;
20
+      this.globalData.IsAndroid=false;
21
+    }
22
+
23
+    if (this.globalData.systemInfo.model.indexOf("iPad")>=0){
24
+      this.globalData.IsIPad=true;
25
+    }
14
   },
26
   },
15
   globalData: {
27
   globalData: {
16
-    Version: "1.0.0.10",
28
+    Version: "1.0.0.11",
17
     IsProduction: true,
29
     IsProduction: true,
18
     ShareTitle: "可以用来记忆一切的工具",
30
     ShareTitle: "可以用来记忆一切的工具",
19
     SharePath: "pages/index/index",
31
     SharePath: "pages/index/index",
@@ -28,6 +40,9 @@ App({
28
     pinyinUrl: "https://pinyin.kylx365.com/sounds/[pinyin].m4a",
40
     pinyinUrl: "https://pinyin.kylx365.com/sounds/[pinyin].m4a",
29
     uploadImageUrl:"https://miaguo-1253256735.file.myqcloud.com/",
41
     uploadImageUrl:"https://miaguo-1253256735.file.myqcloud.com/",
30
     BaiduToken: "",//百度开发平台token
42
     BaiduToken: "",//百度开发平台token
43
+    IsIOS:true,
44
+    IsAndroid:false,
45
+    IsIPad:false,
31
     systemInfo: null,
46
     systemInfo: null,
32
     userInfo: null,
47
     userInfo: null,
33
     SourceID: 0,//来源ID
48
     SourceID: 0,//来源ID

+ 1 - 1
pages/index/accredit.js

@@ -10,7 +10,7 @@ Page({
10
   onLoad: function (options) {
10
   onLoad: function (options) {
11
     urlRedirectTo = options.url;
11
     urlRedirectTo = options.url;
12
     this.setData({
12
     this.setData({
13
-      Containnerheight: common.getSystemHeight(),
13
+      Containnerheight: main.getWindowHeight(),
14
     });
14
     });
15
 
15
 
16
     wx.hideShareMenu();
16
     wx.hideShareMenu();

+ 1 - 1
pages/index/index.js

@@ -55,7 +55,7 @@ Page({
55
       }
55
       }
56
     }
56
     }
57
     this.setData({
57
     this.setData({
58
-      Containnerheight: common.getSystemHeight(),
58
+      Containnerheight: main.getWindowHeight(),
59
     });
59
     });
60
 
60
 
61
     this.updateProgram();
61
     this.updateProgram();

+ 11 - 7
pages/main/addItem.js

@@ -7,7 +7,6 @@ var tempCursor = 0,
7
   btnName = "";
7
   btnName = "";
8
 var arrSoundMark = [];
8
 var arrSoundMark = [];
9
 var isUnload = true;
9
 var isUnload = true;
10
-var isAndroid = false;
11
 var isEdit = true;
10
 var isEdit = true;
12
 
11
 
13
 Page({
12
 Page({
@@ -34,15 +33,13 @@ Page({
34
       title: '编辑 段落' + fieldid,
33
       title: '编辑 段落' + fieldid,
35
     });
34
     });
36
 
35
 
37
-    if (app.globalData.systemInfo.system.indexOf("Android") >= 0) {
38
-      isAndroid = true;
39
-    }
40
   },
36
   },
41
   onShow: function () {
37
   onShow: function () {
42
     console.log("onShow");
38
     console.log("onShow");
43
     var that = this;
39
     var that = this;
44
 
40
 
45
-    if (isAndroid && !isEdit) {
41
+    console.log("onShow:" + isEdit);
42
+    if (app.globalData.IsAndroid && !isEdit) {
46
       return;
43
       return;
47
     }
44
     }
48
 
45
 
@@ -77,7 +74,7 @@ Page({
77
   },
74
   },
78
   bindinputField: function (e) {
75
   bindinputField: function (e) {
79
     var that = this;
76
     var that = this;
80
-    if (isAndroid && !isEdit) {
77
+    if (app.globalData.IsAndroid && !isEdit) {
81
       return;
78
       return;
82
     }
79
     }
83
 
80
 
@@ -134,13 +131,14 @@ Page({
134
   onBindblur: function (e) {
131
   onBindblur: function (e) {
135
     var that = this;
132
     var that = this;
136
     console.log("onBindblur:" + isEdit + " Filed:" + this.data.Field);
133
     console.log("onBindblur:" + isEdit + " Filed:" + this.data.Field);
137
-    if (isAndroid && !isEdit) {
134
+    if (app.globalData.IsAndroid && !isEdit) {
138
       setTimeout(function () {
135
       setTimeout(function () {
139
         isEdit = true;
136
         isEdit = true;
140
       }, 500);
137
       }, 500);
141
       return;
138
       return;
142
     }
139
     }
143
     isEdit = false;
140
     isEdit = false;
141
+    console.log("onBindblur:"+isEdit);
144
 
142
 
145
     this.updateField();
143
     this.updateField();
146
     tempCursor = e.detail.cursor;
144
     tempCursor = e.detail.cursor;
@@ -177,11 +175,17 @@ Page({
177
 
175
 
178
   },
176
   },
179
   onSearch: function (e) {
177
   onSearch: function (e) {
178
+  
180
     wx.setStorageSync("TempFieldNumber", this.data.FieldNumber);
179
     wx.setStorageSync("TempFieldNumber", this.data.FieldNumber);
181
     wx.navigateTo({
180
     wx.navigateTo({
182
       url: './searchWeb',
181
       url: './searchWeb',
183
     });
182
     });
184
     this.updateField();
183
     this.updateField();
184
+    
185
+    setTimeout(function () {
186
+      isEdit = true;
187
+      console.log("onSearchEnd");
188
+    }, 1000);
185
   },
189
   },
186
   clear: function () {
190
   clear: function () {
187
     var that = this;
191
     var that = this;

+ 6 - 0
pages/main/default.js

@@ -19,6 +19,12 @@ Page({
19
         url: './preview?type=share&id=' + id,
19
         url: './preview?type=share&id=' + id,
20
       });
20
       });
21
     }
21
     }
22
+
23
+    if (app.globalData.IsIPad){
24
+      that.setData({
25
+        IsIPad: "_iPad",
26
+      });
27
+    }
22
   },
28
   },
23
   onShow: function () {
29
   onShow: function () {
24
     var that = this;
30
     var that = this;

+ 3 - 3
pages/main/default.wxml

@@ -7,9 +7,9 @@
7
       <image class="universalpic_setup_gray_40x40" src='../images/universalpic_setup_gray_40x40.png' />
7
       <image class="universalpic_setup_gray_40x40" src='../images/universalpic_setup_gray_40x40.png' />
8
     </view>
8
     </view>
9
   </view>
9
   </view>
10
-  <image wx:if="{{TodayTaskNumber>0 && IsStart==1}}" class="task_index_start" src='../images/task_index_start.png' bindtap="goto" data-url="detail" />
11
-  <image wx:if="{{TodayTaskNumber>0 && IsStart==0}}" class="task_index_start" src='../images/task_index_goon.png'  bindtap="goto" data-url="detail" />
12
-  <image wx:if="{{TodayTaskNumber==0}}" class="task_index_start" src='../images/task_index_report.png'  bindtap="goto" data-url="detail" />
10
+  <image wx:if="{{TodayTaskNumber>0 && IsStart==1}}" class="task_index_start{{IsIPad}}" src='../images/task_index_start.png' bindtap="goto" data-url="detail" />
11
+  <image wx:if="{{TodayTaskNumber>0 && IsStart==0}}" class="task_index_start{{IsIPad}}" src='../images/task_index_goon.png'  bindtap="goto" data-url="detail" />
12
+  <image wx:if="{{TodayTaskNumber==0}}" class="task_index_start{{IsIPad}}" src='../images/task_index_report.png'  bindtap="goto" data-url="detail" />
13
 
13
 
14
   <view class='panelBottom FlexColumn'>
14
   <view class='panelBottom FlexColumn'>
15
 
15
 

+ 7 - 0
pages/main/default.wxss

@@ -34,6 +34,13 @@
34
   top:523rpx;
34
   top:523rpx;
35
 }
35
 }
36
 
36
 
37
+.task_index_start_iPad {
38
+  width: 377rpx;
39
+  height: 240rpx;
40
+  position: fixed;
41
+  top:433rpx;
42
+}
43
+
37
 .panelBottom {
44
 .panelBottom {
38
   position: fixed;
45
   position: fixed;
39
   bottom: 0;
46
   bottom: 0;

+ 31 - 7
pages/main/detail.js

@@ -12,6 +12,7 @@ var timeStart; //计算时长
12
 var TaskList = [];
12
 var TaskList = [];
13
 var iTimeout = 0;
13
 var iTimeout = 0;
14
 var arrImage = [], arrImage2 = [];
14
 var arrImage = [], arrImage2 = [];
15
+var intervalSound;
15
 
16
 
16
 Page({
17
 Page({
17
   data: {
18
   data: {
@@ -38,14 +39,21 @@ Page({
38
   onLoad: function () {
39
   onLoad: function () {
39
     wx.hideShareMenu();
40
     wx.hideShareMenu();
40
     var that = this;
41
     var that = this;
42
+    var height = app.globalData.systemInfo.screenHeight * 2-110;
43
+    var height2=750;
44
+    if (app.globalData.IsIPad){
45
+      height=960;
46
+      height2=670;
47
+    }
41
     that.setData({
48
     that.setData({
42
-      Containnerheight: main.getWindowHeight(),
49
+      Containnerheight: height,
50
+      Containnerheight2: height-height2,
43
       IsShowAnswer: [0, 0],
51
       IsShowAnswer: [0, 0],
44
       CanUndo: 1,
52
       CanUndo: 1,
45
     });
53
     });
46
 
54
 
47
     innerAudioContext1 = wx.createInnerAudioContext();
55
     innerAudioContext1 = wx.createInnerAudioContext();
48
-    this.audioCtx = wx.createAudioContext('myAudio');
56
+    this.audioCtx=[];
49
 
57
 
50
     this.getList();
58
     this.getList();
51
 
59
 
@@ -82,6 +90,9 @@ Page({
82
 
90
 
83
     }
91
     }
84
   },
92
   },
93
+  onUnload:function(){
94
+    clearInterval(intervalSound);
95
+  },
85
   onPullDownRefresh: function () {
96
   onPullDownRefresh: function () {
86
   },
97
   },
87
   setSoundFile: function (isFinish) {//isFinish=3搁置 =2撤退 =1结束 =0正常 =-1开始
98
   setSoundFile: function (isFinish) {//isFinish=3搁置 =2撤退 =1结束 =0正常 =-1开始
@@ -116,8 +127,8 @@ Page({
116
       if (wx.setBackgroundColor) {
127
       if (wx.setBackgroundColor) {
117
         wx.setBackgroundColor({
128
         wx.setBackgroundColor({
118
           backgroundColor: color.BackColor,
129
           backgroundColor: color.BackColor,
119
-          backgroundColorTop: color.BackColor, // 顶部窗口的背景色为白色
120
-          backgroundColorBottom: color.BackColor2, // 底部窗口的背景色为白色
130
+          backgroundColorTop: color.BackColor, 
131
+          backgroundColorBottom: color.BackColor2, 
121
         })
132
         })
122
       }
133
       }
123
       if (wx.setNavigationBarColor) {
134
       if (wx.setNavigationBarColor) {
@@ -594,9 +605,22 @@ Page({
594
       url = url.replace("[token]", app.globalData.BaiduToken);
605
       url = url.replace("[token]", app.globalData.BaiduToken);
595
       url = url.replace("[word]", str);
606
       url = url.replace("[word]", str);
596
     }
607
     }
597
-    this.audioCtx.setSrc(url);
598
-    this.audioCtx.play();
599
-    //console.log(url);
608
+
609
+    var arr = url.split(",");
610
+    for (var i = 0; i < arr.length; i++) {
611
+      this.audioCtx.push(wx.createAudioContext('myAudio' + i));
612
+    }
613
+    var index = 0;
614
+    intervalSound = setInterval(function () {
615
+      that.audioCtx[index].setSrc(arr[index]);
616
+      that.audioCtx[index].play();
617
+
618
+      index++;
619
+      if (index >= arr.length) {
620
+        clearInterval(intervalSound);
621
+      }
622
+    }, 1000);
623
+    
600
 
624
 
601
     var fieldid = e.currentTarget.dataset.fieldid;
625
     var fieldid = e.currentTarget.dataset.fieldid;
602
     var content = TaskList[0].ContentNew.Field[fieldid];
626
     var content = TaskList[0].ContentNew.Field[fieldid];

+ 8 - 5
pages/main/detail.wxml

@@ -1,4 +1,4 @@
1
-<view class="container FlexColumn" style='min-height:{{Containnerheight-50}}rpx;background-color:{{Color.BackColor2}}'>
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;background-color:{{Color.BackColor2}}'>
2
   <view class='panelTop FlexRow' style='background-color:{{Color.BackColor}};color:{{Color.FrontColor}};'>
2
   <view class='panelTop FlexRow' style='background-color:{{Color.BackColor}};color:{{Color.FrontColor}};'>
3
     <view class='panelCancel' wx:if="{{NumberNew+NumberReview+NumberHistory==0}}">
3
     <view class='panelCancel' wx:if="{{NumberNew+NumberReview+NumberHistory==0}}">
4
     </view>
4
     </view>
@@ -81,7 +81,7 @@
81
 
81
 
82
   </view>
82
   </view>
83
 
83
 
84
-  <view class="panelField20 FlexColumn" style='min-height:{{Containnerheight-480}}rpx;background-color:{{Color.BackColor2}};color:{{Color.FrontColor2}};' bindtap="onShowAnswer">
84
+  <view class="panelField20 FlexColumn" style='min-height:{{Containnerheight2}}rpx;background-color:{{Color.BackColor2}};color:{{Color.FrontColor2}};' bindtap="onShowAnswer">
85
     <view class="panelField2 FlexColumn" wx:for="{{[2,3]}}" wx:key="indexParent" wx:for-index="indexParent" wx:for-item="itemParent" wx:if="{{TaskInfo.ContentNew.Field[itemParent].length>0 && IsShowAnswer[itemParent-2]}}">
85
     <view class="panelField2 FlexColumn" wx:for="{{[2,3]}}" wx:key="indexParent" wx:for-index="indexParent" wx:for-item="itemParent" wx:if="{{TaskInfo.ContentNew.Field[itemParent].length>0 && IsShowAnswer[itemParent-2]}}">
86
       <view wx:if="{{itemParent==3}}" class="lineField" style='background-color:{{Color.FieldLineColor}};'></view>
86
       <view wx:if="{{itemParent==3}}" class="lineField" style='background-color:{{Color.FieldLineColor}};'></view>
87
       <view class="panelField21 panelItem FlexRow">
87
       <view class="panelField21 panelItem FlexRow">
@@ -114,7 +114,7 @@
114
   </block>
114
   </block>
115
 
115
 
116
   <!-- 最后一页 -->
116
   <!-- 最后一页 -->
117
-  <view class='panelLast FlexColumn' wx:if="{{NumberNew+NumberReview+NumberHistory==0}}" style='height:{{Containnerheight-50}}rpx;background-color:{{Color.BackColor}};color:{{Color.FrontColor}};'>
117
+  <view class='panelLast FlexColumn' wx:if="{{NumberNew+NumberReview+NumberHistory==0}}" style='height:{{Containnerheight}}rpx;background-color:{{Color.BackColor}};color:{{Color.FrontColor}};'>
118
     <view class='text1'>做完了</view>
118
     <view class='text1'>做完了</view>
119
 
119
 
120
     <view class="panelLastTime FlexColumn">
120
     <view class="panelLastTime FlexColumn">
@@ -133,7 +133,7 @@
133
     <view class='panelLastFooter' bindtap='onClose'>关闭</view>
133
     <view class='panelLastFooter' bindtap='onClose'>关闭</view>
134
   </view>
134
   </view>
135
 
135
 
136
-  <view class='footer' wx:if="{{NumberNew+NumberReview+NumberHistory>0}}"></view>
136
+  <view class='footer' wx:if="{{NumberNew+NumberReview+NumberHistory>0}}" bindtap="onShowAnswer" ></view>
137
   <view class='footer1 footer' wx:if="{{NumberNew+NumberReview+NumberHistory==0}}"></view>
137
   <view class='footer1 footer' wx:if="{{NumberNew+NumberReview+NumberHistory==0}}"></view>
138
 
138
 
139
   <block wx:if="{{IsShowAnswer[1]}}">
139
   <block wx:if="{{IsShowAnswer[1]}}">
@@ -198,4 +198,7 @@
198
   </view>
198
   </view>
199
 </view>
199
 </view>
200
 
200
 
201
-<audio hidden='true' id="myAudio"></audio>
201
+<audio hidden='true' id="myAudio0"></audio>
202
+<audio hidden='true' id="myAudio1"></audio>
203
+<audio hidden='true' id="myAudio2"></audio>
204
+<audio hidden='true' id="myAudio3"></audio>

+ 1 - 1
pages/main/detail.wxss

@@ -135,7 +135,7 @@
135
 .universalpic_show_white_30x30{
135
 .universalpic_show_white_30x30{
136
   width: 36rpx;
136
   width: 36rpx;
137
   height: 36rpx;
137
   height: 36rpx;
138
-  margin: 52rpx 50rpx 0 50rpx;
138
+  margin: 68rpx 50rpx 0 50rpx;
139
 }
139
 }
140
 
140
 
141
 .universalpic_hide_white_34x34 {
141
 .universalpic_hide_white_34x34 {

+ 35 - 20
pages/main/preview.js

@@ -2,12 +2,12 @@ import common from '../../utils/util';
2
 import main from '../../utils/main';
2
 import main from '../../utils/main';
3
 
3
 
4
 const app = getApp();
4
 const app = getApp();
5
-var iTimeout = 0;
5
+var iTimeout = 0, intervalSound=0;
6
 var arrImage = [], arrImage2 = [];
6
 var arrImage = [], arrImage2 = [];
7
 
7
 
8
 Page({
8
 Page({
9
   data: {
9
   data: {
10
-    IsExistCard:false,
10
+    IsExistCard: false,
11
   },
11
   },
12
   onLoad: function (options) {
12
   onLoad: function (options) {
13
     wx.hideShareMenu();
13
     wx.hideShareMenu();
@@ -21,10 +21,12 @@ Page({
21
       ShowType: options.type,
21
       ShowType: options.type,
22
       MiaoguoCardID: id,
22
       MiaoguoCardID: id,
23
     });
23
     });
24
-    console.log("MiaoguoCardID:"+id);
25
-    this.audioCtx = wx.createAudioContext('myAudio');
24
+    //console.log("MiaoguoCardID:" + id);
25
+    
26
+    this.audioCtx = [];
27
+    
26
 
28
 
27
-    if (options.type=="share"){
29
+    if (options.type == "share") {
28
       wx.setNavigationBarTitle({
30
       wx.setNavigationBarTitle({
29
         title: "查看共享"
31
         title: "查看共享"
30
       });
32
       });
@@ -44,8 +46,9 @@ Page({
44
     else
46
     else
45
       that.init();
47
       that.init();
46
   },
48
   },
47
-  onUnload:function(){
49
+  onUnload: function () {
48
     clearTimeout(iTimeout);
50
     clearTimeout(iTimeout);
51
+    clearInterval(intervalSound);
49
   },
52
   },
50
   init: function () {
53
   init: function () {
51
     var list = wx.getStorageSync("CardList");
54
     var list = wx.getStorageSync("CardList");
@@ -77,8 +80,8 @@ Page({
77
     arrImage = card.Images;
80
     arrImage = card.Images;
78
     arrImage2 = card.Images2;
81
     arrImage2 = card.Images2;
79
 
82
 
80
-    console.log("arrImage:"+arrImage);
81
-    console.log("arrImage2"+arrImage2);
83
+    console.log("arrImage:" + arrImage);
84
+    console.log("arrImage2" + arrImage2);
82
 
85
 
83
     this.setData({
86
     this.setData({
84
       ID: card.MiaoguoCardID,
87
       ID: card.MiaoguoCardID,
@@ -153,7 +156,7 @@ Page({
153
       wx.hideLoading();
156
       wx.hideLoading();
154
 
157
 
155
       var title = "题卡已存在!";
158
       var title = "题卡已存在!";
156
-      var image ="universalpic_wrong_white_120x120";
159
+      var image = "universalpic_wrong_white_120x120";
157
       if (data == 1) {
160
       if (data == 1) {
158
         title = "已保存";
161
         title = "已保存";
159
         image = "universalpic_saved_white_120x120";
162
         image = "universalpic_saved_white_120x120";
@@ -161,18 +164,18 @@ Page({
161
       wx.showToast({
164
       wx.showToast({
162
         title: title,
165
         title: title,
163
         mask: true,
166
         mask: true,
164
-        image:"../images/"+image+".png",
167
+        image: "../images/" + image + ".png",
165
         duration: 2000,
168
         duration: 2000,
166
         success: function () {
169
         success: function () {
167
           that.setData({
170
           that.setData({
168
-            IsExistCard:true,
171
+            IsExistCard: true,
169
           });
172
           });
170
         }
173
         }
171
       });
174
       });
172
     });
175
     });
173
   },
176
   },
174
   playSound: function (e) {
177
   playSound: function (e) {
175
-    var that=this;
178
+    var that = this;
176
     var str = e.currentTarget.dataset.content;
179
     var str = e.currentTarget.dataset.content;
177
     var url;
180
     var url;
178
     if (str.indexOf("英 [") >= 0 || str.indexOf("美 [") >= 0) {
181
     if (str.indexOf("英 [") >= 0 || str.indexOf("美 [") >= 0) {
@@ -189,8 +192,20 @@ Page({
189
       url = url.replace("[word]", str);
192
       url = url.replace("[word]", str);
190
     }
193
     }
191
 
194
 
192
-    this.audioCtx.setSrc(url);
193
-    this.audioCtx.play();
195
+    var arr = url.split(",");
196
+    for (var i = 0; i < arr.length; i++) {
197
+      this.audioCtx.push(wx.createAudioContext('myAudio' + i));
198
+    }
199
+    var index = 0;
200
+    intervalSound = setInterval(function () {
201
+      that.audioCtx[index].setSrc(arr[index]);
202
+      that.audioCtx[index].play();
203
+
204
+      index++;
205
+      if (index >= arr.length) {
206
+        clearInterval(intervalSound);
207
+      }
208
+    }, 1000);
194
 
209
 
195
     var fieldid = e.currentTarget.dataset.fieldid;
210
     var fieldid = e.currentTarget.dataset.fieldid;
196
     var content = that.data.Field[fieldid];
211
     var content = that.data.Field[fieldid];
@@ -289,22 +304,22 @@ Page({
289
       });
304
       });
290
     }
305
     }
291
   },
306
   },
292
-  showImage:function(e){
307
+  showImage: function (e) {
293
     var name = e.currentTarget.dataset.name;
308
     var name = e.currentTarget.dataset.name;
294
     wx.previewImage({
309
     wx.previewImage({
295
       current: name,
310
       current: name,
296
       urls: arrImage,
311
       urls: arrImage,
297
     });
312
     });
298
   },
313
   },
299
-  onBindError:function(e){
300
-    for(var i=1;i<this.data.Field.length;i++){
301
-      for(var j=0;j<this.data.Field[i].length;j++){
302
-        if (this.data.Field[i][j].Type=="image"){
314
+  onBindError: function (e) {
315
+    for (var i = 1; i < this.data.Field.length; i++) {
316
+      for (var j = 0; j < this.data.Field[i].length; j++) {
317
+        if (this.data.Field[i][j].Type == "image") {
303
           this.data.Field[i][j].Url = this.data.Field[i][j].Content;
318
           this.data.Field[i][j].Url = this.data.Field[i][j].Content;
304
         }
319
         }
305
       }
320
       }
306
     }
321
     }
307
-    arrImage=arrImage2;
322
+    arrImage = arrImage2;
308
     this.setData({
323
     this.setData({
309
       Field: this.data.Field,
324
       Field: this.data.Field,
310
     });
325
     });

+ 4 - 1
pages/main/preview.wxml

@@ -104,4 +104,7 @@
104
   </view>
104
   </view>
105
 </view>
105
 </view>
106
 
106
 
107
-<audio hidden='true' id="myAudio"></audio>
107
+<audio hidden='true' id="myAudio0"></audio>
108
+<audio hidden='true' id="myAudio1"></audio>
109
+<audio hidden='true' id="myAudio2"></audio>
110
+<audio hidden='true' id="myAudio3"></audio>

+ 14 - 13
pages/main/searchCard.wxml

@@ -1,20 +1,21 @@
1
 <view class="container FlexColumn" style='height:{{Containnerheight}}rpx;'>
1
 <view class="container FlexColumn" style='height:{{Containnerheight}}rpx;'>
2
-  <view class="panelSearch FlexRow">
3
-    <view class="panelSearch1 FlexRow" bindtap="onSearch">
4
-      <image class="universalpic_search_gray_30x30" src='../images/universalpic_search_gray_30x30.png' />
5
-      <view>搜索题卡</view>
2
+  <view class='panel'>
3
+    <view class="panelSearch FlexRow">
4
+      <view class="panelSearch1 FlexRow" bindtap="onSearch">
5
+        <image class="universalpic_search_gray_30x30" src='../images/universalpic_search_gray_30x30.png' />
6
+        <view>搜索题卡</view>
7
+      </view>
6
     </view>
8
     </view>
7
-  </view>
8
-  <view class='panelBtn FlexRow'>
9
-    <view class='text1 FlexRow' bindtap="getList" data-id="0">
10
-      <view>全部题卡</view>
11
-      <view class="text2">{{CardNumber}}</view>
9
+    <view class='panelBtn FlexRow'>
10
+      <view class='text1 FlexRow' bindtap="getList" data-id="0">
11
+        <view>全部题卡</view>
12
+        <view class="text2">{{CardNumber}}</view>
13
+      </view>
14
+      <view class='line1'></view>
15
+      <view class='text1' bindtap="getList" data-id="1">今日的任务</view>
12
     </view>
16
     </view>
13
-    <view class='line1'></view>
14
-    <view class='text1' bindtap="getList" data-id="1">今日的任务</view>
17
+    <view class='lineFooter'></view>
15
   </view>
18
   </view>
16
-  <view class='lineFooter'></view>
17
-
18
   <view class='panelBottom FlexColumn'>
19
   <view class='panelBottom FlexColumn'>
19
 
20
 
20
     <view class='panelBottom1 FlexRow'>
21
     <view class='panelBottom1 FlexRow'>

+ 7 - 0
pages/main/searchCard.wxss

@@ -5,6 +5,13 @@
5
   background-color: #f0f0f0;
5
   background-color: #f0f0f0;
6
 }
6
 }
7
 
7
 
8
+
9
+.panel{
10
+  width: 100%;
11
+  position: fixed;
12
+  top:0;
13
+}
14
+
8
 .panelSearch {
15
 .panelSearch {
9
   width: 100%;
16
   width: 100%;
10
   height: 140rpx;
17
   height: 140rpx;

+ 14 - 12
pages/main/searchCard1.wxml

@@ -1,15 +1,17 @@
1
-<view class="container FlexColumn" style='height:{{Containnerheight}}rpx;'>
2
-  <view class="panelSearch FlexRow">
3
-    <view class="panelSearch1 FlexRow">
4
-      <image class="universalpic_search_gray_30x30" src='../images/universalpic_search_gray_30x30.png' />
5
-      <input class='input' maxlength='50' auto-focus bindinput="onKeyInput" value="{{SearchInfo}}" />
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
+  <view class='panel'>
3
+    <view class="panelSearch FlexRow">
4
+      <view class="panelSearch1 FlexRow">
5
+        <image class="universalpic_search_gray_30x30" src='../images/universalpic_search_gray_30x30.png' />
6
+        <input class='input' maxlength='50' auto-focus bindinput="onKeyInput" value="{{SearchInfo}}" />
7
+      </view>
6
     </view>
8
     </view>
9
+    <view class='lineFooter'></view>
10
+    <view class='panelBtn FlexRow'>
11
+      <view class='text1' bindtap="close">取消</view>
12
+      <view class='line1'></view>
13
+      <view class='text2 text1' bindtap="onSearch">搜索</view>
14
+    </view>
15
+    <view class='lineFooter'></view>
7
   </view>
16
   </view>
8
-  <view class='lineFooter'></view>
9
-  <view class='panelBtn FlexRow'>
10
-    <view class='text1' bindtap="close">取消</view>
11
-    <view class='line1'></view>
12
-    <view class='text2 text1' bindtap="onSearch">搜索</view>
13
-  </view>
14
-  <view class='lineFooter'></view>
15
 </view>
17
 </view>

+ 5 - 0
pages/main/searchCard1.wxss

@@ -5,6 +5,11 @@
5
   background-color: #F0F0F0;
5
   background-color: #F0F0F0;
6
 }
6
 }
7
 
7
 
8
+.panel{
9
+  width: 100%;
10
+  position: fixed;
11
+  top:0;
12
+}
8
 .panelSearch{
13
 .panelSearch{
9
   width:100%;
14
   width:100%;
10
   height:140rpx;
15
   height:140rpx;

+ 7 - 10
pages/main/searchWeb2.js

@@ -135,10 +135,15 @@ Page({
135
       this.data.CSS[css].Tag = tag;
135
       this.data.CSS[css].Tag = tag;
136
       if (tag == "发音")
136
       if (tag == "发音")
137
         this.data.CSS[css].SoundMark = soundmark;
137
         this.data.CSS[css].SoundMark = soundmark;
138
-      if (tag == "拼音"){
138
+      if (tag == "拼音") {
139
         var pinyin = main.getPinyin(content);
139
         var pinyin = main.getPinyin(content);
140
         if (pinyin)
140
         if (pinyin)
141
           this.data.CSS[css].SoundMark = pinyin;
141
           this.data.CSS[css].SoundMark = pinyin;
142
+      } 
143
+      if (tag == "读写") {
144
+        var pinyin = main.getPinyin(e.currentTarget.dataset.pinyin);
145
+        if (pinyin)
146
+          this.data.CSS[css].SoundMark = pinyin;
142
       }
147
       }
143
 
148
 
144
       this.data.CSS[css].Number = "1";
149
       this.data.CSS[css].Number = "1";
@@ -157,14 +162,6 @@ Page({
157
     }
162
     }
158
     else {
163
     else {
159
       this.data.CSS[css].Number = Number(this.data.CSS[css].Number) + 1;
164
       this.data.CSS[css].Number = Number(this.data.CSS[css].Number) + 1;
160
-      //if (wx.getStorageSync("TempFieldNumber")) {
161
-        // this.data.CSS[css].Css1 = "";
162
-        // this.data.CSS[css].Css2 = "";
163
-        // this.data.CSS[css].Number = "";
164
-        // this.data.CSS[css].Content = "";
165
-        // this.data.CSS[css].Type = "";
166
-        // this.data.CSS[css].Tag = "";
167
-      //}
168
     }
165
     }
169
 
166
 
170
     this.setData({
167
     this.setData({
@@ -209,7 +206,7 @@ Page({
209
               if (item.Tag == "发音") {
206
               if (item.Tag == "发音") {
210
                 str = "[读 src='" + item.SoundMark+"']" + item.Content + "[/读]";
207
                 str = "[读 src='" + item.SoundMark+"']" + item.Content + "[/读]";
211
               }
208
               }
212
-              else if (item.Tag == "拼音") {
209
+              else if (item.Tag == "拼音" || item.Tag == "读写") {
213
                 if (item.SoundMark)
210
                 if (item.SoundMark)
214
                   str = "[读 src='" + item.SoundMark + "']" + item.Content + "[/读]";
211
                   str = "[读 src='" + item.SoundMark + "']" + item.Content + "[/读]";
215
                 else
212
                 else

+ 1 - 1
pages/main/searchWeb2.wxml

@@ -41,7 +41,7 @@
41
       <view class="panelTitle1">读写</view>
41
       <view class="panelTitle1">读写</view>
42
     </view>
42
     </view>
43
     <view class="panelItem FlexRow">
43
     <view class="panelItem FlexRow">
44
-      <view class="{{CSS['CHN_TianKong_'+index].Css1}} panelItemFrame FlexRow" wx:for="{{Result.CHN.TianKong}}" wx:key="index" bindtap='getInputData' data-type="sound" data-content="{{item}}" data-css="CHN_TianKong_{{index}}" data-tag="读写">
44
+      <view class="{{CSS['CHN_TianKong_'+index].Css1}} panelItemFrame FlexRow" wx:for="{{Result.CHN.TianKong}}" wx:key="index" bindtap='getInputData' data-type="sound" data-content="{{item}}" data-css="CHN_TianKong_{{index}}" data-pinyin="{{Result.CHN.PinYin[0].pinyin}}" data-tag="读写">
45
         <view class="{{CSS['CHN_TianKong_'+index].Css2}} panelSelect0">{{CSS['CHN_TianKong_'+index].Number}}</view>
45
         <view class="{{CSS['CHN_TianKong_'+index].Css2}} panelSelect0">{{CSS['CHN_TianKong_'+index].Number}}</view>
46
         <view class="text1">{{item}}</view>
46
         <view class="text1">{{item}}</view>
47
       </view>
47
       </view>

+ 2 - 2
pages/main/setting.js

@@ -4,8 +4,8 @@ import main from '../../utils/main';
4
 const app = getApp();
4
 const app = getApp();
5
 const arrSortType = ["时间较早的题卡", "时间较近的题卡"];
5
 const arrSortType = ["时间较早的题卡", "时间较近的题卡"];
6
 const arrSortType2 = ["较早的", "较近的"];
6
 const arrSortType2 = ["较早的", "较近的"];
7
-var arrUserName = ["程杰", "程晟涵", "洪立人", "唱意班主任"];
8
-var arrUserID = [1, 2, 3, 4];
7
+var arrUserName = ["程杰", "程晟涵", "唱意班主任", "teresa", "古利古拉"];
8
+var arrUserID = [1, 2, 4, 8, 9];
9
 
9
 
10
 Page({
10
 Page({
11
   data: {
11
   data: {

+ 30 - 20
utils/main.js

@@ -175,6 +175,9 @@ function getWindowHeight() {
175
     )) {
175
     )) {
176
       height = 596;
176
       height = 596;
177
     }
177
     }
178
+    else if (app.globalData.systemInfo.model.indexOf("iPad") >= 0) {
179
+      height = 470;
180
+    }
178
   }
181
   }
179
 
182
 
180
   height = height * 2;
183
   height = height * 2;
@@ -184,8 +187,9 @@ function getWindowHeight() {
184
   else {
187
   else {
185
     height = height + 50;
188
     height = height + 50;
186
   }
189
   }
187
-  //console.log("height:" + height);
190
+  console.log("height:" + height);
188
 
191
 
192
+  //var height = app.globalData.systemInfo.screenHeight * 2;
189
   return height;
193
   return height;
190
 }
194
 }
191
 
195
 
@@ -277,15 +281,15 @@ function EncryptUrl(str) {
277
   if (str) {
281
   if (str) {
278
     str = str.replace(/baidu.com/g, "#####1#####");
282
     str = str.replace(/baidu.com/g, "#####1#####");
279
     str = str.replace(/iciba.com/g, "#####2#####");
283
     str = str.replace(/iciba.com/g, "#####2#####");
280
-    str = str.replace(/kylx365.com/g, "#####3#####");
281
-    str = str.replace(/miaguo-1253256735.file.myqcloud.com/g, "#####4#####");
282
-
284
+    str = str.replace(/https:\/\/pinyin.kylx365.com\/sounds/g, "#####3#####");
285
+    str = str.replace(/https:\/\/miaguo-1253256735.file.myqcloud.com/g, "#####4#####");
283
   }
286
   }
284
 
287
 
285
-  if (str.substr(0,1)=="\n")
286
-    str=str.substr(1);
288
+  if (str.substr(0, 1) == "\n")
289
+    str = str.substr(1);
287
   return str;
290
   return str;
288
 }
291
 }
292
+
289
 function DecryptUrl(str) {
293
 function DecryptUrl(str) {
290
   if (str.constructor == Array) {
294
   if (str.constructor == Array) {
291
     if (str.length > 0)
295
     if (str.length > 0)
@@ -296,8 +300,8 @@ function DecryptUrl(str) {
296
   if (str) {
300
   if (str) {
297
     str = str.replace(/#####1#####/g, "baidu.com");
301
     str = str.replace(/#####1#####/g, "baidu.com");
298
     str = str.replace(/#####2#####/g, "iciba.com");
302
     str = str.replace(/#####2#####/g, "iciba.com");
299
-    str = str.replace(/#####3#####/g, "kylx365.com");
300
-    str = str.replace(/#####4#####/g, "miaguo-1253256735.file.myqcloud.com");
303
+    str = str.replace(/#####3#####/g, "https://pinyin.kylx365.com/sounds");
304
+    str = str.replace(/#####4#####/g, "https://miaguo-1253256735.file.myqcloud.com");
301
   }
305
   }
302
   return str;
306
   return str;
303
 }
307
 }
@@ -336,7 +340,7 @@ function changeStringToView(field) {
336
           if (arr[k].indexOf("[图") >= 0 && arr[k].indexOf("[/图]") > 0) {
340
           if (arr[k].indexOf("[图") >= 0 && arr[k].indexOf("[/图]") > 0) {
337
             var obj = {};
341
             var obj = {};
338
             obj.Type = "image";
342
             obj.Type = "image";
339
-            if (arr[k].indexOf("[图]") >= 0){
343
+            if (arr[k].indexOf("[图]") >= 0) {
340
               obj.Content = arr[k].substring(arr[k].indexOf("[图]") + 3, arr[k].indexOf("[/图]"));
344
               obj.Content = arr[k].substring(arr[k].indexOf("[图]") + 3, arr[k].indexOf("[/图]"));
341
               result.Images.push(obj.Content);
345
               result.Images.push(obj.Content);
342
               result.Images2.push(obj.Content);
346
               result.Images2.push(obj.Content);
@@ -344,8 +348,8 @@ function changeStringToView(field) {
344
             else {
348
             else {
345
               var temp = arr[k].substring(arr[k].indexOf("[图"), arr[k].indexOf("[/图]"));
349
               var temp = arr[k].substring(arr[k].indexOf("[图"), arr[k].indexOf("[/图]"));
346
               obj.Url = temp.substring(temp.indexOf("url=") + 5, temp.indexOf("]") - 1);
350
               obj.Url = temp.substring(temp.indexOf("url=") + 5, temp.indexOf("]") - 1);
347
-              temp=temp.substr(temp.indexOf("]")+1);
348
-              obj.Content=temp;
351
+              temp = temp.substr(temp.indexOf("]") + 1);
352
+              obj.Content = temp;
349
               result.Images.push(obj.Url);
353
               result.Images.push(obj.Url);
350
               result.Images2.push(obj.Content);
354
               result.Images2.push(obj.Content);
351
             }
355
             }
@@ -448,8 +452,8 @@ function getDetailColor(index) {
448
       Name: "每次更换配色",
452
       Name: "每次更换配色",
449
     },
453
     },
450
     {
454
     {
451
-      ID:1,
452
-      Name:"黑白",
455
+      ID: 1,
456
+      Name: "黑白",
453
       BackColor: "#ffffff",
457
       BackColor: "#ffffff",
454
       BackColor1: "#D2D2D2",
458
       BackColor1: "#D2D2D2",
455
       FrontColor: "#1E1E1E",
459
       FrontColor: "#1E1E1E",
@@ -461,7 +465,7 @@ function getDetailColor(index) {
461
       FieldLineColor: "#4B3840",
465
       FieldLineColor: "#4B3840",
462
       IconColor: "black",
466
       IconColor: "black",
463
       FrontColorNavigationBar: "#000000",
467
       FrontColorNavigationBar: "#000000",
464
-      BtnPressDownColor:"#F0F0F0",
468
+      BtnPressDownColor: "#F0F0F0",
465
     },
469
     },
466
     {
470
     {
467
       ID: 2,
471
       ID: 2,
@@ -580,19 +584,25 @@ function getDetailColor(index) {
580
     return arr[index];
584
     return arr[index];
581
   else if (index == 0)
585
   else if (index == 0)
582
     return arr[common.random(1, arr.length - 1)];
586
     return arr[common.random(1, arr.length - 1)];
583
-  else if (index==-1)
587
+  else if (index == -1)
584
     return arr;
588
     return arr;
585
 }
589
 }
586
 
590
 
587
 function getPinyin(pinyin) {
591
 function getPinyin(pinyin) {
592
+  var result = [];
588
   var arr = getPinyinArray();
593
   var arr = getPinyinArray();
589
-  for (var i = 0; i < arr.length; i++) {
590
-    if (arr[i][1] == pinyin) {
591
-      var url = app.globalData.pinyinUrl;
592
-      url = url.replace("[pinyin]", arr[i][0]);
593
-      return url;
594
+  var pinyinArray = pinyin.split(" ");
595
+  for (var j = 0; j < pinyinArray.length; j++) {
596
+    for (var i = 0; i < arr.length; i++) {
597
+      if (arr[i][1] == pinyinArray[j]) {
598
+        var url = app.globalData.pinyinUrl;
599
+        url = url.replace("[pinyin]", arr[i][0]);
600
+        result.push(url);
601
+        break;
602
+      }
594
     }
603
     }
595
   }
604
   }
605
+  return result.join(",");
596
 }
606
 }
597
 
607
 
598
 function getPinyinArray() {
608
 function getPinyinArray() {

+ 5 - 27
utils/util.js

@@ -14,6 +14,9 @@ function formatTime(date) {
14
   return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
14
   return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
15
 }
15
 }
16
 
16
 
17
+function checkIsArray(obj) {
18
+  return Object.prototype.toString.call(obj) === '[object Array]';
19
+}
17
 
20
 
18
 function formatDateCHS(date) {
21
 function formatDateCHS(date) {
19
   if (date) {
22
   if (date) {
@@ -260,31 +263,6 @@ function isExistStr(str1, str2) {
260
   return result;
263
   return result;
261
 }
264
 }
262
 
265
 
263
-function getSystemHeight() {
264
-  var systemInfo = wx.getSystemInfoSync();
265
-  var height = systemInfo.windowHeight;
266
-  if (systemInfo.model) {
267
-    if (height == 603 && systemInfo.model.indexOf("Plus") > 0) {
268
-      height = 625;
269
-    }
270
-    else if (height == 504 && (
271
-      systemInfo.model.indexOf("iPhone 6<") >= 0
272
-      || systemInfo.model.indexOf("iPhone 7<") >= 0
273
-      || systemInfo.model.indexOf("iPhone 6s<") >= 0
274
-      || systemInfo.model.indexOf("iPhone 5") >= 0
275
-      || systemInfo.model.indexOf("iPhone SE") >= 0
276
-    )) {
277
-      height = 596;
278
-    }
279
-  }
280
-
281
-  height = height * 2;
282
-  if (systemInfo.system && systemInfo.system.indexOf("Android") >= 0) {
283
-    height = height + 168;
284
-  }
285
-  return height;
286
-}
287
-
288
 //获取存储数据,若不存在,则获得缺省值。
266
 //获取存储数据,若不存在,则获得缺省值。
289
 function getStorageValue(obj, name, defaultStatus, callback) {
267
 function getStorageValue(obj, name, defaultStatus, callback) {
290
   wx.getStorage({
268
   wx.getStorage({
@@ -380,9 +358,9 @@ module.exports = {
380
   getEnumerationNameByDescription: getEnumerationNameByDescription,
358
   getEnumerationNameByDescription: getEnumerationNameByDescription,
381
   isExistStr: isExistStr,
359
   isExistStr: isExistStr,
382
   getStorageValue: getStorageValue,
360
   getStorageValue: getStorageValue,
383
-  getSystemHeight: getSystemHeight,
384
   ReplaceAllString: ReplaceAllString,
361
   ReplaceAllString: ReplaceAllString,
385
   addDate: addDate,
362
   addDate: addDate,
386
   diffDate: diffDate,
363
   diffDate: diffDate,
387
-  Trim: Trim
364
+  Trim: Trim,
365
+  checkIsArray: checkIsArray,
388
 }
366
 }