chengjie 6 年 前
コミット
a0cfe9bd83

+ 16 - 1
app.js

@@ -11,9 +11,21 @@ App({
11 11
   },
12 12
   getSystemInfo: function () {
13 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 27
   globalData: {
16
-    Version: "1.0.0.10",
28
+    Version: "1.0.0.11",
17 29
     IsProduction: true,
18 30
     ShareTitle: "可以用来记忆一切的工具",
19 31
     SharePath: "pages/index/index",
@@ -28,6 +40,9 @@ App({
28 40
     pinyinUrl: "https://pinyin.kylx365.com/sounds/[pinyin].m4a",
29 41
     uploadImageUrl:"https://miaguo-1253256735.file.myqcloud.com/",
30 42
     BaiduToken: "",//百度开发平台token
43
+    IsIOS:true,
44
+    IsAndroid:false,
45
+    IsIPad:false,
31 46
     systemInfo: null,
32 47
     userInfo: null,
33 48
     SourceID: 0,//来源ID

+ 1 - 1
pages/index/accredit.js

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

+ 1 - 1
pages/index/index.js

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

+ 11 - 7
pages/main/addItem.js

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

+ 6 - 0
pages/main/default.js

@@ -19,6 +19,12 @@ Page({
19 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 29
   onShow: function () {
24 30
     var that = this;

+ 3 - 3
pages/main/default.wxml

@@ -7,9 +7,9 @@
7 7
       <image class="universalpic_setup_gray_40x40" src='../images/universalpic_setup_gray_40x40.png' />
8 8
     </view>
9 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 14
   <view class='panelBottom FlexColumn'>
15 15
 

+ 7 - 0
pages/main/default.wxss

@@ -34,6 +34,13 @@
34 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 44
 .panelBottom {
38 45
   position: fixed;
39 46
   bottom: 0;

+ 31 - 7
pages/main/detail.js

@@ -12,6 +12,7 @@ var timeStart; //计算时长
12 12
 var TaskList = [];
13 13
 var iTimeout = 0;
14 14
 var arrImage = [], arrImage2 = [];
15
+var intervalSound;
15 16
 
16 17
 Page({
17 18
   data: {
@@ -38,14 +39,21 @@ Page({
38 39
   onLoad: function () {
39 40
     wx.hideShareMenu();
40 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 48
     that.setData({
42
-      Containnerheight: main.getWindowHeight(),
49
+      Containnerheight: height,
50
+      Containnerheight2: height-height2,
43 51
       IsShowAnswer: [0, 0],
44 52
       CanUndo: 1,
45 53
     });
46 54
 
47 55
     innerAudioContext1 = wx.createInnerAudioContext();
48
-    this.audioCtx = wx.createAudioContext('myAudio');
56
+    this.audioCtx=[];
49 57
 
50 58
     this.getList();
51 59
 
@@ -82,6 +90,9 @@ Page({
82 90
 
83 91
     }
84 92
   },
93
+  onUnload:function(){
94
+    clearInterval(intervalSound);
95
+  },
85 96
   onPullDownRefresh: function () {
86 97
   },
87 98
   setSoundFile: function (isFinish) {//isFinish=3搁置 =2撤退 =1结束 =0正常 =-1开始
@@ -116,8 +127,8 @@ Page({
116 127
       if (wx.setBackgroundColor) {
117 128
         wx.setBackgroundColor({
118 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 134
       if (wx.setNavigationBarColor) {
@@ -594,9 +605,22 @@ Page({
594 605
       url = url.replace("[token]", app.globalData.BaiduToken);
595 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 625
     var fieldid = e.currentTarget.dataset.fieldid;
602 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 2
   <view class='panelTop FlexRow' style='background-color:{{Color.BackColor}};color:{{Color.FrontColor}};'>
3 3
     <view class='panelCancel' wx:if="{{NumberNew+NumberReview+NumberHistory==0}}">
4 4
     </view>
@@ -81,7 +81,7 @@
81 81
 
82 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 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 86
       <view wx:if="{{itemParent==3}}" class="lineField" style='background-color:{{Color.FieldLineColor}};'></view>
87 87
       <view class="panelField21 panelItem FlexRow">
@@ -114,7 +114,7 @@
114 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 118
     <view class='text1'>做完了</view>
119 119
 
120 120
     <view class="panelLastTime FlexColumn">
@@ -133,7 +133,7 @@
133 133
     <view class='panelLastFooter' bindtap='onClose'>关闭</view>
134 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 137
   <view class='footer1 footer' wx:if="{{NumberNew+NumberReview+NumberHistory==0}}"></view>
138 138
 
139 139
   <block wx:if="{{IsShowAnswer[1]}}">
@@ -198,4 +198,7 @@
198 198
   </view>
199 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 135
 .universalpic_show_white_30x30{
136 136
   width: 36rpx;
137 137
   height: 36rpx;
138
-  margin: 52rpx 50rpx 0 50rpx;
138
+  margin: 68rpx 50rpx 0 50rpx;
139 139
 }
140 140
 
141 141
 .universalpic_hide_white_34x34 {

+ 35 - 20
pages/main/preview.js

@@ -2,12 +2,12 @@ import common from '../../utils/util';
2 2
 import main from '../../utils/main';
3 3
 
4 4
 const app = getApp();
5
-var iTimeout = 0;
5
+var iTimeout = 0, intervalSound=0;
6 6
 var arrImage = [], arrImage2 = [];
7 7
 
8 8
 Page({
9 9
   data: {
10
-    IsExistCard:false,
10
+    IsExistCard: false,
11 11
   },
12 12
   onLoad: function (options) {
13 13
     wx.hideShareMenu();
@@ -21,10 +21,12 @@ Page({
21 21
       ShowType: options.type,
22 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 30
       wx.setNavigationBarTitle({
29 31
         title: "查看共享"
30 32
       });
@@ -44,8 +46,9 @@ Page({
44 46
     else
45 47
       that.init();
46 48
   },
47
-  onUnload:function(){
49
+  onUnload: function () {
48 50
     clearTimeout(iTimeout);
51
+    clearInterval(intervalSound);
49 52
   },
50 53
   init: function () {
51 54
     var list = wx.getStorageSync("CardList");
@@ -77,8 +80,8 @@ Page({
77 80
     arrImage = card.Images;
78 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 86
     this.setData({
84 87
       ID: card.MiaoguoCardID,
@@ -153,7 +156,7 @@ Page({
153 156
       wx.hideLoading();
154 157
 
155 158
       var title = "题卡已存在!";
156
-      var image ="universalpic_wrong_white_120x120";
159
+      var image = "universalpic_wrong_white_120x120";
157 160
       if (data == 1) {
158 161
         title = "已保存";
159 162
         image = "universalpic_saved_white_120x120";
@@ -161,18 +164,18 @@ Page({
161 164
       wx.showToast({
162 165
         title: title,
163 166
         mask: true,
164
-        image:"../images/"+image+".png",
167
+        image: "../images/" + image + ".png",
165 168
         duration: 2000,
166 169
         success: function () {
167 170
           that.setData({
168
-            IsExistCard:true,
171
+            IsExistCard: true,
169 172
           });
170 173
         }
171 174
       });
172 175
     });
173 176
   },
174 177
   playSound: function (e) {
175
-    var that=this;
178
+    var that = this;
176 179
     var str = e.currentTarget.dataset.content;
177 180
     var url;
178 181
     if (str.indexOf("英 [") >= 0 || str.indexOf("美 [") >= 0) {
@@ -189,8 +192,20 @@ Page({
189 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 210
     var fieldid = e.currentTarget.dataset.fieldid;
196 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 308
     var name = e.currentTarget.dataset.name;
294 309
     wx.previewImage({
295 310
       current: name,
296 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 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 323
     this.setData({
309 324
       Field: this.data.Field,
310 325
     });

+ 4 - 1
pages/main/preview.wxml

@@ -104,4 +104,7 @@
104 104
   </view>
105 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 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 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 16
     </view>
13
-    <view class='line1'></view>
14
-    <view class='text1' bindtap="getList" data-id="1">今日的任务</view>
17
+    <view class='lineFooter'></view>
15 18
   </view>
16
-  <view class='lineFooter'></view>
17
-
18 19
   <view class='panelBottom FlexColumn'>
19 20
 
20 21
     <view class='panelBottom1 FlexRow'>

+ 7 - 0
pages/main/searchCard.wxss

@@ -5,6 +5,13 @@
5 5
   background-color: #f0f0f0;
6 6
 }
7 7
 
8
+
9
+.panel{
10
+  width: 100%;
11
+  position: fixed;
12
+  top:0;
13
+}
14
+
8 15
 .panelSearch {
9 16
   width: 100%;
10 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 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 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 17
 </view>

+ 5 - 0
pages/main/searchCard1.wxss

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

+ 7 - 10
pages/main/searchWeb2.js

@@ -135,10 +135,15 @@ Page({
135 135
       this.data.CSS[css].Tag = tag;
136 136
       if (tag == "发音")
137 137
         this.data.CSS[css].SoundMark = soundmark;
138
-      if (tag == "拼音"){
138
+      if (tag == "拼音") {
139 139
         var pinyin = main.getPinyin(content);
140 140
         if (pinyin)
141 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 149
       this.data.CSS[css].Number = "1";
@@ -157,14 +162,6 @@ Page({
157 162
     }
158 163
     else {
159 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 167
     this.setData({
@@ -209,7 +206,7 @@ Page({
209 206
               if (item.Tag == "发音") {
210 207
                 str = "[读 src='" + item.SoundMark+"']" + item.Content + "[/读]";
211 208
               }
212
-              else if (item.Tag == "拼音") {
209
+              else if (item.Tag == "拼音" || item.Tag == "读写") {
213 210
                 if (item.SoundMark)
214 211
                   str = "[读 src='" + item.SoundMark + "']" + item.Content + "[/读]";
215 212
                 else

+ 1 - 1
pages/main/searchWeb2.wxml

@@ -41,7 +41,7 @@
41 41
       <view class="panelTitle1">读写</view>
42 42
     </view>
43 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 45
         <view class="{{CSS['CHN_TianKong_'+index].Css2}} panelSelect0">{{CSS['CHN_TianKong_'+index].Number}}</view>
46 46
         <view class="text1">{{item}}</view>
47 47
       </view>

+ 2 - 2
pages/main/setting.js

@@ -4,8 +4,8 @@ import main from '../../utils/main';
4 4
 const app = getApp();
5 5
 const arrSortType = ["时间较早的题卡", "时间较近的题卡"];
6 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 10
 Page({
11 11
   data: {

+ 30 - 20
utils/main.js

@@ -175,6 +175,9 @@ function getWindowHeight() {
175 175
     )) {
176 176
       height = 596;
177 177
     }
178
+    else if (app.globalData.systemInfo.model.indexOf("iPad") >= 0) {
179
+      height = 470;
180
+    }
178 181
   }
179 182
 
180 183
   height = height * 2;
@@ -184,8 +187,9 @@ function getWindowHeight() {
184 187
   else {
185 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 193
   return height;
190 194
 }
191 195
 
@@ -277,15 +281,15 @@ function EncryptUrl(str) {
277 281
   if (str) {
278 282
     str = str.replace(/baidu.com/g, "#####1#####");
279 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 290
   return str;
288 291
 }
292
+
289 293
 function DecryptUrl(str) {
290 294
   if (str.constructor == Array) {
291 295
     if (str.length > 0)
@@ -296,8 +300,8 @@ function DecryptUrl(str) {
296 300
   if (str) {
297 301
     str = str.replace(/#####1#####/g, "baidu.com");
298 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 306
   return str;
303 307
 }
@@ -336,7 +340,7 @@ function changeStringToView(field) {
336 340
           if (arr[k].indexOf("[图") >= 0 && arr[k].indexOf("[/图]") > 0) {
337 341
             var obj = {};
338 342
             obj.Type = "image";
339
-            if (arr[k].indexOf("[图]") >= 0){
343
+            if (arr[k].indexOf("[图]") >= 0) {
340 344
               obj.Content = arr[k].substring(arr[k].indexOf("[图]") + 3, arr[k].indexOf("[/图]"));
341 345
               result.Images.push(obj.Content);
342 346
               result.Images2.push(obj.Content);
@@ -344,8 +348,8 @@ function changeStringToView(field) {
344 348
             else {
345 349
               var temp = arr[k].substring(arr[k].indexOf("[图"), arr[k].indexOf("[/图]"));
346 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 353
               result.Images.push(obj.Url);
350 354
               result.Images2.push(obj.Content);
351 355
             }
@@ -448,8 +452,8 @@ function getDetailColor(index) {
448 452
       Name: "每次更换配色",
449 453
     },
450 454
     {
451
-      ID:1,
452
-      Name:"黑白",
455
+      ID: 1,
456
+      Name: "黑白",
453 457
       BackColor: "#ffffff",
454 458
       BackColor1: "#D2D2D2",
455 459
       FrontColor: "#1E1E1E",
@@ -461,7 +465,7 @@ function getDetailColor(index) {
461 465
       FieldLineColor: "#4B3840",
462 466
       IconColor: "black",
463 467
       FrontColorNavigationBar: "#000000",
464
-      BtnPressDownColor:"#F0F0F0",
468
+      BtnPressDownColor: "#F0F0F0",
465 469
     },
466 470
     {
467 471
       ID: 2,
@@ -580,19 +584,25 @@ function getDetailColor(index) {
580 584
     return arr[index];
581 585
   else if (index == 0)
582 586
     return arr[common.random(1, arr.length - 1)];
583
-  else if (index==-1)
587
+  else if (index == -1)
584 588
     return arr;
585 589
 }
586 590
 
587 591
 function getPinyin(pinyin) {
592
+  var result = [];
588 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 608
 function getPinyinArray() {

+ 5 - 27
utils/util.js

@@ -14,6 +14,9 @@ function formatTime(date) {
14 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 21
 function formatDateCHS(date) {
19 22
   if (date) {
@@ -260,31 +263,6 @@ function isExistStr(str1, str2) {
260 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 267
 function getStorageValue(obj, name, defaultStatus, callback) {
290 268
   wx.getStorage({
@@ -380,9 +358,9 @@ module.exports = {
380 358
   getEnumerationNameByDescription: getEnumerationNameByDescription,
381 359
   isExistStr: isExistStr,
382 360
   getStorageValue: getStorageValue,
383
-  getSystemHeight: getSystemHeight,
384 361
   ReplaceAllString: ReplaceAllString,
385 362
   addDate: addDate,
386 363
   diffDate: diffDate,
387
-  Trim: Trim
364
+  Trim: Trim,
365
+  checkIsArray: checkIsArray,
388 366
 }