chengjie 6 vuotta sitten
vanhempi
commit
83b62be42c

+ 3 - 1
app.js

@@ -25,7 +25,7 @@ App({
25 25
     }
26 26
   },
27 27
   globalData: {
28
-    Version: "1.0.0.23",
28
+    Version: "1.0.0.24",
29 29
     IsProduction: false,
30 30
     ShareTitle: "可以用来记忆一切的工具",
31 31
     SharePath: "pages/index/index",
@@ -58,5 +58,7 @@ App({
58 58
     TempMiaoguoCardID: 0,//临时题卡ID,用于资料选取时用
59 59
     SearchNull: 0,//资料搜索为空时标记,用于资料搜索时用
60 60
     SearchItem: {},//资料搜索项信息,用于资料搜索时用
61
+    TempFieldNumber:0,//资料搜索时的段落编号
62
+    TempSearcchBackNumber:3,//资料搜索时返回的页面数
61 63
   }
62 64
 })

+ 0 - 1
app.json

@@ -1,7 +1,6 @@
1 1
 {
2 2
   "pages": [
3 3
     "pages/index/index",
4
-    "pages/main/addItem",
5 4
     "pages/index/accredit",
6 5
     "pages/main/default",
7 6
     "pages/main/cardInfo",

+ 285 - 25
pages/main/add.js

@@ -5,21 +5,28 @@ const app = getApp();
5 5
 var field = [[], [], [], []];
6 6
 var arrTag = [];
7 7
 
8
+var tempCursor = 0,
9
+  btnName = "";
10
+var arrSoundMark = [];
11
+var isUnload = true;
12
+var isEdit = true;
13
+
8 14
 Page({
9 15
   data: {
10
-    PracticeTimeStr:"智能安排"
16
+    PracticeTimeStr:"智能安排",
17
+    HiddenFieldEdit:true,
18
+    FieldContent: "",
19
+    SoundSign: "[读]",
20
+    LineSign: "[线]",
21
+    BtnArray: ["+", "-", "×", "÷", "=", "<", ">"],
11 22
   },
12 23
   onLoad: function (options) {
13 24
     wx.hideShareMenu();
14 25
     var that = this;
15
-    var fieldid = 0;
16
-    if (options.fieldid)
17
-      fieldid = options.fieldid;
18 26
     that.setData({
19 27
       Containnerheight: main.getWindowHeight(),
20 28
       UpdateType: options.type,
21 29
       MiaoguoCardID: options.id,
22
-      FieldID: fieldid,
23 30
     });
24 31
 
25 32
     var list = app.globalData.CardList;
@@ -29,6 +36,7 @@ Page({
29 36
         break;
30 37
       }
31 38
     }
39
+    app.globalData.TempFieldNumber=0;
32 40
     app.globalData.TempMiaoguoCardID=that.data.MiaoguoCardID;
33 41
 
34 42
   },
@@ -39,14 +47,15 @@ Page({
39 47
       that.initAddCard();
40 48
     }
41 49
     else {
42
-      var card = {};
50
+      var card = {},content="";
43 51
       var list = app.globalData.CardList;
44 52
       for (var i = 0; i < list.length; i++) {
45 53
         if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
46 54
           card = main.changeStringToView(list[i].Content);
47 55
           card.MiaoguoCardID = list[i].MiaoguoCardID;
48 56
           card.LimitTime = list[i].LimitTime;
49
-          
57
+          if (that.data.FieldNumber && that.data.FieldNumber>0)
58
+            content = main.encryptUrl(list[i].Content[that.data.FieldNumber].Content);
50 59
           break;
51 60
         }
52 61
       }
@@ -54,6 +63,7 @@ Page({
54 63
         MiaoguoCardID: card.MiaoguoCardID,
55 64
         Field: card.Field,
56 65
         Tags: card.Tags,
66
+        FieldContent:content,
57 67
       });
58 68
 
59 69
       if (that.data.UpdateType != "add2") {
@@ -61,13 +71,6 @@ Page({
61 71
           title: '编辑题卡'
62 72
         });
63 73
       }
64
-
65
-      if (that.data.UpdateType == "edit3") {
66
-        that.setData({
67
-          UpdateType: "edit2",
68
-        });
69
-        that.gotoAddItem({ currentTarget: { dataset: { fieldid: that.data.FieldID } } });
70
-      }
71 74
     }
72 75
   },
73 76
   onUnload: function () {
@@ -91,13 +94,28 @@ Page({
91 94
     });
92 95
   },
93 96
   gotoAddItem: function (e) {
97
+    var that=this;
94 98
     var fieldid = e.currentTarget.dataset.fieldid;
95
-    wx.navigateTo({
96
-      url: './addItem?id=' + this.data.MiaoguoCardID + '&fieldid=' + fieldid,
99
+    var content;
100
+    var list = app.globalData.CardList;
101
+    for (var i = 0; i < list.length; i++) {
102
+      if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
103
+        content = main.encryptUrl(list[i].Content[fieldid].Content);
104
+        break;
105
+      }
106
+    }
107
+    that.setData({
108
+      HiddenFieldEdit: false,
109
+      Focus: true,
110
+      FieldNumber: fieldid,
111
+      FieldContent:content,
112
+    });
113
+    wx.setNavigationBarTitle({
114
+      title: '编辑 段落' + fieldid,
97 115
     });
98 116
   },
99 117
   onSearch: function (e) {
100
-    wx.removeStorageSync("TempFieldNumber");
118
+    app.globalData.TempFieldNumber = 0;
101 119
     wx.navigateTo({
102 120
       url: './searchWeb',
103 121
     })
@@ -111,14 +129,6 @@ Page({
111 129
       });
112 130
     }
113 131
     else {
114
-      var list = app.globalData.CardList;
115
-      for (var i = 0; i < list.length; i++) {
116
-        if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
117
-          list[i].Content[0].Content=that.data.Tags;
118
-          break;
119
-        }
120
-      }
121
-      app.globalData.CardList = list;
122 132
       wx.navigateTo({
123 133
         url: './preview?type=preview&id=' + this.data.MiaoguoCardID,
124 134
       });
@@ -358,11 +368,259 @@ Page({
358 368
           that.setData({
359 369
             Tags: that.data.Tags,
360 370
           });
371
+
372
+          var list = app.globalData.CardList;
373
+          for (var i = 0; i < list.length; i++) {
374
+            if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
375
+              list[i].Content[0].Content = that.data.Tags;
376
+              break;
377
+            }
378
+          }
379
+          app.globalData.CardList = list;
361 380
         }
362 381
       }
363 382
     });
364 383
     
365 384
   },
