chengjie 3 månader sedan
förälder
incheckning
ced3926044

+ 13 - 6
app.js

@@ -1,7 +1,7 @@
1 1
 App({
2 2
   globalData: {
3
-    Version: "2.5.2",
4
-    IsProduction: true,
3
+    Version: "2.5.5",
4
+    //IsProduction: true,
5 5
     ShareTitle: "高效学习从秒过开始",
6 6
     SharePath: "pages/index/index",
7 7
     ShareImage: '../images/program_share-a01.png',
@@ -10,6 +10,7 @@ App({
10 10
     AppID: "wx84b3feac6069eec3",
11 11
     serverUrl: "https://www.kylx365.com/apiData/",
12 12
     serverUrlServer: "https://www.kylx365.com/apiData/",
13
+    serverUrlServer2: "https://scoreline.kylx365.com/apiData/",
13 14
     serverUrlLocalhost: "http://localhost:3020/apiData/",
14 15
     audioUrlBaidu: "https://tsn.baidu.com/text2audio?lan=zh&ctp=1&cuid=abcdxxx&tok=[token]&tex=[word]&vol=9&per=0&spd=3&pit=5",
15 16
     audioUrlYoudao: "https://dict.youdao.com/dictvoice?rate=10&le=auto&audio=[word]",
@@ -82,10 +83,16 @@ App({
82 83
       this.globalData.IsAndroid=false;
83 84
 
84 85
       if (this.globalData.systemInfo.model.indexOf("X") >= 0
85
-        || this.globalData.systemInfo.model.indexOf("11") >= 0
86
-        || this.globalData.systemInfo.model.indexOf("12") >= 0
87
-        || this.globalData.systemInfo.model.indexOf("13") >= 0 
88
-        || this.globalData.systemInfo.model.indexOf("14") >= 0)
86
+      || this.globalData.systemInfo.model.indexOf("11") >= 0
87
+      || this.globalData.systemInfo.model.indexOf("12") >= 0
88
+      || this.globalData.systemInfo.model.indexOf("13") >= 0 
89
+      || this.globalData.systemInfo.model.indexOf("14") >= 0 
90
+      || this.globalData.systemInfo.model.indexOf("15") >= 0 
91
+      || this.globalData.systemInfo.model.indexOf("16") >= 0
92
+      || this.globalData.systemInfo.model.indexOf("17") >= 0
93
+      || this.globalData.systemInfo.model.indexOf("18") >= 0
94
+      || this.globalData.systemInfo.model.indexOf("19") >= 0 
95
+      || this.globalData.systemInfo.model.indexOf("20") >= 0)
89 96
         this.globalData.IsIPhoneX=true;
90 97
     }
91 98
 

BIN
pages/images/ArrowDown1.png


BIN
pages/images/ArrowUp1.png


+ 7 - 1
pages/index/index.js

@@ -178,7 +178,13 @@ Page({
178 178
       } 
179 179
       else if (options.type == "helpAddInfomation") { 
180 180
         wx.setStorageSync('IsHelpAddInfomation', 1);
181
-      } 
181
+      }
182
+      else if (options.type=="buildcard"){
183
+        this.setData({ 
184
+          gotoType: "other", 
185
+          gotoUrl: "../main/cardmain?type="+options.type+"&Words="+options.Words, 
186
+        }); 
187
+      }
182 188
     }
183 189
     this.setData({
184 190
       IsRefresh: false,

+ 2 - 0
pages/main/addInfomationDetail.js

@@ -216,6 +216,8 @@ Page({
216 216
               item.Content = main.encryptUrl(item.Content);
217 217
 
218 218
               str = "[图]" + item.Content + "[/图]";
219
+            } else if (key=="ENG_Word") {
220
+              str = "[特]" + item.Content + "[/特]";
219 221
             } else if (key=="LATEX_LatexName") {
220 222
               str = "[特 FS=\"64\"]" + item.Content + "[/特]";
221 223
             } else if (key=="LATEX_LatexContent") {

+ 31 - 1
pages/main/cardmain.js

@@ -12,7 +12,7 @@ Page({
12 12
     IsShowOrder: false,
13 13
     IsIPad: app.globalData.IsIPad,
14 14
   },
15
-  onLoad: function () {
15
+  onLoad: function (options) {
16 16
     var that = this;
17 17
 
18 18
     var isshow=app.globalData.userInfo.isShow;
@@ -35,6 +35,7 @@ Page({
35 35
 
36 36
     canPress=true;
37 37
 
38
+    that.buildCardByYJBDC(options);
38 39
   },
39 40
   onPullDownRefresh: function () {
40 41
     var that = this;
@@ -251,6 +252,35 @@ Page({
251 252
       url: url,
252 253
     });
253 254
   },
255
+  buildCardByYJBDC:function(options){
256
+    if (options.type=="buildcard"){
257
+      wx.setNavigationBarColor({
258
+        frontColor: "#000000",
259
+        backgroundColor: "#ffffff",
260
+      });
261
+  
262
+      let words=options.Words.split(",");
263
+      wx.showModal({
264
+        title: '提醒',
265
+        content: '侦测到来自「语境背单词」小程序发来的信息,要求为您创建'+words.length+'张单词题卡。确认创建吗?',
266
+        complete: (res) => {
267
+          if (res.confirm) {
268
+            let param={};
269
+            param.FolderType=2;
270
+            param.Words=options.Words;
271
+            main.postData('BuildMiaoguoCardByYJBDC?UserID=' + app.globalData.userInfo.UserID, param, function (data) {
272
+              wx.showModal({
273
+                title: '提醒',
274
+                content: '系统已为您创建'+words.length+'张日常练习的新题卡,它们被存放在名为「语境背单词」的卡单中。可在题卡栏目查阅。',
275
+                showCancel:false,
276
+                confirmText:"知道了"
277
+              });
278
+            });
279
+          }
280
+        }
281
+      });
282
+    }
283
+  },
254 284
   onShareAppMessage: function () {
255 285
     return {
256 286
       title: app.globalData.ShareTitle,

+ 55 - 0
pages/main/detail.js

@@ -1551,6 +1551,61 @@ Page({
1551 1551
       topBarHeight: h,
1552 1552
     })
1553 1553
   },
1554
+  gotoYJBDC:function(){
1555
+    let that=this;
1556
+    wx.showLoading({
1557
+      title: '请稍候',
1558
+    });
1559
+    let url="GetMiaoguoCardList2?UserID="+app.globalData.userInfo.UserID+"&IsToday=2&CardType=0&OrderType=ac.LastTime%20desc";
1560
+    main.getData(url, function (data) {
1561
+      if (data) {
1562
+        let list=data.List;
1563
+        let words=[];
1564
+        for(let i=0;i<list.length;i++){
1565
+          let str1=main.extractEnglishWords(list[i].Content[1].Content);
1566
+          if (str1){
1567
+            words.push(str1);
1568
+          }
1569
+          else{
1570
+            let str2=main.extractEnglishWords(list[i].Content[2].Content);
1571
+            if (str2){
1572
+              words.push(str2);
1573
+            }
1574
+          }
1575
+        }
1576
+        words = [...new Set(words)];
1577
+        //debugger;
1578
+        if (words.length>0){
1579
+          let content="本次练习中有"+words.length+"张单词题卡,可生成具备真实语境的英语文章,帮您换种方式深化对单词的理解、掌握其用法,进而提升背记效果。该功能需要切换到秒过新产品「语境背单词」小程序中实现。"
1580
+          wx.showModal({
1581
+            title: '语境背单词',
1582
+            content: content,
1583
+            cancelText:"取消",
1584
+            confirmText: "继续",
1585
+            complete: (res) => {
1586
+              if (res.confirm) {
1587
+                var appid="wx80059777521b897c";
1588
+                var path="pages/index/index?SourceID="+app.globalData.ProgramID+"&goto=selectword&Words="+words.join(",");
1589
+                wx.navigateToMiniProgram({
1590
+                  appId: appid,
1591
+                  path: path,
1592
+                });
1593
+              }
1594
+            }
1595
+          })
1596
+        }
1597
+        else{
1598
+          let content="本次练习暂未匹配到符合条件的单词题卡,详情可咨询小组群或客服天乐。该功能能将当日练习过的符合要求的单词题卡生成英语文章,借助真实语境帮您加深理解、提升背记效率。"
1599
+          wx.showModal({
1600
+            title: '语境背单词',
1601
+            content: content,
1602
+            showCancel:true,
1603
+            confirmText: "知道了",
1604
+          })
1605
+        }
1606
+      }
1607
+    });
1608
+  },
1554 1609
   onShareAppMessage: function () {
1555 1610
     return {
1556 1611
       title: app.globalData.ShareTitle,

+ 6 - 0
pages/main/detail.wxml

@@ -216,6 +216,12 @@
216 216
           </view>
217 217
         </view>
218 218
       </view>
219
+      <view class="panelLastTime4 FlexRow" catch:tap="gotoYJBDC">
220
+        <view class="panelLastTime41 FlexRow">
221
+          <view>语境背单词</view>
222
+        </view>
223
+        <image src='../images/universalpic_indicator_right_gray.png' class="Arrow" />
224
+      </view>
219 225
       <view class="panelLastTime4 FlexRow" catchtap="resetTodayTask" >
220 226
         <view class="panelLastTime41 FlexRow">
221 227
           <image src="../images/icon_reload_1.png" class='icon_reload_1' />

+ 39 - 5
pages/main/mainlist.js

@@ -1272,9 +1272,13 @@ Page({
1272 1272
       if (list[i].Selected)
1273 1273
         selectedCount++;
1274 1274
     }
1275
+    let isShowSelectThis=false;
1276
+    if (selectedCount>0)
1277
+      isShowSelectThis=true;
1275 1278
     that.setData({
1276 1279
       List:list,
1277 1280
       SelectedCount:selectedCount,
1281
+      IsShowSelectThis:isShowSelectThis,
1278 1282
     });
1279 1283
   },
1280 1284
   showMultipleOther: function (event) {
@@ -1301,16 +1305,18 @@ Page({
1301 1305
     var index=event.currentTarget.dataset.index;
1302 1306
     var mData = constant1.arrMultipleSaveData[index];
1303 1307
 
1304
-    if (index==1 || index>=4){
1308
+    if (index==1 || index==4 || index==5 || index==6 || index==7 || index==8){
1305 1309
       var content=mData.Content.replace("[SelectedCount]",that.data.SelectedCount);
1306
-    
1307 1310
       wx.showModal({
1308 1311
         title: '提醒',
1309 1312
         content: content,
1310 1313
         confirmText:mData.ConfirmText,
1311 1314
         complete: (res) => {
1312 1315
           if (res.confirm) {
1313
-            that.saveMultipleData(mData,that.data.List);
1316
+            if (index<8)
1317
+              that.saveMultipleData(mData,that.data.List);
1318
+            else
1319
+              that.gotoYJBDC(that.data.List);
1314 1320
           }
1315 1321
         }
1316 1322
       });
@@ -1351,7 +1357,10 @@ Page({
1351 1357
           that.saveMultipleData(mData,that.data.List);   
1352 1358
         }
1353 1359
       }
1354
-    }    
1360
+    }
1361
+  },
1362
+  selectThisFunc:function(){
1363
+
1355 1364
   },
1356 1365
   //保存多选数据
1357 1366
   saveMultipleData:function(mData,list){
@@ -1523,7 +1532,32 @@ Page({
1523 1532
       urls: [url] // 需要预览的图片http链接列表
1524 1533
     });
1525 1534
   },
1526
-
1535
+  gotoYJBDC:function(list){
1536
+    //console.log(list);
1537
+    let words=[];
1538
+    for(let i=0;i<list.length;i++){
1539
+      if (list[i].Selected){
1540
+        let str1=main.extractEnglishWords(list[i].Content[1].Content);
1541
+        if (str1){
1542
+          words.push(str1);
1543
+        }
1544
+        else{
1545
+          let str2=main.extractEnglishWords(list[i].Content[2].Content);
1546
+          if (str2){
1547
+            words.push(str2);
1548
+          }
1549
+        }
1550
+      }
1551
+    }
1552
+    //debugger;
1553
+    words = [...new Set(words)];
1554
+    var appid="wx80059777521b897c";
1555
+    var path="pages/index/index?SourceID="+app.globalData.ProgramID+"&goto=selectword&Words="+words.join(",");
1556
+    wx.navigateToMiniProgram({
1557
+      appId: appid,
1558
+      path: path,
1559
+    });
1560
+  },
1527 1561
   onShareAppMessage: function () {
1528 1562
     return {
1529 1563
       title: app.globalData.ShareTitle,

+ 9 - 6
pages/main/mainlist.wxml

@@ -51,7 +51,7 @@
51 51
   </view>
52 52
 
53 53
   <view class="panelList FlexColumn">
54
-
54
+    <!-- 有列表时 -->
55 55
     <block wx:if="{{List.length>0}}" wx:for="{{List}}" wx:key="index">
56 56
       <scroll-view class="ScrollView" scroll-left="{{item.ScrollLeft}}" scroll-x="{{CanScroll}}" data-index="{{index}}">
57 57
         <view class="CellHide2" wx:if="{{IsMultipleOptions}}" catchtap="selectedItem" data-id="{{item.MiaoguoCardID}}">
@@ -64,7 +64,6 @@
64 64
             </view>
65 65
           </view>
66 66
         </view>
67
-        
68 67
         <view class='CellItem'>
69 68
           <view class="panelListItem FlexColumn" bindtap='onPreview' data-id="{{item.MiaoguoCardID}}">
70 69
             <view class="panelListItem1 FlexRow">
@@ -118,7 +117,6 @@
118 117
 
119 118
           </view>
120 119
         </view>
121
-
122 120
         <view class='{{FolderListCss}} CellHide' wx:if="{{CardType!=-2 && !PrintID}}">
123 121
           <view class="CellHide1 FlexRow">
124 122
             <view wx:if="{{item.DeleteType==0}}" class="CellHide112 CellHide111 FlexRow" bindtap="DeleteItem" data-id="{{item.MiaoguoCardID}}"><text>删除</text></view>
@@ -139,12 +137,13 @@
139 137
             <view class="CellHide111 FlexRow"><text>放回\n原处</text></view>
140 138
           </view>
141 139
         </view>
142
-
143 140
         <view class="CellHide3" wx:if="{{IsMultipleOptions}}" catchtap="selectedItem" data-id="{{item.MiaoguoCardID}}">
144 141
           
145 142
         </view>
146 143
       </scroll-view>
147
-
144
+      <view class="SelectThisCss FlexRow" wx:if="{{IsShowSelectThis}}" catch:tap="selectThisFunc">
145
+        <image src="../images/ArrowUp1.png" class="ArrowUp1"></image>选择到这里
146
+      </view>
148 147
     </block>
149 148
     <view class="panelMore" wx:if="{{HasPage && CardType!=-2}}" bindtap='gotoNextPage' data-id="{{List[List.length-1].MiaoguoCardID}}"
150 149
       data-iscollect="{{IsCollect}}" data-folderid="{{FolderID}}" data-istoday="{{IsToday}}">更多</view>
@@ -384,6 +383,11 @@
384 383
       <view class="PanelBorderTop PanelMenuItem FlexRow"
385 384
       catchtap="showMultipleNotice" data-index="7"><text>改成新题卡</text></view>
386 385
     </view>
386
+    <view style="height:20rpx;"></view>
387
+    <view class="PanelMenu FlexColumn">
388
+      <view class="PanelBorderTop PanelMenuItem FlexRow"
389
+      catchtap="showMultipleNotice" data-index="8"><text>导到语境背单词</text></view>
390
+    </view>
387 391
   </block>
388 392
 
389 393
   <block wx:if="{{SelectContainerStyle==2}}">
@@ -431,7 +435,6 @@
431 435
   </view>
432 436
 </view>
433 437
 
434
-
435 438
 <view wx:if="{{IsFolderListContainer}}" class="FolderListContainer container FlexColumn" style='height:{{Containnerheight}}rpx;'>
436 439
   <view class="panelTopPanel FlexColumn">
437 440
     <view class="panelTop FlexRow">

+ 18 - 0
pages/main/mainlist.wxss

@@ -550,6 +550,24 @@
550 550
   z-index: 10;
551 551
 }
552 552
 
553
+.SelectThisCss{
554
+  width:200rpx;
555
+  height:50rpx;
556
+  font-size: 24rpx;
557
+  color:#5B677F;
558
+  border-radius: 30rpx;
559
+  background-color: #fff;
560
+  box-shadow: 0 1rpx 1rpx 1rpx rgba(200,200,200,0.10);
561
+  position: fixed;
562
+  left:10rpx;
563
+  bottom: 120rpx;
564
+}
565
+.ArrowUp1{
566
+  width: 14rpx;
567
+  height:26rpx;
568
+  margin-right: 20rpx;
569
+}
570
+
553 571
 /* ************************** */
554 572
 .MenuContainer{
555 573
   width: 100%;

+ 2 - 1
pages/other/userbook.js

@@ -84,7 +84,7 @@ Page({
84 84
       UserID:app.globalData.userInfo.UserID,
85 85
       ShowUserID:app.globalData.userInfo.ShowUserID,
86 86
     });
87
-
87
+    
88 88
     that.init();
89 89
 
90 90
     wx.setNavigationBarColor({
@@ -118,6 +118,7 @@ Page({
118 118
         ClassDayNumber: ClassDayNumber,
119 119
       });
120 120
 
121
+      debugger;
121 122
       //试用
122 123
       if (app.globalData.userInfo.IsTryOut == 1 && app.globalData.userInfo.IsMember == 0){
123 124
         panelShow = 2;

+ 5 - 5
project.private.config.json

@@ -7,11 +7,11 @@
7 7
     "miniprogram": {
8 8
       "list": [
9 9
         {
10
-          "name": "pages_test/knowledge/index",
11
-          "pathName": "pages_test/knowledge/index",
12
-          "query": "",
13
-          "launchMode": "default",
14
-          "scene": null
10
+          "name": "语境",
11
+          "pathName": "pages/index/index",
12
+          "query": "SourceID=173&&type=buildcard&Words=Boy,girl,king,come",
13
+          "scene": null,
14
+          "launchMode": "default"
15 15
         },
16 16
         {
17 17
           "name": "分享",

+ 1 - 0
utils/constant.js

@@ -42,6 +42,7 @@ module.exports = {
42 42
     {ID:5,Title:"转入日常",Content:"是否将[SelectedCount]张题卡转入日常?",ConfirmText:"转入日常",FinishedText:"转入完成",SaveFun:"UpdateMiaoguoCardWebType",Param:{CardType:"0",ListStr:"List"}},
43 43
     {ID:6,Title:"转入紧急",Content:"是否将[SelectedCount]张题卡转入紧急?",ConfirmText:"转入紧急",FinishedText:"转入完成",SaveFun:"UpdateMiaoguoCardWebType",Param:{CardType:"1",ListStr:"List"}},
44 44
     {ID:7,Title:"改成新题卡",Content:"是否将[SelectedCount]张题卡改成新题卡?更改后将在保留以往练习记录的情况下以新题卡的状态从头练习。",ConfirmText:"改成新卡",FinishedText:"更改完成",SaveFun:"ResetUserCard",Param:{CardType:0,ListStr:"List"}},
45
+    {ID:8,Title:"导到语境背单词",Content:"本次选择中有[SelectedCount]张单词题卡,可生成具备真实语境的英语文章,帮您换种方式深化对单词的理解、掌握其用法,进而提升背记效果。该功能需要切换到秒过新产品「语境背单词」小程序中实现。",ConfirmText:"继续"},
45 46
   ],
46 47
   arrListOrder:[{},
47 48
     {

+ 33 - 1
utils/main.js

@@ -1976,6 +1976,37 @@ function showHelpImage() {
1976 1976
   });
1977 1977
 }
1978 1978
 
1979
+//提取英文单词
1980
+function extractEnglishWords(str){
1981
+  let result="";
1982
+  if (str.length>100)
1983
+      result="";
1984
+  else if (str.indexOf("[特")>=0){
1985
+      let str3=str.substring(str.indexOf("[特")+2);
1986
+      str3=str3.substring(str3.indexOf("]")+1,str3.indexOf("[/特]"));
1987
+      result=str3;
1988
+  }
1989
+  else if (str.indexOf("[线]")>=0){
1990
+      let str3=str.substring(str.indexOf("[线]")+3,str.indexOf("[/线]"));
1991
+      result=str3;
1992
+  }
1993
+  else if (str.indexOf("[光]")>=0){
1994
+      let str3=str.substring(str.indexOf("[光]")+3,str.indexOf("[/光]"));
1995
+      result=str3;
1996
+  }
1997
+  else {
1998
+      if (isValidString(str))
1999
+          result=str;
2000
+  }
2001
+  // 去掉前后的空格和换行回车等内容
2002
+  return result.trim();
2003
+
2004
+  function isValidString(str) {
2005
+  // 正则表达式:允许大小写字母(a-zA-Z)、单引号(')、减号(-)和空格(\s)
2006
+    return /^[a-zA-Z'\-\s]+$/.test(str);
2007
+  }
2008
+}
2009
+
1979 2010
 module.exports = {
1980 2011
   getData: getData,
1981 2012
   postData: postData,
@@ -2023,4 +2054,5 @@ module.exports = {
2023 2054
   BuildImage:buildImage,
2024 2055
   ShowHelpImage:showHelpImage,
2025 2056
   getServerSoundErrorArr:getServerSoundErrorArr,
2026
-}
2057
+  extractEnglishWords:extractEnglishWords,
2058
+}