chengjie 4 ay önce
ebeveyn
işleme
0351be01d8

+ 53 - 0
app.wxss

@@ -55,4 +55,57 @@
55 55
 /* 下滑动画类 */
56 56
 .remind-slide-down {
57 57
   animation: slideDown 0.3s ease-out forwards;
58
+}
59
+
60
+.panelGuideContainer{
61
+  width: 100%;
62
+  position: fixed;
63
+  top:0;
64
+  z-index: 20;
65
+}
66
+
67
+.panelGuideContainer .panelGuideContainer0{
68
+  background-color:rgba(0,0,0,0.3);
69
+  position: absolute;
70
+  z-index: 20;
71
+}
72
+
73
+.panelGuideContainer .panelGuideContainerTop{
74
+  width:100%;
75
+  top:0;
76
+}
77
+
78
+.panelGuideContainer .panelGuideContainerLeft{
79
+  left:0;
80
+}
81
+
82
+.panelGuideContainer .panelGuideContainerRight{
83
+  right:0;
84
+  width:750rpx;
85
+}
86
+.panelGuideContainer .panelGuideContainerBottom{
87
+  width:100%;
88
+}
89
+
90
+.panelGuideContainer .panelGuideContainerText1{
91
+  font-size: 32rpx;
92
+  color:#1e1e1e;
93
+  position: absolute;
94
+  background-color: #fff;
95
+  text-align: center;
96
+  border-radius: 20rpx;
97
+  padding: 20rpx;
98
+  z-index: 110;
99
+}
100
+
101
+.panelGuideContainer .panelGuideContainerClose{
102
+  width:212rpx;
103
+  height:80rpx;
104
+  position: absolute;
105
+  z-index: 22;
106
+}
107
+
108
+.panelGuideContainer .panelGuideContainerImage{
109
+  position: absolute;
110
+  z-index: 21;
58 111
 }

BIN
pages/.DS_Store


BIN
pages/images/pic_02.png


BIN
pages/images/pic_ha01.png


BIN
pages/images/pic_ha02.png


BIN
pages/images/pic_ha03.png


BIN
pages/images/pic_ha04.png


BIN
pages/images/pic_ha05.png


BIN
pages/images/pic_ha06.png


BIN
pages/images/pic_ha07.png


BIN
pages/images/pic_ha08.png


BIN
pages/images/sysIcon_b19.png


+ 51 - 9
pages/main/article.js