385
+
386
+
387
+  //段落编辑**************************
388
+
389
+  //字段输入
390
+  bindinputField: function (e) {
391
+    console.log("bindinputField:" + e.detail.value + " isEdit:" + isEdit);
392
+
393
+    var that = this;
394
+    if (app.globalData.IsAndroid && !isEdit) {
395
+      return;
396
+    }
397
+
398
+    this.setData({
399
+      FieldContent: e.detail.value,
400
+    });
401
+    //this.updateField();
402
+
403
+  },
404
+  //加符号
405
+  addSymbol: function (e) {
406
+    //console.log("addSymbol");
407
+    isEdit = true;
408
+    var that = this;
409
+
410
+    btnName = e.currentTarget.dataset.id;
411
+    if (btnName == "[读]") {
412
+      this.setData({
413
+        SoundSign: "[/读]",
414
+      });
415
+    } else if (btnName == "[/读]") {
416
+      this.setData({
417
+        SoundSign: "[读]",
418
+      });
419
+    } else if (btnName == "[线]") {
420
+      this.setData({
421
+        LineSign: "[/线]",
422
+      });
423
+    } else if (btnName == "[/线]") {
424
+      this.setData({
425
+        LineSign: "[线]",
426
+      });
427
+    }
428
+
429
+    if (!this.data.Focus) {
430
+      this.data.FieldContent = this.data.FieldContent + btnName;
431
+      this.setData({
432
+        FieldContent: this.data.FieldContent,
433
+      });
434
+    }
435
+    //console.log("addSymbol:" + this.data.FieldContent);
436
+
437
+    setTimeout(function () {
438
+      that.setData({
439
+        Focus: true,
440
+      });
441
+    }, 300);
442
+  },
443
+  //焦点聚焦
444
+  onBindFocus: function () {
445
+    this.setData({
446
+      Focus: true,
447
+    });
448
+  },
449
+  //失焦
450
+  onBindblur: function (e) {
451
+    var that = this;
452
+    //console.log("onBindblur:" + isEdit + " Filed:" + this.data.FieldContent);
453
+    if (app.globalData.IsAndroid && !isEdit) {
454
+      setTimeout(function () {
455
+        isEdit = true;
456
+        console.log("onBindblur2:" + isEdit);
457
+      }, 500);
458
+      return;
459
+    }
460
+    isEdit = false;
461
+    if (app.globalData.IsAndroid && !isEdit) {
462
+      setTimeout(function () {
463
+        isEdit = true;
464
+        console.log("onBindblur2:" + isEdit);
465
+      }, 500);
466
+    }
467
+    //console.log("onBindblur:"+isEdit);
468
+
469
+    this.updateField();
470
+    tempCursor = e.detail.cursor;
471
+    //console.log("tempCursor:" + tempCursor);
472
+    if (tempCursor == undefined)
473
+      tempCursor = this.data["FieldContent"].length;
474
+    var str1 = "",
475
+      str2 = "";
476
+    if (this.data.FieldContent.length > 0) {
477
+      str1 = this.data.FieldContent.substr(0, tempCursor);
478
+      str2 = this.data.FieldContent.substring(tempCursor, this.data.FieldContent.length);
479
+    }
480
+    //console.log("str1:" + str1);
481
+    //console.log("str2:" + str2);
482
+    var cur = 1;
483
+    if (btnName == "[读]" || btnName == "[线]") {
484
+      cur = 3;
485
+    } else if (btnName == "[/读]" || btnName == "[/线]") {
486
+      cur = 4;
487
+    } else if (btnName == "(   )") {
488
+      cur = 5;
489
+    } else if (btnName == "_____") {
490
+      cur = 5;
491
+    }
492
+
493
+    this.data.FieldContent = str1 + btnName + str2;
494
+    this.setData({
495
+      FieldContent: this.data.FieldContent,
496
+      Focus: false,
497
+      Cursor: tempCursor + cur,
498
+    });
499
+
500
+    btnName = "";
501
+
502
+  },
503
+
504
+  onSearchField: function (e) {
505
+    app.globalData.TempFieldNumber = this.data.FieldNumber;
506
+    wx.navigateTo({
507
+      url: './searchWeb',
508
+    });
509
+    this.updateField();
510
+
511
+    setTimeout(function () {
512
+      isEdit = true;
513
+      //console.log("onSearchEnd");
514
+    }, 1000);
515
+  },
516
+  clear: function () {
517
+    var that = this;
518
+    //console.log("clear");
519
+    this.setData({
520
+      FieldContent: "",
521
+      Focus: true,
522
+      Cursor: 0,
523
+    });
524
+    btnName = "";
525
+    isEdit = false;
526
+    this.updateField();
527
+
528
+  },
529
+  closeAddItem: function (e) {
530
+    var that=this;
531
+    var isSave = e.currentTarget.dataset.idsave;
532
+    if (isSave == "true") {
533
+      isUnload = false;
534
+      wx.removeStorageSync("TempCardInfoAddItem");
535
+      this.updateField();
536
+      var title ="编辑题卡";
537
+      if (that.data.UpdateType == "add2") {
538
+        title = "添加题卡";
539
+      }
540
+      wx.setNavigationBarTitle({
541
+        title: title,
542
+      });
543
+
544
+    }
545
+    this.setData({
546
+      HiddenFieldEdit:true,
547
+    });
548
+  },
549
+
550
+  updateField: function (history) {
551
+    var str = this.data.FieldContent;
552
+    str = main.decryptUrl(str);
553
+
554
+    str = str.replace(/\[读\]/g, "\n[读]");
555
+    str = str.replace(/\[图\]/g, "\n[图]");
556
+    str = str.replace(/\[\/读\]/g, "[\/读]\n");
557
+    str = str.replace(/\[\/图\]/g, "[\/图]\n");
558
+    str = str.replace(/\n\n/g, "\n");
559
+
560
+    var list = app.globalData.CardList;
561
+    var card={};
562
+    for (var i = 0; i < list.length; i++) {
563
+      if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
564
+        if (history != undefined)
565
+          list[i].Content[this.data.FieldNumber].Content = history;
566
+        else
567
+          list[i].Content[this.data.FieldNumber].Content = str;
568
+        
569
+        card = main.changeStringToView(list[i].Content);
570
+        break;
571
+      }
572
+    }
573
+    app.globalData.CardList = list;
574
+
575
+    this.setData({
576
+        Field: card.Field,
577
+        Tags: card.Tags,
578
+    });
579
+  },
580
+
581
+  uploadImageField: function () {
582
+    //console.log("uploadImageStart");
583
+    var that = this;
584
+
585
+    wx.chooseImage({
586
+      count: 1,
587
+      sizeType: ['compressed'],
588
+      sourceType: ['album', 'camera'],
589
+      success(res) {
590
+        // tempFilePath可以作为img标签的src属性显示图片
591
+        const tempFilePaths = res.tempFilePaths;
592
+        //console.log(tempFilePaths[0]);
593
+        //that.data.FieldContent = that.data.FieldContent + "[图 url='" + tempFilePaths[0] + "']" + tempFilePaths[0] + "[/图]";
594
+
595
+        if (tempCursor == undefined)
596
+          tempCursor = that.data.FieldContent.length;
597
+        var str1 = "",
598
+          str2 = "";
599
+        if (that.data.FieldContent.length > 0) {
600
+          str1 = that.data.FieldContent.substr(0, tempCursor);
601
+          str2 = that.data.FieldContent.substring(tempCursor, that.data.FieldContent.length);
602
+        }
603
+
604
+        var str0 = "[图]" + tempFilePaths[0] + "[/图]";
605
+
606
+        that.data.FieldContent = str1 + str0 + str2;
607
+
608
+        //console.log("uploadImageEnd:" + that.data.FieldContent);
609
+
610
+        that.setData({
611
+          FieldContent: that.data.FieldContent,
612
+          Focus: false,
613
+        });
614
+        that.updateField();
615
+      },
616
+      fail: function () {
617
+
618
+      }
619
+    });
620
+
621
+  },
622
+  
623
+
366 624
   onShareAppMessage: function () {
367 625
     return {
368 626
       title: app.globalData.ShareTitle,
@@ -371,3 +629,5 @@ Page({
371 629
     }
372 630
   },
373 631
 })
