chengjie hai 4 meses
pai
achega
96186edac5

+ 1 - 1
app.js

@@ -3,7 +3,7 @@ App({
3 3
   globalData: {
4 4
     Version: "1.0.0",
5 5
     //IsProduction: true,
6
-    ShareTitle: "语境背单词",
6
+    ShareTitle: "阅读理解+答题",
7 7
     SharePath: "pages/index/index",
8 8
     ShareImage: '../images/pic_07.png',
9 9
     ProgramID: 186,

+ 1 - 0
app.json

@@ -8,6 +8,7 @@
8 8
     "pages/main/paste",
9 9
     "pages/main/ocr",
10 10
     "pages/main/selectword",
11
+    "pages/main/feedbackinfo",
11 12
     "pages/main/wordsinput"
12 13
   ],
13 14
   "window": {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 9
app.wxss


BIN=BIN
pages/.DS_Store


BIN=BIN
pages/images/.DS_Store


BIN=BIN
pages/images/icon_add_01.png


BIN=BIN
pages/images/icon_check_01.png


BIN=BIN
pages/images/pic_h01.png


BIN=BIN
pages/images/pic_h02.png


BIN=BIN
pages/images/sysIcon_b06.png


BIN=BIN
pages/images/sysIcon_b07.png


BIN=BIN
pages/images/sysIcon_b16.png


+ 2 - 0
pages/index/index.js

@@ -42,6 +42,8 @@ Page({
42 42
     that.setData({
43 43
       Containnerheight: main.getWindowHeight(),
44 44
     });
45
+    app.globalData.SelectedWords=[];
46
+    app.globalData.OCRWords=[];
45 47
     this.getUserInfo();
46 48
   },
47 49
   //得到用户信息

+ 89 - 20
pages/main/article.js

@@ -36,9 +36,17 @@ Page({
36 36
     let wordsStr=app.globalData.SelectedWords.join(" ");
37 37
     const hiddenhelp=wx.getStorageSync('HiddenArticleFirstOpen');
38 38
 
39
+    
40
+    let IsShowKeyword=wx.getStorageSync('IsShowKeyword');
41
+    if (IsShowKeyword===""){
42
+      IsShowKeyword=true;
43
+      wx.setStorageSync('IsShowKeyword', true);
44
+    }
45
+
39 46
     let IsShowLightColor=wx.getStorageSync('IsShowLightColor');
40
-    if (!IsShowLightColor)
47
+    if (!IsShowLightColor){
41 48
       IsShowLightColor=false;
49
+    }
42 50
     
43 51
     that.setData({
44 52
       Containnerheight: main.getWindowHeight(),
@@ -46,6 +54,7 @@ Page({
46 54
       WordsStr:wordsStr,
47 55
       IsShowFirstOpen:!hiddenhelp,
48 56
       IsShowLightColor:IsShowLightColor,
57
+      IsShowKeyword:IsShowKeyword,
49 58
       IsBuildError:false,
50 59
     });
51 60
 
@@ -118,21 +127,42 @@ Page({
118 127
     if (typeof content === 'string') {
119 128
       content = JSON.parse(content);
120 129
     }
130
+    let hl="nonelight";
131
+    if (that.data.IsShowKeyword)
132
+      hl="highlight";
121 133
     for(let i=0;i<content.ArticleEnglish.length;i++){
122 134
       for(let j=0;j<content.FormsOfWords.length;j++){
123 135
         let word = content.FormsOfWords[j];
124 136
         let regex = new RegExp(`\\b${word}\\b[.,!?;:]?`, 'gi');
125
-        if (that.data.IsShowKeyword){
126
-          content.ArticleEnglish[i] = content.ArticleEnglish[i].replace(regex, match => {
127
-            let punctuation = match.match(/[.,!?;:]$/);
128
-            let punc = punctuation ? punctuation[0] : '';
129
-            let wordPart = match.replace(/[.,!?;:]$/, '');
130
-            return `<span class='highlight'>${wordPart}</span>${punc}`;
131
-          });
137
+        content.ArticleEnglish[i] = content.ArticleEnglish[i].replace(regex, match => {
138
+          let punctuation = match.match(/[.,!?;:]$/);
139
+          let punc = punctuation ? punctuation[0] : '';
140
+          let wordPart = match.replace(/[.,!?;:]$/, '');
141
+          return `<span class='`+hl+`'>${wordPart}</span>${punc}`;
142
+        });
143
+      }
144
+    }
145
+
146
+    
147
+    content.ArticleEnglishArr=[];
148
+    for(let i=0;i<content.ArticleEnglish.length;i++){
149
+      let obj=common.splitByMultipleDelimiters(content.ArticleEnglish[i],["<span class='"+hl+"'>","</span>"]);
150
+      obj=common.removeDuplicateAndTrimStrings(obj);
151
+      //debugger;
152
+      let arr=[];
153
+      for(let j=0;j<obj.length;j++){
154
+        let objChild={};
155
+        objChild.Content=obj[j]+" ";
156
+        objChild.CSS="";
157
+        if (j%2==1){
158
+          objChild.CSS=hl;
159
+          objChild.Content=" "+objChild.Content;
132 160
         }
161
+        arr.push(objChild);
133 162
       }
163
+      content.ArticleEnglishArr.push(arr);
134 164
     }
135
-    content.ArticleEnglishStr=content.ArticleEnglish.join(" ");
165
+
136 166
     for(let i=0;i<content.Question.length;i++){
137 167
       for(let j=0;j<content.Question[i].OptionsEnglish.length;j++){
138 168
         let str=content.Question[i].OptionsChinese[j];
@@ -209,15 +239,24 @@ Page({
209 239
       source="nonelight";
210 240
       target="highlight";
211 241
     }
212
-    content.ArticleEnglishStr=common.ReplaceAllString(content.ArticleEnglishStr,source,target);
213
-    for(let i=0;i<content.Question.length;i++){
214
-      for(let j=0;j<content.Question[i].OptionsEnglish.length;j++){
215
-        content.Question[i].OptionsEnglish[j]=common.ReplaceAllString(content.Question[i].OptionsEnglish[j],source,target);
242
+
243
+    for(let i=0;i<content.ArticleEnglishArr.length;i++){
244
+      let obj=content.ArticleEnglishArr[i];
245
+      let arr=[];
246
+      for(let j=0;j<obj.length;j++){
247
+        if (obj[j].CSS==source)
248
+          obj[j].CSS=target;
216 249
       }
217 250
     }
251
+    for(let i=0;i<content.ArticleEnglish.length;i++){
252
+      content.ArticleEnglish[i]=common.ReplaceAllString(content.ArticleEnglish[i],source,target);
253
+    }
254
+
218 255
     that.setData({
219 256
       Content:content,
220 257
     });
258
+
259
+    wx.setStorageSync('IsShowKeyword', that.data.IsShowKeyword);
221 260
   },
222 261
   nextQuestion:function(e){
223 262
     if (this.data.CurrentQuestionIndex+1<this.data.Content.Question.length){
@@ -256,7 +295,8 @@ Page({
256 295
   //访问服务器的GeneratePDF接口,提交this.data.Content数据,获得一个生成好的pdf文件,服务端的代码已经生成好
257 296
   generatePDF: function(e) {
258 297
     let that = this;
259
-    that.data.Content.Words=that.data.Words.split(" ").join(",");
298
+    //debugger;
299
+    that.data.Content.Words=that.data.Words;
260 300
     let url = common.Encrypt("GeneratePDF");
261 301
     url =app.globalData.serverUrl + url;
262 302
     wx.request({
@@ -287,11 +327,6 @@ Page({
287 327
             fileType: 'pdf',
288 328
             showMenu: true,  // 显示右上角菜单,可以分享
289 329
             success: function() {
290
-              console.log('打开文档成功');
291
-              wx.showToast({
292
-                title: 'PDF生成成功',
293
-                icon: 'success'
294
-              });
295 330
             },
296 331
             fail: function(error) {
297 332
               console.error('打开文档失败:', error);
@@ -332,7 +367,41 @@ Page({
332 367
       wx.navigateBack();
333 368
     }
334 369
   },
335
-  
370
+  onLongPress: function(e) {
371
+    let that = this;
372
+    let strType=e.currentTarget.dataset.strtype;
373
+    let selectedIndex=e.currentTarget.dataset.index;
374
+    let selectedIndex2=e.currentTarget.dataset.index2;
375
+    let content;
376
+    if (strType=="article"){
377
+      //console.log("选中的句子索引:", selectedIndex);
378
+      //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];
384
+    }
385
+    else if (strType=="question"){
386
+      content=that.data.Content.Question[selectedIndex].QuestionEnglish;
387
+      content+="\r\n"+that.data.Content.Question[selectedIndex].QuestionChinese;
388
+    }
389
+    else if (strType=="option"){
390
+      content=that.data.Content.Question[selectedIndex].OptionsEnglish[selectedIndex2];
391
+      content+="\r\n"+that.data.Content.Question[selectedIndex].OptionsChinese[selectedIndex2];
392
+    }
393
+    wx.showModal({
394
+      title: '翻译',
395
+      content: content,
396
+      showCancel:false,
397
+      confirmText:"知道了",
398
+      complete: (res) => {
399
+        if (res.confirm) {
400
+          
401
+        }
402
+      }
403
+    })
404
+  },
336 405
   onUnload:function(){
337 406
     if (!this.data.ID){
338 407
       wx.navigateBack({

+ 13 - 7
pages/main/article.wxml

@@ -6,9 +6,15 @@
6 6
   extClass="fixed-nav {{ThemeCSS}}"
7 7
 ></navigation-bar>
8 8
 <!-- 正常文章 -->
9
-<view wx:if="{{!IsBuilding && !IsBuildError}}" class="{{ThemeCSS}} container FlexColumn" style='min-height:{{Containnerheight}}rpx;' bindtap="onContainerTap">
9
+<view wx:if="{{!IsBuilding && !IsBuildError}}" class="{{ThemeCSS}} container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
10 10
   <view class="panel1 FlexColumn">
11
-    <rich-text class="textArticle" wx:if="{{!IsShowTranslate}}" nodes="{{Content.ArticleEnglishStr}}"></rich-text>
11
+    <!-- 完整文章 -->
12
+    <text class="textArticle" wx:if="{{!IsShowTranslate}}" >
13
+      <text bindlongpress="onLongPress" data-strtype="article" data-index="{{index}}" wx:for="{{Content.ArticleEnglishArr}}" wx:key="index" >
14
+        <text  class="{{itemChild.CSS}}" wx:for="{{item}}" wx:key="index2" wx:for-item="itemChild" wx:for-index="indexChild">{{itemChild.Content}}</text>
15
+      </text>
16
+    </text>
17
+    <!-- 有翻译文章 -->
12 18
     <view class="textArticle FlexColumn" wx:if="{{IsShowTranslate}}">
13 19
       <view wx:for="{{Content.ArticleEnglish}}" wx:key="index" class="textArticle">
14 20
         <rich-text class="textArticle" nodes="{{item}}"></rich-text>
@@ -44,7 +50,7 @@
44 50
             <image src="../images/sysIcon_c0{{index+1}}.png" wx:if="{{ThemeCSS=='DarkColor'}}" class="sysIcon_c01"></image>
45 51
             <image src="../images/sysIcon_d0{{index+1}}.png" wx:if="{{ThemeCSS=='LightColor'}}" class="sysIcon_c01"></image>
46 52
             <view class="text04 FlexColumn">
47
-              <view class="text041">{{item.QuestionEnglish}}</view>
53
+              <view class="text041" bindlongpress="onLongPress" data-strtype="question" data-index="{{index}}">{{item.QuestionEnglish}}</view>
48 54
               <view class="text042" wx:if="{{IsShowTranslate}}">{{item.QuestionChinese}}</view>
49 55
             </view>
50 56
           </view>
@@ -56,7 +62,7 @@
56 62
                 <image wx:if="{{ThemeCSS=='LightColor'}}" src="../images/sysIcon_a11.png" class="sysIcon_a10"></image>
57 63
               </view>
58 64
               <view class="text05 FlexColumn">
59
-              <view class="text051">{{itemChild}}</view>
65
+              <view class="text051" bindlongpress="onLongPress" data-strtype="option" data-index="{{index}}" data-index2="{{indexChild}}">{{itemChild}}</view>
60 66
               <view class="text052" wx:if="{{IsShowTranslate}}">{{item.OptionsChinese[indexChild]}}</view>
61 67
             </view>
62 68
             </view>
@@ -82,7 +88,7 @@
82 88
     <view class="panelAnswer5 FlexColumn">
83 89
       <view class="panelAnswer51 FlexRow">
84 90
         <view class="text12">突出关键词</view>
85
-        <switch class="switchClass" bindchange="showData" checked="true" data-name="IsShowKeyword" />
91
+        <switch class="switchClass" bindchange="showData" checked="{{IsShowKeyword}}" data-name="IsShowKeyword" />
86 92
       </view>
87 93
       <view class="text13">用亮色强调用来生成短文的单词</view>
88 94
     </view>
@@ -90,7 +96,7 @@
90 96
     <view class="panelAnswer5 FlexColumn">
91 97
       <view class="panelAnswer51 panelAnswer510 FlexRow">
92 98
         <view class="text12">浅色方案</view>
93
-        <switch  class="switchClass" bindchange="showData"  data-name="IsShowLightColor"/>
99
+        <switch  class="switchClass" bindchange="showData" checked="{{IsShowLightColor}}" data-name="IsShowLightColor"/>
94 100
       </view>
95 101
     </view>
96 102
     <view class="btnClose btnClose2 FlexRow" capture-bind:tap="showData" data-name="IsShowSetting">
@@ -112,7 +118,7 @@
112 118
 </view>
113 119
 
114 120
 <!-- 显示生成中 -->
115
-<view wx:if="{{IsBuilding}}" class="container {{ThemeCSS}} FlexColumn" style='min-height:{{Containnerheight+140}}rpx;'>
121
+<view wx:if="{{IsBuilding}}" class="panelBuildindParent container {{ThemeCSS}} FlexColumn" style='min-height:{{Containnerheight+140}}rpx;'>
116 122
 </view>
117 123
 <image wx:if="{{IsBuilding && ThemeCSS=='DarkColor'}}" src="../images/pic_08.png" mode="widthFix"  class="pic_08"></image>
118 124
 <image wx:if="{{IsBuilding && ThemeCSS=='LightColor'}}" src="../images/pic_09.png" mode="widthFix"  class="pic_08"></image>

+ 28 - 24
pages/main/article.wxss

@@ -44,7 +44,8 @@
44 44
   font-weight: 400;
45 45
   font-size: 28rpx;
46 46
   width:100%;
47
-  margin: 20rpx 0 0 0;
47
+  margin: 30rpx 0 40rpx 0;
48
+  line-height:40rpx;
48 49
 }
49 50
 
50 51
 .DarkColor .textArticleTranslate{
@@ -66,7 +67,6 @@
66 67
 .LightColor .panelLine{
67 68
   background: rgba(255,255,255,0.60);
68 69
 }
69
-
70 70
 .DarkColor .highlight{
71 71
   color: #FFDD88; 
72 72
   font-weight: bold;
@@ -184,28 +184,6 @@
184 184
 }
185 185
 
186 186
 
187
-.pic_08{
188
-  width: 100%;
189
-  position: fixed;
190
-  top:200rpx;
191
-}
192
-
193
-.panelBuilding{
194
-  z-index: 20;
195
-  position: fixed;
196
-  top:0;
197
-  width:100%;
198
-  justify-content: flex-start;
199
-  font-weight: 700;
200
-}
201
-
202
-.DarkColor .panelBuilding{
203
-  background-image: linear-gradient(180deg, rgba(0,68,51,0.70) 0%, rgba(0,20,15,0.60) 100%);
204
-}
205
-.LightColor .panelBuilding{
206
-  background-image: linear-gradient(180deg, rgba(208,236,211,0.50) 0%, rgba(159,180,161,0.70) 100%);
207
-}
208
-
209 187
 .panelError{
210 188
   margin-top: 560rpx;
211 189
   font-size: 28rpx;
@@ -231,7 +209,33 @@
231 209
 }
232 210
 
233 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
+}
234 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
+}
235 239
 
236 240
 .panelBuilding1{
237 241
   width: 100%;

+ 252 - 0
pages/main/feedbackinfo.js

@@ -0,0 +1,252 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+import constant from '../../utils/constant';
4
+
5
+const app = getApp();
6
+
7
+Page({
8
+  data: {
9
+    Feedback:constant.arrFeedback,
10
+    ImageArr:[],
11
+    ImagePath: app.globalData.uploadImageUrl,
12
+  },
13
+  onLoad: function (options) {
14
+    var that = this;
15
+    var feedbackType=0;
16
+    if (options.type){
17
+      that.data.Feedback[0].CSS="";
18
+      that.data.Feedback[options.type].CSS="Selected";
19
+    }
20
+
21
+    that.setData({
22
+      Containnerheight: main.getWindowHeight(),
23
+      IsShow:app.globalData.userInfo.IsShow,
24
+      Feedback:that.data.Feedback,
25
+    });
26
+  },
27
+  bindKeyInput:function(e){
28
+    var that=this;
29
+    that.setData({
30
+      InputValue:e.detail.value,
31
+    });
32
+  },
33
+  bindKeyInput2:function(e){
34
+    var that=this;
35
+    that.setData({
36
+      InputValue2:e.detail.value,
37
+    });
38
+  },
39
+  saveFeedback:function(){
40
+    var that=this;
41
+    if (!that.data.InputValue){
42
+      wx.showToast({
43
+        title: '请填写内容',
44
+      });
45
+    }
46
+    else if (that.data.InputValue.length<5){
47
+      wx.showToast({
48
+        title: '请多写点内容',
49
+      });
50
+    }
51
+    else{
52
+
53
+      wx.showLoading({
54
+        title: '保存中',
55
+        mask: true,
56
+      });
57
+      
58
+
59
+      that.uploadImageAll(that.data.ImageArr,function (success,arrResult) {
60
+        if (success) {
61
+          wx.hideLoading();         
62
+          var param={};
63
+          param.ProgramID=186;
64
+          param.UserID=app.globalData.userInfo.UserID;
65
+          param.Content=that.data.InputValue;
66
+          param.ContactTa=that.data.InputValue2;
67
+          param.FeedbackType=[];
68
+          for(var i=0;i<that.data.Feedback.length;i++){
69
+            if (that.data.Feedback[i].CSS=="Selected")
70
+              param.FeedbackType.push(that.data.Feedback[i].Name);
71
+          }
72
+          param.FeedbackType=param.FeedbackType.join(",");
73
+          
74
+          if (arrResult.length>0)
75
+            param.ImageUrl1=arrResult[0].Target;
76
+          if (arrResult.length>1)
77
+            param.ImageUrl2=arrResult[1].Target;
78
+          if (arrResult.length>2)
79
+            param.ImageUrl3=arrResult[2].Target;
80
+          if (arrResult.length>3)
81
+            param.ImageUrl4=arrResult[3].Target;
82
+
83
+          param.FeedbackUrl=app.globalData.FeedbackUrl;
84
+            
85
+          main.postData('MPSFeedback', param, function (data) {
86
+            wx.showModal({
87
+              title: '提醒',
88
+              content: '您的反馈已经收到,我们会尽快处理。感谢您的支持!',
89
+              showCancel: false,
90
+              complete: (res) => {
91
+                if (res.confirm) {
92
+                  wx.navigateBack({
93
+                    delta: 1
94
+                  });
95
+                }
96
+              }
97
+            });
98
+          });
99
+
100
+        } else {
101
+          wx.showToast({
102
+            title: '图片上传失败',
103
+            image: "../images/universalpic_exclamation_white_120x120.png",
104
+            mask: true,
105
+          });
106
+        }
107
+      });
108
+    }
109
+  },
110
+  //选择图片上传
111
+  uploadImageField: function () {
112
+    //console.log("uploadImageStart");
113
+    var that = this;
114
+
115
+    //若是安卓机
116
+    if (app.globalData.IsAndroid) {
117
+      selectImage(that);
118
+    } else {
119
+      wx.showActionSheet({
120
+        itemList: ['拍照', '从手机相册选择'],
121
+        success(res) {
122
+          if (res.tapIndex == 0) {
123
+            wx.chooseImage({
124
+              count: 1,
125
+              sizeType: ['compressed'],
126
+              sourceType: ['camera'],
127
+              success(res2) {
128
+                wx.showLoading({
129
+                  title: '请稍候',
130
+                  mask: true,
131
+                });
132
+                setTimeout(function () {
133
+                  wx.hideLoading();
134
+                  selectImage(that);
135
+                }, 2000);
136
+              },
137
+            });
138
+          } else if (res.tapIndex == 1) {
139
+            selectImage(that);
140
+          }
141
+        },
142
+        fail(res) {
143
+          console.log(res.errMsg)
144
+        }
145
+      });
146
+    }
147
+
148
+    function selectImage(that) {
149
+      var sizeType = ['album'];
150
+      //若是安卓机
151
+      if (app.globalData.IsAndroid)
152
+        sizeType = ['album', 'camera'];
153
+
154
+      wx.chooseImage({
155
+        count: 1,
156
+        sizeType: ['compressed'],
157
+        sourceType: sizeType,
158
+        success(res) {
159
+          // tempFilePath可以作为img标签的src属性显示图片
160
+          var tempFilePaths = res.tempFilePaths;
161
+          //console.log(tempFilePaths[0]);
162
+          //that.data.FieldContent = that.data.FieldContent + "[图 url='" + tempFilePaths[0] + "']" + tempFilePaths[0] + "[/图]";
163
+          that.data.ImageArr.push(tempFilePaths[0]);
164
+          that.setData({
165
+            ImageArr:that.data.ImageArr,
166
+          });
167
+        },
168
+        fail: function () {
169
+
170
+        }
171
+      });
172
+    }
173
+  },
174
+  uploadFileToServer: function (file, callback) {
175
+    var url = common.Encrypt("MiaoguoUploadFile2");
176
+    wx.showLoading({
177
+      title: '上传中',
178
+      mask: true,
179
+    });
180
+    url=app.globalData.serverUrl + url;
181
+    wx.uploadFile({
182
+      url: url,
183
+      filePath: file,
184
+      name: 'file',
185
+      success(res) {
186
+        var err = JSON.parse(res.data);
187
+        if (err.errcode == 10000) {
188
+          wx.hideLoading();
189
+          callback(err.result);
190
+        } else {
191
+          wx.hideLoading();
192
+          wx.showModal({
193
+            title: '上传文件失败1',
194
+            showCancel: false,
195
+            content: JSON.stringify(err.errMsg),
196
+          });
197
+        }
198
+      },
199
+      fail: function (err) {
200
+        wx.hideLoading();
201
+        wx.showModal({
202
+          title: '上传文件失败2',
203
+          showCancel: false,
204
+          content: JSON.stringify(err)+" url:"+url,
205
+        });
206
+      }
207
+    });
208
+  },
209
+
210
+  uploadImageAll: function (arr, callback) {
211
+    var that = this;
212
+    var b = false;
213
+    var arrResult = [];
214
+    for (var i = 0; i < arr.length; i++) {
215
+      var source = arr[i];
216
+      that.uploadFileToServer(source, function (data) {
217
+        if (data) {
218
+          var result = data;
219
+          result.Target = app.globalData.uploadImageUrl + result.Target;
220
+          arrResult.push(result);
221
+        }
222
+      });
223
+    }
224
+
225
+    //检查是否上传成功
226
+    setTimeout(function () {
227
+      if (arrResult.length==arr.length)
228
+        callback(true, arrResult);
229
+    }, 2000);
230
+  },
231
+  goto: function (e) {
232
+    main.goto(e);
233
+  },
234
+  onSelect:function(event){
235
+    var that=this;
236
+    main.onSelect(that,event,function(obj,e,result){
237
+      if (e.currentTarget.dataset.object=="Feedback"){
238
+        
239
+      }
240
+    });   
241
+  },
242
+  onShareTimeline: function () {
243
+    return this.onShareAppMessage();
244
+  },
245
+  onShareAppMessage: function () {
246
+    return {
247
+      title: app.globalData.ShareTitle,
248
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
249
+      imageUrl: app.globalData.ShareImage,
250
+    }
251
+  },
252
+})

+ 6 - 0
pages/main/feedbackinfo.json

@@ -0,0 +1,6 @@
1
+{
2
+  "navigationBarTitleText": "用户反馈",
3
+  "navigationBarBackgroundColor": "#F0F0F0",
4
+  "navigationBarTextStyle": "black",
5
+  "backgroundColor": "#F0F0F0"
6
+}

+ 46 - 0
pages/main/feedbackinfo.wxml

@@ -0,0 +1,46 @@
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
+  <view class="panelBasicCss panel1 FlexColumn">
3
+    <view class="text01">本次反馈属于以下哪一种</view>
4
+    <view class="panel11 FlexRow">
5
+      <view class="panelCheckbox panelCheckbox{{item.CSS}} FlexRow" wx:for="{{Feedback}}" wx:key="index"
6
+        bindtap="onSelect" data-object="Feedback" data-index="{{index}}" data-clicktype="checkbox">
7
+        <view class="panelCheckboxCircle panelCheckboxCircle{{item.CSS}} FlexRow">
8
+          <image wx:if="{{item.CSS}}" class="panelCheckbox_icon_check_01" src="../images/icon_check_01.png"></image>
9
+        </view>
10
+        <view>{{item.Name}}</view>
11
+      </view>
12
+    </view> 
13
+  </view>
14
+  <view class="panelBasicCss panel2 FlexColumn">
15
+    <view class="text01">留言</view>
16
+    <view class="panelLine3"></view>
17
+    <textarea class="text02" bindinput="bindKeyInput" value="{{InputValue}}" maxlength="800" placeholder="请填写至少5个汉字以上内容,以便我们准确理解您的意思。" placeholder-style="color:#9b9b9b;font-size:28rpx;font-weight:400;" />
18
+  </view>
19
+  <view class="panelBasicCss panel3 FlexColumn">
20
+    <view class="panel31 FlexRow">
21
+      <view class="text04">相关截图(选填)</view>
22
+      <view class="text03 FlexRow">
23
+        {{ImageArr.length}} / 4
24
+      </view>
25
+    </view>
26
+    <view class="text05">劳烦提供截图,并将错处做个记号。万分感谢。</view>
27
+    <view class="panel32 FlexRow">
28
+      <view class="panel311 FlexColumn" wx:for="{{ImageArr}}" wx:key="index">
29
+        <image class="ImageUpload" mode="aspectFill" src="{{item}}"></image>
30
+      </view>
31
+      <view class="panel311 FlexColumn" wx:key="index" wx:if="{{ImageArr.length<4}}" bindtap="uploadImageField">
32
+        <image class="icon_add_01" src="../images/icon_add_01.png"></image>
33
+      </view>
34
+    </view>
35
+  </view>
36
+
37
+  <view class="panelBasicCss panel4 FlexColumn" wx:if="{{IsShow}}">
38
+    <view class="text01">联系方式</view>
39
+    <view class="panelLine3"></view>
40
+    <textarea class="text06" bindinput="bindKeyInput2" value="{{InputValue2}}" maxlength="100" placeholder="您的联系方式" placeholder-style="color:#9b9b9b;font-size:28rpx;font-weight:400;" />
41
+  </view>
42
+  
43
+  <view class="btn" bindtap="saveFeedback">提交</view>
44
+
45
+  <view style="height:200rpx"></view>
46
+</view>

+ 162 - 0
pages/main/feedbackinfo.wxss

@@ -0,0 +1,162 @@
1
+
2
+.container {
3
+  width:100%;
4
+  color: #4D4D4D;
5
+  justify-content: flex-start;
6
+  font-weight: 700;
7
+  background-color: #F2F2F2;
8
+} 
9
+
10
+.panelBasicCss{
11
+  border-radius: 20rpx;
12
+  background-color: #fff;
13
+  width:710rpx;
14
+  min-height:10rpx;
15
+  position: relative;
16
+  margin-top: 30rpx;
17
+}
18
+
19
+
20
+.panel1{
21
+  height:223rpx;
22
+  align-items: flex-start;
23
+}
24
+
25
+.text01{
26
+  font-size:32rpx;
27
+  margin:0 0 0 40rpx;
28
+  align-self: start;
29
+}
30
+.panel11{
31
+  margin:30rpx 0 0 40rpx;
32
+}
33
+
34
+
35
+.panelCheckbox{
36
+  height:48rpx;
37
+  background-color: #fff;
38
+  border:2rpx solid #E8E6E4;
39
+  border-radius: 10rpx;
40
+  margin-right: 10rpx;
41
+  font-size: 20rpx;
42
+  padding: 0 20rpx;
43
+}
44
+.panelCheckboxSelected{
45
+  background-color: #FCE9E3;
46
+  color:#EB5C28;
47
+  border:2rpx solid #FCE9E3;
48
+}
49
+.panelCheckboxCircle{
50
+  border-radius: 50%;
51
+  width: 30rpx;
52
+  height: 30rpx;
53
+  border: 2rpx solid #E8E6E4;
54
+  margin-right: 10rpx;
55
+}
56
+.panelCheckboxCircleSelected{
57
+  background-color: #EB5C28;
58
+  border: 2rpx solid #EB5C28;
59
+}
60
+
61
+.panelCheckbox_icon_check_01{
62
+  width: 16rpx;
63
+  height: 12rpx;
64
+}
65
+
66
+
67
+.panel2{
68
+  height:526rpx;
69
+}
70
+
71
+.panelLine3{
72
+  width:630rpx;
73
+  background-color: #d2d2d2;
74
+  height:1rpx;
75
+  margin-top: 30rpx;
76
+}
77
+
78
+.text02{
79
+  width:630rpx;
80
+  height:320rpx;
81
+  font-size: 28rpx;
82
+  font-weight: 400;
83
+  color:#2e2e2e;
84
+  margin-top: 30rpx;
85
+}
86
+
87
+.text03{
88
+  font-size: 32rpx;
89
+}
90
+
91
+.panel3{
92
+  justify-content: flex-start;
93
+}
94
+
95
+.panel31{
96
+  width:630rpx;
97
+  justify-content: space-between;
98
+  margin-top: 50rpx;
99
+}
100
+
101
+.text04{
102
+  font-size:32rpx;
103
+  align-self: start;
104
+}
105
+.text05{
106
+  font-size:24rpx;
107
+  font-weight: 400;
108
+  align-self: start;
109
+  margin:4rpx 0 0 40rpx;
110
+}
111
+
112
+.panel32{
113
+  justify-content: flex-start;
114
+  margin-top: 30rpx;
115
+  min-width: 630rpx;
116
+}
117
+
118
+.panel311{
119
+  width:140rpx;
120
+  height:140rpx;
121
+  border-radius: 10rpx;
122
+  background-color: #f0f0f0;
123
+  border:1rpx solid #d2d2d2;
124
+  margin: 0 20rpx 50rpx 0;
125
+}
126
+
127
+.ImageUpload{
128
+  width:140rpx;
129
+  height:140rpx;
130
+  border-radius: 10rpx;
131
+}
132
+
133
+.icon_add_01{
134
+  width:30rpx;
135
+  height:30rpx;
136
+}
137
+
138
+.panel4{
139
+  min-height:283rpx;
140
+}
141
+
142
+.text06{
143
+  width:630rpx;
144
+  height:50rpx;
145
+  font-size: 28rpx;
146
+  font-weight: 400;
147
+  color:#2e2e2e;
148
+  margin-top: 30rpx;
149
+}
150
+
151
+.btn{
152
+  width:710rpx;
153
+  height:110rpx;
154
+  line-height: 110rpx;
155
+  text-align: center;
156
+  border: 3rpx solid #EB5C28;
157
+  margin-top: 40rpx;
158
+  border-radius: 20rpx;
159
+  background-color: #FCE9E3;
160
+  color:#EB5C28;
161
+  font-size: 36rpx;
162
+}

+ 1 - 1
pages/main/help.wxml

@@ -1,4 +1,4 @@
1 1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;' bindtap="onContainerTap">
2
-  <image mode="widthFix" src="../images/pic_h{{item}}.png" class="pic_h04" wx:for='{{["04","05","06","07","08","09","10","11"]}}' wx:key="index"></image>
2
+  <image mode="widthFix" src="../images/pic_h{{item}}.png" class="pic_h04" wx:for='{{["04","05","06","07","08","09","10","11","12","13","14","15"]}}' wx:key="index"></image>
3 3
         
4 4
 </view>

+ 1 - 0
pages/main/index.js

@@ -15,6 +15,7 @@ Page({
15 15
     });
16 16
   },
17 17
   onShow:function(){
18
+    app.globalData.OCRWords=[];
18 19
     this.getData();
19 20
   },
20 21
   goto: function (e) {

+ 1 - 1
pages/main/index.wxml

@@ -19,7 +19,7 @@
19 19
         <view>如何提升AI生成内容的质量</view>
20 20
       </view>
21 21
       <view class="panelLine"></view>
22
-      <view class="panel31 FlexRow">
22
+      <view class="panel31 FlexRow" bind:tap="goto" data-url="feedbackinfo">
23 23
         <view class="text04">纠错与建议</view>
24 24
         <image src="../images/sysIcon_a02.png" class="sysIcon_a02"></image>
25 25
       </view>

+ 7 - 7
pages/main/ocr.js

@@ -203,18 +203,18 @@ Page({
203 203
 
204 204
   // 提取英语单词的函数 - 增强版
205 205
   extractEnglishWords(texts) {
206
-    console.group('英语单词提取');
206
+    //console.group('英语单词提取');
207 207
     const words = new Set();
208 208
 
209 209
     texts.forEach(item => {
210 210
       const text = item.text;
211
-      console.log('处理文本:', text);
211
+      //console.log('处理文本:', text);
212 212
       
213 213
       // 使用多种分隔符分割文本(空格、逗号、句号、感叹号、中文字符等)
214 214
       // 这个正则表达式会匹配任何非英文字母、撇号或连字符的字符作为分隔符
215 215
       const parts = text.split(/[^A-Za-z''-]+/).filter(Boolean);
216 216
       
217
-      console.log('分割后的部分:', parts);
217
+      //console.log('分割后的部分:', parts);
218 218
       
219 219
       // 处理每个可能的单词
220 220
       parts.forEach(part => {
@@ -224,7 +224,7 @@ Page({
224 224
         // 特殊处理单词"I"
225 225
         if (cleanWord === 'I' || cleanWord === 'a') {
226 226
           words.add(cleanWord); // 添加小写的"i"
227
-          console.log('添加单词: I (特殊处理)');
227
+          //console.log('添加单词: I (特殊处理)');
228 228
         }
229 229
         // 处理其他单词(长度>=2)
230 230
         else if (cleanWord && cleanWord.length >= 2 && /^[A-Za-z''-]+$/.test(cleanWord)) {
@@ -233,7 +233,7 @@ Page({
233 233
             lowerWord="I'm";
234 234
           }
235 235
           words.add(lowerWord);
236
-          console.log('添加单词:', lowerWord);
236
+          //console.log('添加单词:', lowerWord);
237 237
         }
238 238
       });
239 239
     });
@@ -241,8 +241,8 @@ Page({
241 241
     //const result = Array.from(words).sort();
242 242
     let result = Array.from(words);
243 243
     result = common.removeDuplicateAndTrimStrings(result);
244
-    console.log('提取结果:', result);
245
-    console.groupEnd();
244
+    //console.log('提取结果:', result);
245
+    //console.groupEnd();
246 246
     return result;
247 247
   },
248 248
   

+ 19 - 20
pages/main/paste.js

@@ -11,7 +11,7 @@ Page({
11 11
   data: {
12 12
     Words:"",
13 13
     importWordStr:"",//输入过的单词
14
-    inputThreshold: 100, // 时间阈值,单位毫秒,可根据实际情况调整
14
+    inputThreshold: 5000, // 时间阈值,单位毫秒,可根据实际情况调整
15 15
   },
16 16
   onLoad: function (options) {
17 17
     let that = this;
@@ -22,8 +22,6 @@ Page({
22 22
       Words:words, 
23 23
     });
24 24
   },
25
-  
26
-  
27 25
   handlePaste: function(e) {
28 26
     let that = this;
29 27
     // 获取剪贴板内容
@@ -32,14 +30,15 @@ Page({
32 30
         let str="";
33 31
         if (that.data.Words)
34 32
           str+=that.data.Words+"\n";
35
-        str+=that.setWordsArr(res.data).join("\n");
33
+        //str+=that.setWordsArr(res.data).join("\n");
34
+        str+=res.data;
36 35
         
37
-        // let arr=that.setWordsArr(str);
38
-        // str=arr.join("\n");
39 36
         that.setData({
40 37
           Words: str,
41 38
           importWordStr:str,
42 39
         });
40
+
41
+        IsEdit=true;
43 42
       },
44 43
       fail: function(err) {
45 44
         console.error('获取剪贴板失败', err);
@@ -57,16 +56,17 @@ Page({
57 56
         let str=that.data.importWordStr;
58 57
         let str2=words.substring(str.length);
59 58
         str+="\n"+str2;
60
-        let arr=that.setWordsArr(str);
61
-        words=arr.join("\n");
59
+        // let arr=that.setWordsArr(str);
60
+        // words=arr.join("\n");
61
+        word=str;
62 62
     } else {
63 63
         console.log("可能是键盘输入");
64 64
     }
65 65
 
66 66
     this.setData({
67 67
         Words: words,
68
-        importWordStr:words,
69
-        lastInputTime: currentTime
68
+        //importWordStr:words,
69
+        //lastInputTime: currentTime
70 70
     });
71 71
     IsEdit=true;
72 72
   },
@@ -83,24 +83,23 @@ Page({
83 83
   },
84 84
   setWordsArr:function(data){
85 85
     let that=this;
86
-    // 这里可以处理粘贴的数据,比如按空格分割成单词
87
-    let words = data.split(/[\r\n]+/);  // 按换行分割
88
-    let words2 = data.split(" ");  // 按空格分割
89
-    //debugger;
90
-    if (words2.length>20 || words2.length>words.length)
91
-      words=words2;
92
-    else if (typeof data === 'string' && data.indexOf(",")>0)
93
-      words = data.split(",");
86
+    let words=[];
87
+    words=data.split(/[\r\n]+/);
88
+    if (words.length==0)
89
+        words = data.split(" ");  // 按空格分割
90
+    
94 91
     // 过滤掉空字符串和非单词内容
95 92
     words = common.filterWordsWithSpecialChars(words);
96 93
     words = common.removeDuplicateAndTrimStrings(words);
97 94
     //debugger;
98 95
     let arr2=[];
99 96
     if (words.length>10){
100
-      for(let i=0;i<10;i++)
97
+      for(let i=0;i<10;i++){
101 98
         arr2.push(words[i]);
102
-        words=arr2;
99
+      }
100
+      words=arr2;
103 101
     }
102
+
104 103
     return words;
105 104
   },
106 105
   submit:function(){

+ 6 - 4
pages/main/paste.wxml

@@ -7,15 +7,15 @@
7 7
         <view>示范</view>
8 8
       </view>
9 9
       <view class="panel112 FlexRow" >
10
-        <view class="panel1121 FlexRow" bind:tap="clearInput" data-id="0">清空全部</view>
11
-        <view class="panel1122 FlexRow" bind:tap="handlePaste">粘贴</view>
10
+        <view class="panel1121 FlexRow" bind:tap="handlePaste">粘贴</view>
11
+        <view class="panel1121 panel1122 FlexRow" bind:tap="clearInput" data-id="0">清空</view>
12 12
       </view>
13 13
     </view>
14 14
   </view>
15 15
 
16 16
   <view class="panel2 FlexRow">
17 17
     <view class="panel21 FlexRow">
18
-      <textarea class="text04" focus="true" value="{{Words}}" bindinput="bindKeyInput" />
18
+      <textarea class="text04" focus="true" maxlength="500" value="{{Words}}" bindinput="bindKeyInput" />
19 19
     </view>
20 20
   </view>
21 21
 
@@ -32,5 +32,7 @@
32 32
     <image src="../images/pic_h02.png" class="pic_h01"></image>
33 33
   </scroll-view>
34 34
   <image src="../images/pic_04.png" class="pic_04"></image>
35
-  <view class="panelExampleBtn FlexColumn" catch:tap="showExample">返回</view>
35
+  <view class="panelExampleBtn FlexColumn" catch:tap="showExample">
36
+    <view class="panelExampleBtn1">关闭</view>
37
+  </view>
36 38
 </view>

+ 10 - 8
pages/main/paste.wxss

@@ -24,16 +24,14 @@
24 24
   font-size:24rpx;
25 25
 }
26 26
 .panel1121{
27
-  width: 120rpx;
27
+  width: 88rpx;
28 28
   height:73rpx;
29
-  margin-right: 62rpx;
29
+  margin-right: 20rpx;
30
+  border: 3rpx solid #C1E1C1;
31
+  border-radius: 20rpx;
30 32
 }
31 33
 .panel1122{
32
-  width: 96rpx;
33
-  height:73rpx;
34 34
   margin-right: 40rpx;
35
-  border: 3rpx solid #C1E1C1;
36
-  border-radius: 20rpx;
37 35
 }
38 36
 .sysIcon_a01{
39 37
   width:24rpx;
@@ -66,7 +64,7 @@
66 64
   height:500rpx;
67 65
   font-size: 36rpx;
68 66
   color: #FFDD88;
69
-  
67
+  line-height: 50rpx;
70 68
 }
71 69
 
72 70
 .panelFooter{
@@ -123,7 +121,6 @@
123 121
   align-items: center;
124 122
   padding-bottom: 300rpx;
125 123
 }
126
-
127 124
 .panelExampleBtn{
128 125
   width: 100%;
129 126
   height:140rpx;
@@ -133,7 +130,12 @@
133 130
   position: fixed;
134 131
   bottom:0;
135 132
   z-index: 20;
133
+  justify-content: flex-start;
136 134
 }
135
+.panelExampleBtn1{
136
+  margin-top: 20rpx;
137
+}
138
+
137 139
 .pic_h01{
138 140
   margin-top: 64rpx;
139 141
   margin-left: 15rpx;

+ 9 - 8
pages/main/selectword.js

@@ -45,6 +45,13 @@ 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
     let word=e.currentTarget.dataset.word;
49 56
     let list=this.data.Words;
50 57
     let count=0;
@@ -52,23 +59,17 @@ Page({
52 59
         if(word==list[i].Name){
53 60
           if (list[i].CSS)
54 61
             list[i].CSS="";
55
-          else if(count<this.data.CountMax && this.data.Count<this.data.CountMax)
62
+          else
56 63
             list[i].CSS="Selected";
57 64
         }
58 65
         if(list[i].CSS=="Selected"){
59 66
           count++;
60 67
         }
61 68
     }
62
-    if (count==this.data.CountMax){
63
-        wx.showToast({
64
-          title: '本次最多'+this.data.CountMax+"个",
65
-          icon:"none"
66
-        })
67
-    }
68
-
69 69
     this.setData({
70 70
       Words:list,
71 71
       Count:count,
72
+      IsShowAlert:false,
72 73
     });
73 74
   },
74 75
   goto: function (e) {

+ 4 - 2
pages/main/selectword.wxml

@@ -1,7 +1,7 @@
1 1
 <view class="container FlexColumn" style='min-height:{{Containnerheight+100}}rpx;'>
2 2
   <block wx:if="{{Words.length>0}}">
3 3
     <view class="panel1 FlexColumn">
4
-      <view class="text01">至少选个</view>
4
+      <view class="text01">至少选1个</view>
5 5
       <view class="panel11 FlexRow" >
6 6
         <view class="panel111 FlexRow" bind:tap="showExample">
7 7
           <image src="../images/sysIcon_a01.png" class="sysIcon_a01"></image>
@@ -61,5 +61,7 @@
61 61
     <image src="../images/pic_h03.png" class="pic_h01"></image>
62 62
   </scroll-view>
63 63
   <image src="../images/pic_04.png" class="pic_04"></image>
64
-  <view class="panelExampleBtn FlexColumn" catch:tap="showExample">返回</view>
64
+  <view class="panelExampleBtn FlexColumn" catch:tap="showExample">
65
+    <view class="panelExampleBtn1">关闭</view>
66
+  </view>
65 67
 </view>

+ 11 - 4
pages/main/selectword.wxss

@@ -21,8 +21,11 @@
21 21
   margin-left: 40rpx;
22 22
 }
23 23
 .panel112{
24
-  width: 176rpx;
24
+  width: 136rpx;
25 25
   height:73rpx;
26
+  border: 3rpx solid #C1E1C1;
27
+  border-radius: 20rpx;
28
+  margin-right: 40rpx;
26 29
 }
27 30
 .sysIcon_a01{
28 31
   width:24rpx;
@@ -34,9 +37,10 @@
34 37
   position: fixed;
35 38
   top:0;
36 39
   width: 100%;
37
-  height:140rpx;
40
+  height:100rpx;
38 41
   z-index: 10;
39 42
   justify-content: flex-start;
43
+  align-items: flex-start;
40 44
   background-image: linear-gradient(180deg, #004433 0%, rgba(0,46,34,0.80) 100%);
41 45
 }
42 46
 
@@ -44,7 +48,7 @@
44 48
   background: #CA4B15;
45 49
   border-radius: 10rpx;
46 50
   height:70rpx;
47
-  margin-left: 30rpx;
51
+  margin: 20rpx 0 0 30rpx;
48 52
   padding: 0 30rpx;
49 53
 }
50 54
 
@@ -196,7 +200,6 @@
196 200
   align-items: center;
197 201
   padding-bottom: 300rpx;
198 202
 }
199
-
200 203
 .panelExampleBtn{
201 204
   width: 100%;
202 205
   height:140rpx;
@@ -206,6 +209,10 @@
206 209
   position: fixed;
207 210
   bottom:0;
208 211
   z-index: 20;
212
+  justify-content: flex-start;
213
+}
214
+.panelExampleBtn1{
215
+  margin-top: 20rpx;
209 216
 }
210 217
 .pic_h01{
211 218
   margin-top: 64rpx;

+ 50 - 7
pages/main/wordsinput.js

@@ -43,12 +43,17 @@ Page({
43 43
       if (app.globalData.SelectedWords[i]){
44 44
         obj.Word=app.globalData.SelectedWords[i];
45 45
         obj.CSS="txtWordFinished";
46
+        if (obj.Word && !that.isValidInput(obj.Word)){
47
+          obj.IsError=true;
48
+        }
49
+        else
50
+          obj.IsError=false;
46 51
       }
47 52
       else{
48 53
         obj.Word="";
49 54
         obj.CSS="";
55
+        obj.IsError=false;
50 56
       }
51
-      obj.IsError=false;
52 57
       that.data.Words.push(obj);
53 58
     }
54 59
     //console.log(app.globalData.SelectedWords);
@@ -97,30 +102,60 @@ Page({
97 102
     }
98 103
     that.setData({
99 104
       IsShowAlert:b,
100
-      AlertContent:"不支持特殊符号、数字、句子、非英语单词内容"
105
+      AlertContent:"请勿使用数字、符号、句子等非英语单词内容"
101 106
     });
102 107
   },
103 108
   setArticleParam:function(e){
104 109
     let that=this;
105 110
     let count=0;
111
+    app.globalData.SelectedWords=[];
106 112
     for(let i=0;i<10;i++){
107 113
       if (that.data.Words[i].CSS=="txtWordFinished"){
114
+        app.globalData.SelectedWords.push(that.data.Words[i].Word);
108 115
         count++
109 116
       }
110 117
     }
111 118
     if (count<5){
112 119
       that.setData({
113 120
         IsShowAlert:true,
114
-        AlertContent:"请输入至少5个英语单词"
121
+        AlertContent:"请输入至少5个英语单词或词组"
115 122
       });
116 123
     }
117 124
     else{
118
-      that.setData({
119
-        IsShowAlert:false,
120
-        IsShowSetPanel:true,
125
+      that.checkMsgSec(function(result){
126
+        if (result){
127
+          that.setData({
128
+            IsShowAlert:false,
129
+            IsShowSetPanel:true,
130
+          });
131
+        }
121 132
       });
122 133
     }
123 134
   },
135
+  //敏感词判断
136
+  checkMsgSec:function(callback){
137
+    let that=this;
138
+    var content = app.globalData.SelectedWords.join(",");
139
+    main.postData("MsgSecCheck2", {
140
+      Content: content,
141
+      ProgramID:app.globalData.ProgramID,
142
+      UserID:app.globalData.userInfo.UserID,
143
+    },
144
+    function (data) {
145
+      if (data && data.errcode == 0) {
146
+        callback(true);
147
+      } else {
148
+        if (data.errmsg) {
149
+          wx.showToast({
150
+            title: data.errmsg,
151
+            duration: 2000,
152
+            image: "../images/sysIcon_b16.png",
153
+          });
154
+        }
155
+        callback(false);
156
+      }
157
+    });
158
+  },
124 159
   setMenu:function(){
125 160
     this.setData({
126 161
       IsShowSetPanel:!this.data.IsShowSetPanel,
@@ -242,7 +277,15 @@ Page({
242 277
     const id=e.currentTarget.dataset.id;
243 278
     if (id=="0"){
244 279
       app.globalData.SelectedWords=[];
245
-      this.onShow();
280
+      for(let i=0;i<that.data.Words.length;i++){
281
+        let obj=that.data.Words[i];
282
+        obj.Word="";
283
+        obj.CSS="";
284
+        obj.IsError=false;
285
+      }
286
+      that.setData({
287
+        Words:that.data.Words, 
288
+      });
246 289
     }
247 290
     else{
248 291
       for(let i=0;i<10;i++){

+ 5 - 3
pages/main/wordsinput.wxml

@@ -1,6 +1,6 @@
1 1
 <view class="container FlexColumn" style='min-height:{{Containnerheight+100}}rpx;'>
2 2
   <view class="panel1 FlexColumn">
3
-    <view class="text01">输入单词5-10个</view>
3
+    <view class="text01">输入单词 5-10个</view>
4 4
     <view class="panel11 FlexRow" >
5 5
       <view class="panel111 FlexRow" bind:tap="showExample">
6 6
         <image src="../images/sysIcon_a01.png" class="sysIcon_a01"></image>
@@ -21,7 +21,7 @@
21 21
       <view class="panel20 panel2{{item.ID}} {{item.CSS}} FlexRow">
22 22
         <view class="panel211" wx:if="{{!item.IsError}}"></view>
23 23
         <view class="panel211 panel2110" wx:if="{{item.IsError}}"></view>
24
-        <input type="text" class="txtWord" focus="{{item.Focus}}" placeholder="单词 {{item.ID}}"  value="{{item.Word}}" confirm-hold="true" hold-keyboard="true" confirm-type="{{KeyboardBtnName}}" maxlength="30" placeholder-class="placeholderClass" bindconfirm="keyboardOK"  bindfocus="setFocus" bindinput="bindKeyInput" data-id="{{item.ID}}"/>
24
+        <input type="text" 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}}"/>
25 25
         <view class="panel20Delete FlexRow" wx:if="{{item.CSS}}" bind:tap="clearInput" data-id="{{item.ID}}">
26 26
           <image src="../images/sysIcon_a99.png" class="sysIcon_a14"></image>
27 27
         </view>
@@ -92,7 +92,9 @@
92 92
     <image src="../images/pic_h01.png" class="pic_h01"></image>
93 93
   </scroll-view>
94 94
   <image src="../images/pic_04.png" class="pic_04"></image>
95
-  <view class="panelExampleBtn FlexColumn" catch:tap="showExample">返回</view>
95
+  <view class="panelExampleBtn FlexColumn" catch:tap="showExample">
96
+    <view class="panelExampleBtn1">关闭</view>
97
+  </view>
96 98
 </view>
97 99
 
98 100
 <view wx:if="{{IsShowRemind}}" class="panelMenu container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>

+ 12 - 3
pages/main/wordsinput.wxss

@@ -21,8 +21,11 @@
21 21
   margin-left: 40rpx;
22 22
 }
23 23
 .panel112{
24
-  width: 176rpx;
24
+  width: 136rpx;
25 25
   height:73rpx;
26
+  border: 3rpx solid #C1E1C1;
27
+  border-radius: 20rpx;
28
+  margin-right: 40rpx;
26 29
 }
27 30
 .sysIcon_a01{
28 31
   width:24rpx;
@@ -34,9 +37,10 @@
34 37
   position: fixed;
35 38
   top:0;
36 39
   width: 100%;
37
-  height:130rpx;
40
+  height:100rpx;
38 41
   z-index: 10;
39 42
   justify-content: flex-start;
43
+  align-items: flex-start;
40 44
   background-image: linear-gradient(180deg, #004433 0%, rgba(0,46,34,0.80) 100%);
41 45
 }
42 46
 
@@ -44,7 +48,7 @@
44 48
   background: #CA4B15;
45 49
   border-radius: 10rpx;
46 50
   height:70rpx;
47
-  margin: 0 0 0 30rpx;
51
+  margin: 20rpx 0 0 30rpx;
48 52
   padding: 0 30rpx;
49 53
 }
50 54
 
@@ -321,7 +325,12 @@
321 325
   position: fixed;
322 326
   bottom:0;
323 327
   z-index: 20;
328
+  justify-content: flex-start;
329
+}
330
+.panelExampleBtn1{
331
+  margin-top: 20rpx;
324 332
 }
333
+
325 334
 .pic_h01{
326 335
   margin-top: 64rpx;
327 336
   margin-left: 15rpx;

+ 8 - 52
utils/constant.js

@@ -1,60 +1,16 @@
1 1
 module.exports = {
2
-  arrHardLevel: [{
3
-    Level: 0,
4
-    Name: "小学生难度"
5
-  }, {
6
-    Level: 1,
7
-    Name: "初中生难度"
8
-  }, {
9
-    Level: 2,
10
-    Name: "高中生难度"
11
-  }, {
12
-    Level: 3,
13
-    Name: "大学生难度"
14
-  }],
15
-  arrArticleStyle: [{
16
-      Name: "童话类",
17
-      List: [{
18
-        Name: "童话故事"
19
-      }, {
20
-        Name: "寓言故事"
21
-      }, {
22
-        Name: "科幻/奇幻故事"
23
-      }]
24
-    },
2
+  arrFeedback: [
25 3
     {
26
-      Name: "生活类",
27
-      List: [{
28
-        Name: "校园文化"
29
-      }, {
30
-        Name: "家庭故事"
31
-      }, {
32
-        Name: "节日与文化"
33
-      }, {
34
-        Name: "旅行见闻"
35
-      }]
4
+      Name: "纠错",
5
+      CSS: "Selected"
36 6
     },
37 7
     {
38
-      Name: "自然与科学",
39
-      List: [{
40
-        Name: "动物故事"
41
-      }, {
42
-        Name: "环保主题"
43
-      }, {
44
-        Name: "科普短文"
45
-      }]
8
+      Name: "提供内容",
9
+      CSS: ""
46 10
     },
47 11
     {
48
-      Name: "情感与哲理",
49
-      List: [{
50
-        Name: "友情与分享"
51
-      }, {
52
-        Name: "成长烦恼"
53
-      }, {
54
-        Name: "人生哲理"
55
-      }, {
56
-        Name: "励志故事"
57
-      }]
12
+      Name: "产品建议",
13
+      CSS: ""
58 14
     },
59
-  ]
15
+  ],
60 16
 }

+ 27 - 0
utils/main.js

@@ -105,11 +105,38 @@ function getWindowHeight() {
105 105
   return height;
106 106
 }
107 107
 
108
+function onSelect(obj,event,callback){
109
+  var result=false;
110
+  var str=event.currentTarget.dataset.object;
111
+  var index=event.currentTarget.dataset.index;
112
+  var clickType=event.currentTarget.dataset.clicktype;
108 113
 
114
+  if (clickType=="checkbox"){
115
+    if (obj.data[str][index].CSS)
116
+      obj.data[str][index].CSS="";
117
+    else{
118
+      obj.data[str][index].CSS="Selected";
119
+      result=true;
120
+    }
121
+  }
122
+  else{
123
+    for(var i=0;i<obj.data[str].length;i++){
124
+      if (i==index){
125
+        obj.data[str][i].CSS="Selected";
126
+      }
127
+      else{
128
+        obj.data[str][i].CSS="";
129
+      }
130
+    }
131
+  }
132
+  obj.setData(obj.data);
133
+  callback(obj,event,result);
134
+}
109 135
 
110 136
 module.exports = {
111 137
   getData: getData,
112 138
   postData: postData,
113 139
   getLocalHost: getLocalHost,
114 140
   getWindowHeight: getWindowHeight,
141
+  onSelect:onSelect,
115 142
 }

+ 37 - 1
utils/util.js

@@ -499,7 +499,15 @@ function initMonthCalendar(dates, line = 6,isNull=true) {
499 499
 }
500 500
 
501 501
 function filterWordsWithSpecialChars(words) {
502
-  return words.filter(word => word && /^[a-zA-Z\s'’-]+$/.test(word));
502
+  if (!Array.isArray(words)) {
503
+    return [];
504
+  }
505
+  
506
+  return words.map(word => {
507
+    if (!word) return '';
508
+    // 只保留大小写字母、单引号、连字符和空格
509
+    return word.toString().replace(/[^a-zA-Z''\- ]/g, '');
510
+  });
503 511
 }
504 512
 
505 513
 /**
@@ -516,6 +524,33 @@ function removeDuplicateAndTrimStrings(arr) {
516 524
   return [...new Set(arr.map(str => str ? str.trim() : ''))];
517 525
 }
518 526
 
527
+/**
528
+ * 使用多个分隔符分割字符串
529
+ * @param {string} str - 要分割的原始字符串
530
+ * @param {string[]} delimiters - 分隔符数组
531
+ * @returns {string[]} 分割后的字符串数组
532
+ */
533
+function splitByMultipleDelimiters(str, delimiters) {
534
+  if (!str || !delimiters || delimiters.length === 0) {
535
+    return [str];
536
+  }
537
+
538
+  // 创建正则表达式,转义特殊字符
539
+  const escapedDelimiters = delimiters.map(d => 
540
+    d.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
541
+  );
542
+  
543
+  // 构建正则表达式模式
544
+  const pattern = new RegExp(`(${escapedDelimiters.join('|')})`);
545
+  
546
+  // 执行分割
547
+  const parts = str.split(pattern);
548
+  
549
+  // 过滤掉分隔符本身
550
+  return parts.filter(part => !delimiters.includes(part));
551
+}
552
+
553
+
519 554
 module.exports = {
520 555
   formatTime: formatTime,
521 556
   formatDateCHS: formatDateCHS,
@@ -543,4 +578,5 @@ module.exports = {
543 578
   initMonthCalendar:initMonthCalendar,
544 579
   filterWordsWithSpecialChars:filterWordsWithSpecialChars,
545 580
   removeDuplicateAndTrimStrings:removeDuplicateAndTrimStrings,
581
+  splitByMultipleDelimiters:splitByMultipleDelimiters,
546 582
 }