chengjie 6 yıl önce
ebeveyn
işleme
9bf406d342

+ 1 - 1
app.js

@@ -14,7 +14,7 @@ App({
14 14
   },
15 15
   globalData: {
16 16
     Version: "1.0.0",
17
-    IsProduction: false,
17
+    IsProduction: true,
18 18
     ShareTitle: "可以用来记忆一切的工具",
19 19
     SharePath: "pages/index/index",
20 20
     ShareImage: '',

+ 1 - 0
pages/index/index.js

@@ -203,6 +203,7 @@ Page({
203 203
       server.getData('GetBaiduToken', function (data) {
204 204
         if (data) {
205 205
           app.globalData.BaiduToken = data;
206
+          //console.log(app.globalData.BaiduToken);
206 207
         }
207 208
       });
208 209
     });

+ 1 - 1
pages/main/colorplan.wxss

@@ -29,7 +29,7 @@
29 29
   height:100rpx;
30 30
   border-radius: 10rpx;
31 31
   margin-bottom: 30rpx;
32
-  border:1rpx solid #E3E3E3;
32
+  border:1rpx solid #9B9B9B;
33 33
 }
34 34
 
35 35
 .panelItemSelected{

+ 7 - 2
pages/main/detail.js

@@ -11,6 +11,7 @@ var innerAudioContext2;
11 11
 var listTaskFinished = []; //完成的任务
12 12
 var timeStart; //计算时长
13 13
 var TaskList = [];
14
+var iTimeout=0;
14 15
 
15 16
 Page({
16 17
   data: {
@@ -299,6 +300,8 @@ Page({
299 300
     });
300 301
   },
301 302
   gotoPrev: function () {
303
+    clearTimeout(iTimeout);
304
+
302 305
     if (listTaskFinished.length > 0) {
303 306
       var card = listTaskFinished.pop();
304 307
       //console.log(card);
@@ -362,6 +365,8 @@ Page({
362 365
   gotoNext: function (e) {
363 366
     var that = this;
364 367
 
368
+    clearTimeout(iTimeout);
369
+
365 370
     wx.showLoading({
366 371
       title: '请稍候',
367 372
     });
@@ -574,6 +579,7 @@ Page({
574 579
     }
575 580
     innerAudioContext2.src = url;
576 581
     innerAudioContext2.play();
582
+    console.log(url);
577 583
 
578 584
     var fieldid = e.currentTarget.dataset.fieldid;
579 585
     var content = TaskList[0].ContentNew.Field[fieldid];
@@ -590,13 +596,12 @@ Page({
590 596
     that.setData({
591 597
       TaskInfo: TaskList[0],
592 598
     });
593
-    setTimeout(function () {
599
+    iTimeout=setTimeout(function () {
594 600
       content[selectIndex].SoundImageName = "png";
595 601
       TaskList[0].ContentNew.Field[fieldid] = content;
596 602
       that.setData({
597 603
         TaskInfo: TaskList[0],
598 604
       });
599
-
600 605
     }, 2000);
601 606
   },
602 607
   getTaskTime: function () {

+ 5 - 12
pages/main/detail.wxml

@@ -37,7 +37,7 @@
37 37
   <block wx:if="{{(NumberNew+NumberReview+NumberHistory)>0}}">
38 38
 
39 39
     <view class="panelField10" style='background-color:{{Color.BackColor}};'></view>
40
-    <view class="panelField1 FlexColumn" bindtouchstart="onShowAnswer" style='background-color:{{Color.BackColor}};color:{{Color.FrontColor}};'>
40
+    <view class="panelField1 FlexColumn" bindtap="onShowAnswer" style='background-color:{{Color.BackColor}};color:{{Color.FrontColor}};'>
41 41
       <view class="panelField11 panelItem FlexRow" style="font-size:{{TaskInfo.FontSize}}rpx;">
42 42
         <block wx:for="{{TaskInfo.ContentNew.Field[1]}}" wx:key="index">
43 43
           <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
@@ -124,13 +124,6 @@
124 124
       <view style='color:{{Color.FrontColor1}};'>单张题卡平均用时</view>
125 125
       <view class="time">{{Speed2}}</view>
126 126
     </view>
127
-
128
-    <!-- <image src="../images/practice_introduction_marks_a.png" class='practice_introduction_marks_a' />
129
-    <text class='text2'>君子曰:学不可以已\n——意指求学之路无止境。</text>
130
-    <image src="../images/practice_introduction_marks_b.png" class='practice_introduction_marks_b' />
131
-
132
-    <text class='text3'>我是荀子,战国末期赵国人\n思想家、文学家、政治家\n约公元前313年-公元前238年</text> -->
133
-
134 127
   </view>
135 128
 
136 129
   <view class='footer' wx:if="{{NumberNew+NumberReview+NumberHistory>0}}"></view>
@@ -139,25 +132,25 @@
139 132
   <block wx:if="{{IsShowAnswer[1]}}">
140 133
     <view class="panelBottomAnswer0" style='background:linear-gradient({{Color.BackColor20}},{{Color.BackColor2}});'></view>
141 134
     <view class='panelBottomAnswer panelBottom FlexRow' style='background-color:{{Color.BackColor2}};color:{{Color.FrontColor2}};'>
142
-      <view class="Answer FlexColumn" hover-class="AnswerHover" catchtap='gotoNext' data-time="{{TaskInfo.Number0}}" data-btnnumber="0">
135
+      <view class="Answer FlexColumn" hover-class="AnswerHover{{Color.ID}}" catchtap='gotoNext' data-time="{{TaskInfo.Number0}}" data-btnnumber="0">
143 136
         <view class="Answer0 btnColor"></view>
144 137
         <view class="btnTime">
145 138
           {{TaskInfo.Number0Str}}
146 139
         </view>
147 140
       </view>
148
-      <view class="Answer FlexColumn" hover-class="AnswerHover" catchtap='gotoNext' data-time="{{TaskInfo.Number1}}" data-btnnumber="3" wx:if="{{TaskInfo.Number1}}">
141
+      <view class="Answer FlexColumn" hover-class="AnswerHover{{Color.ID}}" catchtap='gotoNext' data-time="{{TaskInfo.Number1}}" data-btnnumber="3" wx:if="{{TaskInfo.Number1}}">
149 142
         <view class="Answer1 btnColor"></view>
150 143
         <view class="btnTime">
151 144
           {{TaskInfo.Number1Str}}
152 145
         </view>
153 146
       </view>
154
-      <view class="Answer FlexColumn" hover-class="AnswerHover" catchtap='gotoNext' data-time="{{TaskInfo.Number2}}" data-btnnumber="4">
147
+      <view class="Answer FlexColumn" hover-class="AnswerHover{{Color.ID}}" catchtap='gotoNext' data-time="{{TaskInfo.Number2}}" data-btnnumber="4">
155 148
         <view class="Answer2 btnColor"></view>
156 149
         <view class="btnTime">
157 150
           {{TaskInfo.Number2Str}}
158 151
         </view>
159 152
       </view>
160
-      <view class="Answer FlexColumn" hover-class="AnswerHover" catchtap='gotoNext' data-time="{{TaskInfo.Number3}}" data-btnnumber="5" wx:if="{{TaskInfo.Number3}}">
153
+      <view class="Answer FlexColumn" hover-class="AnswerHover{{Color.ID}}" catchtap='gotoNext' data-time="{{TaskInfo.Number3}}" data-btnnumber="5" wx:if="{{TaskInfo.Number3}}">
161 154
         <view class="Answer3 btnColor"></view>
162 155
         <view class="btnTime">
163 156
           {{TaskInfo.Number3Str}}

+ 30 - 5
pages/main/detail.wxss

@@ -212,15 +212,14 @@
212 212
 /* 底部记忆选择 */
213 213
 
214 214
 .panelBottomAnswer0 {
215
-  height: 30rpx;
215
+  height: 20rpx;
216 216
   width: 100%;
217 217
   position: fixed;
218
-  bottom: 120rpx;
218
+  bottom: 130rpx;
219 219
   z-index: 10;
220 220
 }
221 221
 
222 222
 .panelBottomAnswer {
223
-  height: 120rpx;
224 223
   width: 100%;
225 224
   position: fixed;
226 225
   bottom: 0;
@@ -231,16 +230,42 @@
231 230
 
232 231
 .Answer {
233 232
   flex: 1;
234
-  height: 120rpx;
233
+  height: 130rpx;
235 234
   font-size: 24rpx;
236 235
   justify-content: flex-start;
237 236
 }
238 237
 
238
+.AnswerHover1{
239
+  background-color: #F0F0F0;
240
+}
241
+.AnswerHover2{
242
+  background-color: #49354C;
243
+}
244
+.AnswerHover3{
245
+  background-color: #504F5A;
246
+}
247
+.AnswerHover4{
248
+  background-color: #373B4F;
249
+}
250
+.AnswerHover5{
251
+  background-color: #34384C;
252
+}
253
+.AnswerHover6{
254
+  background-color: #32304C;
255
+}
256
+.AnswerHover7{
257
+  background-color: #3D3838;
258
+}
259
+.AnswerHover8{
260
+  background-color: #473F52;
261
+}
262
+
263
+
239 264
 .Answer .btnColor {
240 265
   height: 30rpx;
241 266
   width: 90%;
242 267
   border-radius: 6rpx;
243
-  margin-top: 20rpx;
268
+  margin-top: 30rpx;
244 269
 }
245 270
 
246 271
 .Answer .btnTime {

+ 32 - 30
pages/main/preview.js

@@ -9,7 +9,7 @@ Page({
9 9
   },
10 10
   onLoad: function (options) {
11 11
     wx.hideShareMenu();
12
-    
12
+
13 13
     var that = this;
14 14
     var id = 0;
15 15
     if (options.id)
@@ -25,7 +25,7 @@ Page({
25 25
   },
26 26
   onShow: function () {
27 27
     var that = this;
28
-    if (that.data.ShowType=="share"){
28
+    if (that.data.ShowType == "share") {
29 29
       var url = "GetMiaoguoCardInfo?UserID=" + app.globalData.introducer + "&MiaoguoCardID=" + that.data.MiaoguoCardID;
30 30
       main.getData(url, function (data) {
31 31
         if (data) {
@@ -40,8 +40,8 @@ Page({
40 40
   init: function () {
41 41
     var list = wx.getStorageSync("CardList");
42 42
     var card = {};
43
-    var prevId=0;
44
-    var nextId=0;
43
+    var prevId = 0;
44
+    var nextId = 0;
45 45
     for (var i = 0; i < list.length; i++) {
46 46
       if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
47 47
         wx.setStorageSync("TempCardInfo", list[i]);
@@ -49,7 +49,7 @@ Page({
49 49
           prevId = list[i - 1].MiaoguoCardID;
50 50
         else
51 51
           prevId = 0;
52
-        if (i < list.length-1)
52
+        if (i < list.length - 1)
53 53
           nextId = list[i + 1].MiaoguoCardID;
54 54
         else
55 55
           nextId = 0;
@@ -57,20 +57,20 @@ Page({
57 57
         card = main.changeStringToView(list[i].Content);
58 58
         card.MiaoguoCardID = list[i].MiaoguoCardID;
59 59
         card.LimitTime = list[i].LimitTime;
60
-        card.FontSize=list[i].FontSize;
60
+        card.FontSize = list[i].FontSize;
61 61
         break;
62 62
       }
63 63
     }
64 64
     if (!card.FontSize)
65
-      card.FontSize=46;
66
-      
65
+      card.FontSize = 46;
66
+
67 67
     this.setData({
68 68
       ID: card.MiaoguoCardID,
69 69
       Field: card.Field,
70 70
       Tags: card.Tags,
71
-      PrevID:prevId,
72
-      NextID:nextId,
73
-      FontSize:card.FontSize,
71
+      PrevID: prevId,
72
+      NextID: nextId,
73
+      FontSize: card.FontSize,
74 74
       LimitTimeStr: common.formatDateCHS(card.LimitTime),
75 75
     });
76 76
   },
@@ -127,17 +127,17 @@ Page({
127 127
     wx.showLoading({
128 128
       title: '处理中',
129 129
     })
130
-    var that=this;
130
+    var that = this;
131 131
     var url = "CollectMiaoguoCard?";
132 132
     url += "MiaoguoCardID=" + that.data.MiaoguoCardID;
133 133
     url += "&UserIDSource=" + app.globalData.introducer;
134 134
     url += "&UserIDTarget=" + app.globalData.userInfo.UserID;
135
-    
135
+
136 136
     main.getData(url, function (data) {
137 137
       wx.hideLoading();
138 138
 
139
-      var title ="题卡已存在!";
140
-      if (data==1){
139
+      var title = "题卡已存在!";
140
+      if (data == 1) {
141 141
         title = "收藏成功!";
142 142
       }
143 143
       wx.showToast({
@@ -146,7 +146,7 @@ Page({
146 146
         duration: 3000,
147 147
         success: function () {
148 148
           that.setData({
149
-            ShowType:'preview'
149
+            ShowType: 'preview'
150 150
           });
151 151
         }
152 152
       });
@@ -159,8 +159,8 @@ Page({
159 159
       str = str.replace("英 [", "[");
160 160
       str = str.replace("美 [", "[");
161 161
       url = e.currentTarget.dataset.soundmark;
162
-    } 
163
-    else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark=="undefined") {
162
+    }
163
+    else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark == "undefined") {
164 164
       url = e.currentTarget.dataset.soundmark;
165 165
     }
166 166
     else {
@@ -168,7 +168,7 @@ Page({
168 168
       url = url.replace("[token]", app.globalData.BaiduToken);
169 169
       url = url.replace("[word]", str);
170 170
     }
171
-    
171
+
172 172
     innerAudioContext1.src = url;
173 173
     innerAudioContext1.play();
174 174
   },
@@ -212,7 +212,7 @@ Page({
212 212
               }
213 213
             }
214 214
             wx.setStorageSync("CardList", list);
215
-            
215
+
216 216
             var taskToday = wx.getStorageSync("TaskToday");
217 217
             taskToday.CardNumber--;
218 218
             wx.setStorageSync("TaskToday", taskToday);
@@ -236,23 +236,25 @@ Page({
236 236
       delta: 1,
237 237
     });
238 238
   },
239
-  editField:function(e){
240
-    var that = this;
241
-    var fieldid = e.currentTarget.dataset.id;
242
-    wx.navigateTo({
243
-      url: './add?type=edit3&id=' + that.data.MiaoguoCardID + '&fieldid=' + fieldid,
244
-    });
239
+  editField: function (e) {
240
+    if (this.data.ShowType == "show") {
241
+      var that = this;
242
+      var fieldid = e.currentTarget.dataset.id;
243
+      wx.navigateTo({
244
+        url: './add?type=edit3&id=' + that.data.MiaoguoCardID + '&fieldid=' + fieldid,
245
+      });
246
+    }
245 247
   },
246 248
   onShareAppMessage: function () {
247
-    var that=this;
249
+    var that = this;
248 250
     this.setData({
249
-      ShowType:'preview'
251
+      ShowType: 'preview'
250 252
     });
251
-    setTimeout(function(){
253
+    setTimeout(function () {
252 254
       that.setData({
253 255
         ShowType: 'show'
254 256
       });
255
-    },1000);
257
+    }, 1000);
256 258
     return {
257 259
       title: '分享题卡',
258 260
       path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID + '&Share=1&MiaoguoCardID=' + this.data.MiaoguoCardID,

+ 9 - 3
pages/main/searchWeb2.js

@@ -132,8 +132,11 @@ Page({
132 132
       this.data.CSS[css].Tag = tag;
133 133
       if (tag == "发音")
134 134
         this.data.CSS[css].SoundMark = soundmark;
135
-      if (tag == "拼音")
136
-        this.data.CSS[css].SoundMark = main.getPinyin(content);
135
+      if (tag == "拼音"){
136
+        var pinyin = main.getPinyin(content);
137
+        if (pinyin)
138
+          this.data.CSS[css].SoundMark = pinyin;
139
+      }
137 140
 
138 141
       this.data.CSS[css].Number = "1";
139 142
       if (wx.getStorageSync("TempFieldNumber")) {
@@ -203,7 +206,10 @@ Page({
203 206
                 str = "[读 src='" + item.SoundMark+"']" + item.Content + "[/读]";
204 207
               }
205 208
               else if (item.Tag == "拼音") {
206
-                str = "[读 src='" + item.SoundMark + "']" + item.Content + "[/读]";
209
+                if (item.SoundMark)
210
+                  str = "[读 src='" + item.SoundMark + "']" + item.Content + "[/读]";
211
+                else
212
+                  str = "[读]" + item.Content + "[/读]";
207 213
               }
208 214
             }
209 215
             else {

+ 24 - 8
utils/main.js

@@ -456,7 +456,8 @@ function getDetailColor(index) {
456 456
     {//随机
457 457
       Name: "每次更换配色",
458 458
     },
459
-    {//配色1
459
+    {
460
+      ID:1,
460 461
       Name:"黑白",
461 462
       BackColor: "#ffffff",
462 463
       BackColor1: "#D2D2D2",
@@ -469,8 +470,10 @@ function getDetailColor(index) {
469 470
       FieldLineColor: "#4B3840",
470 471
       IconColor: "black",
471 472
       FrontColorNavigationBar: "#000000",
473
+      BtnPressDownColor:"#F0F0F0",
472 474
     },
473
-    {//配色2
475
+    {
476
+      ID: 2,
474 477
       Name: "珊瑚树",
475 478
       BackColor: "#A5656E",
476 479
       BackColor1: "#7F4B52",
@@ -483,8 +486,10 @@ function getDetailColor(index) {
483 486
       FieldLineColor: "#D2D2D2",
484 487
       IconColor: "white",
485 488
       FrontColorNavigationBar: "#ffffff",
489
+      BtnPressDownColor: "#49354C",
486 490
     },
487
-    {//配色3
491
+    {
492
+      ID: 3,
488 493
       Name: "水果沙拉",
489 494
       BackColor: "#67A05D",
490 495
       BackColor1: "#467A5C",
@@ -497,8 +502,10 @@ function getDetailColor(index) {
497 502
       FieldLineColor: "#605F6C",
498 503
       IconColor: "white",
499 504
       FrontColorNavigationBar: "#ffffff",
505
+      BtnPressDownColor: "#504F5A",
500 506
     },
501
-    {//配色4
507
+    {
508
+      ID: 4,
502 509
       Name: "瞭望",
503 510
       BackColor: "#0B8457",
504 511
       BackColor1: "#1F6349",
@@ -511,8 +518,10 @@ function getDetailColor(index) {
511 518
       FieldLineColor: "#353A4C",
512 519
       IconColor: "white",
513 520
       FrontColorNavigationBar: "#ffffff",
521
+      BtnPressDownColor: "#373B4F",
514 522
     },
515
-    {//配色5
523
+    {
524
+      ID: 5,
516 525
       Name: "软糖豆",
517 526
       BackColor: "#018790",
518 527
       BackColor1: "#1C686C",
@@ -525,8 +534,10 @@ function getDetailColor(index) {
525 534
       FieldLineColor: "#414760",
526 535
       IconColor: "white",
527 536
       FrontColorNavigationBar: "#ffffff",
537
+      BtnPressDownColor: "#34384C",
528 538
     },
529
-    {//配色6
539
+    {
540
+      ID: 6,
530 541
       Name: "沙漏",
531 542
       BackColor: "#A3816A",
532 543
       BackColor1: "#7D614E",
@@ -539,8 +550,10 @@ function getDetailColor(index) {
539 550
       FieldLineColor: "#3B3F56",
540 551
       IconColor: "white",
541 552
       FrontColorNavigationBar: "#ffffff",
553
+      BtnPressDownColor: "#32304C",
542 554
     },
543
-    {//配色7
555
+    {
556
+      ID: 7,
544 557
       Name: "曼巴",
545 558
       BackColor: "#7E7373",
546 559
       BackColor1: "#E08371",
@@ -553,8 +566,10 @@ function getDetailColor(index) {
553 566
       FieldLineColor: "#4E4949",
554 567
       IconColor: "white",
555 568
       FrontColorNavigationBar: "#ffffff",
569
+      BtnPressDownColor: "#3D3838",
556 570
     },
557
-    {//配色8
571
+    {
572
+      ID: 8,
558 573
       Name: "烧赭",
559 574
       BackColor: "#FB6C54",
560 575
       BackColor1: "#CC554D",
@@ -567,6 +582,7 @@ function getDetailColor(index) {
567 582
       FieldLineColor: "#3D3B4D",
568 583
       IconColor: "white",
569 584
       FrontColorNavigationBar: "#ffffff",
585
+      BtnPressDownColor: "#473F52",
570 586
     },
571 587
   ];
572 588
   if (index > 0)