632
+
633
+

+ 62 - 13
pages/main/add.wxml

@@ -1,4 +1,4 @@
1
-<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;' hidden='{{!HiddenFieldEdit}}'>
2 2
   <view class="panelTimePlan FlexRow" wx:if="{{UpdateType=='add' || UpdateType=='add2'}}">
3 3
     <view class="panelItem1">
4 4
       练习时间
@@ -27,29 +27,18 @@
27 27
           <block wx:if="{{itemParent==2}}">答案</block>
28 28
           <block wx:if="{{itemParent==3}}">其它</block>
29 29
         </text>
30
-
31
-
32 30
         <block wx:for="{{Field[itemParent]}}" wx:key="index">
33
-
34 31
           <text class="textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
35
-
36 32
           <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
37 33
             <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
38 34
               <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
39 35
           <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
40 36
         </block>
41 37
         </text>
42
-
43 38
         <image class="universalpic_read_gray_40x40" wx:if="{{item.Type=='sound'}}" src='../images/universalpic_read_gray_40x40.png' />
44 39
         <text class="textPinyin" wx:if="{{item.Type=='sound'}}">{{item.Content}}</text>
45
-
46
-        <image class="imageBishun" wx:if="{{item.Type=='image' && !item.Url}}" src='{{item.Content}}' />
47
-
48
-        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image' && item.Url}}" src='{{item.Url}}' binderror="onBindError" />
49
-
40
+        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' binderror="onBindError" />
50 41
         <text class="textReturn" wx:if="{{item.Type=='return'}}"></text>
51
-
52
-
53 42
   </block>
54 43
   </view>
55 44
   </view>
@@ -85,4 +74,64 @@
85 74
       <image class="universalpic_preview_black_30x30" src='../images/universalpic_preview_black_30x30.png' />
86 75
     </view>
87 76
   </view>
77
+</view>
78
+
79
+<!-- 字段编辑 -->
80
+<view class="addItem container FlexColumn" style='height:{{Containnerheight}}rpx;' hidden='{{HiddenFieldEdit}}'>
81
+  <view class="panelItemTag FlexRow">
82
+    <view class='left FlexRow'>
83
+      <view class="panelSaveTag1 FlexRow" bindtap="onSearchField">
84
+        <view class="add">+</view> 资料
85
+      </view>
86
+      <view class="panelSaveTag2 panelSaveTag1 FlexRow" bindtap="addSymbol" data-id="{{SoundSign}}" hidden="{{SoundSign=='[/读]'}}">
87
+        <image class="universalpic_read_begin_gray_20x20" src='../images/universalpic_read_begin_gray_20x20.png' />
88
+      </view>
89
+      <view class="panelSaveTag3 panelSaveTag1 FlexRow" bindtap="addSymbol" data-id="{{SoundSign}}" hidden="{{SoundSign=='[读]'}}">
90
+        <image class="universalpic_read_end_white_38x22" src='../images/universalpic_read_end_white_38x22.png' />
91
+      </view>
92
+      <view class="panelSaveTag2 panelSaveTag1 FlexRow" bindtap="addSymbol" data-id="{{LineSign}}" hidden="{{LineSign=='[/线]'}}">
93
+        <image class="universalpic_editbar_underline_gray_14x20" src='../images/universalpic_editbar_underline_gray_14x20.png' />
94
+      </view>
95
+      <view class="panelSaveTag3 panelSaveTag1 FlexRow" bindtap="addSymbol" data-id="{{LineSign}}" hidden="{{LineSign=='[线]'}}">
96
+        <image class="universalpic_underline_end_white_30x22" src='../images/universalpic_underline_end_white_30x22.png' />
97
+      </view>
98
+      <view class="panelSaveTag2 panelSaveTag1 FlexRow" catchtap="uploadImageField">
99
+        <image class="universalpic_picture_gray_26x26" src='../images/universalpic_picture_gray_26x26.png' />
100
+      </view>
101
+
102
+    </view>
103
+    <view class='right FlexRow'>
104
+      <view class="clear" catchtap="clear">清空</view>
105
+    </view>
106
+  </view>
107
+  <view class='lineFooter'></view>
108
+  <view class='panelInput'>
109
+    <textarea class="input" maxlength='-1' show-confirm-bar="true" value="{{FieldContent}}" focus="{{Focus}}" cursor="{{Cursor}}" bindinput="bindinputField" bindblur="onBindblur" bindfocus="onBindFocus" data-id='{{FieldNumber}}' />
110
+  </view>
111
+  <cover-view class='lineFooter'></cover-view>
112
+  <cover-view class='panelBtnItem FlexColumn'>
113
+    <cover-view class="panelBtnSmall FlexRow">
114
+      <cover-view class="btn0"></cover-view>
115
+      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="(     )">
116
+        <cover-image class="universalpic_editbar_brackets_gray" src='../images/universalpic_editbar_brackets_gray.png' />
117
+      </cover-view>
118
+      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="_____">
119
+        <cover-image class="universalpic_editbar_underline_gray" src='../images/universalpic_editbar_underline_gray.png' />
120
+      </cover-view>
121
+      <cover-view class="btn" bindtap="addSymbol" wx:for="{{BtnArray}}" wx:key="index" data-id="{{item}}">{{item}}</cover-view>
122
+      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="²">
123
+        <cover-image class="universalpic_editbar_sqr_gray" src='../images/universalpic_editbar_sqr_gray.png' />
124
+      </cover-view>
125
+      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="³">
126
+        <cover-image class="universalpic_editbar_sqr_gray" src='../images/universalpic_editbar_cube_gray.png' />
127
+      </cover-view>
128
+    </cover-view>
129
+    <cover-view class='lineFooter'></cover-view>
130
+    <cover-view class='panelBtn FlexRow'>
131
+      <cover-view class='text1' bindtap="closeAddItem" data-idsave="false">取消</cover-view>
132
+      <cover-view class='line1'></cover-view>
133
+      <cover-view class='text2 text1' bindtap="closeAddItem" data-idsave="true">确定</cover-view>
134
+    </cover-view>
135
+    <cover-view class='lineFooter'></cover-view>
136
+  </cover-view>
88 137
 </view>

