chengjie 4 月之前
父節點
當前提交
12796de678

+ 1 - 1
app.js

@@ -1,7 +1,7 @@
1 1
 // app.js
2 2
 App({
3 3
   globalData: {
4
-    Version: "1.0.0",
4
+    Version: "1.0.3",
5 5
     //IsProduction: true,
6 6
     ShareTitle: "阅读理解+答题",
7 7
     SharePath: "pages/index/index",

二進制
pages/images/pic_03.png


二進制
pages/images/sysIcon_b17.png


二進制
pages/images/sysIcon_b18.png


+ 63 - 34
pages/main/article.js

@@ -25,6 +25,8 @@ Page({
25 25
     IsShowQuestion:false,
26 26
     IsShowTranslate:false,
27 27
     IsShowSetting:false,
28
+    IsShowRemind:false,
29
+    remindAnimation: "", // 翻译弹窗动画类
28 30
     CurrentQuestionIndex:0,
29 31
     swiperHeight: "526rpx",
30 32
     lastTapTime: 0, // 记录上一次点击的时间,用于检测双击
@@ -56,6 +58,9 @@ Page({
56 58
       IsShowLightColor:IsShowLightColor,
57 59
       IsShowKeyword:IsShowKeyword,
58 60
       IsBuildError:false,
61
+      Level:options.Level,
62
+      ArticleStyle:options.ArticleStyle,
63
+      IsBuilding:false,
59 64
     });
60 65
 
61 66
     if (options.ID)
@@ -71,6 +76,9 @@ Page({
71 76
         data=data[0];
72 77
         that.setData({
73 78
           Words:data.Words,
79
+          Level:data.Level,
80
+          ArticleStyle:data.ArticleStyle,
81
+          CreateTime:data.CreateTime,
74 82
           ID:id,
75 83
         });
76 84
         let content=data.JSONString;
@@ -81,7 +89,14 @@ Page({
81 89
   init:function(options){
82 90
     let that=this;
83 91
     let interval=0;
92
+    //小学初中文章生成时间短
84 93
     that.data.CountDown=30;
94
+    //高中大学文章生成时间长
95
+    if (that.data.Level>=2){
96
+      that.setData({
97
+        CountDown:60,
98
+      });
99
+    }
85 100
     interval = setInterval(function(){
86 101
       that.setData({
87 102
         CountDown:--that.data.CountDown,
@@ -96,13 +111,14 @@ Page({
96 111
     let words=app.globalData.SelectedWords.join(",");
97 112
     main.postData('GenerateArticle?UserID='+app.globalData.userInfo.UserID, {
98 113
       Words:words,
99
-      Level:options.Level,
100
-      ArticleStyle:options.ArticleStyle
114
+      Level:that.data.Level,
115
+      ArticleStyle:that.data.ArticleStyle
101 116
     }, function (data) {
102 117
       if (data){
103 118
         if (data=="-1"){
104 119
           that.setData({
105 120
             IsBuildError:true,
121
+            CreateTime:common.formatDateCHS(common.formatTime(new Date()),true),
106 122
           });
107 123
         }
108 124
         else{
@@ -142,9 +158,8 @@ Page({
142 158
         });
143 159
       }
144 160
     }
145
-
146
-    
147 161
     content.ArticleEnglishArr=[];
162
+    //debugger;
148 163
     for(let i=0;i<content.ArticleEnglish.length;i++){
149 164
       let obj=common.splitByMultipleDelimiters(content.ArticleEnglish[i],["<span class='"+hl+"'>","</span>"]);
150 165
       obj=common.removeDuplicateAndTrimStrings(obj);
@@ -204,7 +219,10 @@ Page({
204 219
     let that=this;
205 220
     const question=e.currentTarget.dataset.question;
206 221
     const index=e.currentTarget.dataset.index;
207
-    that.data.Content.Question[question].UserAnswer=index;
222
+    if (that.data.Content.Question[question].UserAnswer==index)
223
+      that.data.Content.Question[question].UserAnswer=-1;
224
+    else
225
+      that.data.Content.Question[question].UserAnswer=index;
208 226
     that.setData({
209 227
       Content:that.data.Content,
210 228
     });
@@ -297,6 +315,9 @@ Page({
297 315
     let that = this;
298 316
     //debugger;
299 317
     that.data.Content.Words=that.data.Words;
318
+    that.data.Content.Level=that.data.Level;
319
+    that.data.Content.ArticleStyle=that.data.ArticleStyle;
320
+    that.data.Content.CreateTime=that.data.CreateTime;
300 321
     let url = common.Encrypt("GeneratePDF");
301 322
     url =app.globalData.serverUrl + url;
302 323
     wx.request({
@@ -361,51 +382,59 @@ Page({
361 382
     
362 383
     if (!this.data.ID){
363 384
       wx.navigateBack({
364
-        delta: 2,
385
+        delta: 1,
365 386
       });
366
-    } else {
367
-      wx.navigateBack();
368
-    }
387
+    } 
369 388
   },
370 389
   onLongPress: function(e) {
371 390
     let that = this;
372 391
     let strType=e.currentTarget.dataset.strtype;
373 392
     let selectedIndex=e.currentTarget.dataset.index;
374 393
     let selectedIndex2=e.currentTarget.dataset.index2;
375
-    let content;
394
+    let engSentence,chnSentence;
376 395
     if (strType=="article"){
377 396
       //console.log("选中的句子索引:", selectedIndex);
378 397
       //console.log("选中的句子:", that.data.Content.ArticleEnglish[selectedIndex]);
379
-      content=that.data.Content.ArticleEnglish[selectedIndex];
380
-      content=common.ReplaceAllString(content,"<span class='highlight'>","");
381
-      content=common.ReplaceAllString(content,"<span class='nonelight'>","");
382
-      content=common.ReplaceAllString(content,"</span>","");
383
-      content+="\r\n"+that.data.Content.ArticleChinese[selectedIndex];
398
+      engSentence=that.data.Content.ArticleEnglish[selectedIndex];
399
+      engSentence=common.ReplaceAllString(engSentence,"<span class='highlight'>","");
400
+      engSentence=common.ReplaceAllString(engSentence,"<span class='nonelight'>","");
401
+      engSentence=common.ReplaceAllString(engSentence,"</span>","");
402
+      chnSentence=that.data.Content.ArticleChinese[selectedIndex];
384 403
     }
385 404
     else if (strType=="question"){
386
-      content=that.data.Content.Question[selectedIndex].QuestionEnglish;
387
-      content+="\r\n"+that.data.Content.Question[selectedIndex].QuestionChinese;
405
+      engSentence=that.data.Content.Question[selectedIndex].QuestionEnglish;
406
+      chnSentence=that.data.Content.Question[selectedIndex].QuestionChinese;
388 407
     }
389 408
     else if (strType=="option"){
390
-      content=that.data.Content.Question[selectedIndex].OptionsEnglish[selectedIndex2];
391
-      content+="\r\n"+that.data.Content.Question[selectedIndex].OptionsChinese[selectedIndex2];
409
+      engSentence=that.data.Content.Question[selectedIndex].OptionsEnglish[selectedIndex2];
410
+      chnSentence=that.data.Content.Question[selectedIndex].OptionsChinese[selectedIndex2];
392 411
     }
393
-    wx.showModal({
394
-      title: '翻译',
395
-      content: content,
396
-      showCancel:false,
397
-      confirmText:"知道了",
398
-      complete: (res) => {
399
-        if (res.confirm) {
400
-          
401
-        }
402
-      }
403
-    })
412
+    this.setData({
413
+      EnglishSentence:engSentence,
414
+      ChineseSentence:chnSentence,
415
+      remindAnimation: "remind-slide-up", // 添加上滑动画
416
+      IsShowRemind:true,
417
+    });
404 418
   },
405
-  onUnload:function(){
406
-    if (!this.data.ID){
407
-      wx.navigateBack({
408
-        delta: 2,
419
+  showRemind:function(e){
420
+    let that = this;
421
+    if (that.data.IsShowRemind) {
422
+      // 如果当前是显示状态,先播放下滑动画,然后再隐藏
423
+      that.setData({
424
+        remindAnimation: "remind-slide-down" // 添加下滑动画
425
+      });
426
+      
427
+      // 等待动画完成后再隐藏弹窗
428
+      setTimeout(function() {
429
+        that.setData({
430
+          IsShowRemind: false
431
+        });
432
+      }, 300); // 动画持续时间为0.3秒
433
+    } else {
434
+      // 如果当前是隐藏状态,直接显示并播放上滑动画
435
+      that.setData({
436
+        IsShowRemind: true,
437
+        remindAnimation: "remind-slide-up"
409 438
       });
410 439
     }
411 440
   },

+ 43 - 18
pages/main/article.wxml

@@ -4,9 +4,11 @@
4 4
   background="{{ThemeCSS === 'DarkColor' ? '#004433' : '#D0ECD3'}}"
5 5
   color="{{ThemeCSS === 'DarkColor' ? '#ffffff' : '#151815'}}"
6 6
   extClass="fixed-nav {{ThemeCSS}}"
7
+  bind:back="back"
7 8
 ></navigation-bar>
9
+<block wx:if="{{!IsBuilding && !IsBuildError}}">
8 10
 <!-- 正常文章 -->
9
-<view wx:if="{{!IsBuilding && !IsBuildError}}" class="{{ThemeCSS}} container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
11
+<view  class="{{ThemeCSS}} container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
10 12
   <view class="panel1 FlexColumn">
11 13
     <!-- 完整文章 -->
12 14
     <text class="textArticle" wx:if="{{!IsShowTranslate}}" >
@@ -104,6 +106,26 @@
104 106
       <image  wx:if="{{ThemeCSS=='LightColor'}}" src="../images/sysIcon_a09.png" class="sysIcon_a03"></image>
105 107
     </view>
106 108
   </view>
109
+
110
+</view>
111
+
112
+<!-- 翻译 -->
113
+<view wx:if="{{IsShowRemind}}" class="panelRemindParent container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
114
+  <view class="panelRemind FlexColumn {{remindAnimation}}">
115
+    <image src="../images/sysIcon_b17.png" class="sysIcon_b10"></image>
116
+      
117
+    <view class="panelRemind1 FlexRow">
118
+      <image src="../images/sysIcon_b18.png" class="sysIcon_b09"></image>
119
+      <view>中英对照</view>
120
+    </view>
121
+    <view class="panelRemind2 FlexColumn">
122
+      <view class="textRemind FlexColumn">
123
+        <text>{{EnglishSentence}}</text>
124
+        <text class="textRemind2">{{ChineseSentence}}</text>
125
+      </view>
126
+      <view class="btnReind1 FlexColumn" catch:tap="showRemind">关闭</view>
127
+    </view>
128
+  </view>
107 129
 </view>
108 130
 
109 131
 <!-- 显示第一次打开帮助 -->
@@ -111,39 +133,42 @@
111 133
   <view class="panelHelp1">
112 134
     <image src="../images/sysIcon_b07.png" class="sysIcon_b07"></image>
113 135
     <view class="panelHelp2 FlexColumn">
114
-      <text class="text07">在这里看文章\n点下面做题目,右下角还有PDF</text>
136
+      <text class="text07">长按句子单独翻译,\n点下面做题目,右下角还有PDF</text>
115 137
       <view class="btn3 FlexColumn" bind:tap="closeHelp">知道了</view>
116 138
     </view>
117 139
   </view>
118 140
 </view>
141
+</block>
142
+
143
+<!-- 显示生成出错 -->
144
+<view wx:if="{{IsBuildError}}" class="container {{ThemeCSS}} FlexColumn" style='min-height:{{Containnerheight+140}}rpx;'>
145
+  <view class="{{ThemeCSS}} panelError FlexColumn">
146
+    <image  wx:if="{{ThemeCSS=='DarkColor'}}"  src="../images/sysIcon_b14.png" class="sysIcon_b14"></image>
147
+    <image  wx:if="{{ThemeCSS=='LightColor'}}" src="../images/sysIcon_b15.png" class="sysIcon_b14"></image>
148
+    <view class="textError1">抱歉,生成失败</view>
149
+    <view class="textError2">可能网络不畅或使用了不适合的单词</view>
150
+  </view>
151
+</view>
119 152
 
120 153
 <!-- 显示生成中 -->
121
-<view wx:if="{{IsBuilding}}" class="panelBuildindParent container {{ThemeCSS}} FlexColumn" style='min-height:{{Containnerheight+140}}rpx;'>
154
+<view wx:if="{{IsBuilding}}" class="container panelBuildindParent {{ThemeCSS}} FlexColumn" style='min-height:{{Containnerheight+140}}rpx;'>
122 155
 </view>
123
-<image wx:if="{{IsBuilding && ThemeCSS=='DarkColor'}}" src="../images/pic_08.png" mode="widthFix"  class="pic_08"></image>
124
-<image wx:if="{{IsBuilding && ThemeCSS=='LightColor'}}" src="../images/pic_09.png" mode="widthFix"  class="pic_08"></image>
125
-<view wx:if="{{IsBuilding}}" class="panelBuilding FlexColumn" style='min-height:{{Containnerheight+140}}rpx;'>
156
+<image wx:if="{{IsBuilding && ThemeCSS=='DarkColor'}}" src="../images/pic_08.png" mode="widthFix" class="pic_08"></image>
157
+<image wx:if="{{IsBuilding && ThemeCSS=='LightColor'}}" src="../images/pic_09.png" mode="widthFix" class="pic_08"></image>
158
+<view wx:if="{{IsBuilding}}" class="panelBuilding panelBuilding{{ThemeCSS}} FlexColumn" style='min-height:{{Containnerheight+140}}rpx;'>
126 159
   <view class="panelBuilding1 FlexColumn">
127 160
     <image src="../images/pic_03.png" class="pic_03"></image>
128 161
     <image src="../images/sysIcon_b08.gif" class="sysIcon_b08"></image>
129 162
     <view class="panelBuilding11 FlexColumn">
130 163
       <text class="text08" wx:if="{{CountDown>0}}">生成中…{{CountDown}}秒</text>
131
-      <text class="text08" wx:if="{{CountDown==0}}">生成中…差一点,就快好了</text>
132
-      <text class="text09">请眨眨眼,揉揉四白穴、睛明穴、攒竹穴</text>
164
+      <text class="text08" wx:if="{{CountDown==0 && (Level=='0' || Level=='1')}}">生成中…差一点,就快好了</text>
165
+      <text class="text08" wx:if="{{CountDown==0 && (Level=='2' || Level=='3')}}">再等一等,就差一点点了</text>
166
+      <text class="text09" wx:if="{{Level=='0' || Level=='1'}}">请眨眨眼,揉揉四白穴、睛明穴、攒竹穴</text>
167
+      <text class="text09" wx:if="{{Level=='2' || Level=='3'}}">高中和大学的文章生成时间比小学和初中更长,\n这是由于单词水平要求更高且内容更为复杂。</text>
133 168
     </view>
134 169
     <view class="panelBuilding12 FlexColumn">
135 170
       <text class="text10">Vocabulary:</text>
136 171
       <text class="text11">{{WordsStr}}</text>
137 172
     </view>
138 173
   </view>
139
-</view>
140
-
141
-<!-- 显示生成出错 -->
142
-<view wx:if="{{IsBuildError}}" class="container {{ThemeCSS}} FlexColumn" style='min-height:{{Containnerheight+140}}rpx;'>
143
-  <view class="{{ThemeCSS}} panelError FlexColumn">
144
-    <image  wx:if="{{ThemeCSS=='DarkColor'}}"  src="../images/sysIcon_b14.png" class="sysIcon_b14"></image>
145
-    <image  wx:if="{{ThemeCSS=='LightColor'}}" src="../images/sysIcon_b15.png" class="sysIcon_b14"></image>
146
-    <view class="textError1">抱歉,生成失败</view>
147
-    <view class="textError2">可能网络不畅或使用了不适合的单词</view>
148
-  </view>
149 174
 </view>

+ 190 - 83
pages/main/article.wxss

@@ -208,89 +208,6 @@
208 208
   margin-top: 10rpx;
209 209
 }
210 210
 
211
-
212
-.panelBuildindParent{
213
-  z-index: 50;
214
-}
215
-
216
-.pic_08{
217
-  width: 100%;
218
-  position: fixed;
219
-  top:200rpx;
220
-  z-index: 50;
221
-}
222
-
223
-.panelBuilding{
224
-  z-index: 20;
225
-  position: fixed;
226
-  top:0;
227
-  width:100%;
228
-  justify-content: flex-start;
229
-  font-weight: 700;
230
-  z-index: 50;
231
-}
232
-
233
-.DarkColor .panelBuilding{
234
-  background-image: linear-gradient(180deg, rgba(0,68,51,0.70) 0%, rgba(0,20,15,0.60) 100%);
235
-}
236
-.LightColor .panelBuilding{
237
-  background-image: linear-gradient(180deg, rgba(208,236,211,0.50) 0%, rgba(159,180,161,0.70) 100%);
238
-}
239
-
240
-.panelBuilding1{
241
-  width: 100%;
242
-  position: fixed;
243
-  top:345rpx;
244
-}
245
-
246
-.pic_03{
247
-  width:100%;
248
-  height:880rpx;
249
-  position: absolute;
250
-  top:0;
251
-}
252
-.sysIcon_b08{
253
-  width:220rpx;
254
-  height:220rpx;
255
-  position: absolute;
256
-  top:337rpx;
257
-  z-index: 25;
258
-}
259
-
260
-.panelBuilding11{
261
-  position: absolute;
262
-  top: 190rpx;
263
-  color: #2E2E2E;
264
-}
265
-
266
-.text08{
267
-  font-size: 48rpx;
268
-}
269
-.text09{
270
-  font-size: 28rpx;
271
-  text-align: center;
272
-  margin-top: 20rpx;
273
-  font-weight: 400;
274
-}
275
-
276
-.panelBuilding12{
277
-  position: absolute;
278
-  top: 610rpx;
279
-  color: #FDAD94;
280
-}
281
-
282
-.text10{
283
-  font-size: 24rpx;
284
-  text-align: center;
285
-}
286
-.text11{
287
-  font-size: 28rpx;
288
-  text-align: center;
289
-  margin-top: 10rpx;
290
-  font-weight: 400;
291
-  width: 640rpx;
292
-}
293
-
294 211
 .panelAnswer{
295 212
   width:100%;
296 213
   position: fixed;
@@ -633,4 +550,194 @@
633 550
   position: absolute;
634 551
   right: -20rpx !important;
635 552
   left: unset !important;
553
+}
554
+
555
+
556
+.panelMenu{
557
+  background-color: rgba(26,67,51,0.50);
558
+  z-index: 20;
559
+  position: fixed;
560
+  top:0;
561
+}
562
+
563
+/* 翻译 */
564
+.panelRemindParent{
565
+  background-color: rgba(26,67,51,0.10);
566
+  z-index: 20;
567
+  position: fixed;
568
+  top:0;
569
+}
570
+
571
+/* 翻译弹窗动画 */
572
+@keyframes slideUp {
573
+  from {
574
+    transform: translateY(100%);
575
+    opacity: 0;
576
+  }
577
+  to {
578
+    transform: translateY(0);
579
+    opacity: 1;
580
+  }
581
+}
582
+
583
+@keyframes slideDown {
584
+  from {
585
+    transform: translateY(0);
586
+    opacity: 1;
587
+  }
588
+  to {
589
+    transform: translateY(100%);
590
+    opacity: 0;
591
+  }
592
+}
593
+
594
+.remind-slide-up {
595
+  animation: slideUp 0.3s ease-out forwards;
596
+}
597
+
598
+.remind-slide-down {
599
+  animation: slideDown 0.3s ease-out forwards;
600
+}
601
+
602
+.panelRemind{
603
+  width: 690rpx;
604
+  margin-bottom: 75rpx;
605
+  position: fixed;
606
+  bottom: 0;
607
+  background: #259D57;
608
+  box-shadow: 0 20rpx 0 0 #196F3D, 0 50rpx 0 0 rgba(0,0,0,0.50);
609
+  border-radius: 60rpx;
610
+}
611
+.sysIcon_b10{
612
+  width: 360rpx;
613
+  height:140rpx;
614
+  position: absolute;
615
+  right:0;
616
+  top:-22rpx;
617
+}
618
+.panelRemind1{
619
+  width: 100%;
620
+  justify-content: flex-start;
621
+  margin-top: 40rpx;
622
+  font-size: 36rpx;
623
+  color: #FFFFFF;
624
+  z-index: 25rpx;
625
+}
626
+.sysIcon_b09{
627
+  width: 50rpx;
628
+  height:50rpx;
629
+  margin: 0 20rpx 0 50rpx ;
630
+}
631
+.panelRemind2{
632
+  width: 650rpx;
633
+  min-height:220rpx;
634
+  background: #FFFFFF;
635
+  color: #2E2E2E;
636
+  border-radius: 40rpx;
637
+  margin: 30rpx 0;
638
+  justify-content: flex-start;
639
+}
640
+.textRemind{
641
+  width:570rpx;
642
+  font-weight: 400;
643
+  font-size: 28rpx;
644
+  align-items: flex-start;
645
+  margin-top: 80rpx;
646
+}
647
+.textRemind2{
648
+  margin-top: 30rpx;
649
+  font-size: 36rpx;
650
+  font-weight: 400;
651
+}
652
+.btnReind1{
653
+  width:590rpx;
654
+  height:90rpx;
655
+  background: #F0F0F0;
656
+  border-radius: 20rpx;
657
+  font-size: 36rpx;
658
+  margin-top: 60rpx;
659
+  margin-bottom: 40rpx;
660
+}
661
+
662
+/* 生成中 */
663
+.panelBuildindParent{
664
+  z-index: 50;
665
+}
666
+
667
+.pic_08{
668
+  width: 100%;
669
+  position: fixed;
670
+  top:200rpx;
671
+  z-index: 50;
672
+}
673
+
674
+.panelBuilding{
675
+  z-index: 20;
676
+  position: fixed;
677
+  top:0;
678
+  width:100%;
679
+  justify-content: flex-start;
680
+  font-weight: 700;
681
+  z-index: 50;
682
+}
683
+
684
+.panelBuildingDarkColor{
685
+  background-image: linear-gradient(180deg, rgba(0,68,51,0.70) 0%, rgba(0,20,15,0.60) 100%);
686
+}
687
+.panelBuildingLightColor{
688
+  background-image: linear-gradient(180deg, rgba(208,236,211,0.50) 0%, rgba(165,221,187,0.50) 100%);
689
+}
690
+
691
+.panelBuilding1{
692
+  width: 100%;
693
+  position: fixed;
694
+  top:345rpx;
695
+}
696
+
697
+.pic_03{
698
+  width:100%;
699
+  height:880rpx;
700
+  position: absolute;
701
+  top:0;
702
+}
703
+.sysIcon_b08{
704
+  width:220rpx;
705
+  height:220rpx;
706
+  position: absolute;
707
+  top:347rpx;
708
+  z-index: 25;
709
+}
710
+
711
+.panelBuilding11{
712
+  position: absolute;
713
+  top: 170rpx;
714
+  color: #2E2E2E;
715
+}
716
+
717
+.text08{
718
+  font-size: 48rpx;
719
+}
720
+.text09{
721
+  font-size: 28rpx;
722
+  text-align: center;
723
+  margin-top: 20rpx;
724
+  font-weight: 400;
725
+}
726
+
727
+.panelBuilding12{
728
+  position: absolute;
729
+  top: 610rpx;
730
+  color: #FDAD94;
731
+}
732
+
733
+.text10{
734
+  font-size: 24rpx;
735
+  text-align: center;
736
+}
737
+.text11{
738
+  font-size: 28rpx;
739
+  text-align: center;
740
+  margin-top: 10rpx;
741
+  font-weight: 400;
742
+  width: 640rpx;
636 743
 }

+ 1 - 1
pages/main/index.wxss

@@ -115,7 +115,7 @@
115 115
   height:140rpx;
116 116
   position: absolute;
117 117
   right:0;
118
-  top:-20rpx;
118
+  top:-22rpx;
119 119
 }
120 120
 .panelRemind1{
121 121
   width: 100%;

+ 4 - 0
pages/main/myarticles.js

@@ -15,8 +15,12 @@ Page({
15 15
     that.getData();
16 16
   },
17 17
   getData:function(){
18
+    wx.showLoading({
19
+      title: '请稍候',
20
+    });
18 21
     let that=this;
19 22
     main.getData('GetYJBDCArticleList?UserID=' + app.globalData.userInfo.UserID, function (data) {
23
+      wx.hideLoading();
20 24
       if (data) {
21 25
         for(let i=0;i<data.length;i++){
22 26
             let item=data[i];

+ 1 - 1
pages/main/myarticles.wxss

@@ -114,7 +114,7 @@
114 114
   height:140rpx;
115 115
   position: absolute;
116 116
   right:0;
117
-  top:-20rpx;
117
+  top:-22rpx;
118 118
 }
119 119
 .panelRemind1{
120 120
   width: 100%;

+ 1 - 0
pages/main/ocr.js

@@ -64,6 +64,7 @@ Page({
64 64
         const tempFilePath = res.tempFiles[0].tempFilePath
65 65
         this.setData({
66 66
           imageUrl: tempFilePath,
67
+          cameraActive: false,
67 68
         })
68 69
         this.performOCR(tempFilePath)
69 70
       },

+ 1 - 1
pages/main/ocr.wxml

@@ -1,6 +1,6 @@
1 1
 <view class="container FlexColumn">
2 2
   <view class="camera-container" wx:if="{{cameraActive}}">
3
-    <camera device-position="back" flash="auto" class="camera"></camera>
3
+    <camera device-position="back" flash="auto" class="camera" wx:if="{{cameraActive}}"></camera>
4 4
     <view class="btnCamera FlexColumn" bindtap="takePhoto">
5 5
       <image src="../images/sysIcon_b05.png" class="sysIcon_b05"></image>
6 6
     </view>

+ 18 - 13
pages/main/selectword.js

@@ -45,32 +45,37 @@ Page({
45 45
     });
46 46
   },
47 47
   selectWord:function(e){
48
-    if (this.data.Count>=this.data.CountMax){
49
-      wx.showToast({
50
-        title: '本次最多'+this.data.CountMax+"个",
51
-        icon:"none"
52
-      });
53
-      return ;
54
-    }
48
+    
55 49
     let word=e.currentTarget.dataset.word;
56 50
     let list=this.data.Words;
57
-    let count=0;
51
+    let count=0,index=-1;
58 52
     for(let i=0;i<list.length;i++){
59 53
         if(word==list[i].Name){
60 54
           if (list[i].CSS)
61 55
             list[i].CSS="";
62 56
           else
63 57
             list[i].CSS="Selected";
58
+          index=i;
64 59
         }
65 60
         if(list[i].CSS=="Selected"){
66 61
           count++;
67 62
         }
68 63
     }
69
-    this.setData({
70
-      Words:list,
71
-      Count:count,
72
-      IsShowAlert:false,
73
-    });
64
+    //debugger;
65
+    if (this.data.Count==this.data.CountMax && count>this.data.CountMax){
66
+      wx.showToast({
67
+        title: '本次最多'+this.data.CountMax+"个",
68
+        icon:"none"
69
+      });
70
+      list[index].CSS="";
71
+    }
72
+    else{
73
+      this.setData({
74
+        Words:list,
75
+        Count:count,
76
+        IsShowAlert:false,
77
+      });
78
+    }
74 79
   },
75 80
   goto: function (e) {
76 81
     let that=this;

+ 1 - 1
pages/main/wordsinput.js

@@ -20,7 +20,7 @@ Page({
20 20
       grade=[{Name:"小学",CSS:"Selected"},{Name:"初中",CSS:""},{Name:"高中",CSS:""},{Name:"大学",CSS:""}];
21 21
     let ArticleStyle=wx.getStorageSync('ArticleStyle');
22 22
     if (!ArticleStyle)
23
-      ArticleStyle=[{Name:"任意",CSS:"Selected"},{Name:"童话",CSS:""},{Name:"科幻",CSS:""},{Name:"奇幻",CSS:""},{Name:"旅行",CSS:""},{Name:"动物",CSS:""},{Name:"家庭亲子",CSS:""},{Name:"校园生活",CSS:""},{Name:"科普",CSS:""},{Name:"节日文化",CSS:""},{Name:"成长",CSS:""},{Name:"人生励志",CSS:""},{Name:"环保",CSS:""}];
23
+      ArticleStyle=[{Name:"随机",CSS:"Selected"},{Name:"童话",CSS:""},{Name:"科幻",CSS:""},{Name:"奇幻",CSS:""},{Name:"旅行",CSS:""},{Name:"动物",CSS:""},{Name:"家庭亲子",CSS:""},{Name:"校园生活",CSS:""},{Name:"科普",CSS:""},{Name:"节日文化",CSS:""},{Name:"成长",CSS:""},{Name:"人生励志",CSS:""},{Name:"环保",CSS:""}];
24 24
   
25 25
     const hiddenhelp=wx.getStorageSync('HiddenWordInputFirstOpen');
26 26
 

+ 1 - 1
pages/main/wordsinput.wxss

@@ -362,7 +362,7 @@
362 362
   height:140rpx;
363 363
   position: absolute;
364 364
   right:0;
365
-  top:-20rpx;
365
+  top:-22rpx;
366 366
 }
367 367
 .panelRemind1{
368 368
   width: 100%;

+ 2 - 0
utils/main.js

@@ -11,6 +11,7 @@ function getData(url, callback) {
11 11
   //console.log("加密后的结果为===",url);
12 12
   wx.request({
13 13
     url: app.globalData.serverUrl + url,
14
+    timeout:120000,
14 15
     success: function (res) {
15 16
       if (res.statusCode)
16 17
         common.checkError(res.statusCode);
@@ -38,6 +39,7 @@ function postData(url, postData, callback) {
38 39
   wx.request({
39 40
     url: app.globalData.serverUrl + url,
40 41
     method: "POST",
42
+    timeout:120000,
41 43
     data: postData,
42 44
     success: function (res) {
43 45
       if (res.statusCode)