chengjie 4 months ago
parent
commit
7b34aa7bdf

+ 1 - 1
app.js

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

+ 2 - 8
pages/main/article.js

@@ -53,7 +53,7 @@ Page({
53 53
         IsShowGuideContainer:true,
54 54
         IsShowFirstOpen2:false,
55 55
       });
56
-      main.showGuideContainer(that,"#btnQAndA",-124,-370,"pic_ha07",520,5,-2,-20);
56
+      main.showGuideContainer(that,"#btnQAndA",-61,-195,"pic_ha07",240,0);
57 57
     }
58 58
     
59 59
     let IsShowKeyword=wx.getStorageSync('IsShowKeyword');
@@ -307,12 +307,6 @@ Page({
307 307
     });
308 308
     wx.setStorageSync('IsShowLightColor', that.data.IsShowLightColor);
309 309
   },
310
-  closeHelp:function(){
311
-    this.setData({
312
-      IsShowFirstOpen2:false,
313
-    });
314
-    wx.setStorageSync('IsShowFirstOpen2', 2);
315
-  },
316 310
   selectedAnswer:function(e){
317 311
     let that=this;
318 312
     const question=e.currentTarget.dataset.question;
@@ -347,7 +341,7 @@ Page({
347 341
       });
348 342
     }
349 343
     else if (name=="IsShowQuestion"){
350
-      main.showGuideContainer(that,"#panelArticle",75,60,"pic_ha08",391,556);
344
+      main.showGuideContainer(that,"#panelArticle",38,30,"pic_ha08",196,279);
351 345
     }
352 346
   },