+ 209 - 0
pages/main/add.wxss

@@ -239,3 +239,212 @@
239 239
   height: 36rpx;
240 240
   margin: 0 40rpx;
241 241
 }
242
+
243
+/* 字段编辑 */
244
+.addItem {
245
+  justify-content: flex-start;
246
+  font-weight: 500;
247
+  color: #1e1e1e;
248
+  background-color: #f0f0f0;
249
+  position: fixed;
250
+  top: 0;
251
+}
252
+
253
+.left {
254
+  margin-left: 25rpx;
255
+}
256
+
257
+.right {
258
+  margin-right: 25rpx;
259
+}
260
+
261
+.panelItemTag {
262
+  width: 100%;
263
+  justify-content: space-between;
264
+  min-height: 120rpx;
265
+  background-color: #fff;
266
+}
267
+
268
+.panelSaveTag1 {
269
+  width: 148rpx;
270
+  background-color: #fff;
271
+  border: 1rpx solid #9b9b9b;
272
+  color: #787878;
273
+  text-align: center;
274
+  height: 80rpx;
275
+  line-height: 80rpx;
276
+  border-radius: 10rpx;
277
+  font-size: 28rpx;
278
+}
279
+
280
+.panelSaveTag2 {
281
+  width: 80rpx;
282
+  height: 80rpx;
283
+  background-color: #fff;
284
+  border: 1rpx solid #9b9b9b;
285
+  margin-left: 10rpx;
286
+}
287
+
288
+.panelSaveTag3 {
289
+  width: 80rpx;
290
+  height: 80rpx;
291
+  margin-left: 10rpx;
292
+  background-color: #0071ef;
293
+  border: 1rpx solid #0071ef;
294
+}
295
+
296
+.universalpic_read_begin_gray_20x20 {
297
+  width: 21rpx;
298
+  height: 20rpx;
299
+}
300
+
301
+.universalpic_read_end_white_38x22 {
302
+  width: 38rpx;
303
+  height: 22rpx;
304
+}
305
+
306
+.universalpic_editbar_underline_gray_14x20 {
307
+  width: 14rpx;
308
+  height: 20rpx;
309
+}
310
+
311
+.universalpic_underline_end_white_30x22 {
312
+  width: 31rpx;
313
+  height: 22rpx;
314
+}
315
+
316
+.universalpic_picture_gray_26x26 {
317
+  width: 26rpx;
318
+  height: 26rpx;
319
+}
320
+
321
+.add {
322
+  font-size: 42rpx;
323
+  font-weight: 600;
324
+  margin: 0 10rpx 10rpx 0;
325
+}
326
+
327
+.clear {
328
+  width: 108rpx;
329
+  height: 80rpx;
330
+  color: #0071ef;
331
+  background-color: #fff;
332
+  border: 1rpx solid #9b9b9b;
333
+  text-align: center;
334
+  border-radius: 10rpx;
335
+  line-height: 80rpx;
336
+  font-size: 24rpx;
337
+}
338
+
339
+.line1 {
340
+  width: 4rpx;
341
+  height: 30rpx;
342
+  background-color: #d2d2d2;
343
+  margin-right: 20rpx;
344
+}
345
+
346
+.universalpic_help_gray_26x26 {
347
+  width: 26rpx;
348
+  height: 26rpx;
349
+  margin: 0 0 0 40rpx;
350
+}
351
+
352
+.panelInput {
353
+  width: 100%;
354
+  height: 250rpx;
355
+  margin-top: 10rpx;
356
+  background-color: #fff;
357
+  font-size: 36rpx;
358
+  font-weight: 400;
359
+}
360
+
361
+.input {
362
+  margin: 30rpx 30rpx 0 30rpx;
363
+  width: 690rpx;
364
+  height: 220rpx;
365
+}
366
+
367
+.panelBtnItem {
368
+  position: fixed;
369
+  top: 382rpx;
370
+  width: 100%;
371
+  background-color: #fff;
372
+}
373
+
374
+.panelBtnSmall {
375
+  z-index: 10;
376
+  width:100%;
377
+  height: 120rpx;
378
+  background-color: #fff;
379
+  justify-content: flex-start;
380
+}
381
+
382
+.panelBtnSmall .btn0 {
383
+  width: 10rpx;
384
+}
385
+
386
+.panelBtnSmall .btn {
387
+  font-family: 'Roboto-Black';
388
+  width: 80rpx;
389
+  background-color: #fff;
390
+  border: 1rpx solid #9b9b9b;
391
+  color: #787878;
392
+  border-radius: 10rpx;
393
+  text-align: center;
394
+  line-height: 80rpx;
395
+  height: 80rpx;
396
+  margin-right: 10rpx;
397
+  font-size: 36rpx;
398
+}
399
+
400
+.panelBtnSmall .btn1 {
401
+  width: 80rpx;
402
+  height: 80rpx;
403
+  background-color: #fff;
404
+  border: 1rpx solid #9b9b9b;
405
+  border-radius: 10rpx;
406
+  margin-right: 10rpx;
407
+}
408
+
409
+.universalpic_editbar_brackets_gray {
410
+  width: 34rpx;
411
+  height: 26rpx;
412
+}
413
+
414
+.universalpic_editbar_underline_gray {
415
+  width: 18rpx;
416
+  height: 28rpx;
417
+}
418
+
419
+.universalpic_editbar_sqr_gray {
420
+  width: 25rpx;
421
+  height: 22rpx;
422
+}
423
+
424
+.panelBtn {
425
+  width: 100%;
426
+  background-color: #f8f8f8;
427
+  z-index: 10;
428
+}
429
+
430
+.panelBtn .line1 {
431
+  width: 4rpx;
432
+  height: 30rpx;
433
+  background-color: #d2d2d2;
434
+}
435
+
436
+.panelBtn .text1 {
437
+  width: 374rpx;
438
+  line-height: 100rpx;
439
+  text-align: center;
440
+  font-size: 28rpx;
441
+  color: #a20602;
442
+}
443
+
444
+.panelBtn .text2 {
445
+  color: #0071ef;
446
+}
447
+
448
+.lineFooter {
449
+  z-index: 10;
450
+}

+ 0 - 292
pages/main/addItem.js

