chengjie 5 mesi fa
parent
commit
a72ccb0d6e
74 ha cambiato i file con 2628 aggiunte e 16 eliminazioni
  1. BIN
      .DS_Store
  2. 2 0
      app.js
  3. 11 4
      app.json
  4. 13 3
      app.wxss
  5. BIN
      images/words.jpg
  6. BIN
      pages/.DS_Store
  7. 8 4
      pages/article_generator/article_generator.js
  8. 2 0
      pages/article_generator/article_generator.wxss
  9. BIN
      pages/images/.DS_Store
  10. BIN
      pages/images/pic_01.png
  11. BIN
      pages/images/pic_02.png
  12. BIN
      pages/images/pic_03.png
  13. BIN
      pages/images/pic_04.png
  14. BIN
      pages/images/pic_05.png
  15. BIN
      pages/images/pic_06.png
  16. BIN
      pages/images/pic_h01.png
  17. BIN
      pages/images/pic_h02.png
  18. BIN
      pages/images/pic_h03.png
  19. BIN
      pages/images/sysIcon_a01.png
  20. BIN
      pages/images/sysIcon_a02.png
  21. BIN
      pages/images/sysIcon_a03.png
  22. BIN
      pages/images/sysIcon_a04.png
  23. BIN
      pages/images/sysIcon_a05.png
  24. BIN
      pages/images/sysIcon_a06.png
  25. BIN
      pages/images/sysIcon_a07.png
  26. BIN
      pages/images/sysIcon_a08.png
  27. BIN
      pages/images/sysIcon_a09.png
  28. BIN
      pages/images/sysIcon_a10.png
  29. BIN
      pages/images/sysIcon_a11.png
  30. BIN
      pages/images/sysIcon_a12.png
  31. BIN
      pages/images/sysIcon_a13.png
  32. BIN
      pages/images/sysIcon_b01.png
  33. BIN
      pages/images/sysIcon_b02.png
  34. BIN
      pages/images/sysIcon_b03.png
  35. BIN
      pages/images/sysIcon_b04.png
  36. BIN
      pages/images/sysIcon_b05.png
  37. BIN
      pages/images/sysIcon_b06.png
  38. BIN
      pages/images/sysIcon_b07.png
  39. BIN
      pages/images/sysIcon_c01.png
  40. BIN
      pages/images/sysIcon_c02.png
  41. BIN
      pages/images/sysIcon_c03.png
  42. BIN
      pages/images/sysIcon_c04.png
  43. BIN
      pages/images/sysIcon_c05.png
  44. BIN
      pages/images/sysIcon_d01.png
  45. BIN
      pages/images/sysIcon_d02.png
  46. BIN
      pages/images/sysIcon_d03.png
  47. BIN
      pages/images/sysIcon_d04.png
  48. BIN
      pages/images/sysIcon_d05.png
  49. 390 0
      pages/main/article.js
  50. 4 0
      pages/main/article.json
  51. 123 0
      pages/main/article.wxml
  52. 542 0
      pages/main/article.wxss
  53. 30 0
      pages/main/index.js
  54. 3 0
      pages/main/index.json
  55. 32 0
      pages/main/index.wxml
  56. 94 0
      pages/main/index.wxss
  57. 232 0
      pages/main/ocr.js
  58. 4 0
      pages/main/ocr.json
  59. 14 0
      pages/main/ocr.wxml
  60. 57 0
      pages/main/ocr.wxss
  61. 60 0
      pages/main/paste.js
  62. 4 0
      pages/main/paste.json
  63. 24 0
      pages/main/paste.wxml
  64. 95 0
      pages/main/paste.wxss
  65. 98 0
      pages/main/selectword.js
  66. 4 0
      pages/main/selectword.json
  67. 51 0
      pages/main/selectword.wxml
  68. 169 0
      pages/main/selectword.wxss
  69. 198 0
      pages/main/wordsinput.js
  70. 3 0
      pages/main/wordsinput.json
  71. 82 0
      pages/main/wordsinput.wxml
  72. 272 0
      pages/main/wordsinput.wxss
  73. 1 1
      project.private.config.json
  74. 6 4
      utils/util.js

BIN
.DS_Store


+ 2 - 0
app.js