@@ -38,8 +38,21 @@ Page({
38 38
     let that = this;
39 39
     let words=app.globalData.SelectedWords.join(",");
40 40
     let wordsStr=app.globalData.SelectedWords.join(" ");
41
-    const hiddenhelp=wx.getStorageSync('HiddenArticleFirstOpen');
42
-
41
+    
42
+    const IsShowFirstOpen2=wx.getStorageSync('IsShowFirstOpen2');
43
+    const IsShowGuideContainer=wx.getStorageSync('IsShowGuideContainer');
44
+    if (!IsShowGuideContainer && !IsShowFirstOpen2){
45
+      that.setData({
46
+        IsShowFirstOpen2:1,
47
+      });
48
+    }
49
+    else if (IsShowGuideContainer){
50
+      that.setData({
51
+        IsShowGuideContainer:true,
52
+        IsShowFirstOpen2:false,
53
+      });
54
+      main.showGuideContainer(that,"#btnQAndA",-124,-370,"pic_ha07",520,5,-2,-20);
55
+    }
43 56
     
44 57
     let IsShowKeyword=wx.getStorageSync('IsShowKeyword');
45 58
     if (IsShowKeyword===""){
@@ -59,7 +72,7 @@ Page({
59 72
       Level:options.Level,
60 73
       ArticleStyle:options.ArticleStyle,
61 74
       AIVersion:options.AIVersion,
62
-      IsShowFirstOpen:!hiddenhelp,
75
+      OpenType:options.Type,//打开的类型,可能是新用户引导
63 76
       IsShowLightColor:IsShowLightColor,
64 77
       IsShowKeyword:IsShowKeyword,
65 78
       IsBuildError:false,
@@ -80,6 +93,9 @@ Page({
80 93
 
81 94
     main.checkGenerating();
82 95
   },
96
+  onShow:function(){
97
+    main.getPageInfo();
98
+  },
83 99
   getArticleByID:function(id){
84 100
     let that=this;
85 101
     main.getData('GetYJBDCArticleList?UserID=' + app.globalData.userInfo.UserID+'&ID='+id, function (data) {
@@ -135,10 +151,10 @@ Page({
135 151
           });
136 152
         }
137 153
         else{
138
-          let content=data;
139
-          that.updateData(content);
154
+          that.updateData(data.Content);
140 155
           that.setData({
141 156
             IsBuilding:false,
157
+            ID:data.ID,
142 158
           });
143 159
         }
144 160
         
@@ -148,7 +164,10 @@ Page({
148 164
 
149 165
     that.getChoicenessArticle();
150 166
   },
151
-
167
+  updateReadCount:function(id){
168
+    if (id!="MAX")
169
+      main.getData('UpdateYJBDCArticleReadCount?UserID=' + app.globalData.userInfo.UserID+'&ID='+id, function (data) {});
170
+  },
152 171
   //得到精选文章
153 172
   getChoicenessArticle:function(){
154 173
     let that=this;
@@ -165,6 +184,12 @@ Page({
165 184
     let that=this;
166 185
     //console.log(content);
167 186
     
187
+    // 添加检查,确保 content 不是 undefined
188
+    if (!content) {
189
+      console.error('Content is undefined in updateData');
190
+      return;
191
+    }
192
+    
168 193
     if (typeof content === 'string') {
169 194
       content = JSON.parse(content);
170 195
     }
@@ -259,6 +284,9 @@ Page({
259 284
     that.setData({
260 285
       Content:content,
261 286
     });
287
+    setTimeout(function(){
288
+      that.updateReadCount(that.data.ID);
289
+    },3000);
262 290
   },
263 291
   setTheme:function(){
264 292
     let that=this;
@@ -279,9 +307,9 @@ Page({
279 307
   },
280 308
   closeHelp:function(){
281 309
     this.setData({
282
-      IsShowFirstOpen:false,
310
+      IsShowFirstOpen2:false,
283 311
     });
284
-    wx.setStorageSync('HiddenArticleFirstOpen', true);
312
+    wx.setStorageSync('IsShowFirstOpen2', 2);
285 313
   },
286 314
   selectedAnswer:function(e){
287 315
     let that=this;
@@ -316,6 +344,9 @@ Page({
316 344
         Content:content,
317 345
       });
318 346
     }
347
+    else if (name=="IsShowQuestion"){
348
+      main.showGuideContainer(that,"#panelArticle",75,60,"pic_ha08",391,556);
349
+    }
319 350
   },
320 351
   setShowKeyword:function(){
321 352
     let that=this;
@@ -449,7 +480,7 @@ Page({
449 480
   },
450 481
   // 处理导航栏返回按钮点击事件
451 482
   onUnload: function() {
452
-    if (!this.data.ID){
483
+    if (!this.data.ID || this.data.OpenType=="Guide"){
453 484
       app.globalData.SelectedWords=[];
454 485
       wx.navigateBack({
455 486
         delta: 1,
@@ -490,6 +521,12 @@ Page({
490 521
       showAnimation: 'remind-slide-down'
491 522
     });
492 523
   },
524
+  closeGuideContainer:function(){
525
+    this.setData({
526
+      IsShowGuideContainer:false,
527
+    });
528
+    wx.setStorageSync('IsShowGuideContainer', false);
529
+  },
493 530
   goto: function (e) {
494 531
     let that=this;
495 532
     var url=e.currentTarget.dataset.url;
@@ -497,6 +534,11 @@ Page({
497 534
       url: url,
498 535
     });
499 536
   },
537
+  // 阻止示例面板的触摸事件传递到底层
538
+  catchTouchMove: function(e) {
539
+    // 这个函数不需要做任何事情,只需要捕获事件防止冒泡
540
+    return false;
541
+  },
500 542
   onShareAppMessage: function () {
501 543
     return {
502 544
       title: app.globalData.ShareTitle,

+ 15 - 3
pages/main/article.wxml

@@ -1,6 +1,7 @@
1 1
 <block wx:if="{{!IsBuilding && !IsBuildError}}">
2 2
 <!-- 正常文章 -->
3
-<view  class="{{ThemeCSS}} container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
3
+<view class="{{ThemeCSS}} container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
4
+  <view id="panelArticle" style="width: 100%;height: 1rpx;"></view>
4 5
   <view class="panel1 FlexColumn">
5 6
     <!-- 完整文章 -->
6 7
     <text class="textArticle" wx:if="{{!IsShowTranslate}}" >
@@ -25,7 +26,7 @@
25 26
         <image src="../images/sysIcon_a15.png" class="sysIcon_a15"></image>
26 27
         <view class="text02">中英对照</view>
27 28
       </view>
28
-      <view class="panelFooter12 panelFooter10 FlexColumn" bind:tap="showData" data-name="IsShowQuestion">
29
+      <view id="btnQAndA" class="panelFooter12 panelFooter10 FlexColumn" bind:tap="showData" data-name="IsShowQuestion">
29 30
         答题
30 31
       </view>
31 32
       <view class="panelFooter13 panelFooter10 FlexColumn" bind:tap="showData" data-name="IsShowSetting">
@@ -122,7 +123,7 @@
122 123
 </view>
123 124
 
124 125
 <!-- 显示第一次打开帮助 -->
125
-<view wx:if="{{IsShowFirstOpen}}" class="panelHelp container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
126
+<view wx:if="{{IsShowFirstOpen2}}" class="panelHelp container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
126 127
   <view class="panelHelp1">
127 128
     <image src="../images/sysIcon_b07.png" class="sysIcon_b07"></image>
128 129
     <view class="panelHelp2 FlexColumn">
@@ -133,6 +134,17 @@
133 134
 </view>
134 135
 </block>
135 136
 
137
+<!-- 显示引导 -->
138
+<view  wx:if="{{IsShowGuideContainer}}" class="panelGuideContainer container FlexColumn">
139
+  <view class="panelGuideContainerTop panelGuideContainer0" style='height:{{panelGuideContainerTop}}rpx;' catchtouchmove="catchTouchMove"></view>
140
+  <view class="panelGuideContainerLeft panelGuideContainer0" style='top:{{panelGuideContainerTop}}rpx;width:{{panelGuideContainerWidth1}}rpx;height:{{panelGuideContainerHeight1}}rpx;' catchtouchmove="catchTouchMove"></view>
141
+  <view class="panelGuideContainerRight panelGuideContainer0" style='top:{{panelGuideContainerTop}}rpx;left:{{panelGuideContainerLeft2}}rpx;height:{{panelGuideContainerHeight1}}rpx;' catchtouchmove="catchTouchMove"></view>
142
+  <view class="panelGuideContainerBottom panelGuideContainer0" style='top:{{panelGuideContainerTop+panelGuideContainerHeight1-1}}rpx;height:{{Containnerheight}}rpx;' catchtouchmove="catchTouchMove"></view>
143
+  <image class="panelGuideContainerImage {{panelGuideContainerImage}}" style="left:{{panelGuideContainerImageLeft}}rpx;top:{{panelGuideContainerImageTop}}rpx;" src="../images/{{panelGuideContainerImage}}.png" catchtouchmove="catchTouchMove">
144
+    <view class="panelGuideContainerClose FlexColumn" style="left:{{panelGuideContainerCloseLeft}}rpx;top:{{panelGuideContainerCloseTop}}rpx;" catchtap="closeGuideContainer"></view>
145
+  </image>
146
+</view>
147
+
136 148
 <!-- 显示生成出错 -->
137 149
 <view wx:if="{{IsBuildError}}" class="container {{ThemeCSS}} FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
138 150
   <view class="{{ThemeCSS}} panelError FlexColumn">

+ 9 - 0
pages/main/article.wxss

@@ -730,4 +730,13 @@
730 730
   font-size: 24rpx;
731 731
   font-weight: 400;
732 732
   margin-top: 10rpx;
733
+}
734
+
735
+.panelGuideContainer .pic_ha07{
736
+  width: 610rpx;
737
+  height: 378rpx;
738
+}
739
+.panelGuideContainer .pic_ha08{
740
+  width: 610rpx;
741
+  height: 643rpx;
733 742
 }

+ 29 - 0
pages/main/index.js

@@ -20,6 +20,15 @@ Page({
20 20
     app.globalData.OCRWords=[];
21 21
     this.getData();
22 22
     main.checkGenerating();
23
+
24
+    if (wx.getStorageSync('IsShowGuideContainer')){
25
+      this.initGuide();
26
+    }
27
+    else{
28
+      this.setData({
29
+        IsShowGuideContainer:false,
30
+      })
31
+    }
23 32
   },
24 33
   goto: function (e) {
25 34
     let that=this;
@@ -46,6 +55,7 @@ Page({
46 55
         that.setData({
47 56
           TodayCount:data.TodayCount,
48 57
           MaxCount:data.MaxCount,
58
+          UnReadCount:data.UnReadCount,
49 59
         });
50 60
       }
51 61
     });
@@ -53,6 +63,25 @@ Page({
53 63
   showRemind:function(){
54 64
     animation.toggleRemindWithAnimation(this);
55 65
   },
66
+  initGuide:function(){
67
+    let that=this;
68
+    that.setData({
69
+      IsShowGuideContainer:true,
70
+    });
71
+    main.showGuideContainer(that,"#txtWordsInput",0,110,"pic_ha01",396,248,-5);
72
+    wx.setStorageSync('IsShowGuideContainer', true);
73
+  },
74
+  closeGuideContainer:function(){
75
+    this.setData({
76
+      IsShowGuideContainer:false,
77
+    });
78
+    wx.setStorageSync('IsShowGuideContainer', false);
79
+  },
80
+  // 阻止示例面板的触摸事件传递到底层
81
+  catchTouchMove: function(e) {
82
+    // 这个函数不需要做任何事情,只需要捕获事件防止冒泡
83
+    return false;
84
+  },
56 85
   onShareAppMessage: function () {
57 86
     return {
58 87
       title: app.globalData.ShareTitle,

+ 18 - 1
pages/main/index.wxml

@@ -5,15 +5,21 @@
5 5
     </view>
6 6
 
7 7
     <view class="panel2 FlexColumn">
8
-      <view class="btn01 FlexColumn" bind:tap="goto" data-url="wordsinput">
8
+      <view id="txtWordsInput" class="btn01 FlexColumn" bind:tap="goto" data-url="wordsinput">
9 9
         <view>制作</view>
10 10
       </view>
11 11
       <view class="btn02 FlexColumn" bind:tap="goto" data-url="myarticles">
12 12
         <view>我的文库</view>
13
+        <view class="btn021 FlexColumn" wx:if="{{UnReadCount>0}}">未读</view>
13 14
       </view>
14 15
     </view>
15 16
 
16 17
     <view class="panel3 FlexColumn">
18
+      <view class="panel31 FlexRow" bind:tap="initGuide">
19
+        <image src="../images/sysIcon_b19.png" class="sysIcon_b19"></image>
20
+        <view>新手引导</view>
21
+      </view>
22
+      <view class="panelLine"></view>
17 23
       <view class="panel31 FlexRow" bind:tap="goto" data-url="help">
18 24
         <image src="../images/sysIcon_a01.png" class="sysIcon_a01"></image>
19 25
         <view>如何提升AI生成内容的质量</view>
@@ -48,4 +54,15 @@
48 54
       <view class="btnReind2 FlexColumn" catch:tap="goto" data-url="myarticles">去我的文库看看</view>
49 55
     </view>
50 56
   </view>
57
+</view>
58
+
59
+<!-- 显示引导 -->
60
+<view  wx:if="{{IsShowGuideContainer}}" class="panelGuideContainer container FlexColumn">
61
+  <view class="panelGuideContainerTop panelGuideContainer0" style='height:{{panelGuideContainerTop}}rpx;' catchtouchmove="catchTouchMove"></view>
62
+  <view class="panelGuideContainerLeft panelGuideContainer0" style='top:{{panelGuideContainerTop}}rpx;width:{{panelGuideContainerWidth1}}rpx;height:{{panelGuideContainerHeight1}}rpx;' catchtouchmove="catchTouchMove"></view>
63
+  <view class="panelGuideContainerRight panelGuideContainer0" style='top:{{panelGuideContainerTop}}rpx;left:{{panelGuideContainerLeft2}}rpx;height:{{panelGuideContainerHeight1}}rpx;' catchtouchmove="catchTouchMove"></view>
64
+  <view class="panelGuideContainerBottom panelGuideContainer0" style='top:{{panelGuideContainerTop+panelGuideContainerHeight1-1}}rpx;height:{{Containnerheight}}rpx;' catchtouchmove="catchTouchMove"></view>
65
+  <image class="panelGuideContainerImage {{panelGuideContainerImage}}" style="left:{{panelGuideContainerImageLeft}}rpx;top:{{panelGuideContainerImageTop}}rpx;" src="../images/{{panelGuideContainerImage}}.png" catchtouchmove="catchTouchMove">
66
+    <view class="panelGuideContainerClose FlexColumn" style="left:{{panelGuideContainerCloseLeft}}rpx;top:{{panelGuideContainerCloseTop}}rpx;" catchtap="closeGuideContainer"></view>
67
+  </image>
51 68
 </view>

+ 23 - 1
pages/main/index.wxss

@@ -41,6 +41,18 @@
41 41
   border-radius: 30rpx;
42 42
   font-size: 36rpx;
43 43
   color: #C1E1C1;
44
+  position: relative;
45
+}
46
+
47
+.btn021{
48
+  width: 80rpx;
49
+  height:50rpx;
50
+  background: #C1E1C1;
51
+  border-radius: 10rpx;
52
+  color:#004433;
53
+  font-size: 24rpx;
54
+  position: absolute;
55
+  right:30rpx;
44 56
 }
45 57
 
46 58
 .panel3{
@@ -61,6 +73,11 @@
61 73
   height:24rpx;
62 74
   margin: 0 10rpx 0 0;
63 75
 }
76
+.sysIcon_b19{
77
+  width:28rpx;
78
+  height:28rpx;
79
+  margin: 0 10rpx 0 0;
80
+}
64 81
 
65 82
 .panelLine{
66 83
   width: 360rpx;
@@ -82,7 +99,7 @@
82 99
 
83 100
 .pic_02{
84 101
   width:100%;
85
-  height:340rpx;
102
+  height:280rpx;
86 103
 }
87 104
 
88 105
 .text03{
@@ -161,4 +178,9 @@
161 178
   background: #fff;
162 179
   font-size: 28rpx;
163 180
   margin: 30rpx 0 40rpx 0;
181
+}
182
+
183
+.panelGuideContainer .panelGuideContainerImage{
184
+  width: 610rpx;
185
+  height: 338rpx;
164 186
 }

+ 94 - 9
pages/main/wordsinput.js

@@ -13,15 +13,29 @@ Page({
13 13
     IsShowFirstOpen:false,
14 14
     IsShowExample:false,
15 15
     IsShowRemind:false,
16
+    IsShowGuideContainer:false,
17
+    IsShowGuideRemind:false,
16 18
   },
17 19
   onLoad: function (options) {
18 20
     let that = this;
21
+    const IsShowFirstOpen=wx.getStorageSync('IsShowFirstOpen');
22
+    const IsShowGuideContainer=wx.getStorageSync('IsShowGuideContainer');
23
+    if (!IsShowGuideContainer && !IsShowFirstOpen){
24
+      that.setData({
25
+        IsShowFirstOpen:1,
26
+      });
27
+    }
28
+    else{
29
+      const IsShowGuideRemind=wx.getStorageSync('IsShowGuideRemind');
19 30
     
20
-    const hiddenhelp=wx.getStorageSync('HiddenWordInputFirstOpen');
21
-
31
+      if (!IsShowGuideRemind){
32
+        that.setData({
33
+          IsShowGuideRemind:1,
34
+        });
35
+      }
36
+    }
22 37
     that.setData({
23 38
       Containnerheight: main.getWindowHeight(),
24
-      IsShowFirstOpen:!hiddenhelp,
25 39
       KeyboardBtnName:"next",
26 40
     });
27 41
     that.initMenu();
@@ -29,6 +43,15 @@ Page({
29 43
     main.checkGenerating();
30 44
   },
31 45
   onShow:function(e){
46
+    let that = this;
47
+    that.initWords();
48
+    that.isShowAlert();
49
+    that.initGuide(null);
50
+  },
51
+  onHide:function(e){
52
+    this.getInputData();
53
+  },
54
+  initWords:function(){
32 55
     let that = this;
33 56
     app.globalData.SelectedWords=common.removeDuplicateAndTrimStrings(app.globalData.SelectedWords);
34 57
     that.data.Words=[];
@@ -55,10 +78,25 @@ Page({
55 78
     that.setData({
56 79
       Words:that.data.Words,
57 80
     });
58
-    that.isShowAlert();
59 81
   },
60
-  onHide:function(e){
61
-    this.getInputData();
82
+  initGuide:function(e){
83
+    let that=this;
84
+    if (e && e.currentTarget.dataset.isstart){
85
+      wx.setStorageSync('IsShowGuideContainer', true);
86
+      //wx.setStorageSync('IsShowGuideRemind', 2);
87
+      wx.navigateBack({
88
+        delta: 1,
89
+      });
90
+    }
91
+    else if (wx.getStorageSync("IsShowGuideContainer")){
92
+      that.setData({
93
+        IsShowGuideContainer:true,
94
+        IsShowGuideRemind:false,
95
+      });
96
+      app.globalData.SelectedWords=["cat","dog","meat","fight","","happy","love","study","cry","flower"];
97
+      that.initWords();
98
+      main.showGuideContainer(that,"#txtWord5",290,-457,"pic_ha02",-50,5,-5,-5);
99
+    }
62 100
   },
63 101
   initMenu:function(){
64 102
     let that = this;
@@ -92,7 +130,6 @@ Page({
92 130
       }
93 131
     }
94 132
 
95
-    
96 133
     that.setData({
97 134
       GradeArr:GradeArr,
98 135
       ArticleStyleArr:ArticleStyleArr,
@@ -103,6 +140,19 @@ Page({
103 140
     let that=this;
104 141
     let id=e.currentTarget.dataset.id;
105 142
     let word=e.detail.value;
143
+
144
+    if (wx.getStorageSync("IsShowGuideContainer") && word.toString().toLowerCase()=="win"){
145
+      that.data.Words[4].Focus=false;
146
+      that.data.Words[4].Word="win";
147
+      that.setData({
148
+        Words:that.data.Words,
149
+      });
150
+      main.showGuideContainer(that,"#btnNext",80,-260,"pic_ha03",0,0,-3,-20);
151
+    }
152
+    else if (that.data.IsShowGuideContainer){
153
+      return;
154
+    }
155
+      
106 156
     for(let i=0;i<10;i++){
107 157
       if (i+1==id){
108 158
         that.data.Words[i].Word=word;
@@ -162,6 +212,11 @@ Page({
162 212
             IsShowAlert:false,
163 213
             IsShowSetPanel:true,
164 214
           });
215
+
216
+          if (wx.getStorageSync("IsShowGuideContainer")){
217
+            
218
+            main.showGuideContainer(that,"#btnLevel1",165,-115,"pic_ha04",270,330,-2,0);
219
+          }
165 220
         }
166 221
       });
167 222
     }
@@ -200,7 +255,22 @@ Page({
200 255
       IsShowExample:!this.data.IsShowExample,
201 256
     });
202 257
   },
258
+  showGuideRemind:function(){
259
+    this.setData({
260
+      IsShowGuideRemind:!this.data.IsShowGuideRemind,
261
+    });
262
+    wx.setStorageSync('IsShowGuideRemind', 2);
263
+  },
264
+  closeGuideContainer:function(){
265
+    this.setData({
266
+      IsShowGuideContainer:false,
267
+    });
268
+    wx.setStorageSync('IsShowGuideContainer', false);
269
+  },
203 270
   keyboardOK:function(e){
271
+    if (wx.getStorageSync('IsShowGuideContainer')){
272
+      return ;
273
+    }
204 274
     let that=this;
205 275
     let id=e.currentTarget.dataset.id;
206 276
     id++;
@@ -219,13 +289,15 @@ Page({
219 289
       Words:that.data.Words,
220 290
     });
221 291
   },
222
-  closeHelp:function(){
292
+  closeIsShowFirstOpen:function(){
223 293
     this.setData({
224 294
       IsShowFirstOpen:false,
295
+      IsShowGuideRemind:true,
225 296
     });
226
-    wx.setStorageSync('HiddenWordInputFirstOpen', true);
297
+    wx.setStorageSync('IsShowFirstOpen', 2);
227 298
   },
228 299
   selectBtn:function(e){
300
+    let that=this;
229 301
     const index=e.currentTarget.dataset.index;
230 302
     const id=e.currentTarget.dataset.id;
231 303
     
@@ -245,6 +317,9 @@ Page({
245 317
         ArticleStyleArr:arr,
246 318
       });
247 319
       wx.setStorageSync('ArticleStyle', index);
320
+      if (wx.getStorageSync("IsShowGuideContainer")){
321
+        main.showGuideContainer(that,"#btnBuild",38,-247,"pic_ha06",480,0,-5,-17);
322
+      }
248 323
     }
249 324
     else if (id==2){
250 325
       this.setData({
@@ -257,6 +332,9 @@ Page({
257 332
         GradeArr:arr,
258 333
       });
259 334
       wx.setStorageSync('Grade', index);
335
+      if (wx.getStorageSync("IsShowGuideContainer")){
336
+        main.showGuideContainer(that,"#btnArticleStyle1",140,-32,"pic_ha05",240,290,-1,-3);
337
+      }
260 338
     }
261 339
     
262 340
   },
@@ -293,6 +371,13 @@ Page({
293 371
           break;
294 372
         }
295 373
       }
374
+
375
+      if (wx.getStorageSync("IsShowGuideContainer")){
376
+        wx.navigateTo({
377
+          url: "article?ID=258&Type=Guide",
378
+        });
379
+        return;
380
+      }
296 381
     }
297 382
 
298 383
     

+ 28 - 8
pages/main/wordsinput.wxml

@@ -6,6 +6,7 @@
6 6
         <image src="../images/sysIcon_a01.png" class="sysIcon_a01"></image>
7 7
         <view>示范</view>
8 8
       </view>
9
+      <view class="panel113 FlexRow" bind:tap="initGuide" data-isstart="1">新手引导</view>
9 10
       <view class="panel112 FlexRow" bind:tap="clearInput" data-id="0">清空</view>
10 11
     </view>
11 12
   </view>
@@ -18,7 +19,7 @@
18 19
 
19 20
   <view class="panel2 FlexColumn">
20 21
     <block wx:for="{{Words}}" wx:key="index">
21
-      <view class="panel20 panel2{{item.ID}} {{item.CSS}} FlexRow">
22
+      <view id="txtWord{{item.ID}}" class="panel20 panel2{{item.ID}} {{item.CSS}} FlexRow">
22 23
         <view class="panel211" wx:if="{{!item.IsError}}"></view>
23 24
         <view class="panel211 panel2110" wx:if="{{item.IsError}}"></view>
24 25
         <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}}"/>
@@ -29,6 +30,17 @@
29 30
     </block>
30 31
   </view>
31 32
 
33
+  <view class="panelGuide FlexRow" wx:if="{{IsShowGuideRemind}}">
34
+    <text class="panelGuide1" catch:tap="initGuide" data-isstart="1">
35
+      <text>卡在单词输入?</text>
36
+      <text class="panelGuideText1">新手引导</text>
37
+      <text>带您体验</text>
38
+    </text>
39
+    <view class="panelGuide2 FlexRow" bind:tap="showGuideRemind">
40
+      <image src="../images/sysIcon_a03.png" class="sysIcon_a03"></image>
41
+    </view>
42
+  </view>
43
+
32 44
   <view class="panelFooter FlexRow">
33 45
     <view class="panelFooter1 FlexRow">
34 46
       <view class="panelFooter11 panelFooter10 FlexColumn" bindtap="goto" data-url="../main/selectword">
@@ -39,11 +51,9 @@
39 51
         <image src="../images/sysIcon_a05.png" class="sysIcon_a03"></image>
40 52
         <view class="text02">粘贴</view>
41 53
       </view>
42
-      <view class="panelFooter13 panelFooter10 FlexColumn" bind:tap="setArticleParam">下一步</view>
54
+      <view id="btnNext" class="panelFooter13 panelFooter10 FlexColumn" bind:tap="setArticleParam">下一步</view>
43 55
     </view>
44 56
   </view>
45
-
46
-  
47 57
 </view>
48 58
 
49 59
 <view wx:if="{{IsShowFirstOpen}}" class="panelHelp container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
@@ -51,7 +61,7 @@
51 61
     <image src="../images/sysIcon_b06.png" class="sysIcon_b06"></image>
52 62
     <view class="panelHelp2 FlexColumn">
53 63
       <text class="text07">先从这里输入单词\n再点下一步生成文章</text>
54
-      <view class="btn3 FlexColumn" bind:tap="closeHelp">知道了</view>
64
+      <view class="btn3 FlexColumn" bind:tap="closeIsShowFirstOpen">知道了</view>
55 65
     </view>
56 66
   </view>
57 67
 </view>
@@ -65,14 +75,14 @@
65 75
     <view class="panelMenu11 FlexColumn">
66 76
       <view class="text04 text05">单词水平</view>
67 77
       <view class="panelMenu111 FlexRow">
68
-        <view class="btn btn{{item.CSS}} FlexRow" wx:for="{{GradeArr}}" wx:key="index" capture-bind:tap="selectBtn" data-id="0" data-index="{{index}}">{{item.Name}}</view>
78
+        <view id="btnLevel{{index}}" class="btn btn{{item.CSS}} FlexRow" wx:for="{{GradeArr}}" wx:key="index" capture-bind:tap="selectBtn" data-id="0" data-index="{{index}}">{{item.Name}}</view>
69 79
       </view>
70 80
     </view>
71 81
     <view class="panelMenu11 FlexColumn">
72 82
       <view class="text04 text06">主题</view>
73 83
       <scroll-view scroll-x="true" class="panelMenu1110">
74 84
         <view class="panelMenu1111 FlexRow">
75
-          <view class="btn btn{{item.CSS}} FlexRow" wx:for="{{ArticleStyleArr}}" wx:key="index" capture-bind:tap="selectBtn" data-id="1" data-index="{{index}}">{{item.Name}}</view>
85
+          <view id="btnArticleStyle{{index}}" class="btn btn{{item.CSS}} FlexRow" wx:for="{{ArticleStyleArr}}" wx:key="index" capture-bind:tap="selectBtn" data-id="1" data-index="{{index}}">{{item.Name}}</view>
76 86
         </view>
77 87
       </scroll-view>
78 88
     </view>
@@ -85,7 +95,7 @@
85 95
         </view>
86 96
       </view>
87 97
     </view>
88
-    <view class="btn2 FlexRow" catch:tap="goto" data-url="article">
98
+    <view id="btnBuild" class="btn2 FlexRow" catch:tap="goto" data-url="article">
89 99
       <image src="../images/sysIcon_b01.png" class="sysIcon_b01"></image>
90 100
       <view>生成短文</view>
91 101
     </view>
@@ -97,6 +107,16 @@
97 107
     </view>
98 108
   </view>
99 109
 </view>
110
+<!-- 显示引导 -->
111
+<view  wx:if="{{IsShowGuideContainer}}" class="panelGuideContainer container FlexColumn">
112
+  <view class="panelGuideContainerTop panelGuideContainer0" style='height:{{panelGuideContainerTop}}rpx;' catchtouchmove="catchTouchMove"></view>
113
+  <view class="panelGuideContainerLeft panelGuideContainer0" style='top:{{panelGuideContainerTop}}rpx;width:{{panelGuideContainerWidth1}}rpx;height:{{panelGuideContainerHeight1}}rpx;' catchtouchmove="catchTouchMove"></view>
114
+  <view class="panelGuideContainerRight panelGuideContainer0" style='top:{{panelGuideContainerTop}}rpx;left:{{panelGuideContainerLeft2}}rpx;height:{{panelGuideContainerHeight1}}rpx;' catchtouchmove="catchTouchMove"></view>
115
+  <view class="panelGuideContainerBottom panelGuideContainer0" style='top:{{panelGuideContainerTop+panelGuideContainerHeight1-1}}rpx;height:{{Containnerheight}}rpx;' catchtouchmove="catchTouchMove"></view>
116
+  <image class="panelGuideContainerImage {{panelGuideContainerImage}}" style="left:{{panelGuideContainerImageLeft}}rpx;top:{{panelGuideContainerImageTop}}rpx;" src="../images/{{panelGuideContainerImage}}.png" catchtouchmove="catchTouchMove">
117
+    <view class="panelGuideContainerClose FlexColumn" style="left:{{panelGuideContainerCloseLeft}}rpx;top:{{panelGuideContainerCloseTop}}rpx;" catchtap="closeGuideContainer"></view>
118
+  </image>
119
+</view>
100 120
 
101 121
 <view wx:if="{{IsShowExample}}" class="panelExample container FlexColumn" style='min-height:{{Containnerheight}}rpx;' catchtouchmove="catchTouchMove">
102 122
   <scroll-view scroll-y="true" class="exampleScrollView" style='height:{{Containnerheight}}rpx;'>

+ 55 - 0
pages/main/wordsinput.wxss

@@ -20,6 +20,11 @@
20 20
 .panel111{
21 21
   margin-left: 40rpx;
22 22
 }
23
+.panel113{
24
+  width:96rpx;
25
+  height:73rpx;
26
+  margin-left: -250rpx;
27
+}
23 28
 .panel112{
24 29
   width: 88rpx;
25 30
   height:73rpx;
@@ -129,6 +134,35 @@
129 134
   height:22rpx;
130 135
 }
131 136
 
137
+.panelGuide{
138
+  width: 710rpx;
139
+  height:70rpx;
140
+  background: #453C2D;
141
+  border: 5rpx solid #E6971A;
142
+  border-radius: 70rpx;
143
+  position: fixed;
144
+  bottom:195rpx;
145
+  z-index: 10;
146
+  justify-content: space-between;
147
+}
148
+
149
+.panelGuide1{
150
+  font-size:28rpx;
151
+  color:#F2F2F2;
152
+  margin-left: 40rpx;
153
+}
154
+.panelGuideText1{
155
+  color:#FFCD00;
156
+  text-decoration: underline;
157
+}
158
+.panelGuide2{
159
+  border-radius: 50%;
160
+  width: 46rpx;
161
+  height:46rpx;
162
+  background-color: #E59819;
163
+  margin-right: 17rpx;
164
+}
165
+
132 166
 .panelFooter{
133 167
   width: 100%;
134 168
   height:180rpx;
@@ -427,3 +461,24 @@
427 461
   margin-top: 60rpx;
428 462
   margin-bottom: 40rpx;
429 463
 }
464
+
465
+.panelGuideContainer .pic_ha02{
466
+  width: 370rpx;
467
+  height: 465rpx;
468
+}
469
+.panelGuideContainer .pic_ha03{
470
+  width: 250rpx;
471
+  height: 255rpx;
472
+}
473
+.panelGuideContainer .pic_ha04{
474
+  width: 359rpx;
475
+  height: 420rpx;
476
+}
477
+.panelGuideContainer .pic_ha05{
478
+  width: 329rpx;
479
+  height: 380rpx;
480
+}
481
+.panelGuideContainer .pic_ha06{
482
+  width: 570rpx;
483
+  height: 255rpx;
484
+}

+ 85 - 18
utils/main.js

@@ -76,9 +76,27 @@ function getLocalHost(callback) {
76 76
   }
77 77
 }
78 78
 
79
+function getPageInfo(){
80
+  let result={};
81
+  const pages = getCurrentPages(); // 获取页面栈
82
+  result.NavigationDepth = pages.length;
83
+  console.log("导航深度:", result.NavigationDepth);
84
+  const prevPage = pages[pages.length - 2];
85
+  result.FromRoute = prevPage ? prevPage.route : null;
86
+  console.log("来源页面:", result.FromRoute);
87
+  const currentPage = pages[pages.length - 1]; // 当前页面对象
88
+  result.CurrentRoute = currentPage.route; // 当前页面路径
89
+  console.log("当前页面:", result.CurrentRoute);
79 90
 
80
-function getWindowHeight() {
91
+  if (pages.length > 1) {
92
+    result.BackFromPage = pages[pages.length - 1].route;
93
+    console.log("返回来源页面:", result.BackFromPage);
94
+  }
95
+  
96
+  return result;
97
+}
81 98
 
99
+function getWindowHeight() {
82 100
   var height = app.globalData.systemInfo.windowHeight;
83 101
   //console.log("app.globalData.systemInfo.windowHeight:" + app.globalData.systemInfo.windowHeight * 2);
84 102
   if (app.globalData.systemInfo.model) {
@@ -136,35 +154,82 @@ function onSelect(obj,event,callback){
136 154
 }
137 155
 
138 156
 function checkGenerating(){
157
+  let that=this;
139 158
   if (app.globalData.Generating){
159
+    let timeStart=new Date().getTime();
140 160
     let intervalGenerate=setInterval(function(){
141
-      console.log(new Date().getTime());
161
+      let time=(new Date().getTime()-timeStart)/1000;
162
+      console.log(time);
142 163
       if (!app.globalData.Generating){
143 164
         clearInterval(intervalGenerate);
144
-        wx.showModal({
145
-          title: '通知',
146
-          content: '文章生成好了。',
147
-          cancelText:"不去",
148
-          confirmText:"去看",
149
-          complete: (res) => {
150
-            if (res.confirm) {
151
-              let next='article?ID=MAX';
152
-              wx.reLaunch({
153
-                url: 'index',
154
-                complete:function(){
155
-                  wx.navigateTo({
156
-                    url: next,
165
+        let page=that.getPageInfo();
166
+        if (!(page.NavigationDepth==3 
167
+          && page.CurrentRoute=="pages/main/article" 
168
+          && page.BackFromPage=="pages/main/article")){
169
+            wx.showModal({
170
+              title: '通知',
171
+              content: '文章生成好了。',
172
+              cancelText:"不去",
173
+              confirmText:"去看",
174
+              complete: (res) => {
175
+                if (res.confirm) {
176
+                  let next='article?ID=MAX';
177
+                  wx.reLaunch({
178
+                    url: 'index',
179
+                    complete:function(){
180
+                      wx.navigateTo({
181
+                        url: next,
182
+                      })
183
+                    }
157 184
                   })
158 185
                 }
159
-              })
160
-            }
186
+              }
187
+            });
161 188
           }
162
-        })
163 189
       }
190
+      if (time > 120)
191
+        clearInterval(intervalGenerate);
192
+
164 193
     },1000);
165 194
   }
166 195
 }
167 196
 
197
+function showGuideContainer(obj,myClass,imageLeft,imageTop,imageName,closeLeft,closeTop,offsetLeft,offsetTop){
198
+  setTimeout(function(){
199
+    wx.createSelectorQuery().select(myClass).boundingClientRect(function (rect) {
200
+      console.log("rect.left:"+rect.left);
201
+      console.log("rect.top:"+rect.top);
202
+      console.log("rect.width:"+rect.width);
203
+      console.log("rect.height:"+rect.height);
204
+      rect.top-=10;
205
+      if (offsetTop)
206
+        rect.top+=offsetTop;
207
+
208
+      rect.height+=5;
209
+
210
+      if (offsetLeft)
211
+        rect.left+=offsetLeft;
212
+        
213
+      rect.left2=(rect.left+rect.width)-5;
214
+
215
+      obj.setData({
216
+        panelGuideContainerTop:rect.top*2,
217
+        panelGuideContainerWidth1:rect.left*2,
218
+        panelGuideContainerHeight1:rect.height*2,
219
+        panelGuideContainerLeft2:rect.left2*2,
220
+        panelGuideContainerCloseLeft:closeLeft,
221
+        panelGuideContainerCloseTop:closeTop,
222
+        panelGuideContainerImage:imageName,
223
+      });
224
+      obj.setData({
225
+        panelGuideContainerImageLeft:obj.data.panelGuideContainerWidth1+imageLeft,
226
+        panelGuideContainerImageTop:obj.data.panelGuideContainerTop+imageTop,
227
+      });
228
+    }).exec();
229
+  },200);
230
+}
231
+
232
+
168 233
 module.exports = {
169 234
   getData: getData,
170 235
   postData: postData,
@@ -172,4 +237,6 @@ module.exports = {
172 237
   getWindowHeight: getWindowHeight,
173 238
   onSelect:onSelect,
174 239
   checkGenerating:checkGenerating,
240
+  getPageInfo:getPageInfo,
241
+  showGuideContainer:showGuideContainer,
175 242
 }