@@ -1,292 +0,0 @@
1
-import common from '../../utils/util';
2
-import main from '../../utils/main';
3
-
4
-const app = getApp();
5
-
6
-var tempCursor = 0,
7
-  btnName = "";
8
-var arrSoundMark = [];
9
-var isUnload = true;
10
-var isEdit = true;
11
-
12
-Page({
13
-  data: {
14
-    Field: "",
15
-    SoundSign: "[读]",
16
-    LineSign: "[线]",
17
-    BtnArray: ["+", "-", "×", "÷", "=", "<", ">"],
18
-  },
19
-  onLoad: function (options) {
20
-    wx.hideShareMenu();
21
-    var id = options.id;
22
-    var fieldid = options.fieldid;
23
-    tempCursor = 0, btnName = "", arrSoundMark = [];
24
-
25
-    var that = this;
26
-    that.setData({
27
-      MiaoguoCardID: id,
28
-      Focus: true,
29
-      FieldNumber: fieldid,
30
-      Containnerheight: main.getWindowHeight(),
31
-    });
32
-    wx.setNavigationBarTitle({
33
-      title: '编辑 段落' + fieldid,
34
-    });
35
-
36
-  },
37
-  onShow: function () {
38
-    //console.log("onShow");
39
-    var that = this;
40
-
41
-    //console.log("onShow:" + isEdit);
42
-    if (app.globalData.IsAndroid && !isEdit) {
43
-      return;
44
-    }
45
-
46
-    var list = app.globalData.CardList;
47
-    var card = {};
48
-    for (var i = 0; i < list.length; i++) {
49
-      if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
50
-        var content = main.encryptUrl(list[i].Content[this.data.FieldNumber].Content);
51
-        this.setData({
52
-          Field: content,
53
-        });
54
-
55
-        if (!wx.getStorageSync("TempCardInfoAddItem")) {
56
-          wx.setStorageSync("TempCardInfoAddItem", content);
57
-        }
58
-        break;
59
-      }
60
-    }
61
-
62
-    isUnload = true;
63
-  },
64
-  onUnload: function () {
65
-    if (isUnload) {
66
-      var content = wx.getStorageSync("TempCardInfoAddItem");
67
-      if (content != undefined) {
68
-        this.updateField(content);
69
-        wx.removeStorageSync("TempCardInfoAddItem");
70
-      }
71
-    }
72
-    isEdit = true;
73
-  },
74
-  bindinputField: function (e) {
75
-    console.log("bindinputField:" + e.detail.value + " isEdit:" + isEdit);
76
-
77
-    var that = this;
78
-    if (app.globalData.IsAndroid && !isEdit) {
79
-      return;
80
-    }
81
-
82
-    this.setData({
83
-      Field: e.detail.value,
84
-    });
85
-    //this.updateField();
86
-
87
-  },
88
-  addSymbol: function (e) {
89
-    //console.log("addSymbol");
90
-    isEdit = true;
91
-    var that = this;
92
-
93
-    btnName = e.currentTarget.dataset.id;
94
-    if (btnName == "[读]") {
95
-      this.setData({
96
-        SoundSign: "[/读]",
97
-      });
98
-    } else if (btnName == "[/读]") {
99
-      this.setData({
100
-        SoundSign: "[读]",
101
-      });
102
-    } else if (btnName == "[线]") {
103
-      this.setData({
104
-        LineSign: "[/线]",
105
-      });
106
-    } else if (btnName == "[/线]") {
107
-      this.setData({
108
-        LineSign: "[线]",
109
-      });
110
-    }
111
-
112
-    if (!this.data.Focus) {
113
-      this.data.Field = this.data.Field + btnName;
114
-      this.setData({
115
-        Field: this.data.Field,
116
-      });
117
-    }
118
-    //console.log("addSymbol:" + this.data.Field);
119
-
120
-    setTimeout(function () {
121
-      that.setData({
122
-        Focus: true,
123
-      });
124
-    }, 300);
125
-  },
126
-  onBindFocus: function () {
127
-    this.setData({
128
-      Focus: true,
129
-    });
130
-  },
131
-  onBindblur: function (e) {
132
-    var that = this;
133
-    //console.log("onBindblur:" + isEdit + " Filed:" + this.data.Field);
134
-    if (app.globalData.IsAndroid && !isEdit) {
135
-      setTimeout(function () {
136
-        isEdit = true;
137
-        console.log("onBindblur2:" + isEdit);
138
-      }, 500);
139
-      return;
140
-    }
141
-    isEdit = false;
142
-    if (app.globalData.IsAndroid && !isEdit) {
143
-      setTimeout(function () {
144
-        isEdit = true;
145
-        console.log("onBindblur2:" + isEdit);
146
-      }, 500);
147
-    }
148
-    //console.log("onBindblur:"+isEdit);
149
-
150
-    this.updateField();
151
-    tempCursor = e.detail.cursor;
152
-    //console.log("tempCursor:" + tempCursor);
153
-    if (tempCursor == undefined)
154
-      tempCursor = this.data["Field"].length;
155
-    var str1 = "",
156
-      str2 = "";
157
-    if (this.data.Field.length > 0) {
158
-      str1 = this.data.Field.substr(0, tempCursor);
159
-      str2 = this.data.Field.substring(tempCursor, this.data.Field.length);
160
-    }
161
-    //console.log("str1:" + str1);
162
-    //console.log("str2:" + str2);
163
-    var cur = 1;
164
-    if (btnName == "[读]" || btnName == "[线]") {
165
-      cur = 3;
166
-    } else if (btnName == "[/读]" || btnName == "[/线]") {
167
-      cur = 4;
168
-    } else if (btnName == "(   )") {
169
-      cur = 5;
170
-    } else if (btnName == "_____") {
171
-      cur = 5;
172
-    }
173
-
174
-    this.data.Field = str1 + btnName + str2;
175
-    this.setData({
176
-      Field: this.data.Field,
177
-      Focus: false,
178
-      Cursor: tempCursor + cur,
179
-    });
180
-
181
-    btnName = "";
182
-
183
-  },
184
-  onSearch: function (e) {
185
-  
186
-    wx.setStorageSync("TempFieldNumber", this.data.FieldNumber);
187
-    wx.navigateTo({
188
-      url: './searchWeb',
189
-    });
190
-    this.updateField();
191
-    
192
-    setTimeout(function () {
193
-      isEdit = true;
194
-      //console.log("onSearchEnd");
195
-    }, 1000);
196
-  },
197
-  clear: function () {
198
-    var that = this;
199
-    //console.log("clear");
200
-    this.setData({
201
-      Field: "",
202
-      Focus: true,
203
-      Cursor: 0,
204
-    });
205
-    btnName = "";
206
-    isEdit = false;
207
-    this.updateField();
208
-
209
-  },
210
-  closeAddItem: function (e) {
211
-    var isSave = e.currentTarget.dataset.idsave;
212
-    if (isSave == "true") {
213
-      isUnload = false;
214
-      wx.removeStorageSync("TempCardInfoAddItem");
215
-      this.updateField();
216
-    }
217
-    wx.navigateBack({
218
-      delta: 1,
219
-    });
220
-  },
221
-
222
-  uploadImage: function () {
223
-    //console.log("uploadImageStart");
224
-    var that = this;
225
-
226
-    wx.chooseImage({
227
-      count: 1,
228
-      sizeType: ['compressed'],
229
-      sourceType: ['album', 'camera'],
230
-      success(res) {
231
-        // tempFilePath可以作为img标签的src属性显示图片
232
-        const tempFilePaths = res.tempFilePaths;
233
-        //console.log(tempFilePaths[0]);
234
-        //that.data.Field = that.data.Field + "[图 url='" + tempFilePaths[0] + "']" + tempFilePaths[0] + "[/图]";
235
-
236
-        if (tempCursor == undefined)
237
-          tempCursor = that.data.Field.length;
238
-        var str1 = "",
239
-          str2 = "";
240
-        if (that.data.Field.length > 0) {
241
-          str1 = that.data.Field.substr(0, tempCursor);
242
-          str2 = that.data.Field.substring(tempCursor, that.data.Field.length);
243
-        }
244
-
245
-        var str0 = "[图]" + tempFilePaths[0] + "[/图]";
246
-
247
-        that.data.Field = str1 + str0 + str2;
248
-
249
-        //console.log("uploadImageEnd:" + that.data.Field);
250
-
251
-        that.setData({
252
-          Field: that.data.Field,
253
-          Focus: false,
254
-        });
255
-        that.updateField();
256
-      },
257
-      fail: function () {
258
-
259
-      }
260
-    });
261
-
262
-  },
263
-  updateField: function (history) {
264
-    var str = this.data.Field;
265
-    str = main.decryptUrl(str);
266
-
267
-    str = str.replace(/\[读\]/g, "\n[读]");
268
-    str = str.replace(/\[图\]/g, "\n[图]");
269
-    str = str.replace(/\[\/读\]/g, "[\/读]\n");
270
-    str = str.replace(/\[\/图\]/g, "[\/图]\n");
271
-    str = str.replace(/\n\n/g, "\n");
272
-
273
-    var list = app.globalData.CardList;
274
-    for (var i = 0; i < list.length; i++) {
275
-      if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
276
-        if (history != undefined)
277
-          list[i].Content[this.data.FieldNumber].Content = history;
278
-        else
279
-          list[i].Content[this.data.FieldNumber].Content = str;
280
-        break;
281
-      }
282
-    }
283
-    app.globalData.CardList=list;
284
-  },
285
-  onShareAppMessage: function () {
286
-    return {
287
-      title: app.globalData.ShareTitle,
288
-      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
289
-      imageUrl: app.globalData.ShareImage,
290
-    }
291
-  },
292
-})

