chengjie 6 年之前
父节点
当前提交
45985704e4

+ 2 - 2
app.js

@@ -25,8 +25,8 @@ App({
25 25
     }
26 26
   },
27 27
   globalData: {
28
-    Version: "1.0.0.24",
29
-    IsProduction: false,
28
+    Version: "1.0.0.26",
29
+    IsProduction: true,
30 30
     ShareTitle: "可以用来记忆一切的工具",
31 31
     SharePath: "pages/index/index",
32 32
     ShareImage: '',

+ 15 - 15
pages/main/add.js

@@ -388,7 +388,7 @@ Page({
388 388
 
389 389
   //字段输入
390 390
   bindinputField: function (e) {
391
-    console.log("bindinputField:" + e.detail.value + " isEdit:" + isEdit);
391
+    //console.log("bindinputField:" + e.detail.value + " isEdit:" + isEdit);
392 392
 
393 393
     var that = this;
394 394
     if (app.globalData.IsAndroid && !isEdit) {
@@ -533,29 +533,29 @@ Page({
533 533
       isUnload = false;
534 534
       wx.removeStorageSync("TempCardInfoAddItem");
535 535
       this.updateField();
536
-      var title ="编辑题卡";
537
-      if (that.data.UpdateType == "add2") {
538
-        title = "添加题卡";
539
-      }
540
-      wx.setNavigationBarTitle({
541
-        title: title,
542
-      });
543
-
544 536
     }
545 537
     this.setData({
546 538
       HiddenFieldEdit:true,
547 539
     });
540
+
541
+    var title = "编辑题卡";
542
+    if (that.data.UpdateType == "add2") {
543
+      title = "添加题卡";
544
+    }
545
+    wx.setNavigationBarTitle({
546
+      title: title,
547
+    });
548 548
   },
549 549
 
550 550
   updateField: function (history) {
551 551
     var str = this.data.FieldContent;
552
-    str = main.decryptUrl(str);
552
+    // str = main.decryptUrl(str);
553 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");
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\n/g, "\n\n");
559 559
 
560 560
     var list = app.globalData.CardList;
561 561
     var card={};

+ 6 - 4
pages/main/add.wxml

@@ -9,7 +9,7 @@
9 9
       <switch class='panelTimePlan2' checked="{{IsTodayStudy}}" bindchange="switch1Change" />
10 10
     </view>
11 11
   </view>
12
-  <view class='lineFooter'></view>
12
+  <view style='height:120rpx'></view>
13 13
   <view class="panelTitle FlexRow">
14 14
     <view class="panelTitle1">段落</view>
15 15
   </view>
@@ -38,6 +38,7 @@
38 38
         <image class="universalpic_read_gray_40x40" wx:if="{{item.Type=='sound'}}" src='../images/universalpic_read_gray_40x40.png' />
39 39
         <text class="textPinyin" wx:if="{{item.Type=='sound'}}">{{item.Content}}</text>
40 40
         <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' binderror="onBindError" />
41
+        <view class="textBr" wx:if="{{item.Type=='br'}}"></view>
41 42
         <text class="textReturn" wx:if="{{item.Type=='return'}}"></text>
42 43
   </block>
43 44
   </view>
@@ -69,10 +70,11 @@
69 70
       <view class="add">+</view> 资料
70 71
     </view>
71 72
     <view class='panelSave0' bindtap="saveCard">保存</view>
72
-    <view class="panelSave2 FlexRow" bindtap='onPreview'>
73
-      <view class="line1"></view>
74
-      <image class="universalpic_preview_black_30x30" src='../images/universalpic_preview_black_30x30.png' />
73
+
74
+    <view class="panelSave2 panelSave1 FlexRow" bindtap="onPreview">
75
+      预览
75 76
     </view>
77
+    
76 78
   </view>
77 79
 </view>
78 80
 

+ 13 - 5
pages/main/add.wxss

@@ -6,11 +6,15 @@
6 6
 }
7 7
 
8 8
 .panelTimePlan {
9
-  min-height: 120rpx;
9
+  height: 120rpx;
10 10
   width: 100%;
11 11
   justify-content: space-between;
12 12
   font-size: 28rpx;
13 13
   background-color: #fff;
14
+  position: fixed;
15
+  top:0;
16
+  z-index: 10;
17
+  border-bottom: 1rpx solid #d2d2d2;
14 18
 }
15 19
 
16 20
 
@@ -137,6 +141,10 @@
137 141
 .panelItem .textReturn{
138 142
   width:100%;
139 143
 }
144
+.panelItem .textBr{
145
+  width:100%;
146
+  height:20rpx;
147
+}
140 148
 .panelItem .textReturn2{
141 149
   width:100%;
142 150
   height:30rpx;
@@ -208,12 +216,11 @@
208 216
   line-height: 80rpx;
209 217
   height:80rpx;
210 218
   border-radius: 10rpx;
211
-  font-size:28rpx;
212
-  margin-left: 20rpx;
219
+  font-size:24rpx;
220
+  margin:0 20rpx;
213 221
 }
214 222
 .panelSave .panelSave2 {
215
-  width: 168rpx;
216
-  justify-content: flex-end;
223
+  width: 108rpx;
217 224
 }
218 225
 
219 226
 .add {
@@ -226,6 +233,7 @@
226 233
   width:400rpx;
227 234
   line-height:100rpx;
228 235
   text-align: center;
236
+  margin-right: 40rpx;
229 237
 }
230 238
 
231 239
 .panelSave .line1 {

+ 22 - 25
pages/main/detail.wxml

@@ -41,27 +41,27 @@
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>
44
-
44
+          <view class="textBr" wx:if="{{index>0 && item.Type=='br'}}"></view>
45 45
           <text class="textNormal" selectable="true" space='ensp' wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
46 46
 
47 47
           <text class="textNormal FlexRow" selectable="true" space='ensp' wx:if="{{item.Type=='line'}}">
48 48
             <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
49 49
               <text space='ensp' wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
50
-          <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
51
-        </block>
52
-        </text>
50
+            <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
51
+          </block>
52
+          </text>
53 53
 
54
-        <view class="panelSound FlexRow" wx:if="{{item.Type=='sound'}}" bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">
55
-          <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.{{item.SoundImageName}}' />
56
-        </view>
54
+          <view class="panelSound FlexRow" wx:if="{{item.Type=='sound'}}" bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">
55
+            <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.{{item.SoundImageName}}' />
56
+          </view>
57 57
 
58
-        <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">{{item.Content}}</text>
59
-        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
58
+          <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">{{item.Content}}</text>
59
+          <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
60 60
       
61
-  </block>
62
-  </view>
61
+        </block>
62
+      </view>
63 63
 
64
-  </view>
64
+    </view>
65 65
   <view class="panelTag FlexRow" bindtap="onShowAnswer" style='background-color:{{Color.BackColor2}};color:{{Color.FrontColor2}};'>
66 66
     <view wx:if="{{!TaskInfo.ContentNew.Tags || TaskInfo.ContentNew.Tags.length==0}}"></view>
67 67
     <view class="panelTag1 FlexRow" wx:if="{{TaskInfo.ContentNew.Tags && TaskInfo.ContentNew.Tags.length>0}}">
@@ -84,26 +84,23 @@
84 84
       <view class="panelField21 panelItem FlexRow">
85 85
         <block wx:for="{{TaskInfo.ContentNew.Field[itemParent]}}" wx:key="index">
86 86
           <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
87
-
87
+          <view class="textBr" wx:if="{{index>0 && item.Type=='br'}}"></view>
88
+        
88 89
           <text class="textNormal2 textNormal" selectable="true" space='ensp' wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
89 90
 
90 91
           <text class="textNormal2 FlexRow" selectable="true" space='ensp' wx:if="{{item.Type=='line'}}">
91 92
             <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
92 93
               <text space='ensp' wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
93
-          <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
94
-        </block>
95
-        </text>
94
+              <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
95
+            </block>
96
+          </text>
96 97
 
97
-        <view class="panelSound FlexRow" wx:if="{{item.Type=='sound'}}" bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">
98
-          <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.{{item.SoundImageName}}' />
99
-        </view>
98
+          <view class="panelSound FlexRow" wx:if="{{item.Type=='sound'}}" bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">
99
+            <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.{{item.SoundImageName}}' />
100
+          </view>
100 101
 
101
-        <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">{{item.Content}}</text>
102
-
103
-        <!-- <image class="imageBishun" wx:if="{{item.Type=='image' && !item.Url}}" src='{{item.Content}}' catchtap='showImage' data-name="{{item.Content}}" /> -->
104
-
105
-        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
106
-      
102
+          <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">{{item.Content}}</text>
103
+          <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
107 104
         </block>
108 105
       </view>
109 106
     </view>

+ 5 - 0
pages/main/detail.wxss

@@ -210,6 +210,11 @@
210 210
   border-radius: 20rpx;
211 211
 }
212 212
 
213
+.panelItem .textBr{
214
+  width:100%;
215
+  height:20rpx;
216
+}
217
+
213 218
 .panelItem .textReturn {
214 219
   width: 100%;
215 220
 }

+ 4 - 1
pages/main/preview.wxml

@@ -16,6 +16,8 @@
16 16
     <view class="panelField11 panelItem FlexRow" style="font-size:{{FontSize}}rpx;">
17 17
       <block wx:for="{{Field[1]}}" wx:key="index">
18 18
         <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
19
+        <view class="textBr" wx:if="{{index>0 && item.Type=='br'}}"></view>
20
+        
19 21
         <text class="textNormal" selectable="true" space='ensp' wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
20 22
         <text class="textNormal FlexRow" selectable="true" space='ensp' wx:if="{{item.Type=='line'}}">
21 23
           <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
@@ -46,7 +48,8 @@
46 48
     <view class="panelField21 panelItem FlexRow">
47 49
       <block wx:for="{{Field[itemParent]}}" wx:key="index">
48 50
         <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
49
-
51
+        <view class="textBr" wx:if="{{index>0 && item.Type=='br'}}"></view>
52
+        
50 53
         <text class="textNormal" selectable="true" space='ensp' wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
51 54
 
52 55
         <text class="textNormal FlexRow" selectable="true" space='ensp' wx:if="{{item.Type=='line'}}">

+ 5 - 0
pages/main/preview.wxss

@@ -124,6 +124,11 @@
124 124
   border-radius: 20rpx;
125 125
 }
126 126
 
127
+.panelItem .textBr{
128
+  width:100%;
129
+  height:20rpx;
130
+}
131
+
127 132
 .panelItem .textReturn {
128 133
   width: 100%;
129 134
 }

+ 2 - 1
pages/main/searchWeb.js

@@ -16,7 +16,7 @@ Page({
16 16
   },
17 17
   onShow: function () {
18 18
     var that = this;
19
-    var arr = wx.getStorageSync("SearchWord2");
19
+    var arr = wx.getStorageSync("SearchWord3");
20 20
     if (!arr)
21 21
       arr = [];
22 22
 
@@ -45,6 +45,7 @@ Page({
45 45
     });
46 46
   },
47 47
   onSearch: function (e) {
48
+    app.globalData.TempSearcchBackNumber = 3;
48 49
     wx.navigateTo({
49 50
       url: './searchWeb1',
50 51
     })

+ 14 - 11
pages/main/searchWeb1.js

@@ -57,19 +57,22 @@ Page({
57 57
 
58 58
       that.searchResult(search);
59 59
 
60
-      var arr = that.data.SearchTextList;
61
-      for (var i = 0; i < arr.length; i++) {
62
-        if (arr[i] == search) {
63
-          arr.splice(i, 1);
64
-          break;
60
+      setTimeout(function(){
61
+        var arr = that.data.SearchTextList;
62
+        for (var i = 0; i < arr.length; i++) {
63
+          if (arr[i] == search) {
64
+            arr.splice(i, 1);
65
+            break;
66
+          }
65 67
         }
66
-      }
67
-      arr.unshift(search);
68
+        arr.unshift(search);
68 69
 
69
-      wx.setStorageSync("SearchTextList", arr);
70
-      that.setData({
71
-        SearchTextList: arr,
72
-      });
70
+        wx.setStorageSync("SearchTextList", arr);
71
+        that.setData({
72
+          SearchTextList: arr,
73
+        });
74
+      },2000);
75
+      
73 76
     }
74 77
     else {
75 78
       wx.showToast({

+ 54 - 11
pages/main/searchWeb2.js

@@ -16,7 +16,7 @@ Page({
16 16
       Containnerheight: main.getWindowHeight(),
17 17
     });
18 18
     this.getList();
19
-    
19
+
20 20
     hasStart = {};
21 21
 
22 22
   },
@@ -53,6 +53,32 @@ Page({
53 53
           }
54 54
         }
55 55
       }
56
+
57
+      //判断诗词单词是否过长,过长就分段显示
58
+      if (data.CHN.PeomContent) {
59
+        data.CHN.PeomContentIsLong = false;
60
+        if (data.CHN.PeomContent.length > 1 ) {
61
+          for (var i = 0; i < data.CHN.PeomContent.length; i++) {
62
+            if (data.CHN.PeomContent[i]){
63
+              var item = data.CHN.PeomContent[i].join("");
64
+              if (item && item.length>18){
65
+                data.CHN.PeomContentIsLong = true;
66
+                break;
67
+              }
68
+            }
69
+          }
70
+        }
71
+        else if (data.CHN.PeomContent.length == 1) {
72
+          
73
+          for (var i = 0; i < data.CHN.PeomContent[0].length; i++) {
74
+            var item = data.CHN.PeomContent[0][i];
75
+            if (item && item.length > 18) {
76
+              data.CHN.PeomContentIsLong = true;
77
+              break;
78
+            }
79
+          }
80
+        }
81
+      }
56 82
     }
57 83
 
58 84
     if (data.ENG && data.ENG.Paraphrase && common.checkIsArray(data.ENG.Paraphrase)) {
@@ -97,7 +123,7 @@ Page({
97 123
       }
98 124
 
99 125
       this.data.CSS[css].Number = "1";
100
-      if (app.globalData.TempFieldNumber>0 && !hasStart[css]) {
126
+      if (app.globalData.TempFieldNumber > 0 && !hasStart[css]) {
101 127
         this.data.CSS[css].Number = app.globalData.TempFieldNumber;
102 128
         hasStart[css] = true;
103 129
       }
@@ -138,8 +164,14 @@ Page({
138 164
                 strArrTag = list[i].Content[0].Content.join(",") + ",";
139 165
               else
140 166
                 list[i].Content[0].Content = list[i].Content[0].Content.split(",");
141
-              if (strArrTag.indexOf(item.Tag + ",") < 0)
142
-                list[i].Content[0].Content.push(item.Tag);
167
+
168
+              var tags = item.Tag.split(",");
169
+              for (var j = 0; j < tags.length; j++) {
170
+                if (tags[i]) {
171
+                  if (strArrTag.indexOf(tags[i] + ",") < 0)
172
+                    list[i].Content[0].Content.push(tags[i]);
173
+                }
174
+              }
143 175
             }
144 176
 
145 177
             var str = "";
@@ -161,21 +193,32 @@ Page({
161 193
               }
162 194
             }
163 195
             else {
164
-              if (item.Tag == "原文") {
165
-                for (var j = 0; j < item.Content.length; j++) {
166
-                  if (item.Content.length == 1)
167
-                    item.Content[j] = item.Content[j].join("\n");
196
+              if (item.Tag == "原文" || item.Tag == "译文"){
197
+                if (common.checkIsArray(item.Content) 
198
+                  && common.checkIsArray(item.Content[0])){
199
+                  for (var j = 0; j < item.Content.length; j++) {
200
+                    if (common.checkIsArray(item.Content[j])){
201
+                      item.Content[j] = item.Content[j].join("");
202
+                    }
203
+                  }
204
+                  if (common.checkIsArray(item.Content))
205
+                    str = item.Content.join("\n");
206
+                  else
207
+                    str = item.Content;
208
+                }
209
+                else{
210
+                  if (common.checkIsArray(item.Content))
211
+                    str = item.Content.join("");
168 212
                   else
169
-                    item.Content[j] = item.Content[j].join("");
213
+                    str = item.Content;
170 214
                 }
171
-                str = item.Content.join("\n");
172 215
               }
173 216
               else
174 217
                 str = item.Content;
175 218
             }
176 219
 
177 220
             if (list[i].Content[item.Number].Content)
178
-              str = "\n" + str;
221
+              str = "\n\n" + str;
179 222
             list[i].Content[item.Number].Content += str;
180 223
 
181 224
           }

+ 68 - 9
pages/main/searchWeb2.wxml

@@ -41,7 +41,8 @@
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-pinyin="{{Result.CHN.PinYin[0].pinyin}}" 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}}"
45
+        data-tag="读写">
45 46
         <view class="{{CSS['CHN_TianKong_'+index].Css2}} panelSelect0">{{CSS['CHN_TianKong_'+index].Number}}</view>
46 47
         <view class="text1">{{item}}</view>
47 48
       </view>
@@ -124,10 +125,10 @@
124 125
   <!-- 作者与朝代 -->
125 126
   <block wx:if="{{Result.CHN.Author && Result.CHN.Author.length>0}}">
126 127
     <view class="panelTitle FlexRow">
127
-      <view class="panelTitle1">诗词作者</view>
128
+      <view class="panelTitle1">作者</view>
128 129
     </view>
129 130
     <view class="panelItem FlexRow">
130
-      <view class="{{CSS.CHN_Author.Css1}} panelItemFrame FlexRow" bindtap='getInputData' data-type="normal" data-content="{{Result.CHN.Dynasty}} {{Result.CHN.Author}}" data-css="CHN_Author"  data-tag="作者">
131
+      <view class="{{CSS.CHN_Author.Css1}} panelItemFrame FlexRow" bindtap='getInputData' data-type="normal" data-content="{{Result.CHN.Dynasty}} {{Result.CHN.Author}}" data-css="CHN_Author" data-tag="作者">
131 132
         <view class="{{CSS.CHN_Author.Css2}} panelSelect0">{{CSS.CHN_Author.Number}}</view>
132 133
         <view class="text1">{{Result.CHN.Dynasty}} {{Result.CHN.Author}}</view>
133 134
       </view>
@@ -138,17 +139,44 @@
138 139
   <!-- 诗词原文 -->
139 140
   <block wx:if="{{Result.CHN.PeomContent && Result.CHN.PeomContent.length>0}}">
140 141
     <view class="panelTitle FlexRow">
141
-      <view class="panelTitle1">诗词原文</view>
142
+      <view class="panelTitle1">原文</view>
142 143
     </view>
143 144
     <view class="panelItem FlexRow">
145
+
146
+      <!-- 每段原文较短 -->
147
+      <block wx:if="{{!Result.CHN.PeomContentIsLong}}" >
144 148
       <view class="{{CSS.CHN_PeomContent.Css1}} panelItemFrame FlexRow" bindtap='getInputData' data-type="normal" data-content="{{Result.CHN.PeomContent}}" data-css="CHN_PeomContent" data-tag="原文">
145 149
         <view class="{{CSS.CHN_PeomContent.Css2}} panelSelect0">{{CSS.CHN_PeomContent.Number}}</view>
146
-        <view class="text1">
150
+        <text class="text1">
147 151
           <block wx:for="{{Result.CHN.PeomContent}}" wx:key="index" wx:for-item="item1">
148
-            <block wx:for="{{item1}}" wx:key="indexChild" wx:for-item="item2">{{item2}}</block>\n
152
+            <block wx:if="{{index>0}}">\n</block>
153
+            <block wx:for="{{item1}}" wx:key="indexChild" wx:for-item="item2">{{item2}}</block>
149 154
           </block>
150
-        </view>
155
+        </text>
151 156
       </view>
157
+      </block>
158
+
159
+      <!-- 每段原文较长,且有多段 -->
160
+      <block wx:if="{{Result.CHN.PeomContentIsLong && Result.CHN.PeomContent.length>1}}">
161
+        <view class="{{CSS['CHN_PeomContent_'+index].Css1}} panelItemFrame FlexRow" wx:for="{{Result.CHN.PeomContent}}" wx:key="index" bindtap='getInputData' data-type="normal" data-content="{{item}}" data-css="CHN_PeomContent_{{index}}" data-tag="原文">
162
+          <view class="{{CSS['CHN_PeomContent_'+index].Css2}} panelSelect0">{{CSS['CHN_PeomContent_'+index].Number}}</view>
163
+          <view class="text1">
164
+            <block wx:for="{{item}}" wx:key="indexChild" wx:for-item="item2">{{item2}}</block>
165
+          </view>
166
+        </view>
167
+      </block>
168
+
169
+      <!-- 每句原文较长,且有单段 -->
170
+      <block wx:if="{{Result.CHN.PeomContentIsLong && Result.CHN.PeomContent.length==1}}">
171
+        <view class="{{CSS['CHN_PeomContent_'+index].Css1}} panelItemFrame FlexRow" wx:for="{{Result.CHN.PeomContent[0]}}" wx:if="{{item}}" wx:key="index" bindtap='getInputData' data-type="normal" data-content="{{item}}" data-css="CHN_PeomContent_{{index}}" data-tag="原文">
172
+          <view class="{{CSS['CHN_PeomContent_'+index].Css2}} panelSelect0">{{CSS['CHN_PeomContent_'+index].Number}}</view>
173
+          <view class="text1">
174
+            {{item}}
175
+          </view>
176
+        </view>
177
+      </block>
178
+      
179
+      
152 180
     </view>
153 181
     <view class='lineFooter'></view>
154 182
   </block>
@@ -156,13 +184,44 @@
156 184
   <!-- 诗词译文 -->
157 185
   <block wx:if="{{Result.CHN.Translation && Result.CHN.Translation.length>0}}">
158 186
     <view class="panelTitle FlexRow">
159
-      <view class="panelTitle1">诗词译文</view>
187
+      <view class="panelTitle1">译文</view>
160 188
     </view>
161 189
     <view class="panelItem FlexRow">
190
+      <!-- 每段原文较短 -->
191
+      <block wx:if="{{!Result.CHN.PeomContentIsLong}}" >
162 192
       <view class="{{CSS.CHN_Translation.Css1}} panelItemFrame FlexRow" bindtap='getInputData' data-type="normal" data-content="{{Result.CHN.Translation}}" data-css="CHN_Translation" data-tag="译文">
163 193
         <view class="{{CSS.CHN_Translation.Css2}} panelSelect0">{{CSS.CHN_Translation.Number}}</view>
164
-        <view class="text1">{{Result.CHN.Translation}}</view>
194
+        <text class="text1">
195
+          <block wx:for="{{Result.CHN.Translation}}" wx:key="index" wx:for-item="item1">
196
+            <block wx:if="{{index>0}}">\n</block>
197
+            <block wx:for="{{item1}}" wx:key="indexChild" wx:for-item="item2">{{item2}}</block>
198
+          </block>
199
+        </text>
165 200
       </view>
201
+      </block>
202
+
203
+      <!-- 每段原文较长,且有多段 -->
204
+      <block wx:if="{{Result.CHN.PeomContentIsLong && Result.CHN.Translation.length>1}}">
205
+        <view class="{{CSS['CHN_Translation_'+index].Css1}} panelItemFrame FlexRow" wx:for="{{Result.CHN.Translation}}" wx:key="index" bindtap='getInputData' data-type="normal" data-content="{{item}}" data-css="CHN_Translation_{{index}}" data-tag="译文">
206
+          <view class="{{CSS['CHN_Translation_'+index].Css2}} panelSelect0">{{CSS['CHN_Translation_'+index].Number}}</view>
207
+          <view class="text1">
208
+            <block wx:for="{{item}}" wx:key="indexChild" wx:for-item="item2">{{item2}}</block>
209
+          </view>
210
+        </view>
211
+      </block>
212
+
213
+      <!-- 每句原文较长,且有单段 -->
214
+      <block wx:if="{{Result.CHN.PeomContentIsLong && Result.CHN.Translation.length==1}}">
215
+        <view class="{{CSS.CHN_Translation.Css1}} panelItemFrame FlexRow" bindtap='getInputData' data-type="normal" data-content="{{Result.CHN.Translation[0]}}" data-css="CHN_Translation" data-tag="译文">
216
+        <view class="{{CSS.CHN_Translation.Css2}} panelSelect0">{{CSS.CHN_Translation.Number}}</view>
217
+        <text class="text1">
218
+          <block wx:for="{{Result.CHN.Translation}}" wx:key="index" wx:for-item="item1">
219
+            {{item1}}
220
+          </block>
221
+        </text>
222
+      </view>
223
+      </block>
224
+      
166 225
     </view>
167 226
     <view class='lineFooter'></view>
168 227
   </block>

+ 10 - 4
utils/main.js

@@ -260,7 +260,7 @@ function changeViewToString(content) {
260 260
   if (!str)
261 261
     str = ""
262 262
   else {
263
-    str = str.replace(/\n\n/g, "\n");
263
+    str = str.replace(/\n\n\n/g, "\n\n");
264 264
     if (str.indexOf("\n") == 0) {
265 265
       str = str.substr(1);
266 266
     }
@@ -332,7 +332,7 @@ function changeStringToView(field) {
332 332
         str = str.replace(/\[图/g, "\n[图");
333 333
         str = str.replace(/\[\/读\]/g, "[\/读]\n");
334 334
         str = str.replace(/\[\/图\]/g, "[\/图]\n");
335
-        str = str.replace(/\n\n/g, "\n");
335
+        str = str.replace(/\n\n\n/g, "\n\n");
336 336
 
337 337
         var arr = str.split("\n");
338 338
         for (var k = 0; k < arr.length; k++) {
@@ -421,6 +421,12 @@ function changeStringToView(field) {
421 421
             obj.Type = "normal";
422 422
             obj.Content = arr[k];
423 423
             arrResult.push(obj);
424
+          } 
425
+          else if (k>0 && arr[k] == "") {
426
+            var obj = {};
427
+            obj.Type = "br";
428
+            obj.Content = "";
429
+            arrResult.push(obj);
424 430
           }
425 431
           var obj = {};
426 432
           obj.Type = "return";
@@ -652,7 +658,7 @@ function saveTempImage(serverUrl, tempUrl) {
652 658
 }
653 659
 
654 660
 function updateSearchList(obj){
655
-  var arr = wx.getStorageSync("SearchWord2");
661
+  var arr = wx.getStorageSync("SearchWord3");
656 662
   if (!arr)
657 663
     arr = [];
658 664
   for (var i = 0; i < arr.length; i++) {
@@ -669,7 +675,7 @@ function updateSearchList(obj){
669 675
   if (arr.length > 100) {
670 676
     arr.pop();
671 677
   }
672
-  wx.setStorageSync("SearchWord2", arr);
678
+  wx.setStorageSync("SearchWord3", arr);
673 679
   app.globalData.SearchItem = obj.Value;
674 680
 }
675 681