353 347
   setShowKeyword:function(){

+ 1 - 1
pages/main/article.wxml

@@ -128,7 +128,7 @@
128 128
     <image src="../images/sysIcon_b07.png" class="sysIcon_b07"></image>
129 129
     <view class="panelHelp2 FlexColumn">
130 130
       <text class="text07">长按句子单独翻译,\n点下面做题目,右下角还有PDF</text>
131
-      <view class="btn3 FlexColumn" bind:tap="closeHelp">知道了</view>
131
+      <view class="btn3 FlexColumn" catch:tap="setDataBoolean" data-name="IsShowFirstOpen2" data-savedata="2">知道了</view>
132 132
     </view>
133 133
   </view>
134 134
 </view>

+ 1 - 1
pages/main/index.js

@@ -70,7 +70,7 @@ Page({
70 70
     that.setData({
71 71
       IsShowGuideContainer:true,
72 72
     });
73
-    main.showGuideContainer(that,"#txtWordsInput",0,110,"pic_ha01",396,248,-5);
73
+    main.showGuideContainer(that,"#txtWordsInput",-5,60,"pic_ha01",196,126);
74 74
     wx.setStorageSync('IsShowGuideContainer', true);
75 75
   },
76 76
   catchTouchMove: main.catchTouchMove,

+ 29 - 3
pages/main/myarticles.js

@@ -7,22 +7,35 @@ const app = getApp();
7 7
 Page({
8 8
   data: {
9 9
     IsShowRemind:false,
10
+    IsNew:0,
10 11
   },
11 12
   onLoad: function (options) {
12 13
     let that = this;
13 14
     that.setData({
14 15
       Containnerheight: main.getWindowHeight(),
15 16
     });
16
-    that.getData(app.globalData.userInfo.UserID);
17
-
18 17
     main.checkGenerating();
18
+    that.getData(app.globalData.userInfo.UserID);
19
+  },
20
+  onShow:function(e){
21
+    let that=this;
22
+    if (that.data.IsNew){
23
+      setTimeout(function(){
24
+        that.getData(app.globalData.userInfo.UserID);
25
+      },1000);
26
+    }
19 27
   },
20 28
   getData:function(userID){
21 29
     wx.showLoading({
22 30
       title: '请稍候',
23 31
     });
24 32
     let that=this;
25
-    main.getData('GetYJBDCArticleList?UserID=' + userID, function (data) {
33
+    let url='GetYJBDCArticleList?UserID=' + userID;
34
+    //debugger;
35
+    if (that.data.IsNew==1)
36
+      url+="&IsNew=1";
37
+    console.log(url);
38
+    main.getData(url, function (data) {
26 39
       wx.hideLoading();
27 40
       if (data) {
28 41
         for(let i=0;i<data.length;i++){
@@ -37,6 +50,16 @@ Page({
37 50
   },
38 51
   goto: function (e) {
39 52
     let that=this;
53
+    if (e.currentTarget.dataset.readcount===0){
54
+      that.setData({
55
+        IsNew:1,
56
+      });
57
+    }
58
+    else{
59
+      that.setData({
60
+        IsNew:0,
61
+      });
62
+    }
40 63
     var url=e.currentTarget.dataset.url;
41 64
     wx.navigateTo({
42 65
       url: url,
@@ -64,6 +87,9 @@ Page({
64 87
          wx.showToast({
65 88
            title: '删除完成',
66 89
          });
90
+         that.setData({
91
+            IsNew:1,
92
+         });
67 93
          that.getData(app.globalData.userInfo.UserID);
68 94
       });
69 95
     }

+ 5 - 3
pages/main/myarticles.wxml

@@ -6,9 +6,11 @@
6 6
   </view>
7 7
   <block wx:if="{{List.length>0}}">
8 8
     <view class="panel1 FlexColumn" wx:for="{{List}}" wx:key="index">
9
-      <view class="text01" bind:tap="goto" data-url="article?ID={{item.ID}}">{{item.CreateTime}}</view>
10
-      
11
-      <view class="panel10 FlexColumn"  bind:tap="goto" data-url="article?ID={{item.ID}}">
9
+      <view class="panel13 FlexRow" bind:tap="goto" data-url="article?ID={{item.ID}}" data-readcount="{{item.ReadCount}}">
10
+        <view class="panel131 FlexRow" wx:if="{{item.ReadCount==0}}">未读</view>
11
+        <view class="text01" >{{item.CreateTime}}</view>
12
+      </view>
13
+      <view class="panel10 FlexColumn"  bind:tap="goto" data-url="article?ID={{item.ID}}" data-readcount="{{item.ReadCount}}">
12 14
         <view class="panel11 FlexRow">
13 15
           <view class="panelLine"></view>
14 16
           <view class="panel111 FlexColumn">

+ 14 - 1
pages/main/myarticles.wxss

@@ -19,11 +19,24 @@
19 19
 .panel10{
20 20
   width:100%;
21 21
 }
22
-.text01{
22
+.panel13{
23 23
   align-self: start;
24
+  justify-content: flex-start;
24 25
   margin: 30rpx 0 0 30rpx;
26
+}
27
+.panel131{
28
+  width: 88rpx;
29
+  height:53rpx;
30
+  background: #C1E1C1;
31
+  border-radius: 10rpx;
32
+  color:#004433;
25 33
   font-size: 24rpx;
34
+  margin-right: 20rpx;
26 35
 }
36
+.text01{
37
+  font-size: 24rpx;
38
+}
39
+
27 40
 .panel11{
28 41
   width: 100%;
29 42
   justify-content: flex-start;

+ 6 - 6
pages/main/wordsinput.js

@@ -97,7 +97,7 @@ Page({
97 97
       });
98 98
       app.globalData.SelectedWords=["cat","dog","meat","fight","","happy","love","study","cry","flower"];
99 99
       that.initWords();
100
-      main.showGuideContainer(that,"#txtWord5",290,-457,"pic_ha02",-50,5,-5,-5);
100
+      main.showGuideContainer(that,"#txtWord5",134,-238,"pic_ha02",0,2);
101 101
     }
102 102
   },
103 103
   initMenu:function(){
@@ -149,7 +149,7 @@ Page({
149 149
       that.setData({
150 150
         Words:that.data.Words,
151 151
       });
152
-      main.showGuideContainer(that,"#btnNext",80,-260,"pic_ha03",0,0,-3,-20);
152
+      main.showGuideContainer(that,"#btnNext",37,-130,"pic_ha03",0,2);
153 153
     }
154 154
     else if (that.data.IsShowGuideContainer){
155 155
       return;
@@ -217,7 +217,7 @@ Page({
217 217
 
218 218
           if (wx.getStorageSync("IsShowGuideContainer")){
219 219
             
220
-            main.showGuideContainer(that,"#btnLevel1",165,-115,"pic_ha04",270,330,-2,0);
220
+            main.showGuideContainer(that,"#btnLevel1",75,-70,"pic_ha04",135,167);
221 221
           }
222 222
         }
223 223
       });
@@ -298,7 +298,7 @@ Page({
298 298
       });
299 299
       wx.setStorageSync('ArticleStyle', index);
300 300
       if (wx.getStorageSync("IsShowGuideContainer")){
301
-        main.showGuideContainer(that,"#btnBuild",38,-247,"pic_ha06",480,0,-5,-17);
301
+        main.showGuideContainer(that,"#btnBuild",20,-128,"pic_ha06",240,0);
302 302
       }
303 303
     }
304 304
     else if (id==2){
@@ -313,7 +313,7 @@ Page({
313 313
       });
314 314
       wx.setStorageSync('Grade', index);
315 315
       if (wx.getStorageSync("IsShowGuideContainer")){
316
-        main.showGuideContainer(that,"#btnArticleStyle1",140,-32,"pic_ha05",240,290,-1,-3);
316
+        main.showGuideContainer(that,"#btnArticleStyle1",75,-12,"pic_ha05",100,145);
317 317
       }
318 318
     }
319 319
     
@@ -354,7 +354,7 @@ Page({
354 354
 
355 355
       if (wx.getStorageSync("IsShowGuideContainer")){
356 356
         wx.navigateTo({
357
-          url: "article?ID=258&Type=Guide",
357
+          url: "article?ID=260&Type=Guide",
358 358
         });
359 359
         return;
360 360
       }

+ 6 - 6
pages/templates/guide-container.wxml

@@ -2,12 +2,12 @@
2 2
 <!-- 显示引导模板 -->
3 3
 <template name="guide-container">
4 4
   <view wx:if="{{IsShowGuideContainer}}" class="panelGuideContainer container FlexColumn">
5
-    <view class="panelGuideContainerTop panelGuideContainer0" style='height:{{panelGuideContainerTop}}rpx;' catchtouchmove="catchTouchMove"></view>
6
-    <view class="panelGuideContainerLeft panelGuideContainer0" style='top:{{panelGuideContainerTop}}rpx;width:{{panelGuideContainerWidth1}}rpx;height:{{panelGuideContainerHeight1}}rpx;' catchtouchmove="catchTouchMove"></view>
7
-    <view class="panelGuideContainerRight panelGuideContainer0" style='top:{{panelGuideContainerTop}}rpx;left:{{panelGuideContainerLeft2}}rpx;height:{{panelGuideContainerHeight1}}rpx;' catchtouchmove="catchTouchMove"></view>
8
-    <view class="panelGuideContainerBottom panelGuideContainer0" style='top:{{panelGuideContainerTop+panelGuideContainerHeight1-1}}rpx;height:{{Containnerheight}}rpx;' catchtouchmove="catchTouchMove"></view>
9
-    <image class="panelGuideContainerImage {{panelGuideContainerImage}}" style="left:{{panelGuideContainerImageLeft}}rpx;top:{{panelGuideContainerImageTop}}rpx;" src="../images/{{panelGuideContainerImage}}.png" catchtouchmove="catchTouchMove">
10
-      <view class="panelGuideContainerClose FlexColumn" style="left:{{panelGuideContainerCloseLeft}}rpx;top:{{panelGuideContainerCloseTop}}rpx;" catchtap="closeGuideContainer"></view>
5
+    <view class="panelGuideContainerTop panelGuideContainer0" style='height:{{panelGuideContainerTop}}px;' catchtouchmove="catchTouchMove"></view>
6
+    <view class="panelGuideContainerLeft panelGuideContainer0" style='top:{{panelGuideContainerTop}}px;width:{{panelGuideContainerWidth1}}px;height:{{panelGuideContainerHeight1}}px;' catchtouchmove="catchTouchMove"></view>
7
+    <view class="panelGuideContainerRight panelGuideContainer0" style='top:{{panelGuideContainerTop}}px;left:{{panelGuideContainerLeft2}}px;height:{{panelGuideContainerHeight1}}px;' catchtouchmove="catchTouchMove"></view>
8
+    <view class="panelGuideContainerBottom panelGuideContainer0" style='top:{{panelGuideContainerTop+panelGuideContainerHeight1}}px;height:{{Containnerheight}}px;' catchtouchmove="catchTouchMove"></view>
9
+    <image class="panelGuideContainerImage {{panelGuideContainerImage}}" style="left:{{panelGuideContainerImageLeft}}px;top:{{panelGuideContainerImageTop}}px;" src="../images/{{panelGuideContainerImage}}.png" catchtouchmove="catchTouchMove">
10
+      <view class="panelGuideContainerClose FlexColumn" style="left:{{panelGuideContainerCloseLeft}}px;top:{{panelGuideContainerCloseTop}}px;" catchtap="closeGuideContainer"></view>
11 11
     </image>
12 12
   </view>
13 13
 </template>

+ 5 - 9
utils/main.js

@@ -201,22 +201,18 @@ function showGuideContainer(obj,myClass,imageLeft,imageTop,imageName,closeLeft,c
201 201
       console.log("rect.top:"+rect.top);
202 202
       console.log("rect.width:"+rect.width);
203 203
       console.log("rect.height:"+rect.height);
204
-      rect.top-=10;
205 204
       if (offsetTop)
206 205
         rect.top+=offsetTop;
207
-
208
-      rect.height+=5;
209
-
210 206
       if (offsetLeft)
211 207
         rect.left+=offsetLeft;
212 208
         
213
-      rect.left2=(rect.left+rect.width)-5;
209
+      rect.left2=(rect.left+rect.width);
214 210
 
215 211
       obj.setData({
216
-        panelGuideContainerTop:rect.top*2,
217
-        panelGuideContainerWidth1:rect.left*2,
218
-        panelGuideContainerHeight1:rect.height*2,
219
-        panelGuideContainerLeft2:rect.left2*2,
212
+        panelGuideContainerTop:rect.top,
213
+        panelGuideContainerWidth1:rect.left,
214
+        panelGuideContainerHeight1:rect.height,
215
+        panelGuideContainerLeft2:rect.left2,
220 216
         panelGuideContainerCloseLeft:closeLeft,
221 217
         panelGuideContainerCloseTop:closeTop,
222 218
         panelGuideContainerImage:imageName,