+ 0 - 4
pages/main/addItem.json

@@ -1,4 +0,0 @@
1
-{
2
-  "navigationBarTitleText": "编辑 段落1",
3
-  "backgroundColor": "#F0F0F0"
4
-}

+ 0 - 58
pages/main/addItem.wxml

@@ -1,58 +0,0 @@
1
-<view class="container FlexColumn" style='height:{{Containnerheight}}rpx;'>
2
-  <view class="panelTag FlexRow">
3
-    <view class='left FlexRow'>
4
-      <view class="panelSave1 FlexRow" bindtap="onSearch">
5
-        <view class="add">+</view> 资料
6
-      </view>
7
-      <view class="panelSave2 panelSave1 FlexRow" bindtap="addSymbol" data-id="{{SoundSign}}" hidden="{{SoundSign=='[/读]'}}">
8
-        <image class="universalpic_read_begin_gray_20x20" src='../images/universalpic_read_begin_gray_20x20.png' />
9
-      </view>
10
-      <view class="panelSave3 panelSave1 FlexRow" bindtap="addSymbol" data-id="{{SoundSign}}" hidden="{{SoundSign=='[读]'}}">
11
-        <image class="universalpic_read_end_white_38x22" src='../images/universalpic_read_end_white_38x22.png' />
12
-      </view>
13
-      <view class="panelSave2 panelSave1 FlexRow" bindtap="addSymbol" data-id="{{LineSign}}" hidden="{{LineSign=='[/线]'}}">
14
-        <image class="universalpic_editbar_underline_gray_14x20" src='../images/universalpic_editbar_underline_gray_14x20.png' />
15
-      </view>
16
-      <view class="panelSave3 panelSave1 FlexRow" bindtap="addSymbol" data-id="{{LineSign}}" hidden="{{LineSign=='[线]'}}">
17
-        <image class="universalpic_underline_end_white_30x22" src='../images/universalpic_underline_end_white_30x22.png' />
18
-      </view>
19
-      <view class="panelSave2 panelSave1 FlexRow" catchtap="uploadImage">
20
-        <image class="universalpic_picture_gray_26x26" src='../images/universalpic_picture_gray_26x26.png' />
21
-      </view>
22
-
23
-    </view>
24
-    <view class='right FlexRow'>
25
-      <view class="clear" catchtap="clear">清空</view>
26
-    </view>
27
-  </view>
28
-  <view class='lineFooter'></view>
29
-  <view class='panelInput'>
30
-    <textarea class="input" maxlength='-1' show-confirm-bar="true" value="{{Field}}" focus="{{Focus}}" cursor="{{Cursor}}" bindinput="bindinputField" bindblur="onBindblur" bindfocus="onBindFocus" data-id='{{FieldNumber}}' />
31
-  </view>
32
-  <cover-view class='lineFooter'></cover-view>
33
-  <cover-view class='panel2 FlexColumn'>
34
-    <cover-view class="panelBtnSmall FlexRow">
35
-      <cover-view class="btn0"></cover-view>
36
-      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="(     )">
37
-        <cover-image class="universalpic_editbar_brackets_gray" src='../images/universalpic_editbar_brackets_gray.png' />
38
-      </cover-view>
39
-      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="_____">
40
-        <cover-image class="universalpic_editbar_underline_gray" src='../images/universalpic_editbar_underline_gray.png' />
41
-      </cover-view>
42
-      <cover-view class="btn" bindtap="addSymbol" wx:for="{{BtnArray}}" wx:key="index" data-id="{{item}}">{{item}}</cover-view>
43
-      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="²">
44
-        <cover-image class="universalpic_editbar_sqr_gray" src='../images/universalpic_editbar_sqr_gray.png' />
45
-      </cover-view>
46
-      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="³">
47
-        <cover-image class="universalpic_editbar_sqr_gray" src='../images/universalpic_editbar_cube_gray.png' />
48
-      </cover-view>
49
-    </cover-view>
50
-    <cover-view class='lineFooter'></cover-view>
51
-    <cover-view class='panelBtn FlexRow'>
52
-      <cover-view class='text1' bindtap="closeAddItem" data-idsave="false">取消</cover-view>
53
-      <cover-view class='line1'></cover-view>
54
-      <cover-view class='text2 text1' bindtap="closeAddItem" data-idsave="true">确定</cover-view>
55
-    </cover-view>
56
-    <cover-view class='lineFooter'></cover-view>
57
-  </cover-view>
58
-</view>

+ 0 - 207
pages/main/addItem.wxss