@@ -30,6 +30,8 @@ App({
30 30
     Key: "kylx365_chengjie",
31 31
     IV: "kylx365hongliren",
32 32
     TempStr:"",
33
+    OCRWords:[],//OCR的单词
34
+    SelectedWords:[],//选中的单词
33 35
     ocrReady: false
34 36
   },
35 37
   onLaunch: function (options) {

+ 11 - 4
app.json

@@ -1,15 +1,22 @@
1 1
 {
2 2
   "pages": [
3
+    "pages/main/article",
4
+    "pages/main/index",
5
+    "pages/main/paste",
6
+    "pages/main/ocr",
7
+    "pages/main/selectword",
8
+    "pages/main/wordsinput",
3 9
     "pages/index/index",
4
-    "pages/article_generator/article_generator",
5 10
     "pages/logs/logs",
11
+    "pages/article_generator/article_generator",
6 12
     "pages/ocr/ocr"
7 13
   ],
8 14
   "window": {
9 15
     "backgroundTextStyle": "light",
10
-    "navigationBarBackgroundColor": "#fff",
11
-    "navigationBarTitleText": "秒过英语-AI生文记单词",
12
-    "navigationBarTextStyle": "black"
16
+    "backgroundColor": "#004433",
17
+    "navigationBarBackgroundColor": "#004433",
18
+    "navigationBarTitleText": "语境背单词",
19
+    "navigationBarTextStyle": "white"
13 20
   },
14 21
   "style": "v2",
15 22
   "sitemapLocation": "sitemap.json",

File diff suppressed because it is too large
+ 13 - 3
app.wxss


BIN
images/words.jpg


BIN
pages/.DS_Store


+ 8 - 4
pages/article_generator/article_generator.js

@@ -22,9 +22,12 @@ Page({
22 22
       Containnerheight: main.getWindowHeight(),
23 23
       IsShowTranslate:false,
24 24
     });
25
-    if (options.words) {
25
+    let words=options.words;
26
+    if (!options.words)
27
+      words="boy,girl,king,come,go,yellow,dragon,fire";
28
+    if (words) {
26 29
       try {
27
-        const wordList = options.words.split(",");
30
+        const wordList = words.split(",");
28 31
         this.setData({ wordList });
29 32
       } catch (e) {
30 33
         wx.showToast({
@@ -69,7 +72,6 @@ Page({
69 72
       //url="https://www.kylx365.com/apiData/"+url;
70 73
       url="http://localhost:3020/api/GenerateArticle";
71 74
       let words=that.data.wordList;
72
-      debugger;
73 75
       const cloudRes = await new Promise((resolve, reject) => {
74 76
         wx.request({
75 77
           url: url,
@@ -83,9 +85,11 @@ Page({
83 85
           fail: reject,
84 86
         })
85 87
       });
86
-      console.log(cloudRes);
88
+      //console.log(cloudRes);
87 89
       let result=cloudRes.data.result.choices[0].message.content;
90
+      console.log(result);
88 91
       let content=JSON.parse(result);
92
+      //console.log(content);
89 93
       for(let i=0;i<content.ArticleEnglish.length;i++){
90 94
         for(let j=0;j<content.FormsOfWords.length;j++){
91 95
           let word = content.FormsOfWords[j];

+ 2 - 0
pages/article_generator/article_generator.wxss

@@ -1,5 +1,7 @@
1 1
 
2 2
 .container {
3
+  background-color: #fff;
4
+  color:#000;
3 5
 }
4 6
 
5 7
 .section {

BIN
pages/images/.DS_Store


BIN
pages/images/pic_01.png


BIN
pages/images/pic_02.png


BIN
pages/images/pic_03.png


BIN
pages/images/pic_04.png


BIN
pages/images/pic_05.png


BIN
pages/images/pic_06.png


BIN
pages/images/pic_h01.png


BIN
pages/images/pic_h02.png


BIN
pages/images/pic_h03.png


BIN
pages/images/sysIcon_a01.png


BIN
pages/images/sysIcon_a02.png


BIN
pages/images/sysIcon_a03.png


BIN
pages/images/sysIcon_a04.png


BIN
pages/images/sysIcon_a05.png


BIN
pages/images/sysIcon_a06.png


BIN
pages/images/sysIcon_a07.png


BIN
pages/images/sysIcon_a08.png


BIN
pages/images/sysIcon_a09.png


BIN
pages/images/sysIcon_a10.png


BIN
pages/images/sysIcon_a11.png


BIN
pages/images/sysIcon_a12.png


BIN
pages/images/sysIcon_a13.png


BIN
pages/images/sysIcon_b01.png


BIN
pages/images/sysIcon_b02.png


BIN
pages/images/sysIcon_b03.png


BIN
pages/images/sysIcon_b04.png


BIN
pages/images/sysIcon_b05.png


BIN
pages/images/sysIcon_b06.png


BIN
pages/images/sysIcon_b07.png


BIN
pages/images/sysIcon_c01.png


BIN
pages/images/sysIcon_c02.png


BIN
pages/images/sysIcon_c03.png


BIN
pages/images/sysIcon_c04.png


BIN
pages/images/sysIcon_c05.png


BIN
pages/images/sysIcon_d01.png


BIN
pages/images/sysIcon_d02.png


BIN
pages/images/sysIcon_d03.png


BIN
pages/images/sysIcon_d04.png


BIN
pages/images/sysIcon_d05.png


+ 390 - 0
pages/main/article.js

@@ -0,0 +1,390 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+const Theme=[{
4
+    "Name":"DarkColor",
5
+    "backgroundColor": "#004433",
6
+    "color":"#C1E1C1",
7
+    "frontColor": '#ffffff',
8
+  },{
9
+    "Name":"LightColor",
10
+    "backgroundColor": "#D0ECD3",
11
+    "color":"#151815",
12
+    "frontColor": '#000000',
13
+  }
14
+];
15
+const app = getApp();
16
+
17
+Page({
18
+  data: {
19
+    Words:"",
20
+    IsShowPanelHelp:true,
21
+    IsBuilding:false,
22
+    IsShowLightColor:false,
23
+    IsShowKeyword:true,//显示关键词
24
+    IsShowQuestion:true,
25
+    IsShowTranslate:false,
26
+    IsShowAnswer:false,
27
+    IsShowSetting:false,
28
+    CurrentQuestionIndex:0,
29
+    swiperHeight: "526rpx",
30
+    lastTapTime: 0, // 记录上一次点击的时间,用于检测双击
31
+  },
32
+  onLoad: function (options) {
33
+    let that = this;
34
+    let words=app.globalData.SelectedWords.join(" ");
35
+    const hiddenhelp=wx.getStorageSync('HiddenArticleHelp');
36
+
37
+    that.setData({
38
+      Containnerheight: main.getWindowHeight(),
39
+      Words:words, 
40
+      IsShowPanelHelp:!hiddenhelp,
41
+    });
42
+
43
+    that.init();
44
+    that.setTheme();
45
+  },
46
+
47
+  init:function(){
48
+    const that=this;
49
+    let content={
50
+          "ArticleEnglish": [
51
+              "Once upon a time, there was a king in a beautiful kingdom.",
52
+              "A fierce dragon came and brought yellow fire to the kingdom.",
53
+              "The people in the kingdom were very afraid.",
54
+              "A brave boy and a kind - hearted girl decided to go and fight against the dragon.",
55
+              "They came to the dragon's cave and saw the dragon sleeping.",
56
+              "The boy used a big stick to wake up the dragon.",
57
+              "The dragon was angry and spat out yellow fire at them.",
58
+              "But the boy and the girl were not scared.",
59
+              "They worked together and finally defeated the dragon.",
60
+              "The king was very happy and thanked the boy and the girl."
61
+          ],
62
+          "ArticleChinese": [
63
+              "从前,在一个美丽的王国里有一位国王。",
64
+              "一条凶猛的龙来了,给王国带来了黄色的火焰。",
65
+              "王国里的人们非常害怕。",
66
+              "一个勇敢的男孩和一个善良的女孩决定去与龙战斗。",
67
+              "他们来到了龙的洞穴,看到龙正在睡觉。",
68
+              "男孩用一根大棍子把龙叫醒了。",
69
+              "龙很生气,朝他们吐出了黄色的火焰。",
70
+              "但是男孩和女孩并不害怕。",
71
+              "他们齐心协力,最终打败了龙。",
72
+              "国王非常高兴,感谢了男孩和女孩。"
73
+          ],
74
+          "FormsOfWords": [
75
+              "boy",
76
+              "girl",
77
+              "king",
78
+              "come",
79
+              "came",
80
+              "go",
81
+              "went",
82
+              "yellow",
83
+              "dragon",
84
+              "dragons",
85
+              "fire"
86
+          ],
87
+          "Question": [
88
+              {
89
+                  "QuestionEnglish": "Who brought yellow fire to the kingdom?",
90
+                  "QuestionChinese": "谁给王国带来了黄色的火焰?",
91
+                  "OptionsEnglish": [
92
+                      "A. The boy",
93
+                      "B. The girl",
94
+                      "C. The king",
95
+                      //"D. The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon  The dragon"
96
+                      "D. The dragon"
97
+                  ],
98
+                  "OptionsChinese": [
99
+                      "A. 男孩",
100
+                      "B. 女孩",
101
+                      "C. 国王",
102
+                      "D. 龙"
103
+                  ],
104
+                  "Answer": "D"
105
+              },
106
+              {
107
+                  "QuestionEnglish": "What did the boy and the girl decide to do?",
108
+                  "QuestionChinese": "男孩和女孩决定做什么?",
109
+                  "OptionsEnglish": [
110
+                      "A. Go home",
111
+                      "B. Fight against the dragon",
112
+                      "C. Play with the dragon",
113
+                      "D. Sleep in the cave"
114
+                  ],
115
+                  "OptionsChinese": [
116
+                      "A. 回家",
117
+                      "B. 与龙战斗",
118
+                      "C. 和龙一起玩",
119
+                      "D. 在洞穴里睡觉"
120
+                  ],
121
+                  "Answer": "B"
122
+              },
123
+              {
124
+                  "QuestionEnglish": "How did the boy wake up the dragon?",
125
+                  "QuestionChinese": "男孩是如何叫醒龙的?",
126
+                  "OptionsEnglish": [
127
+                      "A. By shouting",
128
+                      "B. By using a big stick",
129
+                      "C. By throwing stones",
130
+                      "D. By singing"
131
+                  ],
132
+                  "OptionsChinese": [
133
+                      "A. 通过大喊",
134
+                      "B. 通过使用一根大棍子",
135
+                      "C. 通过扔石头",
136
+                      "D. 通过唱歌"
137
+                  ],
138
+                  "Answer": "B"
139
+              },
140
+              {
141
+                  "QuestionEnglish": "How did the dragon feel when it woke up?",
142
+                  "QuestionChinese": "龙醒来时感觉如何?",
143
+                  "OptionsEnglish": [
144
+                      "A. Happy",
145
+                      "B. Sad",
146
+                      "C. Angry",
147
+                      "D. Tired"
148
+                  ],
149
+                  "OptionsChinese": [
150
+                      "A. 高兴的",
151
+                      "B. 悲伤的",
152
+                      "C. 生气的",
153
+                      "D. 疲惫的"
154
+                  ],
155
+                  "Answer": "C"
156
+              },
157
+              {
158
+                  "QuestionEnglish": "What did the king do after the boy and the girl defeated the dragon?",
159
+                  "QuestionChinese": "男孩和女孩打败龙后,国王做了什么?",
160
+                  "OptionsEnglish": [
161
+                      "A. He punished them",
162
+                      "B. He thanked them",
163
+                      "C. He ignored them",
164
+                      "D. He was angry with them"
165
+                  ],
166
+                  "OptionsChinese": [
167
+                      "A. 他惩罚了他们",
168
+                      "B. 他感谢了他们",
169
+                      "C. 他无视了他们",
170
+                      "D. 他对他们很生气"
171
+                  ],
172
+                  "Answer": "B"
173
+              }
174
+          ]
175
+      };
176
+    that.updateData(content);
177
+  },
178
+  setTheme:function(){
179
+    const that=this;
180
+    const css=Theme[that.data.IsShowLightColor?1:0];
181
+    wx.setNavigationBarColor({
182
+      frontColor: css.frontColor,
183
+      backgroundColor: css.backgroundColor,
184
+    });
185
+    wx.setBackgroundColor({
186
+      backgroundColor: css.backgroundColor,
187
+      backgroundColorTop:css.backgroundColor,
188
+      backgroundColorBottom:css.backgroundColor,
189
+    });
190
+    that.setData({
191
+      ThemeCSS:css.Name,
192
+    });
193
+  },
194
+  updateData:function(content){
195
+    const that=this;
196
+    //console.log(content);
197
+    for(let i=0;i<content.ArticleEnglish.length;i++){
198
+      for(let j=0;j<content.FormsOfWords.length;j++){
199
+        let word = content.FormsOfWords[j];
200
+        let regex = new RegExp(`\\b${word}\\b[.,!?;:]?`, 'gi');
201
+        if (that.data.IsShowKeyword){
202
+          content.ArticleEnglish[i] = content.ArticleEnglish[i].replace(regex, match => {
203
+            let punctuation = match.match(/[.,!?;:]$/);
204
+            let punc = punctuation ? punctuation[0] : '';
205
+            let wordPart = match.replace(/[.,!?;:]$/, '');
206
+            return `<span class='highlight'>${wordPart}</span>${punc}`;
207
+          });
208
+        }
209
+      }
210
+    }
211
+    content.ArticleEnglishStr=content.ArticleEnglish.join(" ");
212
+    for(let i=0;i<content.Question.length;i++){
213
+      for(let j=0;j<content.Question[i].OptionsEnglish.length;j++){
214
+        let str=content.Question[i].OptionsChinese[j];
215
+        content.Question[i].OptionsChinese[j]=str.substr(2);
216
+      }
217
+      let char = content.Question[i].Answer;
218
+      let asciiCode = char.charCodeAt(0);
219
+      content.Question[i].AnswerNumber=asciiCode-65;
220
+    }
221
+    that.setData({
222
+      Content:content,
223
+    }, function() {
224
+      // 数据加载完成后,计算swiper高度
225
+      that.calculateSwiperHeight();
226
+      setTimeout(function(){
227
+        that.setData({
228
+          IsShowQuestion:false,
229
+        })
230
+      },1000);
231
+    });
232
+  },
233
+  closeHelp:function(){
234
+    this.setData({
235
+      IsShowPanelHelp:false,
236
+    });
237
+    wx.setStorageSync('HiddenArticleHelp', true);
238
+  },
239
+  selectedAnswer:function(e){
240
+    const that=this;
241
+    const question=e.currentTarget.dataset.question;
242
+    const index=e.currentTarget.dataset.index;
243
+    that.data.Content.Question[question].UserAnswer=index;
244
+    that.setData({
245
+      Content:that.data.Content,
246
+    });
247
+  },
248
+
249
+  showData:function(e){
250
+    const that=this;
251
+    let name=e.currentTarget.dataset.name;
252
+    this.data[name] = !this.data[name];
253
+    this.setData(this.data);
254
+
255
+    if (name=="IsShowKeyword"){
256
+      that.setShowKeyword();
257
+    }
258
+    else if (name=="IsShowLightColor"){
259
+      that.setTheme();
260
+    }
261
+    else if (this.data[name] && (name=="IsShowTranslate" || name=="IsShowQuestion")){
262
+      wx.showLoading({
263
+        title: '请稍等',
264
+        mask:true,
265
+      })
266
+      that.calculateSwiperHeight();
267
+      setTimeout(function(){
268
+        wx.hideLoading();
269
+      },500);
270
+    }
271
+  },
272
+  setShowKeyword:function(){
273
+    const that=this;
274
+    let content=that.data.Content;
275
+    let source="highlight",target="nonelight";
276
+    if (that.data["IsShowKeyword"]){
277
+      source="nonelight";
278
+      target="highlight";
279
+    }
280
+    content.ArticleEnglishStr=common.ReplaceAllString(content.ArticleEnglishStr,source,target);
281
+    for(let i=0;i<content.Question.length;i++){
282
+      for(let j=0;j<content.Question[i].OptionsEnglish.length;j++){
283
+        content.Question[i].OptionsEnglish[j]=common.ReplaceAllString(content.Question[i].OptionsEnglish[j],source,target);
284
+      }
285
+    }
286
+    that.setData({
287
+      Content:content,
288
+    });
289
+  },
290
+  nextQuestion:function(e){
291
+    if (this.data.CurrentQuestionIndex+1<this.data.Content.Question.length){
292
+      this.data.CurrentQuestionIndex=this.data.CurrentQuestionIndex+1;
293
+      this.setData({
294
+        IsShowAnswer:false,
295
+        CurrentQuestionIndex:this.data.CurrentQuestionIndex,
296
+      });
297
+    }
298
+  },
299
+  updateQuestionIndex:function(e){
300
+    this.setData({
301
+      CurrentQuestionIndex:e.detail.current,
302
+    });
303
+  },
304
+  // 计算所有swiper-item的高度,并设置swiper的高度为最高的那个
305
+  calculateSwiperHeight: function() {
306
+    const that = this;
307
+
308
+    // 增加延迟时间,确保DOM完全渲染
309
+    setTimeout(function() {
310
+      // 分别计算每个问题和选项的高度
311
+      const query = wx.createSelectorQuery();
312
+      
313
+      // 先计算问题文本的高度
314
+      query.selectAll('.text04').boundingClientRect();
315
+      
316
+      // 再计算所有选项的高度
317
+      query.selectAll('.text05').boundingClientRect();
318
+      
319
+      query.exec(function(res) {
320
+        if (!res || res.length < 2 || !res[0] || !res[1]) return;
321
+        
322
+        const questionRects = res[0];
323
+        const optionsRects = res[1];
324
+        
325
+        // 计算每个swiper-item的总高度
326
+        let itemHeights = [];
327
+        
328
+        // 假设问题和选项是一一对应的
329
+        const questionCount =questionRects.length;
330
+        
331
+        for (let i = 0; i < questionCount; i++) {
332
+          // 问题高度 + 选项高度 + 固定间距(margin等)
333
+          let totalHeight = questionRects[i].height + 100; // 100是估计的间距
334
+          for(let j=0;j<4;j++){
335
+            optionsRects[i*4+j].height=optionsRects[i*4+j].height*2+40;
336
+            console.log(optionsRects[i*4+j].height);
337
+            totalHeight+=optionsRects[i*4+j].height;
338
+          }
339
+          //debugger;
340
+          itemHeights.push(totalHeight);
341
+        }
342
+        
343
+        // 找出最高的高度
344
+        let maxHeight = 0;
345
+        itemHeights.forEach(function(height) {
346
+          if (height > maxHeight) {
347
+            maxHeight = height;
348
+          }
349
+        });
350
+        
351
+          console.log("计算的各项高度:", itemHeights);
352
+          console.log("最大高度:", maxHeight);
353
+        
354
+        // 为swiper高度增加一些额外空间(为指示点和边距)
355
+        maxHeight += 200; // 增加额外空间,确保内容完全显示
356
+        
357
+        // 设置swiper的高度
358
+        that.setData({
359
+          swiperHeight: maxHeight + 'rpx',
360
+        });
361
+      });
362
+    }, 500); // 增加延迟时间到500ms
363
+  },
364
+
365
+  onContainerTap: function() {
366
+    const currentTime = new Date().getTime();
367
+    const lastTapTime = this.data.lastTapTime;
368
+    const timeDiff = currentTime - lastTapTime;
369
+    
370
+    // 如果两次点击的时间间隔小于300毫秒,则认为是双击
371
+    if (timeDiff < 300 && timeDiff > 0) {
372
+      console.log('双击事件触发');
373
+      // 在这里添加双击事件的处理逻辑
374
+      // 例如:切换翻译显示状态
375
+      this.showData({currentTarget:{dataset:{name:"IsShowTranslate"}}});
376
+    }
377
+    
378
+    // 更新上一次点击的时间
379
+    this.setData({
380
+      lastTapTime: currentTime
381
+    });
382
+  },
383
+  onShareAppMessage: function () {
384
+    return {
385
+      title: app.globalData.ShareTitle,
386
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
387
+      imageUrl: app.globalData.ShareImage,
388
+    }
389
+  },
390
+})

+ 4 - 0
pages/main/article.json

@@ -0,0 +1,4 @@
1
+{
2
+  "navigationBarTitleText": "短文",
3
+  "usingComponents": {}
4
+}

+ 123 - 0
pages/main/article.wxml

@@ -0,0 +1,123 @@
1
+<view class="{{ThemeCSS}} container FlexColumn" style='min-height:{{Containnerheight}}rpx;' bindtap="onContainerTap">
2
+  <view class="panel1 FlexColumn">
3
+    <rich-text class="textArticle" wx:if="{{!IsShowTranslate}}" nodes="{{Content.ArticleEnglishStr}}"></rich-text>
4
+    <view class="textArticle FlexColumn" wx:if="{{IsShowTranslate}}">
5
+      <view wx:for="{{Content.ArticleEnglish}}" wx:key="index" class="textArticle">
6
+        <rich-text class="textArticle" nodes="{{item}}"></rich-text>
7
+        <view class="textArticleTranslate">{{Content.ArticleChinese[index]}}</view>
8
+        <view class="panelLine" wx:if="{{index<Content.ArticleEnglish.length-1}}"></view>
9
+      </view>
10
+    </view>
11
+  </view>
12
+
13
+  <view wx:if="{{!IsShowQuestion}}" class="panelFooter FlexRow">
14
+    <view class="panelFooter1 FlexRow">
15
+      <view class="panelFooter11 panelFooter10 FlexColumn" bindtap="goto" data-url="">
16
+        <image src="../images/sysIcon_a07.png" class="sysIcon_a03"></image>
17
+        <view class="text02">PDF下载</view>
18
+      </view>
19
+      <view class="panelFooter12 panelFooter10 FlexColumn" bind:tap="showData" data-name="IsShowQuestion">
20
+        答题
21
+      </view>
22
+      <view class="panelFooter13 panelFooter10 FlexColumn" bind:tap="showData" data-name="IsShowSetting">
23
+        <image src="../images/sysIcon_a08.png" class="sysIcon_a03"></image>
24
+        <view class="text02">设置</view>
25
+      </view>
26
+    </view>
27
+  </view>
28
+
29
+  <!-- 看问题 -->
30
+  <view hidden="{{!IsShowQuestion}}" class="{{ThemeCSS}} panelAnswer FlexColumn">
31
+    <view class="text03">Reading Comprehension Questions</view>
32
+    <swiper class="panelAnswer1" style="height:{{swiperHeight}};" indicator-dots="true" current="{{CurrentQuestionIndex}}" bindchange="updateQuestionIndex" >
33
+      <swiper-item class="panelAnswer1Item" wx:for="{{Content.Question}}" wx:key="index" data-index="{{index}}">
34
+        <view class="panelAnswer1Item1 FlexColumn">
35
+          <view class="panelAnswer2 FlexRow">
36
+            <image src="../images/sysIcon_c0{{index+1}}.png" wx:if="{{ThemeCSS=='DarkColor'}}" class="sysIcon_c01"></image>
37
+            <image src="../images/sysIcon_d0{{index+1}}.png" wx:if="{{ThemeCSS=='LightColor'}}" class="sysIcon_c01"></image>
38
+            <view class="text04 FlexColumn">
39
+              <view class="text041">{{item.QuestionEnglish}}</view>
40
+              <view class="text042" wx:if="{{IsShowTranslate}}">{{item.QuestionChinese}}</view>
41
+            </view>
42
+            
43
+          </view>
44
+          <view class="panelAnswer3 FlexColumn" >
45
+            <view class="panelAnswer31 {{ item.AnswerNumber==indexChild && IsShowAnswer?'panelAnswer310':'' }} FlexRow" wx:for="{{item.OptionsEnglish}}" wx:key="indexChild" wx:for-item="itemChild" wx:for-index="indexChild" catch:tap="selectedAnswer" data-question="{{index}}" data-index="{{indexChild}}">
46
+              <view class="panelAnswer311 {{ item.AnswerNumber==indexChild && IsShowAnswer?'panelAnswer3110':'' }}" wx:if="{{indexChild!=item.UserAnswer}}"></view>
47
+              <view class="panelAnswer311 panelAnswer3110 FlexColumn" wx:if="{{indexChild==item.UserAnswer}}">
48
+                <image wx:if="{{ThemeCSS=='DarkColor'}}" src="../images/sysIcon_a10.png" class="sysIcon_a10"></image>
49
+                <image wx:if="{{ThemeCSS=='LightColor'}}" src="../images/sysIcon_a11.png" class="sysIcon_a10"></image>
50
+              </view>
51
+              <view class="text05 FlexColumn">
52
+              <view class="text051">{{itemChild}}</view>
53
+              <view class="text052" wx:if="{{IsShowTranslate}}">{{item.OptionsChinese[indexChild]}}</view>
54
+            </view>
55
+            </view>
56
+          </view>
57
+        </view>
58
+      </swiper-item>
59
+    </swiper>    
60
+    <view class="panelLine2"></view>
61
+    <view class="panelAnswer4 FlexRow">
62
+      <view class="btn1 FlexRow" catch:tap="showData" data-name="IsShowAnswer"><block wx:if="{{!IsShowAnswer}}">看答案</block><block wx:if="{{IsShowAnswer}}">关答案</block></view>
63
+      <view class="btn1  {{ CurrentQuestionIndex+1==Content.Question.length?'btn10':'' }} FlexRow" catch:tap="nextQuestion">下一题</view>
64
+    </view>
65
+    <view class="btnClose" capture-bind:tap="showData" data-name="IsShowQuestion">隐藏</view>
66
+  </view>
67
+
68
+  <!-- 设置 -->
69
+  <view wx:if="{{IsShowSetting}}" class="panelAnswer FlexColumn">
70
+    <view class="text03 text06">阅读设置</view>
71
+    <view class="btn2 FlexRow" catch:tap="showData" data-name="IsShowTranslate">
72
+      <image  wx:if="{{ThemeCSS=='DarkColor'}}" src="../images/sysIcon_b02.png" class="sysIcon_b02"></image>
73
+      <image  wx:if="{{ThemeCSS=='LightColor'}}" src="../images/sysIcon_b03.png" class="sysIcon_b02"></image>
74
+      <view>中英对照</view>
75
+    </view>
76
+    <view class="panelAnswer5 FlexColumn">
77
+      <view class="panelAnswer51 FlexRow">
78
+        <view class="text12">突出关键词</view>
79
+        <switch class="switchClass" bindchange="showData" checked="true" data-name="IsShowKeyword"/>
80
+      </view>
81
+      <view class="text13">用亮色强调用来生成短文的单词</view>
82
+    </view>
83
+    <view class="panelLine3"></view>
84
+    <view class="panelAnswer5 FlexColumn">
85
+      <view class="panelAnswer51 panelAnswer510 FlexRow">
86
+        <view class="text12">浅色方案</view>
87
+        <switch class="switchClass" bindchange="showData"  data-name="IsShowLightColor"/>
88
+      </view>
89
+    </view>
90
+    
91
+    <view class="btnClose btnClose2 FlexRow" capture-bind:tap="showData" data-name="IsShowSetting">
92
+      <image  wx:if="{{ThemeCSS=='DarkColor'}}" src="../images/sysIcon_a03.png" class="sysIcon_a03"></image>
93
+      <image  wx:if="{{ThemeCSS=='LightColor'}}" src="../images/sysIcon_a09.png" class="sysIcon_a03"></image>
94
+    </view>
95
+  </view>
96
+
97
+</view>
98
+
99
+
100
+
101
+<view wx:if="{{IsShowPanelHelp}}" class="panelHelp container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
102
+  <view class="panelHelp1">
103
+    <image src="../images/sysIcon_b07.png" class="sysIcon_b07"></image>
104
+    <view class="panelHelp2 FlexColumn">
105
+      <text class="text07">上面看短文\n下面做题目,右下角还有调节功能</text>
106
+      <view class="btn3 FlexColumn" bind:tap="closeHelp">知道了</view>
107
+    </view>
108
+  </view>
109
+</view>
110
+
111
+<view wx:if="{{IsBuilding}}" class="panelBuilding container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
112
+  <view class="panelBuilding1 FlexColumn">
113
+    <image src="../images/pic_03.png" class="pic_03"></image>
114
+    <view class="panelBuilding11 FlexColumn">
115
+      <text class="text08">生成中</text>
116
+      <text class="text09">还需要5……10秒左右\n感谢您耐心等待</text>
117
+    </view>
118
+    <view class="panelBuilding12 FlexColumn">
119
+      <text class="text10">Vocabulary:</text>
120
+      <text class="text11">{{Words}}</text>
121
+    </view>
122
+  </view>
123
+</view>

+ 542 - 0
pages/main/article.wxss

@@ -0,0 +1,542 @@
1
+.DarkColor{
2
+  background-color: #004433;
3
+  color:#C1E1C1;
4
+}
5
+.LightColor{
6
+  background-color: #D0ECD3;
7
+  color:#151815;
8
+}
9
+
10
+.panel1{
11
+  width:670rpx;
12
+  margin: 50rpx 0 250rpx 0;
13
+  justify-content: flex-start;
14
+  align-items: flex-start;
15
+}
16
+
17
+.textArticle{
18
+  width:670rpx;
19
+  font-size: 48rpx;
20
+  line-height: 90rpx;
21
+  font-weight: 400;
22
+}
23
+
24
+.textArticleTranslate{
25
+  font-weight: 400;
26
+  font-size: 28rpx;
27
+  width:100%;
28
+  margin: 20rpx 0 0 0;
29
+}
30
+
31
+.DarkColor .textArticleTranslate{
32
+  color: #A6FCA6;
33
+}
34
+.LightColor .textArticleTranslate{
35
+  color: #5A7D5A;
36
+}
37
+
38
+
39
+.panelLine{
40
+  width:100%;
41
+  height:8rpx;
42
+  margin: 20rpx 0;
43
+}
44
+.DarkColor .panelLine{
45
+  background: rgba(0,0,0,0.20);
46
+}
47
+.LightColor .panelLine{
48
+  background: rgba(255,255,255,0.60);
49
+}
50
+
51
+.DarkColor .highlight{
52
+  color: #FFDD88; 
53
+  font-weight: bold;
54
+}
55
+
56
+.LightColor .highlight{
57
+  color:#009933;
58
+  font-weight: bold;
59
+}
60
+
61
+
62
+.DarkColor .panelFooter{
63
+  width: 100%;
64
+  height:180rpx;
65
+  background-image: linear-gradient(180deg, #004433 0%, #002C21 100%);
66
+  position: fixed;
67
+  bottom: 0rpx;
68
+  align-items: flex-start;
69
+  z-index: 10;
70
+}
71
+
72
+.LightColor .panelFooter{
73
+  width: 100%;
74
+  height:180rpx;
75
+  background-color: #D0ECD3;
76
+  position: fixed;
77
+  bottom: 0rpx;
78
+  align-items: flex-start;
79
+  z-index: 10;
80
+}
81
+
82
+.panelFooter1{
83
+  width:730rpx;
84
+  height:140rpx;
85
+  color:#F2F2F2;
86
+  background: #1E1E1E;
87
+  box-shadow: 0 30rpx 0 0 #0C0C0C;
88
+  border-radius: 10rpx 10rpx 60rpx 60rpx;
89
+}
90
+.panelFooter10{
91
+  background-color: #303030;
92
+  font-size:24rpx;
93
+}
94
+.panelFooter11{
95
+  width:160rpx;
96
+  height:120rpx;
97
+  border-radius: 5rpx 10rpx 10rpx 50rpx;
98
+}
99
+.panelFooter12{
100
+  width:370rpx;
101
+  height:120rpx;
102
+  border-radius: 10rpx 10rpx 10rpx 10rpx;
103
+  margin: 0 10rpx;
104
+  font-size:36rpx;
105
+}
106
+.panelFooter13{
107
+  width:160rpx;
108
+  height:120rpx;
109
+  border-radius: 10rpx 5rpx 50rpx 10rpx;
110
+}
111
+.text02{
112
+  font-size:24rpx;
113
+  margin-top: 17rpx;
114
+}
115
+
116
+.sysIcon_a03{
117
+  width:20rpx;
118
+  height:20rpx;
119
+}
120
+
121
+
122
+.panelHelp{
123
+  background-color: rgba(0,0,0,0.00);
124
+  z-index: 20;
125
+  position: fixed;
126
+  top:0;
127
+}
128
+
129
+.panelHelp1{
130
+  width: 100%;
131
+  position: fixed;
132
+  bottom:902rpx;
133
+}
134
+
135
+.sysIcon_b07{
136
+  width:100%;
137
+  height: 697rpx;
138
+  position: absolute;
139
+}
140
+
141
+.panelHelp2{
142
+  position: absolute;
143
+  left:0;
144
+  right:0;
145
+  top:180rpx;
146
+}
147
+
148
+.text07{
149
+  font-size: 36rpx;
150
+  color: #2E2E2E;
151
+  text-align: center;
152
+  width:550rpx;
153
+}
154
+.btn3{
155
+  width:310rpx;
156
+  height:90rpx;
157
+  background: #303030;
158
+  border-radius: 20rpx;
159
+  color:#F2F2F2;
160
+  margin-top: 50rpx;
161
+}
162
+
163
+.panelBuilding{
164
+  background-image: linear-gradient(180deg, rgba(0,68,51,0.70) 0%, rgba(0,20,15,0.90) 100%);
165
+  z-index: 20;
166
+  position: fixed;
167
+  top:0;
168
+}
169
+
170
+.panelBuilding1{
171
+  width: 100%;
172
+  position: fixed;
173
+  top:145rpx;
174
+}
175
+
176
+.pic_03{
177
+  width:100%;
178
+  height:880rpx;
179
+  position: absolute;
180
+  top:0;
181
+}
182
+
183
+.panelBuilding11{
184
+  position: absolute;
185
+  top: 190rpx;
186
+  color: #2E2E2E;
187
+}
188
+
189
+.text08{
190
+  font-size: 48rpx;
191
+}
192
+.text09{
193
+  font-size: 28rpx;
194
+  text-align: center;
195
+  margin-top: 20rpx;
196
+}
197
+
198
+.panelBuilding12{
199
+  position: absolute;
200
+  top: 610rpx;
201
+  color: #FDAD94;
202
+}
203
+
204
+.text10{
205
+  font-size: 24rpx;
206
+  text-align: center;
207
+}
208
+.text11{
209
+  font-size: 28rpx;
210
+  text-align: center;
211
+  margin-top: 10rpx;
212
+  font-weight: 400;
213
+  width: 580rpx;
214
+}
215
+
216
+.panelAnswer{
217
+  width:100%;
218
+  position: fixed;
219
+  bottom:0;
220
+  z-index: 10;
221
+  border-radius: 60rpx 60rpx 0 0;
222
+  justify-content: flex-start;
223
+}
224
+
225
+.DarkColor .panelAnswer{
226
+  background: #1E1E1E;
227
+  color: #C1E1C1;
228
+}
229
+
230
+.LightColor .panelAnswer{
231
+  background: #FFFFFF;
232
+  color: #2E2E2E;
233
+}
234
+
235
+.text03{
236
+  font-size: 28rpx;
237
+  align-self: start;
238
+  margin: 50rpx 0 0 40rpx;
239
+}
240
+
241
+.DarkColor .text03{
242
+  background: #1E1E1E;
243
+  color: #C1E1C1;
244
+}
245
+
246
+.LightColor .text03{
247
+  background: #FFFFFF;
248
+  color: #2E2E2E;
249
+}
250
+
251
+.btnClose{
252
+  width: 88rpx;
253
+  line-height:60rpx;
254
+  border-radius: 20rpx;
255
+  font-size:24rpx;
256
+  text-align: center;
257
+  position: absolute;
258
+  top:40rpx;
259
+  right:40rpx;
260
+}
261
+
262
+.DarkColor .btnClose{
263
+  background: #303030;
264
+  color:#F2F2F2;
265
+}
266
+
267
+.LightColor .btnClose{
268
+  background: #F0F0F0;
269
+  color:#2E2E2E;
270
+}
271
+
272
+.btnClose2{
273
+  width: 60rpx;
274
+  height:60rpx;
275
+  border-radius: 50%;
276
+  top:40rpx;
277
+  right:40rpx;
278
+}
279
+
280
+
281
+.panelAnswer1{
282
+  width: 100%;
283
+  min-height: 526rpx;
284
+}
285
+
286
+.DarkColor .panelAnswer1{
287
+  background-color: #1e1e1e;
288
+  /* background-image: linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.30) 100%); */
289
+}
290
+.LightColor .panelAnswer1{
291
+  background-color: #FFFFFF;
292
+}
293
+.panelAnswer1Item{
294
+  margin-top: 20rpx;
295
+  width: 750rpx;
296
+}
297
+.DarkColor .panelAnswer1Item1{
298
+  background-color: #1e1e1e;
299
+}
300
+.LightColor .panelAnswer1Item1{
301
+  background-color: #fff;
302
+}
303
+.panelAnswer2{
304
+  width:100%;
305
+  margin: 30rpx 0 0 0;
306
+  align-items: flex-start;
307
+}
308
+.sysIcon_c01{
309
+  width: 40rpx;
310
+  height:40rpx;
311
+  margin: 10rpx 30rpx 0 0;
312
+}
313
+
314
+.text04{
315
+  width: 600rpx;
316
+  word-wrap: break-word;
317
+  white-space: normal;
318
+}
319
+.text041{
320
+  width:100%;
321
+  font-size: 48rpx;
322
+  word-wrap: break-word;
323
+  white-space: normal;
324
+}
325
+.text042{
326
+  width:100%;
327
+  font-weight: 400;
328
+  font-size: 28rpx;
329
+  margin:10rpx 0 0 0;
330
+}
331
+
332
+.panelAnswer3{
333
+  width:100%;
334
+  margin-top: 40rpx;
335
+}
336
+.panelAnswer31{
337
+  width:100%;
338
+  justify-content: flex-start;
339
+}
340
+
341
+.DarkColor .panelAnswer31{
342
+  background: #1e1e1e;
343
+}
344
+.LightColor .panelAnswer31{
345
+  background: #fff;
346
+  color: #2E2E2E;
347
+}
348
+
349
+.DarkColor .panelAnswer310{
350
+  background: #C1E1C1;
351
+  color: #004433;
352
+}
353
+.LightColor .panelAnswer310{
354
+  background: #009933;
355
+  color: #FFFFFF;
356
+}
357
+
358
+.panelAnswer311{
359
+  border-radius: 50%;
360
+  width:40rpx;
361
+  height:40rpx;
362
+  margin: 0 30rpx 0 40rpx;
363
+}
364
+
365
+
366
+.DarkColor .panelAnswer311{
367
+  background: #303030;
368
+  border: 3rpx solid #4D4D4D;
369
+}
370
+.LightColor .panelAnswer311{
371
+  background: #F8F8F8;
372
+  border: 3rpx solid #D2D2D2;
373
+}
374
+
375
+.DarkColor .panelAnswer3110{
376
+  background: #C1E1C1;
377
+  border: 3rpx solid #C1E1C1;
378
+}
379
+.LightColor .panelAnswer3110{
380
+  background: #009933;
381
+  border: 3rpx solid #009933;
382
+}
383
+
384
+.sysIcon_a10{
385
+  width:20rpx;
386
+  height:16rpx;
387
+}
388
+
389
+.text05{
390
+  width: 600rpx;
391
+  margin: 20rpx 0;
392
+}
393
+.text051{
394
+  width:100%;
395
+  font-weight: 400;
396
+  font-size: 36rpx;
397
+}
398
+.text052{
399
+  width:100%;
400
+  font-weight: 400;
401
+  font-size: 28rpx;
402
+  margin:10rpx 0 0 0;
403
+}
404
+
405
+.DarkColor .panelLine2{
406
+  width:100%;
407
+  height:10rpx;
408
+  background-image: linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.30) 100%);
409
+}
410
+.LightColor .panelLine2{
411
+  width:100%;
412
+  height:10rpx;
413
+  background-image: linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.10) 100%);
414
+}
415
+
416
+.panelAnswer4{
417
+  width:100%;
418
+}
419
+
420
+.btn1{
421
+  border-radius: 20rpx;
422
+  width:310rpx;
423
+  height:90rpx;
424
+  margin:60rpx 15rpx;
425
+  font-size: 36rpx;
426
+}
427
+
428
+
429
+.DarkColor .btn1{
430
+  background: #303030;
431
+}
432
+.LightColor .btn1{
433
+  background: #F0F0F0;
434
+}
435
+
436
+.btn10{
437
+  color: #1E1E1E;
438
+}
439
+
440
+.text06{
441
+  font-size: 28rpx;
442
+  color: #F2F2F2;
443
+}
444
+
445
+.btn2{
446
+  width:670rpx;
447
+  height:90rpx;
448
+  border-radius: 20rpx;
449
+  margin: 70rpx 0 40rpx 0;
450
+}
451
+
452
+.DarkColor .btn2{
453
+  background: #303030;
454
+  color:#F2F2F2;
455
+}
456
+
457
+.LightColor .btn2{
458
+  background: #F0F0F0;
459
+  color:#2E2E2E;
460
+}
461
+
462
+.sysIcon_b02{
463
+  width:38rpx;
464
+  height:28rpx;
465
+  margin-right: 20rpx;
466
+}
467
+
468
+.panelAnswer5{
469
+  width:100%;
470
+}
471
+.panelAnswer51{
472
+  width:100%;
473
+  justify-content: space-between;
474
+  margin: 40rpx 0;
475
+}
476
+.text12{
477
+  margin-left: 40rpx;
478
+  font-size: 28rpx;
479
+}
480
+
481
+.DarkColor .text12{
482
+  color:#F2F2F2;
483
+}
484
+
485
+.LightColor .text12{
486
+  color:#2E2E2E;
487
+}
488
+
489
+.text13{
490
+  width: 670rpx;
491
+  font-size: 24rpx;
492
+  margin-bottom: 30rpx;
493
+}
494
+
495
+.DarkColor .text13{
496
+  color: #E3E3E3;
497
+}
498
+
499
+.LightColor .text13{
500
+  color:#787878;
501
+}
502
+.panelLine3{
503
+  width:670rpx;
504
+  height:1rpx;
505
+  background-color: #787878;
506
+}
507
+.panelAnswer510{
508
+  margin-bottom: 100rpx;
509
+}
510
+.switchClass{
511
+  margin-right: 40rpx;
512
+}
513
+
514
+.wx-swiper-dot {
515
+  width: 14rpx !important;
516
+  height: 14rpx !important;
517
+  margin-left: 5rpx !important;
518
+  margin-right: 5rpx !important;
519
+}
520
+
521
+
522
+.DarkColor .wx-swiper-dot {
523
+  background-color: #4d4d4d !important;
524
+}
525
+
526
+.LightColor .wx-swiper-dot {
527
+  background-color: #D2D2D2 !important;
528
+}
529
+
530
+.DarkColor .wx-swiper-dot-active {
531
+  background-color: #C1E1C1 !important;
532
+}
533
+.LightColor .wx-swiper-dot-active {
534
+  background-color: #787878 !important;
535
+}
536
+
537
+/* 自定义swiper指示点位置 */
538
+.wx-swiper-dots {
539
+  position: absolute;
540
+  right: -20rpx !important;
541
+  left: unset !important;
542
+}

+ 30 - 0
pages/main/index.js

@@ -0,0 +1,30 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+
4
+const app = getApp();
5
+
6
+Page({
7
+  data: {
8
+  },
9
+  onLoad: function (options) {
10
+    var that = this;
11
+    that.setData({
12
+      Containnerheight: main.getWindowHeight(),
13
+      Version:app.globalData.Version,
14
+    });
15
+  },
16
+  goto: function (e) {
17
+    let that=this;
18
+    var url=e.currentTarget.dataset.url;
19
+    wx.navigateTo({
20
+      url: url,
21
+    });
22
+  },
23
+  onShareAppMessage: function () {
24
+    return {
25
+      title: app.globalData.ShareTitle,
26
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
27
+      imageUrl: app.globalData.ShareImage,
28
+    }
29
+  },
30
+})

+ 3 - 0
pages/main/index.json

@@ -0,0 +1,3 @@
1
+{
2
+  "usingComponents": {}
3
+}

+ 32 - 0
pages/main/index.wxml

@@ -0,0 +1,32 @@
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
+  <view class="panelTop FlexColumn">
3
+    <view class="panel1 FlexColumn">
4
+      <image src="../images/pic_01.png" class="pic_01"></image>
5
+    </view>
6
+
7
+    <view class="panel2 FlexColumn">
8
+      <view class="btn01 FlexColumn" bind:tap="goto" data-url="wordsinput">
9
+        <view>制作</view>
10
+      </view>
11
+      <view class="btn02 FlexColumn">
12
+        <view>我的文库</view>
13
+      </view>
14
+    </view>
15
+
16
+    <view class="panel3 FlexColumn">
17
+      <view class="panel31 FlexRow">
18
+        <image src="../images/sysIcon_a01.png" class="sysIcon_a01"></image>
19
+        <view>提升用AI生成短文质量的技巧</view>
20
+      </view>
21
+      <view class="panelLine"></view>
22
+      <view class="panel31 FlexRow">
23
+        <view class="text04">纠错与建议</view>
24
+        <image src="../images/sysIcon_a02.png" class="sysIcon_a02"></image>
25
+      </view>
26
+    </view>
27
+  </view>
28
+  <view class="panelFooter FlexColumn">
29
+    <image src="../images/pic_02.png" class="pic_02"></image>
30
+    <view class="text03">©2025 秒过语境背单词 {{Version}}</view>
31
+  </view>
32
+</view>

+ 94 - 0
pages/main/index.wxss

@@ -0,0 +1,94 @@
1
+.panelTop{
2
+  width:100%;
3
+  position: fixed;
4
+  top:0;
5
+  z-index: 10;
6
+}
7
+
8
+.panel1{
9
+  position: relative;
10
+  margin-top: 80rpx;
11
+  color: #C1E1C1;
12
+  width: 600rpx;
13
+  align-items: flex-start;
14
+  align-self: start;
15
+}
16
+.pic_01{
17
+  width:431rpx;
18
+  height:351rpx;
19
+  margin:0 0 0 100rpx;
20
+}
21
+.panel2{
22
+  margin: 87rpx 0 0 0;
23
+  width: 100%;
24
+}
25
+
26
+.btn01{
27
+  width: 590rpx;
28
+  height:100rpx;
29
+  background: #CA4B15;
30
+  box-shadow: 0 20rpx 0 0 #702F14, 0 40rpx 0 0 rgba(0,0,0,0.30);
31
+  border-radius: 30rpx;
32
+  font-size: 48rpx;
33
+}
34
+
35
+.btn02{
36
+  width: 590rpx;
37
+  height:100rpx;
38
+  margin: 80rpx 0 40rpx 0;
39
+  background: #004433;
40
+  border: 5rpx solid #C1E1C1;
41
+  border-radius: 30rpx;
42
+  font-size: 36rpx;
43
+  color: #C1E1C1;
44
+}
45
+
46
+.panel3{
47
+  width:360rpx;
48
+  align-self: start;
49
+  margin-left: 120rpx;
50
+  font-size: 24rpx;
51
+  color: #C1E1C1;
52
+}
53
+
54
+.panel31{
55
+  width:100%;
56
+  height:93rpx;
57
+  justify-content: flex-start;
58
+}
59
+.sysIcon_a01{
60
+  width:24rpx;
61
+  height:24rpx;
62
+  margin: 0 10rpx 0 0;
63
+}
64
+
65
+.panelLine{
66
+  width: 360rpx;
67
+  height: 1rpx;
68
+  background-color: #C1E1C1;
69
+}
70
+
71
+.sysIcon_a02{
72
+  width:10rpx;
73
+  height:18rpx;
74
+  margin: 0 0 0 10rpx;
75
+}
76
+
77
+.panelFooter{
78
+  width:100%;
79
+  position: fixed;
80
+  bottom: 0;
81
+}
82
+
83
+.pic_02{
84
+  width:100%;
85
+  height:340rpx;
86
+}
87
+
88
+.text03{
89
+  position: absolute;
90
+  bottom:30rpx;
91
+  left:50rpx;
92
+  font-size: 20rpx;
93
+  color: #544641;
94
+}

+ 232 - 0
pages/main/ocr.js

@@ -0,0 +1,232 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+
4
+const app = getApp();
5
+
6
+Page({
7
+  data: {
8
+    Menu:[],
9
+  },
10
+  onLoad: function (options) {
11
+  },
12
+  onShow:function(){
13
+    var that = this;
14
+    that.setData({
15
+      Menu:[{Name:"相册",CSS:"",Fun:"chooseImage"},{Name:"拍照",CSS:"Selected",Fun:"retake"}]
16
+    });
17
+  },
18
+  retake() {
19
+    this.data.Menu[0].CSS="";
20
+    this.data.Menu[1].CSS="Selected";
21
+    this.setData({
22
+      Menu:this.data.Menu,
23
+    });
24
+  },
25
+  // 拍照识别
26
+  takePhoto() {
27
+    const ctx = wx.createCameraContext();
28
+    ctx.takePhoto({
29
+      quality: 'high',
30
+      success: (res) => {
31
+        this.setData({
32
+          imageUrl: res.tempImagePath,
33
+          cameraActive: false,
34
+          showCanvas: true
35
+        })
36
+        this.performOCR(res.tempImagePath)
37
+      },
38
+      fail: (err) => {
39
+        console.error('拍照失败:', err)
40
+        wx.showToast({
41
+          title: '拍照失败,请重试',
42
+          icon: 'none'
43
+        })
44
+      }
45
+    })
46
+  },
47
+  chooseImage() {
48
+    this.data.Menu[0].CSS="Selected";
49
+    this.data.Menu[1].CSS="";
50
+    this.setData({
51
+      Menu:this.data.Menu,
52
+    });
53
+
54
+    wx.chooseMedia({
55
+      count: 1,
56
+      mediaType: ['image'],
57
+      sourceType: ['album'],
58
+      success: (res) => {
59
+        const tempFilePath = res.tempFiles[0].tempFilePath
60
+        this.setData({
61
+          imageUrl: tempFilePath,
62
+          cameraActive: false,
63
+          showCanvas: true
64
+        })
65
+        this.performOCR(tempFilePath)
66
+      },
67
+      fail: (err) => {
68
+        console.error('选择图片失败:', err)
69
+        wx.showToast({
70
+          title: '选择图片失败',
71
+          icon: 'none'
72
+        })
73
+      }
74
+    })
75
+  },
76
+  // 加强版的OCR识别方法
77
+  async performOCR(imagePath) {
78
+    if (!imagePath) {
79
+      console.error('图片路径无效')
80
+    }
81
+
82
+    wx.showLoading({ title: '识别中...', mask: true })
83
+
84
+    try {
85
+      // 1. 压缩图片
86
+      const compressed = await new Promise((resolve, reject) => {
87
+        wx.compressImage({
88
+          src: imagePath,
89
+          quality: 70,
90
+          success: resolve,
91
+          fail: () => resolve({ tempFilePath: imagePath })
92
+        })
93
+      })
94
+      //console.log("1");
95
+      // 2. 转换为base64
96
+      const fileRes = await new Promise((resolve, reject) => {
97
+        wx.getFileSystemManager().readFile({
98
+          filePath: compressed.tempFilePath,
99
+          encoding: 'base64',
100
+          success: resolve,
101
+          fail: reject
102
+        })
103
+      })
104
+      //console.log("2");
105
+      // 3. 调用云函数(添加超时处理)
106
+      let postData={ ImageBase64: `data:image/jpeg;base64,${fileRes.data}` };
107
+      
108
+      let url = common.Encrypt("OCRImageData");
109
+      url=app.globalData.serverUrl+url;
110
+      //console.log("url:"+url);
111
+      const cloudRes = await new Promise((resolve, reject) => {
112
+        wx.request({
113
+          url: url,
114
+          method: "POST",
115
+          data: postData,
116
+          success: resolve,
117
+          fail: reject,
118
+        })
119
+      });
120
+      //console.log("3");
121
+
122
+      // 4. 验证返回结果
123
+      if (!cloudRes || !cloudRes.data.result) {
124
+        throw new Error('无效的响应格式')
125
+      }
126
+      //console.log("4");
127
+      if (!cloudRes.data.result) {
128
+        throw new Error(cloudRes.data.result.message || '识别服务返回空数据')
129
+      }
130
+
131
+      // 5. 处理识别结果
132
+      const texts = cloudRes.data.result.TextDetections.map(item => ({
133
+        text: item.DetectedText || '未识别到文字',
134
+        pos: this.convertPosition(item.ItemPolygon || { Points: [] })
135
+      })).filter(item => item.DetectedText !== '未识别到文字')
136
+
137
+      //console.log("5");
138
+
139
+      if (texts.length === 0) {
140
+        throw new Error('未识别到有效文字')
141
+      }
142
+
143
+      // 6.提取英文单词
144
+      const engTexts=this.extractEnglishWords(texts);
145
+
146
+      let arr=[];
147
+      for(var i=0;i<engTexts.length;i++){
148
+        let obj={};
149
+        obj.Word=engTexts[i];
150
+        obj.Selected=0;
151
+        arr.push(obj);
152
+      }
153
+
154
+      app.globalData.OCRWords=engTexts;
155
+      wx.navigateTo({
156
+        url: "./selectword",
157
+      });
158
+
159
+    } catch (err) {
160
+      console.error('OCR处理失败:', err)
161
+      wx.showToast({
162
+        title: err.message || '识别失败',
163
+        icon: 'none',
164
+        duration: 3000
165
+      })
166
+    } finally {
167
+      wx.hideLoading()
168
+    }
169
+  },
170
+
171
+  // 加强坐标转换
172
+  convertPosition(polygon) {
173
+    try {
174
+      const points = polygon.Points || []
175
+      if (points.length === 0) {
176
+        return { x: 50, y: 50, width: 200, height: 30 }
177
+      }
178
+
179
+      const xs = points.map(p => p.X || 0)
180
+      const ys = points.map(p => p.Y || 0)
181
+      return {
182
+        x: Math.min(...xs),
183
+        y: Math.min(...ys),
184
+        width: Math.max(...xs) - Math.min(...xs),
185
+        height: Math.max(...ys) - Math.min(...ys)
186
+      }
187
+    } catch (e) {
188
+      return { x: 50, y: 50, width: 200, height: 30 }
189
+    }
190
+  },
191
+
192
+  // 提取英语单词的函数 - 增强版
193
+  extractEnglishWords(texts) {
194
+    console.group('英语单词提取');
195
+    const words = new Set();
196
+    
197
+    texts.forEach(item => {
198
+      const text = item.text;
199
+      console.log('处理文本:', text);
200
+      
201
+      // 改进的正则表达式,能更好处理中英文混合文本
202
+      const wordRegex = /(?:^|\s|[\u4e00-\u9fa5])([A-Za-z]{2,}(?:['’-][A-Za-z]+)*)(?=$|\s|[\u4e00-\u9fa5])/g;
203
+      
204
+      let match;
205
+      while ((match = wordRegex.exec(text)) !== null) {
206
+        const word = match[1];
207
+        console.log('匹配到单词:', word);
208
+        
209
+        // 验证单词有效性
210
+        if (/^[A-Za-z'’-]+$/.test(word)) {
211
+          const lowerWord = word.toLowerCase();
212
+          words.add(lowerWord);
213
+          console.log('添加单词:', lowerWord);
214
+        }
215
+      }
216
+    });
217
+    
218
+    //const result = Array.from(words).sort();
219
+    const result=Array.from(words);
220
+    console.log('提取结果:', result);
221
+    console.groupEnd();
222
+    return result;
223
+  },
224
+
225
+  onShareAppMessage: function () {
226
+    return {
227
+      title: app.globalData.ShareTitle,
228
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
229
+      imageUrl: app.globalData.ShareImage,
230
+    }
231
+  },
232
+})

+ 4 - 0
pages/main/ocr.json

@@ -0,0 +1,4 @@
1
+{
2
+  "navigationBarTitleText": "拍照",
3
+  "usingComponents": {}
4
+}

+ 14 - 0
pages/main/ocr.wxml

@@ -0,0 +1,14 @@
1
+<view class="container FlexColumn">
2
+  <view class="camera-container">
3
+    <camera device-position="back" flash="auto" class="camera"></camera>
4
+    <view class="btnCamera FlexColumn" bindtap="takePhoto">
5
+      <image src="../images/sysIcon_b05.png" class="sysIcon_b05"></image>
6
+    </view>
7
+  </view>
8
+  <view class="panelFooter FlexRow">
9
+    <view class="btn btn{{item.CSS}} FlexColumn" bindtap="{{item.Fun}}" wx:for="{{Menu}}" wx:key="index">
10
+      <view>{{item.Name}}</view>
11
+      <view class="panelLine panelLine{{item.CSS}}"></view>
12
+    </view>
13
+  </view>
14
+</view>

+ 57 - 0
pages/main/ocr.wxss

@@ -0,0 +1,57 @@
1
+
2
+.container {
3
+  height: 100vh;
4
+}
5
+
6
+.camera-container {
7
+  width: 100%;
8
+  height: 100%;
9
+  position: relative;
10
+}
11
+
12
+.camera {
13
+  width: 100%;
14
+  height: 100%;
15
+}
16
+
17
+.btnCamera{
18
+  width: 220rpx;
19
+  height: 220rpx;
20
+  position: fixed;
21
+  left:265rpx;
22
+  right:265rpx;
23
+  bottom: 180rpx;
24
+  z-index: 20;
25
+}
26
+.sysIcon_b05{
27
+  width: 220rpx;
28
+  height: 220rpx;
29
+}
30
+.panelFooter{
31
+  width: 100%;
32
+  position: fixed;
33
+  bottom: 0;
34
+  background: #004433;
35
+  z-index: 10;
36
+}
37
+
38
+.btn{
39
+  width: 50%;
40
+  height:120rpx;
41
+  font-size: 36rpx;
42
+  color: #C1E1C1;
43
+  justify-content: flex-end;
44
+}
45
+.btnSelected{
46
+  color: #FFDD88;
47
+}
48
+.panelLine{
49
+  width: 72rpx;
50
+  height: 14rpx;
51
+  margin-top: 21rpx;
52
+}
53
+.panelLineSelected{
54
+  width: 72rpx;
55
+  height: 14rpx;
56
+  background-color: #FFDD88;
57
+}

+ 60 - 0
pages/main/paste.js

@@ -0,0 +1,60 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+
4
+const COUNT_MAX=10;
5
+const app = getApp();
6
+
7
+Page({
8
+  data: {
9
+    Words:"",
10
+  },
11
+  onLoad: function (options) {
12
+    let that = this;
13
+    let words=app.globalData.SelectedWords.join("\n");
14
+    that.setData({
15
+      Containnerheight: main.getWindowHeight(),
16
+      Words:words, 
17
+    });
18
+    that.handlePaste();
19
+  },
20
+  handlePaste: function(e) {
21
+    let that = this;
22
+    // 获取剪贴板内容
23
+    wx.getClipboardData({
24
+      success: function(res) {
25
+        // res.data 包含剪贴板的内容
26
+        let pasteData = res.data;
27
+        
28
+        // 这里可以处理粘贴的数据,比如按空格分割成单词
29
+        let words = pasteData.split(/[\r\n]+/);  // 按空格分割
30
+        
31
+        // 过滤掉空字符串和非单词内容
32
+        words = common.filterWordsWithSpecialChars(words);
33
+        //debugger;
34
+        let str="";
35
+        if (that.data.Words)
36
+          str+=that.data.Words+"\n";
37
+        str+=words.join("\n");
38
+        that.setData({
39
+          Words: str,
40
+        });
41
+      },
42
+      fail: function(err) {
43
+        console.error('获取剪贴板失败', err);
44
+      }
45
+    });
46
+  },
47
+  submit:function(){
48
+    app.globalData.SelectedWords=this.data.Words.split("\n");
49
+    wx.navigateBack({
50
+      delta: 1
51
+    });
52
+  },
53
+  onShareAppMessage: function () {
54
+    return {
55
+      title: app.globalData.ShareTitle,
56
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
57
+      imageUrl: app.globalData.ShareImage,
58
+    }
59
+  },
60
+})

+ 4 - 0
pages/main/paste.json

@@ -0,0 +1,4 @@
1
+{
2
+  "navigationBarTitleText": "粘贴",
3
+  "usingComponents": {}
4
+}

+ 24 - 0
pages/main/paste.wxml

@@ -0,0 +1,24 @@
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
+  <view class="panel1 FlexRow">
3
+    <view class="text01">1行1个单词或词组</view>
4
+    <view class="panel11 FlexRow">
5
+      <image src="../images/sysIcon_a01.png" class="sysIcon_a01"></image>
6
+      <view>范例</view>
7
+    </view>
8
+  </view>
9
+
10
+  <view class="panel2 FlexRow">
11
+    <view class="panel21 FlexRow">
12
+      <view class="panel211 FlexColumn">
13
+        <view class="text03" wx:for="{{[1,2,3,4,5,6,7,8,9,10]}}" wx:key="index">{{item}}</view>
14
+      </view>
15
+      <textarea class="text04" focus="true" value="{{Words}}" />
16
+    </view>
17
+  </view>
18
+
19
+  <view class="panelFooter FlexRow">
20
+    <view class="panelFooter1 FlexRow">
21
+      <view class="panelFooter13 panelFooter10 FlexColumn" bind:tap="submit">确定</view>
22
+    </view>
23
+  </view>
24
+</view>

+ 95 - 0
pages/main/paste.wxss

@@ -0,0 +1,95 @@
1
+
2
+.panel1{
3
+  width:100%;
4
+  height:140rpx;
5
+  color: #C1E1C1;
6
+  justify-content: space-between;
7
+  position: relative;
8
+}
9
+
10
+.text01{
11
+  font-size: 36rpx;
12
+  margin-left: 70rpx;
13
+}
14
+
15
+.panel11{
16
+  margin-right: 70rpx;
17
+  font-size:24rpx;
18
+}
19
+.sysIcon_a01{
20
+  width:24rpx;
21
+  height:24rpx;
22
+  margin-right: 10rpx;
23
+}
24
+
25
+
26
+.panel2{
27
+  width:690rpx;
28
+  min-height:150rpx;
29
+  background: #002F24;
30
+  box-shadow: 0 10rpx 0 0 rgba(0,0,0,0.50);
31
+  border-radius: 40rpx;
32
+  justify-content: flex-start;
33
+}
34
+
35
+.panel21{
36
+  width: 630rpx;
37
+  margin: 30rpx;
38
+  font-size: 36rpx;
39
+  border-radius: 20rpx;
40
+  background-color: #004433;
41
+  justify-content: flex-start;
42
+}
43
+.panel211{
44
+  margin: 25rpx 30rpx 15rpx 0;
45
+  align-items: flex-start;
46
+}
47
+.text03{
48
+  width: 30rpx;
49
+  margin-bottom: 10rpx;
50
+  font-size: 28rpx;
51
+  color: #728173;
52
+  margin-left: 30rpx;
53
+}
54
+.text04{
55
+  width:510rpx;
56
+  height:500rpx;
57
+  font-size: 36rpx;
58
+  color: #FFDD88;
59
+  line-height: 49rpx;
60
+}
61
+
62
+.panelFooter{
63
+  width: 100%;
64
+  height:180rpx;
65
+  background-image: linear-gradient(180deg, #004433 0%, #002C21 100%);
66
+  position: fixed;
67
+  bottom: 0rpx;
68
+  align-items: flex-start;
69
+  z-index: 10;
70
+}
71
+
72
+.panelFooter1{
73
+  width:730rpx;
74
+  height:140rpx;
75
+  color:#F2F2F2;
76
+  background: #1E1E1E;
77
+  box-shadow: 0 30rpx 0 0 #0C0C0C;
78
+  border-radius: 10rpx 10rpx 60rpx 60rpx;
79
+}
80
+
81
+.panelFooter10{
82
+  background-color: #303030;
83
+  font-size:24rpx;
84
+}
85
+
86
+.panelFooter13{
87
+  width:710rpx;
88
+  height:120rpx;
89
+  border-radius: 5rpx 5rpx 50rpx 50rpx;
90
+  font-size:36rpx;
91
+}
92
+.text02{
93
+  font-size:24rpx;
94
+  margin-top: 17rpx;
95
+}

+ 98 - 0
pages/main/selectword.js

@@ -0,0 +1,98 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+
4
+const COUNT_MAX=10;
5
+const app = getApp();
6
+
7
+Page({
8
+  data: {
9
+    IsShowAlert:false,
10
+    Count:0,
11
+    CountMax:COUNT_MAX,
12
+    Words:[],
13
+  },
14
+  onLoad: function (options) {
15
+    var that = this;
16
+    let words=app.globalData.OCRWords;
17
+    that.data.Words=[];
18
+    for(let i=0;i<words.length;i++){
19
+      let obj={};
20
+      obj.Name=words[i];
21
+      obj.CSS="";
22
+      that.data.Words.push(obj);
23
+    }
24
+    let list=app.globalData.SelectedWords;
25
+    that.setData({
26
+      Containnerheight: main.getWindowHeight(),
27
+      Words:that.data.Words,
28
+      CountMax:COUNT_MAX-list.length,
29
+    });
30
+  },
31
+  selectWord:function(e){
32
+    let word=e.currentTarget.dataset.word;
33
+    let list=this.data.Words;
34
+    let count=0;
35
+    for(let i=0;i<list.length;i++){
36
+        if(word==list[i].Name){
37
+          if (list[i].CSS)
38
+            list[i].CSS="";
39
+          else if(count<this.data.CountMax && this.data.Count<this.data.CountMax)
40
+            list[i].CSS="Selected";
41
+        }
42
+        if(list[i].CSS=="Selected"){
43
+          count++;
44
+        }
45
+    }
46
+    if (count>0){
47
+      this.setData({
48
+        IsShowAlert:false,
49
+      });
50
+    }
51
+    else{
52
+      this.setData({
53
+        IsShowAlert:true,
54
+      });
55
+    }
56
+    this.setData({
57
+      Words:list,
58
+      Count:count,
59
+    });
60
+  },
61
+  goto: function (e) {
62
+    let that=this;
63
+    var url=e.currentTarget.dataset.url;
64
+    wx.navigateTo({
65
+      url: url,
66
+    });
67
+  },
68
+  close:function(n){
69
+    if (!n)
70
+      n=1;
71
+    wx.navigateBack({
72
+      delta: n
73
+    })
74
+  },
75
+  submit:function(){
76
+    if (this.data.Count==0){
77
+      this.setData({
78
+        IsShowAlert:true,
79
+      });
80
+    }
81
+    else{
82
+      let list=this.data.Words;
83
+      for(let i=0;i<list.length;i++){
84
+        if(list[i].CSS=="Selected"){
85
+          app.globalData.SelectedWords.push(list[i].Name);
86
+        }
87
+      }
88
+      this.close(2);
89
+    }
90
+  },
91
+  onShareAppMessage: function () {
92
+    return {
93
+      title: app.globalData.ShareTitle,
94
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
95
+      imageUrl: app.globalData.ShareImage,
96
+    }
97
+  },
98
+})

+ 4 - 0
pages/main/selectword.json

@@ -0,0 +1,4 @@
1
+{
2
+  "navigationBarTitleText": "选单词",
3
+  "usingComponents": {}
4
+}

+ 51 - 0
pages/main/selectword.wxml

@@ -0,0 +1,51 @@
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
+  <block wx:if="{{Words.length>0}}">
3
+    <view class="panel1 FlexRow">
4
+      <view class="text01">挑选单词1-{{CountMax}}个</view>
5
+      <view class="panel11 FlexRow">
6
+        <image src="../images/sysIcon_a01.png" class="sysIcon_a01"></image>
7
+        <view>提升识别</view>
8
+      </view>
9
+    </view>
10
+    <view class="panel10 FlexRow" wx:if="{{IsShowAlert}}">
11
+      <view class="panel101 FlexRow">
12
+        <image src="../images/sysIcon_a03.png" class="sysIcon_a03"></image>
13
+        <view class="text03">请至少选择1个单词</view>
14
+      </view>
15
+    </view>
16
+
17
+    <view class="panel2 FlexRow">
18
+      <view class="panel21 FlexRow">
19
+        <view class="btn btn{{item.CSS}} FlexRow" wx:for="{{Words}}" wx:key="index" bind:tap="selectWord" data-word="{{item.Name}}">{{item.Name}}</view>
20
+      </view>
21
+    </view>
22
+  </block>
23
+
24
+  <block wx:if="{{Words.length==0}}">
25
+    <view class="panelNull FlexColumn">
26
+      <image src="../images/pic_05.png" class="pic_05"></image>
27
+      <view class="text05">未识别到单词</view>
28
+      <view class="text06">请拍摄含有英语单词、句子的画面</view>
29
+      <view class="panelNull1 FlexRow">
30
+        <image src="../images/sysIcon_a01.png" class="sysIcon_a01"></image>
31
+        <view>提升识别质量</view>
32
+      </view>
33
+    </view>
34
+    <image src="../images/pic_06.png" class="pic_06"></image>
35
+  </block>
36
+
37
+  <view class="panelFooter FlexRow">
38
+    <view class="panelFooter1 FlexRow">
39
+      <view class="panelFooter11 panelFooter10 FlexColumn" bindtap="close">
40
+        <image src="../images/sysIcon_a04.png" class="sysIcon_a03"></image>
41
+        <view class="text02">拍照</view>
42
+      </view>
43
+      <view wx:if="{{Words.length>0}}" class="panelFooter14 panelFooter10 FlexRow" bind:tap="submit">
44
+        <view>确定</view>
45
+        <view class="text04 FlexRow">{{Count}}<image src="../images/sysIcon_a06.png" class="sysIcon_a06"></image>{{CountMax}}</view>
46
+      </view>
47
+      <view wx:if="{{Words.length==0}}" class="panelFooter14 FlexRow">
48
+      </view>
49
+    </view>
50
+  </view>
51
+</view>

+ 169 - 0
pages/main/selectword.wxss

@@ -0,0 +1,169 @@
1
+.panel1{
2
+  width:100%;
3
+  height:140rpx;
4
+  color: #C1E1C1;
5
+  justify-content: space-between;
6
+  position: relative;
7
+}
8
+
9
+.text01{
10
+  font-size: 36rpx;
11
+  margin-left: 70rpx;
12
+}
13
+
14
+.panel11{
15
+  margin-right: 70rpx;
16
+  font-size:24rpx;
17
+}
18
+.sysIcon_a01{
19
+  width:24rpx;
20
+  height:24rpx;
21
+  margin-right: 10rpx;
22
+}
23
+
24
+.panel10{
25
+  position: fixed;
26
+  top:0;
27
+  width: 100%;
28
+  height:140rpx;
29
+  z-index: 10;
30
+  justify-content: flex-start;
31
+  background-image: linear-gradient(180deg, #004433 0%, rgba(0,46,34,0.80) 100%);
32
+}
33
+
34
+.panel101{
35
+  background: #CA4B15;
36
+  border-radius: 10rpx;
37
+  height:70rpx;
38
+  margin-left: 30rpx;
39
+  padding: 0 30rpx;
40
+}
41
+
42
+.text03{
43
+  font-size:24rpx;
44
+  color:#fff;
45
+  margin-left: 20rpx;
46
+}
47
+
48
+.sysIcon_a03{
49
+  width:20rpx;
50
+  height:20rpx;
51
+}
52
+
53
+.panel2{
54
+  width:690rpx;
55
+  min-height:150rpx;
56
+  background: #002F24;
57
+  box-shadow: 0 10rpx 0 0 rgba(0,0,0,0.50);
58
+  border-radius: 40rpx;
59
+  justify-content: flex-start;
60
+}
61
+.panel21{
62
+  width: 655rpx;
63
+  margin: 40rpx 0 20rpx 30rpx;
64
+  flex-wrap: wrap;
65
+  align-items: flex-start;
66
+  justify-content: flex-start;
67
+}
68
+
69
+.btn{
70
+  min-width: 88rpx;
71
+  height:90rpx;
72
+  background: #061A1B;
73
+  border-radius: 20rpx;
74
+  margin: 0 20rpx 20rpx 0;
75
+  color:#C1E1C1;
76
+  font-weight: 400;
77
+  padding: 0 20rpx;
78
+  font-size: 36rpx;
79
+}
80
+.btnSelected{
81
+  background: #004433;
82
+  color:#FFDD88;
83
+  font-weight: 700;
84
+  padding: 0 18rpx;
85
+}
86
+
87
+.panelNull{
88
+  margin-top: 360rpx;
89
+  color: #C1E1C1;
90
+}
91
+
92
+.pic_05{
93
+  width:300rpx;
94
+  height:43rpx;
95
+}
96
+
97
+.text05{
98
+  font-size: 28rpx;
99
+  margin-top: 40rpx;
100
+}
101
+
102
+.text06{
103
+  font-weight: 400;
104
+  font-size: 24rpx;
105
+  margin: 10rpx 0 0 0;
106
+}
107
+.panelNull1{
108
+  margin-top: 40rpx;
109
+  font-size: 24rpx;
110
+}
111
+
112
+
113
+.pic_06{
114
+  width:300rpx;
115
+  height:144rpx;
116
+  position: fixed;
117
+  left:0;
118
+  bottom:180rpx;
119
+}
120
+
121
+.panelFooter{
122
+  width: 100%;
123
+  height:180rpx;
124
+  background-image: linear-gradient(180deg, #004433 0%, #002C21 100%);
125
+  position: fixed;
126
+  bottom: 0rpx;
127
+  align-items: flex-start;
128
+  z-index: 10;
129
+}
130
+
131
+.panelFooter1{
132
+  width:730rpx;
133
+  height:140rpx;
134
+  color:#F2F2F2;
135
+  background: #1E1E1E;
136
+  box-shadow: 0 30rpx 0 0 #0C0C0C;
137
+  border-radius: 10rpx 10rpx 60rpx 60rpx;
138
+}
139
+.panelFooter10{
140
+  background-color: #303030;
141
+  font-size:24rpx;
142
+}
143
+.panelFooter11{
144
+  width:160rpx;
145
+  height:120rpx;
146
+  border-radius: 5rpx 10rpx 10rpx 50rpx;
147
+}
148
+.panelFooter14{
149
+  width:540rpx;
150
+  height:120rpx;
151
+  border-radius: 10rpx 5rpx 50rpx 10rpx;
152
+  font-size:36rpx;
153
+  margin-left: 10rpx;
154
+}
155
+.text02{
156
+  font-size:24rpx;
157
+  margin-top: 17rpx;
158
+}
159
+.text04{  
160
+  font-size: 28rpx;
161
+  color: #9B9B9B;
162
+  position: absolute;
163
+  right:60rpx;
164
+}
165
+.sysIcon_a06{
166
+  width:10rpx;
167
+  height:16rpx;
168
+  margin: 0 10rpx;
169
+}

+ 198 - 0
pages/main/wordsinput.js

@@ -0,0 +1,198 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+
4
+const app = getApp();
5
+
6
+Page({
7
+  data: {
8
+    Words:[],
9
+    IsShowAlert:false,
10
+    IsShowSetPanel:false,
11
+    IsShowPanelHelp:false,
12
+  },
13
+  onLoad: function (options) {
14
+    var that = this;
15
+    let grade=wx.getStorageSync('Grade');
16
+    if (!grade)
17
+      grade=[{Name:"小学",CSS:"Selected"},{Name:"初中",CSS:""},{Name:"高中",CSS:""},{Name:"大学",CSS:""}];
18
+    let articleCategory=wx.getStorageSync('ArticleCategory');
19
+    if (!articleCategory)
20
+      articleCategory=[{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:""}];
21
+  
22
+    const hiddenhelp=wx.getStorageSync('HiddenWordInputHelp');
23
+
24
+    that.setData({
25
+      Containnerheight: main.getWindowHeight(),
26
+      Grade:grade,
27
+      ArticleCategory:articleCategory,
28
+      IsShowPanelHelp:!hiddenhelp,
29
+      KeyboardBtnName:"next",
30
+    });
31
+
32
+  },
33
+  onShow:function(e){
34
+    var that = this;
35
+    that.data.Words=[];
36
+    for(let i=0;i<10;i++){
37
+      let obj={};
38
+      obj.ID=i+1;
39
+      if (app.globalData.SelectedWords[i]){
40
+        obj.Word=app.globalData.SelectedWords[i];
41
+        obj.CSS="txtWordFinished";
42
+      }
43
+      else{
44
+        obj.Word="";
45
+        obj.CSS="";
46
+      }
47
+      obj.IsError=false;
48
+      that.data.Words.push(obj);
49
+    }
50
+    console.log(app.globalData.SelectedWords);
51
+    that.setData({
52
+      Words:that.data.Words,
53
+    });
54
+    that.isShowAlert();
55
+  },
56
+  bindKeyInput: function (e) {
57
+    let that=this;
58
+    let id=e.currentTarget.dataset.id;
59
+    let word=e.detail.value;
60
+    for(let i=0;i<10;i++){
61
+      if (i+1==id){
62
+        that.data.Words[i].Word=word;
63
+        that.data.Words[i].CSS="txtWordFinished";
64
+        
65
+        if (word && !that.isValidInput(word)){
66
+          that.data.Words[i].IsError=true;
67
+        }
68
+        else{
69
+          that.data.Words[i].IsError=false;
70
+          if (!word)
71
+            that.data.Words[i].CSS="";
72
+        }
73
+        break;
74
+      }
75
+    }
76
+    
77
+    that.setData({
78
+      Words:that.data.Words, 
79
+    });
80
+    that.isShowAlert();
81
+  },
82
+  isShowAlert:function(){
83
+    const that=this;
84
+    let b=false;
85
+    for(let i=0;i<10;i++){
86
+      if (that.data.Words[i].IsError){
87
+        b=true;
88
+        break;
89
+      }
90
+    }
91
+    that.setData({
92
+      IsShowAlert:b,
93
+      AlertContent:"不支持特殊符号、数字、句子、非英语单词内容"
94
+    });
95
+  },
96
+  setArticleParam:function(e){
97
+    const that=this;
98
+    let count=0;
99
+    for(let i=0;i<10;i++){
100
+      if (that.data.Words[i].CSS=="txtWordFinished"){
101
+        count++
102
+      }
103
+    }
104
+    if (count<5){
105
+      that.setData({
106
+        IsShowAlert:true,
107
+        AlertContent:"请输入至少5个英语单词"
108
+      });
109
+    }
110
+    else{
111
+      that.setData({
112
+        IsShowAlert:false,
113
+        IsShowSetPanel:true,
114
+      });
115
+    }
116
+  },
117
+  setMenu:function(){
118
+    this.setData({
119
+      IsShowSetPanel:!this.data.IsShowSetPanel,
120
+    });
121
+  },
122
+  keyboardOK:function(e){
123
+    const that=this;
124
+    let id=e.currentTarget.dataset.id;
125
+    id++;
126
+    that.setFocus({currentTarget:{dataset:{id:id}}});
127
+  },
128
+  setFocus:function(e){
129
+    const that=this;
130
+    let id=e.currentTarget.dataset.id;
131
+    
132
+    for(let i=0;i<that.data.Words.length;i++){
133
+      that.data.Words[i].Focus=false;
134
+      if (that.data.Words[i].ID==id)
135
+        that.data.Words[i].Focus=true;
136
+    }
137
+    that.setData({
138
+      Words:that.data.Words,
139
+    });
140
+  },
141
+  closeHelp:function(){
142
+    this.setData({
143
+      IsShowPanelHelp:false,
144
+    });
145
+    wx.setStorageSync('HiddenWordInputHelp', true);
146
+  },
147
+  selectBtn:function(e){
148
+    const index=e.currentTarget.dataset.index;
149
+    const id=e.currentTarget.dataset.id;
150
+    let arr=this.data.Grade;
151
+    if (id==1)
152
+      arr=this.data.ArticleCategory;
153
+    for(let i=0;i<arr.length;i++){
154
+      if (i==index)
155
+        arr[i].CSS="Selected";
156
+      else
157
+        arr[i].CSS="";
158
+    }
159
+    if (id==1){
160
+      this.setData({
161
+        ArticleCategory:arr,
162
+      });
163
+      wx.setStorageSync('ArticleCategory', arr);
164
+    }
165
+    else{
166
+      this.setData({
167
+        Grade:arr,
168
+      });
169
+      wx.setStorageSync('Grade', arr);
170
+    }
171
+    
172
+  },
173
+  isValidInput:function(input) {
174
+      // 正则表达式匹配:大小写字母、空格、单引号、减号
175
+      const regex = /^[a-zA-Z\s'-]+$/;
176
+      return regex.test(input);
177
+  },
178
+  goto: function (e) {
179
+    let that=this;
180
+    app.globalData.SelectedWords=[];
181
+    for(let i=0;i<that.data.Words.length;i++){
182
+      if (that.data.Words[i].Word)
183
+        app.globalData.SelectedWords.push(that.data.Words[i].Word);
184
+    }
185
+    //debugger;
186
+    var url=e.currentTarget.dataset.url;
187
+    wx.navigateTo({
188
+      url: url,
189
+    });
190
+  },
191
+  onShareAppMessage: function () {
192
+    return {
193
+      title: app.globalData.ShareTitle,
194
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
195
+      imageUrl: app.globalData.ShareImage,
196
+    }
197
+  },
198
+})

+ 3 - 0
pages/main/wordsinput.json

@@ -0,0 +1,3 @@
1
+{
2
+  "usingComponents": {}
3
+}

+ 82 - 0
pages/main/wordsinput.wxml

@@ -0,0 +1,82 @@
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
+  <view class="panel1 FlexRow">
3
+    <view class="text01">输入单词5-10个</view>
4
+    <view class="panel11 FlexRow">
5
+      <image src="../images/sysIcon_a01.png" class="sysIcon_a01"></image>
6
+      <view>范例</view>
7
+    </view>
8
+  </view>
9
+  <view class="panel10 FlexRow" wx:if="{{IsShowAlert}}">
10
+    <view class="panel101 FlexRow">
11
+      <image src="../images/sysIcon_a03.png" class="sysIcon_a03"></image>
12
+      <view class="text03">{{AlertContent}}</view>
13
+    </view>
14
+  </view>
15
+
16
+  <view class="panel2 FlexColumn">
17
+    <block wx:for="{{Words}}" wx:key="index">
18
+      <view class="panel20 panel2{{item.ID}} {{item.CSS}} FlexRow">
19
+        <view class="panel211" wx:if="{{!item.IsError}}"></view>
20
+        <view class="panel211 panel2110" wx:if="{{item.IsError}}"></view>
21
+        <input class="txtWord" focus="{{item.Focus}}" placeholder="单词 {{item.ID}}"  value="{{item.Word}}" confirm-type="{{KeyboardBtnName}}" maxlength="30" placeholder-class="placeholderClass" bindconfirm="keyboardOK"  bindfocus="setFocus" bindinput="bindKeyInput" data-id="{{item.ID}}"/>
22
+      </view>
23
+    </block>
24
+  </view>
25
+
26
+  <view class="panelFooter FlexRow">
27
+    <view class="panelFooter1 FlexRow">
28
+      <view class="panelFooter11 panelFooter10 FlexColumn" bindtap="goto" data-url="../main/ocr">
29
+        <image src="../images/sysIcon_a04.png" class="sysIcon_a03"></image>
30
+        <view class="text02">拍照</view>
31
+      </view>
32
+      <view class="panelFooter12 panelFooter10 FlexColumn" bindtap="goto" data-url="../main/paste">
33
+        <image src="../images/sysIcon_a05.png" class="sysIcon_a03"></image>
34
+        <view class="text02">粘贴</view>
35
+      </view>
36
+      <view class="panelFooter13 panelFooter10 FlexColumn" bind:tap="setArticleParam">下一步</view>
37
+    </view>
38
+  </view>
39
+
40
+  
41
+</view>
42
+
43
+<view wx:if="{{IsShowPanelHelp}}" class="panelHelp container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
44
+  <view class="panelHelp1">
45
+    <image src="../images/sysIcon_b06.png" class="sysIcon_b06"></image>
46
+    <view class="panelHelp2 FlexColumn">
47
+      <view class="text07">先从这里输入单词再点这里生成短文</view>
48
+      <view class="btn3 FlexColumn" bind:tap="closeHelp">知道了</view>
49
+    </view>
50
+  </view>
51
+</view>
52
+
53
+
54
+<view wx:if="{{IsShowSetPanel}}" class="panelMenu container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
55
+  <view class="panelMenu1 FlexColumn">
56
+    <view class="panelMenu11 FlexColumn">
57
+      <view class="text04">要求</view>
58
+    </view>
59
+    <view class="panelMenu11 FlexColumn">
60
+      <view class="text04 text05">接近哪个年龄段的单词水平</view>
61
+      <view class="panelMenu111 FlexRow">
62
+        <view class="btn btn{{item.CSS}} FlexRow" wx:for="{{Grade}}" wx:key="index" capture-bind:tap="selectBtn" data-id="0" data-index="{{index}}">{{item.Name}}</view>
63
+      </view>
64
+    </view>
65
+    <view class="panelMenu11 FlexColumn">
66
+      <view class="text04 text06">短文主题</view>
67
+      <view class="panelMenu111 FlexRow">
68
+        <view class="btn btn{{item.CSS}} FlexRow" wx:for="{{ArticleCategory}}" wx:key="index" capture-bind:tap="selectBtn" data-id="1" data-index="{{index}}">{{item.Name}}</view>
69
+      </view>
70
+    </view>
71
+    <view class="btn2 FlexRow">
72
+      <image src="../images/sysIcon_b01.png" class="sysIcon_b01"></image>
73
+      <view>生成短文</view>
74
+    </view>
75
+
76
+    <view class="panelClose FlexRow" capture-bind:tap="setMenu">
77
+      <view class="panelClose1 FlexRow">
78
+        <image src="../images/sysIcon_a03.png" class="sysIcon_a03"></image>
79
+      </view>
80
+    </view>
81
+  </view>
82
+</view>

+ 272 - 0
pages/main/wordsinput.wxss

@@ -0,0 +1,272 @@
1
+.panel1{
2
+  width:100%;
3
+  height:140rpx;
4
+  color: #C1E1C1;
5
+  justify-content: space-between;
6
+  position: relative;
7
+}
8
+
9
+.text01{
10
+  font-size: 36rpx;
11
+  margin-left: 70rpx;
12
+}
13
+
14
+.panel11{
15
+  margin-right: 70rpx;
16
+  font-size:24rpx;
17
+}
18
+.sysIcon_a01{
19
+  width:24rpx;
20
+  height:24rpx;
21
+  margin-right: 10rpx;
22
+}
23
+
24
+.panel10{
25
+  position: fixed;
26
+  top:0;
27
+  width: 100%;
28
+  height:140rpx;
29
+  z-index: 10;
30
+  justify-content: flex-start;
31
+  background-image: linear-gradient(180deg, #004433 0%, rgba(0,46,34,0.80) 100%);
32
+}
33
+
34
+.panel101{
35
+  background: #CA4B15;
36
+  border-radius: 10rpx;
37
+  height:70rpx;
38
+  margin-left: 30rpx;
39
+  padding: 0 30rpx;
40
+}
41
+
42
+.text03{
43
+  font-size:24rpx;
44
+  color:#fff;
45
+  margin-left: 20rpx;
46
+}
47
+
48
+.sysIcon_a03{
49
+  width:20rpx;
50
+  height:20rpx;
51
+}
52
+
53
+.panel2{
54
+  width: 690rpx;
55
+  min-height: 300rpx;
56
+  background: #002F24;
57
+  box-shadow: 0 10rpx 0 0 rgba(0,0,0,0.50);
58
+  border-radius: 40rpx;
59
+  margin: 0 0 230rpx 0;
60
+}
61
+
62
+.panel20{
63
+  width:646rpx;
64
+  height:90rpx;
65
+  background: #061A1B;
66
+  border-radius: 5rpx;
67
+  margin: 10rpx 0 0 0;
68
+  justify-content: flex-start;
69
+}
70
+
71
+.panel21{
72
+  border-radius: 20rpx 20rpx 5rpx 5rpx;
73
+  margin: 30rpx 0 0 0;
74
+}
75
+
76
+.panel210{
77
+  border-radius: 5rpx 5rpx 20rpx 20rpx;
78
+  margin: 10rpx 0 30rpx 0;
79
+}
80
+.panel211{
81
+  width:16rpx;
82
+  height:90rpx;
83
+  border-radius: 5rpx 0 0 5rpx;
84
+  margin-right: 14rpx;
85
+}
86
+.panel2110{
87
+  background: #CA4B15;
88
+}
89
+
90
+.txtWord{
91
+  width:570rpx;
92
+  height:50rpx;
93
+  text-align: left;
94
+  font-size:36rpx;
95
+  font-weight: 400;
96
+  color: #FFDD88;
97
+}
98
+.txtWordFinished{
99
+  background-color: #004433;
100
+}
101
+
102
+.placeholderClass{
103
+  color:#627062;
104
+}
105
+
106
+.panelFooter{
107
+  width: 100%;
108
+  height:180rpx;
109
+  background-image: linear-gradient(180deg, #004433 0%, #002C21 100%);
110
+  position: fixed;
111
+  bottom: 0rpx;
112
+  align-items: flex-start;
113
+  z-index: 10;
114
+}
115
+
116
+.panelFooter1{
117
+  width:730rpx;
118
+  height:140rpx;
119
+  color:#F2F2F2;
120
+  background: #1E1E1E;
121
+  box-shadow: 0 30rpx 0 0 #0C0C0C;
122
+  border-radius: 10rpx 10rpx 60rpx 60rpx;
123
+}
124
+.panelFooter10{
125
+  background-color: #303030;
126
+  font-size:24rpx;
127
+}
128
+.panelFooter11{
129
+  width:160rpx;
130
+  height:120rpx;
131
+  border-radius: 5rpx 10rpx 10rpx 50rpx;
132
+}
133
+.panelFooter12{
134
+  width:160rpx;
135
+  height:120rpx;
136
+  border-radius: 10rpx 10rpx 10rpx 10rpx;
137
+  margin: 0 10rpx;
138
+}
139
+.panelFooter13{
140
+  width:370rpx;
141
+  height:120rpx;
142
+  border-radius: 10rpx 5rpx 50rpx 10rpx;
143
+  font-size:36rpx;
144
+}
145
+.text02{
146
+  font-size:24rpx;
147
+  margin-top: 17rpx;
148
+}
149
+
150
+.panelHelp{
151
+  background-color: rgba(0,0,0,0.00);
152
+  z-index: 20;
153
+  position: fixed;
154
+  top:0;
155
+}
156
+
157
+.panelHelp1{
158
+  width: 100%;
159
+  position: fixed;
160
+  bottom:902rpx;
161
+}
162
+
163
+.sysIcon_b06{
164
+  width:100%;
165
+  height: 642rpx;
166
+  position: absolute;
167
+}
168
+
169
+.panelHelp2{
170
+  position: absolute;
171
+  left:0;
172
+  right:0;
173
+  top:160rpx;
174
+}
175
+
176
+.text07{
177
+  font-size: 36rpx;
178
+  color: #2E2E2E;
179
+  text-align: center;
180
+  width:288rpx;
181
+}
182
+.btn3{
183
+  width:310rpx;
184
+  height:90rpx;
185
+  background: #303030;
186
+  border-radius: 20rpx;
187
+  color:#F2F2F2;
188
+  margin-top: 50rpx;
189
+}
190
+
191
+.panelMenu{
192
+  background-color: rgba(26,67,51,0.50);
193
+  z-index: 20;
194
+  position: fixed;
195
+  top:0;
196
+}
197
+
198
+.panelMenu1{
199
+  width:100%;
200
+  background: #1E1E1E;
201
+  border-radius: 60rpx 60rpx 0 0;
202
+  position: fixed;
203
+  bottom:0;
204
+  justify-content: flex-start;
205
+}
206
+
207
+.panelMenu11{
208
+  width: 100%;
209
+}
210
+.text04{
211
+  align-self: start;
212
+  margin: 50rpx 0 0 40rpx;
213
+  font-size: 28rpx;
214
+}
215
+.text05{
216
+  margin: 40rpx 0 0 40rpx;
217
+}
218
+.text06{
219
+  margin: 20rpx 0 0 40rpx;
220
+}
221
+.panelMenu111{
222
+  width:720rpx;
223
+  flex-wrap: wrap;
224
+  margin: 30rpx 0 0 30rpx;
225
+  justify-content: flex-start;
226
+  align-items: flex-start;
227
+}
228
+
229
+.btn{
230
+  margin: 0 20rpx 20rpx 0;
231
+  height:90rpx;
232
+  padding: 0 26rpx;
233
+  background: #1E1E1E;
234
+  border: 6rpx solid #303030;
235
+  box-shadow: 0 6rpx 0 0 rgba(0,0,0,0.20);
236
+  border-radius: 20rpx;
237
+  color:#D2D2D2;
238
+  font-size: 28rpx;
239
+}
240
+.btnSelected{
241
+  background: #0D4433;
242
+  border: 6rpx solid #C1E1C1;
243
+  box-shadow: 0 6rpx 0 0 rgba(0,0,0,0.10);
244
+  color: #C1E1C1;
245
+}
246
+
247
+.btn2{
248
+  width: 650rpx;
249
+  height:90rpx;
250
+  background: #303030;
251
+  border-radius: 20rpx;
252
+  margin: 60rpx 0;
253
+  font-size: 36rpx;
254
+}
255
+.sysIcon_b01{
256
+  width:40rpx;
257
+  height:40rpx;
258
+  margin-right: 20rpx;
259
+}
260
+.panelClose{
261
+  width:100rpx;
262
+  height:100rpx;
263
+  position: absolute;
264
+  top:20rpx;
265
+  right:30rpx;
266
+}
267
+.panelClose1{
268
+  width:60rpx;
269
+  height:60rpx;
270
+  background: #303030;
271
+  border-radius: 50%;
272
+}

+ 1 - 1
project.private.config.json

@@ -19,5 +19,5 @@
19 19
     "checkInvalidKey": true,
20 20
     "ignoreDevUnusedFiles": true
21 21
   },
22
-  "libVersion": "3.8.6"
22
+  "libVersion": "3.8.9"
23 23
 }

+ 6 - 4
utils/util.js

@@ -492,15 +492,16 @@ function initMonthCalendar(dates, line = 6,isNull=true) {
492 492
        } 
493 493
        if (n.length == 7) break;    // 放了7个格子该结束了
494 494
      }
495
- 
496 495
      //arr.push(n);
497 496
      //n = [];           // 这一行放完了,清空ba
498 497
    }
499
- 
500
- 
501 498
    return n;
502 499
 }
503 500
 
501
+function filterWordsWithSpecialChars(words) {
502
+  return words.filter(word => word && /^[a-zA-Z\s'’-]+$/.test(word));
503
+}
504
+
504 505
 module.exports = {
505 506
   formatTime: formatTime,
506 507
   formatDateCHS: formatDateCHS,
@@ -525,5 +526,6 @@ module.exports = {
525 526
   IsNumber:IsNumber,
526 527
   formatDateENG: formatDateENG,
527 528
   formatMoney:formatMoney,
528
-  initMonthCalendar:initMonthCalendar
529
+  initMonthCalendar:initMonthCalendar,
530
+  filterWordsWithSpecialChars:filterWordsWithSpecialChars
529 531
 }