@@ -1,207 +0,0 @@
1
-.container {
2
-  justify-content: flex-start;
3
-  font-weight: 500;
4
-  color: #1e1e1e;
5
-  background-color: #f0f0f0;
6
-  position: fixed;
7
-  top: 0;
8
-}
9
-
10
-.left {
11
-  margin-left: 25rpx;
12
-}
13
-
14
-.right {
15
-  margin-right: 25rpx;
16
-}
17
-
18
-.panelTag {
19
-  width: 100%;
20
-  justify-content: space-between;
21
-  min-height: 120rpx;
22
-  background-color: #fff;
23
-}
24
-
25
-.panelSave1 {
26
-  width: 148rpx;
27
-  background-color: #fff;
28
-  border: 1rpx solid #9b9b9b;
29
-  color: #787878;
30
-  text-align: center;
31
-  height: 80rpx;
32
-  line-height: 80rpx;
33
-  border-radius: 10rpx;
34
-  font-size: 28rpx;
35
-}
36
-
37
-.panelSave2 {
38
-  width: 80rpx;
39
-  height: 80rpx;
40
-  background-color: #fff;
41
-  border: 1rpx solid #9b9b9b;
42
-  margin-left: 10rpx;
43
-}
44
-
45
-.panelSave3 {
46
-  width: 80rpx;
47
-  height: 80rpx;
48
-  margin-left: 10rpx;
49
-  background-color: #0071ef;
50
-  border: 1rpx solid #0071ef;
51
-}
52
-
53
-.universalpic_read_begin_gray_20x20 {
54
-  width: 21rpx;
55
-  height: 20rpx;
56
-}
57
-
58
-.universalpic_read_end_white_38x22 {
59
-  width: 38rpx;
60
-  height: 22rpx;
61
-}
62
-
63
-.universalpic_editbar_underline_gray_14x20 {
64
-  width: 14rpx;
65
-  height: 20rpx;
66
-}
67
-
68
-.universalpic_underline_end_white_30x22 {
69
-  width: 31rpx;
70
-  height: 22rpx;
71
-}
72
-
73
-.universalpic_picture_gray_26x26 {
74
-  width: 26rpx;
75
-  height: 26rpx;
76
-}
77
-
78
-.add {
79
-  font-size: 42rpx;
80
-  font-weight: 600;
81
-  margin: 0 10rpx 10rpx 0;
82
-}
83
-
84
-.clear {
85
-  width: 108rpx;
86
-  height: 80rpx;
87
-  color: #0071ef;
88
-  background-color: #fff;
89
-  border: 1rpx solid #9b9b9b;
90
-  text-align: center;
91
-  border-radius: 10rpx;
92
-  line-height: 80rpx;
93
-  font-size: 24rpx;
94
-}
95
-
96
-.line1 {
97
-  width: 4rpx;
98
-  height: 30rpx;
99
-  background-color: #d2d2d2;
100
-  margin-right: 20rpx;
101
-}
102
-
103
-.universalpic_help_gray_26x26 {
104
-  width: 26rpx;
105
-  height: 26rpx;
106
-  margin: 0 0 0 40rpx;
107
-}
108
-
109
-.panelInput {
110
-  width: 100%;
111
-  height: 250rpx;
112
-  margin-top: 10rpx;
113
-  background-color: #fff;
114
-  font-size: 36rpx;
115
-  font-weight: 400;
116
-}
117
-
118
-.input {
119
-  margin: 30rpx 30rpx 0 30rpx;
120
-  width: 690rpx;
121
-  height: 220rpx;
122
-}
123
-
124
-.panel2 {
125
-  position: fixed;
126
-  top: 382rpx;
127
-  width: 100%;
128
-  background-color: #fff;
129
-}
130
-
131
-.panelBtnSmall {
132
-  z-index: 10;
133
-  width:100%;
134
-  height: 120rpx;
135
-  background-color: #fff;
136
-  justify-content: flex-start;
137
-}
138
-
139
-.panelBtnSmall .btn0 {
140
-  width: 10rpx;
141
-}
142
-
143
-.panelBtnSmall .btn {
144
-  font-family: 'Roboto-Black';
145
-  width: 80rpx;
146
-  background-color: #fff;
147
-  border: 1rpx solid #9b9b9b;
148
-  color: #787878;
149
-  border-radius: 10rpx;
150
-  text-align: center;
151
-  line-height: 80rpx;
152
-  height: 80rpx;
153
-  margin-right: 10rpx;
154
-  font-size: 36rpx;
155
-}
156
-
157
-.panelBtnSmall .btn1 {
158
-  width: 80rpx;
159
-  height: 80rpx;
160
-  background-color: #fff;
161
-  border: 1rpx solid #9b9b9b;
162
-  border-radius: 10rpx;
163
-  margin-right: 10rpx;
164
-}
165
-
166
-.universalpic_editbar_brackets_gray {
167
-  width: 34rpx;
168
-  height: 26rpx;
169
-}
170
-
171
-.universalpic_editbar_underline_gray {
172
-  width: 18rpx;
173
-  height: 28rpx;
174
-}
175
-
176
-.universalpic_editbar_sqr_gray {
177
-  width: 25rpx;
178
-  height: 22rpx;
179
-}
180
-
181
-.panelBtn {
182
-  width: 100%;
183
-  background-color: #f8f8f8;
184
-  z-index: 10;
185
-}
186
-
187
-.panelBtn .line1 {
188
-  width: 4rpx;
189
-  height: 30rpx;
190
-  background-color: #d2d2d2;
191
-}
192
-
193
-.panelBtn .text1 {
194
-  width: 374rpx;
195
-  line-height: 100rpx;
196
-  text-align: center;
197
-  font-size: 28rpx;
198
-  color: #a20602;
199
-}
200
-
201
-.panelBtn .text2 {
202
-  color: #0071ef;
203
-}
204
-
205
-.lineFooter {
206
-  z-index: 10;
207
-}

+ 1 - 1
pages/main/detail.wxml

@@ -161,7 +161,7 @@
161 161
         </view>
162 162
       </view>
163 163
     </view>
164
-    <view class="iphoneX" wx:if="{{IsIphoneX}}"></view>
164
+    <view class="iphoneX" wx:if="{{IsIphoneX}}" style='background-color:{{Color.BackColor2}};'></view>
165 165
   </view>
166 166
 </view>
167 167
 

+ 1 - 1
pages/main/detail.wxss

@@ -245,7 +245,7 @@
245 245
 
246 246
 .iphoneX{
247 247
   width: 100%;
248
-  height: 80rpx;
248
+  height: 60rpx;
249 249
   z-index: 10;
250 250
 }
251 251
 

+ 2 - 1
pages/main/searchWeb.js

@@ -59,8 +59,9 @@ Page({
59 59
       }
60 60
     }
61 61
     main.updateSearchList(obj);
62
+    app.globalData.TempSearcchBackNumber=2;
62 63
     wx.navigateTo({
63
-      url: './searchWeb2?back=2',
64
+      url: './searchWeb2',
64 65
     });
65 66
   },
66 67
   onShareAppMessage: function () {

+ 1 - 1
pages/main/searchWeb.wxml

@@ -20,7 +20,7 @@
20 20
         <view class="panelItemSearch11">
21 21
           {{item.Key}}
22 22
         </view>
23
-        <view class="panelItemSearch12 FlexRow" wx:if="{{item.Type=='shici'}}">
23
+        <view class="panelItemSearch12 FlexRow" wx:if="{{item.Type=='shici' || item.Type=='eng'}}">
24 24
           {{item.TypeName}}
25 25
         </view>
26 26
       </view>

+ 8 - 2
pages/main/searchWeb1.js

@@ -155,15 +155,21 @@ Page({
155 155
             obj.Dynasty = data.CHN.Dynasty;
156 156
           if (data.CHN && data.CHN.PeomContent) {
157 157
             obj.Type = "shici";
158
+            obj.TypeName = "诗词";
158 159
             obj.Content = data.CHN.PeomContent.join("").substr(0, 26);
159 160
           }
160
-          else {
161
+          else if (data.CHN){
161 162
             obj.Type = "zici";
162 163
           }
164
+          if (data.ENG && !data.CHN) {
165
+            obj.Type = "eng";
166
+            obj.TypeName="外语";
167
+          }
168
+          
163 169
           main.updateSearchList(obj);
164 170
 
165 171
           wx.navigateTo({
166
-            url: './searchWeb2?back=3',
172
+            url: './searchWeb2',
167 173
           });
168 174
         }
169 175
       }

+ 6 - 6
pages/main/searchWeb1.wxml

@@ -60,17 +60,17 @@
60 60
           <view class="panelItemSearch11">
61 61
             {{item.Key}}
62 62
           </view>
63
-          <view class="panelItemSearch12 FlexRow" wx:if="{{item.Type=='shici'}}">
63
+          <view class="panelItemSearch12 FlexRow" wx:if="{{item.Type=='shici' || item.Type=='eng'}}">
64 64
             {{item.TypeName}}
65 65
           </view>
66 66
         </view>
67
-        <view class="panelItemSearch2 FlexRow" wx:if="{{item.Type=='zici'}}">
67
+        <view class="panelItemSearch2 FlexRow" wx:if="{{item.Type=='zici'  || item.Type=='eng'}}">
68 68
           {{item.Remark}}
69 69
         </view>
70 70
         <view class="panelItemSearch2 FlexRow" wx:if="{{item.Type=='shici'}}">
71 71
           {{item.Author}} {{item.Dynasty}}
72 72
         </view>
73
-        <view class="panelItemSearch3 FlexRow" wx:if="{{item.Type=='shici'}}">
73
+        <view class="panelItemSearch3 FlexRow">
74 74
           {{item.Content}}
75 75
         </view>
76 76
       </view>
@@ -90,17 +90,17 @@
90 90
           <view class="panelItemSearch11">
91 91
             {{item.Key}}
92 92
           </view>
93
-          <view class="panelItemSearch12 FlexRow" wx:if="{{item.Type=='shici'}}">
93
+          <view class="panelItemSearch12 FlexRow" wx:if="{{item.Type=='shici' || item.Type=='eng'}}">
94 94
             {{item.TypeName}}
95 95
           </view>
96 96
         </view>
97
-        <view class="panelItemSearch2 FlexRow" wx:if="{{item.Type=='zici'}}">
97
+        <view class="panelItemSearch2 FlexRow" wx:if="{{item.Type=='zici' || item.Type=='eng'}}">
98 98
           {{item.Remark}}
99 99
         </view>
100 100
         <view class="panelItemSearch2 FlexRow" wx:if="{{item.Type=='shici'}}">
101 101
           {{item.Author}} {{item.Dynasty}}
102 102
         </view>
103
-        <view class="panelItemSearch3 FlexRow" wx:if="{{item.Type=='shici' || item.Type=='zici'}}">
103
+        <view class="panelItemSearch3 FlexRow">
104 104
           {{item.Content}}
105 105
         </view>
106 106
       </view>

+ 9 - 17
pages/main/searchWeb2.js

@@ -2,7 +2,6 @@ import common from '../../utils/util';
2 2
 import main from '../../utils/main';
3 3
 
4 4
 const app = getApp();
5
-var back = 3;
6 5
 var hasStart = {};
7 6
 
8 7
 Page({
@@ -16,10 +15,6 @@ Page({
16 15
     that.setData({
17 16
       Containnerheight: main.getWindowHeight(),
18 17
     });
19
-
20
-    if (options.back)
21
-      back = Number(options.back);
22
-
23 18
     this.getList();
24 19
     
25 20
     hasStart = {};
@@ -58,13 +53,13 @@ Page({
58 53
           }
59 54
         }
60 55
       }
56
+    }
61 57
 
62
-      if (data.ENG && data.ENG.Paraphrase && common.checkIsArray(data.ENG.Paraphrase)) {
58
+    if (data.ENG && data.ENG.Paraphrase && common.checkIsArray(data.ENG.Paraphrase)) {
63 59
 
64
-        for (var i = 0; i < data.ENG.Paraphrase.length; i++) {
65
-          var item = data.ENG.Paraphrase[i];
66
-          item.PartOfSpeech = common.ReplaceAllString(item.PartOfSpeech, "释义", "");
67
-        }
60
+      for (var i = 0; i < data.ENG.Paraphrase.length; i++) {
61
+        var item = data.ENG.Paraphrase[i];
62
+        item.PartOfSpeech = common.ReplaceAllString(item.PartOfSpeech, "释义", "");
68 63
       }
69 64
     }
70 65
 
@@ -102,8 +97,8 @@ Page({
102 97
       }
103 98
 
104 99
       this.data.CSS[css].Number = "1";
105
-      if (wx.getStorageSync("TempFieldNumber") && !hasStart[css]) {
106
-        this.data.CSS[css].Number = Number(wx.getStorageSync("TempFieldNumber"));
100
+      if (app.globalData.TempFieldNumber>0 && !hasStart[css]) {
101
+        this.data.CSS[css].Number = app.globalData.TempFieldNumber;
107 102
         hasStart[css] = true;
108 103
       }
109 104
     }
@@ -130,10 +125,7 @@ Page({
130 125
           delete this.data.CSS[item];
131 126
         }
132 127
       }
133
-      if (wx.getStorageSync("TempFieldNumber")) {
134
-        wx.removeStorageSync("TempFieldNumber");
135
-      }
136
-
128
+      app.globalData.TempFieldNumber = 0;
137 129
       var id = app.globalData.TempMiaoguoCardID;
138 130
       var list = app.globalData.CardList;
139 131
       for (var i = 0; i < list.length; i++) {
@@ -193,7 +185,7 @@ Page({
193 185
       app.globalData.CardList = list;
194 186
 
195 187
       wx.navigateBack({
196
-        delta: back,
188
+        delta: app.globalData.TempSearcchBackNumber,
197 189
       });
198 190
     }
199 191
     else {