chengjie 6 年之前
父节点
当前提交
c00fe7ec5a

+ 1 - 1
app.js

@@ -25,7 +25,7 @@ App({
25 25
     }
26 26
   },
27 27
   globalData: {
28
-    Version: "1.0.0.22",
28
+    Version: "1.0.0.23",
29 29
     IsProduction: false,
30 30
     ShareTitle: "可以用来记忆一切的工具",
31 31
     SharePath: "pages/index/index",

+ 2 - 1
app.json

@@ -35,5 +35,6 @@
35 35
     "wxa5e33c61fe37dd01",
36 36
     "wxaa1a8b48d9853872",
37 37
     "wx80059777521b897c"
38
-  ]
38
+  ],
39
+  "sitemapLocation": "sitemap.json"
39 40
 }

+ 15 - 14
pages/main/add.wxml

@@ -1,5 +1,5 @@
1 1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
-  <block wx:if="{{Tags && Tags.length>0}}">
2
+  <!-- <block wx:if="{{Tags && Tags.length>0}}">
3 3
     <view class="panelTag FlexRow">
4 4
       <view class="panelItem1">记号</view>
5 5
       <view class="panelItem2 FlexRow">
@@ -7,7 +7,19 @@
7 7
       </view>
8 8
     </view>
9 9
     <view class='lineFooter'></view>
10
-  </block>
10
+  </block> -->
11
+
12
+  <view class="panelItem3 FlexRow" wx:if="{{UpdateType=='add' || UpdateType=='add2'}}">
13
+    <view class="panelItem1">
14
+      练习时间
15
+    </view>
16
+    <view class="panelItem2 FlexRow">
17
+      <view class="panelItem31" hidden="{{IsTodayStudy}}">智能安排</view>
18
+      <view class="panelItem311 panelItem31" hidden="{{!IsTodayStudy}}">今日必练</view>
19
+      <switch class='panelItem32' checked="{{IsTodayStudy}}" bindchange="switch1Change" />
20
+    </view>
21
+  </view>
22
+  <view class='lineFooter'></view>
11 23
   <view class="panelTitle FlexRow">
12 24
     <view class="panelTitle1">段落</view>
13 25
   </view>
@@ -51,18 +63,7 @@
51 63
   </block>
52 64
   <view class='lineFooter'></view>
53 65
 
54
-  <view class="panelItem3 FlexRow" wx:if="{{UpdateType=='add' || UpdateType=='add2'}}">
55
-    <view class="panelItem1">
56
-      练习时间
57
-    </view>
58
-    <view class="panelItem2 FlexRow">
59
-      <view class="panelItem31" hidden="{{IsTodayStudy}}">智能安排</view>
60
-      <view class="panelItem311 panelItem31" hidden="{{!IsTodayStudy}}">今日必练</view>
61
-      <switch class='panelItem32' checked="{{IsTodayStudy}}" bindchange="switch1Change" />
62
-    </view>
63
-  </view>
64
-  <view class='lineFooter'></view>
65
-  <view class="panelItem3Remark" wx:if="{{UpdateType=='add' || UpdateType=='add2'}}">指定该题卡必定出现在今天任务中,可能增加额外的任务量</view>
66
+  <!-- <view class="panelItem3Remark" wx:if="{{UpdateType=='add' || UpdateType=='add2'}}">指定该题卡必定出现在今天任务中,可能增加额外的任务量</view> -->
66 67
   <view style='height:300rpx;'></view>
67 68
 
68 69
   <view class='panelSave FlexRow'>

+ 0 - 1
pages/main/add.wxss

@@ -134,7 +134,6 @@
134 134
 
135 135
 .panelItem3 {
136 136
   min-height: 100rpx;
137
-  margin-top: 50rpx;
138 137
   width: 100%;
139 138
   justify-content: space-between;
140 139
   font-size: 28rpx;

+ 1 - 0
pages/main/preview.wxss

@@ -105,6 +105,7 @@
105 105
 
106 106
 .panelItem .textNormal {
107 107
   width:650rpx;
108
+  justify-content: flex-start;
108 109
 }
109 110
 .panelItem .textPinyin {
110 111
   text-decoration: underline;

+ 1 - 1
pages/main/searchCardList.js

@@ -79,7 +79,7 @@ Page({
79 79
     }
80 80
 
81 81
     var hasPage=false;
82
-    if (list.length % 20 == 0 && that.data.IsToday==0)
82
+    if (list.length<that.data.Count && that.data.IsToday==0)
83 83
       hasPage=true;
84 84
     
85 85
     this.setData({

+ 31 - 23
pages/main/searchWeb.js

@@ -9,33 +9,36 @@ Page({
9 9
   onLoad: function () {
10 10
     wx.hideShareMenu();
11 11
     var that = this;
12
-    
12
+
13 13
     that.setData({
14 14
       Containnerheight: main.getWindowHeight(),
15 15
     });
16 16
   },
17
-  onShow:function(){
17
+  onShow: function () {
18 18
     var that = this;
19 19
     var arr = wx.getStorageSync("SearchWord2");
20 20
     if (!arr)
21 21
       arr = [];
22
-    
23
-    var list=[];
24
-    for(var i=0;i<10;i++){
25
-      if (!arr[i].Type)
26
-        arr[i].Type="zici";
27
-      switch(arr[i].Type){
28
-        case 'zici':
29
-          arr[i].TypeName = '字词';
30
-          break;
31
-        case 'shici':
32
-          arr[i].TypeName = '诗词';
33
-          break;
34
-        case 'eng':
35
-          arr[i].TypeName = '外语';
36
-          break;
22
+
23
+    var list = [];
24
+    if (arr.length > 0) {
25
+      var count=arr.length<10?arr.length:10;
26
+      for (var i = 0; i < count; i++) {
27
+        if (!arr[i].Type)
28
+          arr[i].Type = "zici";
29
+        switch (arr[i].Type) {
30
+          case 'zici':
31
+            arr[i].TypeName = '字词';
32
+            break;
33
+          case 'shici':
34
+            arr[i].TypeName = '诗词';
35
+            break;
36
+          case 'eng':
37
+            arr[i].TypeName = '外语';
38
+            break;
39
+        }
40
+        list.push(arr[i]);
37 41
       }
38
-      list.push(arr[i]);
39 42
     }
40 43
     that.setData({
41 44
       SelectList: list,
@@ -47,12 +50,17 @@ Page({
47 50
     })
48 51
   },
49 52
   onSearchHistory: function (e) {
50
-    var search = e.currentTarget.dataset.search;
51
-    var searchType = e.currentTarget.dataset.searchtype;
52
-    var author = e.currentTarget.dataset.author;
53
-
53
+    var index = Number(e.currentTarget.dataset.index);
54
+    var obj={};
55
+    for(var i=0;i<this.data.SelectList.length;i++){
56
+      if (i==index){
57
+        obj=this.data.SelectList[i];
58
+        break;
59
+      }
60
+    }
61
+    main.updateSearchList(obj);
54 62
     wx.navigateTo({
55
-      url: './searchWeb2?back=2&search=' + search + '&searchType=' + searchType+'&author='+author,
63
+      url: './searchWeb2?back=2',
56 64
     });
57 65
   },
58 66
   onShareAppMessage: function () {

+ 7 - 11
pages/main/searchWeb.wxml

@@ -6,31 +6,27 @@
6 6
     </view>
7 7
   </view>
8 8
   <view class='lineFooter'></view>
9
-  <view class="panelTitle FlexRow" wx:if="{{SelectList.length>0}}">
9
+  <view class="panelTitle FlexRow">
10 10
     <view class="panelTitle1">看过的资料</view>
11 11
   </view>
12
+  <view class="panelNull" wx:if="{{SelectList.length==0}}">暂无。为方便再次查看,近期打开过的资料会显示在这里。</view>
12 13
 
13 14
   <block wx:for="{{SelectList}}" wx:key="index">
14 15
     <view class="lineWidthAll FlexRow" wx:if="{{index>0}}">
15 16
       <view class="lineWidth720"></view>
16 17
     </view>
17
-    <view class="panelItemSearch FlexColumn">
18
+    <view class="panelItemSearch FlexColumn"  bindtap='onSearchHistory' data-index="{{index}}">
18 19
       <view class="panelItemSearch1 FlexRow">
19
-        <view class="panelItemSearch11" bindtap='onSearchHistory' data-search="{{item.Key}}" data-searchtype="{{item.Type}}" data-author="{{item.Author}}">
20
+        <view class="panelItemSearch11">
20 21
           {{item.Key}}
21 22
         </view>
22
-        <view class="panelItemSearch12 FlexRow">
23
+        <view class="panelItemSearch12 FlexRow" wx:if="{{item.Type=='shici'}}">
23 24
           {{item.TypeName}}
24 25
         </view>
25 26
       </view>
26
-      <view class="panelItemSearch2 FlexRow" wx:if="{{item.Type=='shici'}}">
27
-        {{item.Author}} {{item.Dynasty}}
28
-      </view>
29
-      <view class="panelItemSearch2 FlexRow" wx:if="{{item.Type=='shici'}}">
30
-        {{item.Content}}
31
-      </view>
32 27
     </view>
28
+    <view class='lineFooter'></view>
33 29
   </block>
34
-  <view class='lineFooter'></view>
30
+  
35 31
   <view style='height:100rpx;'></view>
36 32
 </view>

+ 11 - 1
pages/main/searchWeb.wxss

@@ -50,6 +50,16 @@
50 50
   margin-bottom: 32rpx;
51 51
 }
52 52
 
53
+.panelNull{
54
+  margin-top: -20rpx;
55
+  font-size:24rpx;
56
+  font-weight: 400;
57
+  color:#787878;
58
+  align-self: flex-start;
59
+  margin-left: 30rpx;
60
+
61
+}
62
+
53 63
 .panelItemSearch {
54 64
   width: 100%;
55 65
   min-height: 100rpx;
@@ -75,7 +85,7 @@
75 85
 
76 86
 
77 87
 .panelItemSearch .panelItemSearch12{
78
-  border:2rpx solid #0071EF;
88
+  border:1rpx solid #0071EF;
79 89
   font-size:20rpx;
80 90
   text-align: center;
81 91
   line-height: 34rpx;

+ 85 - 107
pages/main/searchWeb1.js

@@ -6,18 +6,20 @@ const app = getApp();
6 6
 Page({
7 7
   data: {
8 8
     ListOther: [{
9
-      Key: '愛', Type: 'zici'
9
+      Key: '愛', Type: 'zici', TypeName: '字词'
10 10
     }, {
11
-      Key: '饕餮', Type: 'zici'
11
+      Key: '饕餮', Type: 'zici', TypeName: '字词'
12 12
     }, {
13
-      Key: '鸿鹄之志', Type: 'zici'
13
+      Key: '鸿鹄之志', Type: 'zici', TypeName: '字词'
14 14
     }, {
15
-      Key: '天净沙·秋思', Type: 'shici'
15
+      Key: '咏鹅', Type: 'shici', Author: '骆宾王', Dynasty: '唐', TypeName: '诗词'
16 16
     }, {
17
-      Key: 'success', Type: 'zici'
17
+      Key: '天净沙·秋思', Type: 'shici', Author: '马致远', Dynasty: '元', TypeName: '诗词'
18 18
     }, {
19
-      Key: 'Study hard and make progress every day.', Type: 'eng'
20
-    }
19
+      Key: 'success', Type: 'zici', TypeName: '字词'
20
+    },{
21
+        Key: 'Study hard and make progress every day.', Type: 'eng', TypeName: '外语'
22
+    },
21 23
     ]
22 24
   },
23 25
   onLoad: function () {
@@ -25,28 +27,11 @@ Page({
25 27
     var that = this;
26 28
     that.setData({
27 29
       Containnerheight: main.getWindowHeight(),
28
-      IsShowNull: false,
30
+      IsStart: true,
29 31
     });
30
-    app.globalData.SearchResultList = [];
31
-    app.globalData.SearchNull = 0;
32 32
     common.getStorageValue(that, "SearchTextList", [], function () {
33 33
     });
34 34
   },
35
-  onShow: function () {
36
-    if (app.globalData.SearchNull == 1) {
37
-      var len = 26;
38
-      var list = app.globalData.SearchResultList;
39
-      for (var i = 0; i < list.length; i++) {
40
-        var item = list[i];
41
-        if (item.Content && item.Content.length > len)
42
-          item.Content = item.Content.substr(0, len) + "...";
43
-      }
44
-      this.setData({
45
-        List: list,
46
-      });
47
-      app.globalData.SearchNull = 0;
48
-    }
49
-  },
50 35
   onKeyInput: function (e) {
51 36
     var search = e.detail.value;
52 37
     var that = this;
@@ -54,13 +39,22 @@ Page({
54 39
       SearchInfo: search,
55 40
     });
56 41
   },
42
+  onBindfocus:function(){
43
+    this.setData({
44
+      IsStart:true,
45
+      List:[],
46
+    });
47
+    wx.setNavigationBarTitle({
48
+      title: "搜索中"
49
+    });
50
+  },
57 51
   onSearch: function (e) {
58 52
     var that = this;
59 53
     if (e.currentTarget.dataset.search)
60 54
       this.data.SearchInfo = e.currentTarget.dataset.search;
61 55
     if (this.data.SearchInfo && this.data.SearchInfo.length > 0) {
62 56
       var search = this.data.SearchInfo;
63
-      
57
+
64 58
       that.searchResult(search);
65 59
 
66 60
       var arr = that.data.SearchTextList;
@@ -83,13 +77,21 @@ Page({
83 77
       })
84 78
     }
85 79
   },
86
-  onSearchSelect: function (e) {
87
-    var search = e.currentTarget.dataset.search;
88
-    var searchType = e.currentTarget.dataset.searchtype;
89
-    var author = e.currentTarget.dataset.author;
90
-    wx.navigateTo({
91
-      url: './searchWeb2?search=' + search + '&searchType=' + searchType + '&author=' + author,
92
-    });
80
+  onSearchHistory: function (e) {
81
+    var index = e.currentTarget.dataset.index;
82
+    var listtype = e.currentTarget.dataset.type;
83
+    var list = this.data.List;
84
+    if (listtype=="null")
85
+      list=this.data.ListOther;
86
+    var obj={};
87
+    for(var i=0;i<list.length;i++){
88
+      if (index==i){
89
+        obj=list[i];
90
+        break;
91
+      }
92
+    }
93
+    this.searchResult(obj.Key,obj.Type,obj.Author);
94
+    
93 95
   },
94 96
   close: function (e) {
95 97
     wx.navigateBack({
@@ -107,96 +109,72 @@ Page({
107 109
     wx.setStorageSync("SearchTextList", that.data.SearchTextList);
108 110
 
109 111
   },
110
-  searchResult: function (search, searchType, author,dynasty,content) {
112
+  searchResult: function (search, searchType, author) {
111 113
 
112 114
     wx.showLoading({
113 115
       title: '查询中',
114 116
     });
115 117
     var that = this;
116 118
 
117
-    var arr = wx.getStorageSync("SearchWord2");
118
-    if (!arr)
119
-      arr = [];
120
-    var obj = {};
121
-    obj.Key = search;
119
+    var url = 'GetMiaoguoAISearch?UserID=' + app.globalData.userInfo.UserID;
120
+    url += "&Word=" + search;
122 121
     if (searchType)
123
-      obj.Type = searchType;
124
-    else
125
-      obj.Type = "zici";
122
+      url += "&SearchType=" + searchType;
126 123
     if (author)
127
-      obj.Author = author;
128
-    if (dynasty)
129
-      obj.dynasty = dynasty;
130
-    if (content)
131
-      obj.Content = content;
132
-    var b = false;
133
-    for (var i = 0; i < arr.length; i++) {
134
-      if (arr[i].Key == search 
135
-      && arr[i].Type == searchType 
136
-      && arr[i].Author == author) {
137
-        obj.Value = arr[i].Value;
138
-        arr.splice(i, 1);
139
-        b = true;
140
-        break;
141
-      }
142
-    }
143
-    if (b) {
144
-      arr.unshift(obj);
145
-      wx.setStorageSync("SearchWord2", arr);
146
-      app.globalData.SearchItem=obj.Value;
147
-
124
+      url += "&Author=" + author;
125
+    main.getData(url, function (data) {
148 126
       wx.hideLoading();
149
-
150
-      wx.navigateTo({
151
-        url: './searchWeb2?back=3',
127
+      wx.setNavigationBarTitle({
128
+        title: "搜索结果"
152 129
       });
153
-    }
154
-    else {
155
-      var url = 'GetMiaoguoAISearch?UserID=' + app.globalData.userInfo.UserID;
156
-      url += "&Word=" + search;
157
-      if (searchType)
158
-        url += "&SearchType=" + searchType;
159
-      if (author)
160
-        url += "&Author=" + author;
161
-      main.getData(url, function (data) {
162
-        wx.hideLoading();
163
-        searchType = "";
164
-        author = "";
165
-        if (data) {
166
-          //console.log(data);
130
+      searchType = "";
131
+      author = "";
132
+      if (data) {
133
+        //console.log(data);
167 134
 
168
-          if (data.List) {
169
-            app.globalData.SearchResultList = data.List;
170
-            app.globalData.SearchNull = 1;
171
-            wx.navigateBack({
172
-              delta: 1,
173
-            });
174
-          }
175
-          else {
176
-            obj.Value = data;
177
-            if (data.CHN && data.CHN.Author)
178
-              obj.Author = data.CHN.Author;
179
-            if (data.CHN && data.CHN.PeomContent)
180
-              obj.Type = "shici";
181
-            arr.unshift(obj);
182
-
183
-            if (arr.length > 100) {
184
-              arr.pop();
185
-            }
186
-
187
-            wx.setStorageSync("SearchWord2", arr);
188
-            that.getListFinished(data);
135
+        if (data.List) {
136
+          var len = 26;
137
+          var list = data.List;
138
+          for (var i = 0; i < list.length; i++) {
139
+            var item = list[i];
140
+            if (item.Content && item.Content.length > len)
141
+              item.Content = item.Content.substr(0, len) + "...";
189 142
           }
143
+          that.setData({
144
+            List: list,
145
+            IsStart: false,
146
+          });
190 147
         }
191 148
         else {
192
-          app.globalData.SearchNull = 1;
193
-          app.globalData.SearchResultList = [];
194
-          wx.navigateBack({
195
-            delta: 1,
149
+          var obj = {};
150
+          obj.Key=search;
151
+          obj.Value = data;
152
+          if (data.CHN && data.CHN.Author)
153
+            obj.Author = data.CHN.Author;
154
+          if (data.CHN && data.CHN.Dynasty)
155
+            obj.Dynasty = data.CHN.Dynasty;
156
+          if (data.CHN && data.CHN.PeomContent) {
157
+            obj.Type = "shici";
158
+            obj.Content = data.CHN.PeomContent.join("").substr(0, 26);
159
+          }
160
+          else {
161
+            obj.Type = "zici";
162
+          }
163
+          main.updateSearchList(obj);
164
+
165
+          wx.navigateTo({
166
+            url: './searchWeb2?back=3',
196 167
           });
197 168
         }
198
-      });
199
-    }
169
+      }
170
+      else {
171
+        that.setData({
172
+          List: [],
173
+          IsStart: false,
174
+        });
175
+      }
176
+    });
177
+
200 178
   },
201 179
   onShareAppMessage: function () {
202 180
     return {

+ 68 - 38
pages/main/searchWeb1.wxml

@@ -2,81 +2,111 @@
2 2
   <view class="panelSearch FlexRow">
3 3
     <view class="panelSearch1 FlexRow">
4 4
       <image class="universalpic_search_gray_30x30" src='../images/universalpic_search_gray_30x30.png' />
5
-      <input class='input' maxlength='50' auto-focus bindinput="onKeyInput" value="{{SearchInfo}}" />
5
+      <input class='input' maxlength='50' auto-focus bindinput="onKeyInput" value="{{SearchInfo}}" bindfocus="onBindfocus" />
6 6
     </view>
7 7
   </view>
8 8
   <view class='lineFooter'></view>
9
-  <view class='panelBtn FlexRow'>
10
-    <view class='text1' bindtap="close" data-idsave="false">取消</view>
11
-    <view class='line1'></view>
12
-    <view class='text2 text1' bindtap="onSearch" data-idsave="true">搜索</view>
13
-  </view>
14
-  <view class='lineFooter'></view>
15 9
 
16
-  <block wx:if="{{SearchTextList.length>0}}">
17
-    <view class="panelTitle FlexRow">
18
-      <view class="panelTitle1">搜索记录</view>
10
+  <!-- 搜索起始状态 -->
11
+  <block wx:if="{{IsStart}}">
12
+    <view class='panelBtn FlexRow'>
13
+      <view class='text1' bindtap="close" data-idsave="false">取消</view>
14
+      <view class='line1'></view>
15
+      <view class='text2 text1' bindtap="onSearch" data-idsave="true">搜索</view>
19 16
     </view>
20
-    <block wx:for="{{SearchTextList}}" wx:key="index">
21
-      <view class="lineWidthAll FlexRow" wx:if="{{index>0}}">
22
-        <view class="lineWidth720"></view>
17
+    <view class='lineFooter'></view>
18
+
19
+    <block wx:if="{{SearchTextList.length>0}}">
20
+      <view class="panelTitle FlexRow">
21
+        <view class="panelTitle1">搜索记录</view>
23 22
       </view>
24
-      <view class="panelItemSearch FlexRow">
25
-        <view class="panelItemSearch1">
23
+      <block wx:for="{{SearchTextList}}" wx:key="index">
24
+        <view class="lineWidthAll FlexRow" wx:if="{{index>0}}">
25
+          <view class="lineWidth720"></view>
26 26
         </view>
27
-        <view class="panelItemSearch2 FlexRow">
28
-          <view class="panelItemSearchText1" bindtap='onSearch' data-search="{{item}}">
29
-            {{item}}
27
+        <view class="panelItemSearch0 FlexRow">
28
+          <view class="panelItemSearch01">
30 29
           </view>
31
-          <view class="panelItemSearch21 FlexRow" bindtap='deleteItem' data-id="{{index}}">
32
-            <image src='../images/universalpic_del_gray_14x14.png' class="universalpic_del_gray_14x14" />
30
+          <view class="panelItemSearch02 FlexRow">
31
+            <view class="panelItemSearchText01" bindtap='onSearch' data-search="{{item}}">
32
+              {{item}}
33
+            </view>
34
+            <view class="panelItemSearch021 FlexRow" bindtap='deleteItem' data-id="{{index}}">
35
+              <image src='../images/universalpic_del_gray_14x14.png' class="universalpic_del_gray_14x14" />
36
+            </view>
33 37
           </view>
34 38
         </view>
35
-      </view>
36 39
 
40
+      </block>
41
+      <view class='lineFooter'></view>
37 42
     </block>
38
-    <view class='lineFooter'></view>
39 43
   </block>
40 44
 
41
-  <block wx:if="{{List.length==0}}">
45
+  <!-- 无资料匹配状态 -->
46
+  <block wx:if="{{!IsStart && List.length==0}}">
42 47
     <view class='panelNull FlexColumn'>
43
-      <view class="text3">无资料匹配</view>
48
+      <view class="text3">无匹配</view>
44 49
       <view class="text4">通过搜索汉字、词语、成语、诗词、英语单词,添加相关资料</view>
45 50
     </view>
46 51
     <view class="panelTitle FlexRow">
47
-      <view class="panelTitle1">换个搜搜看</view>
52
+      <view class="panelTitle1">参考资料</view>
48 53
     </view>
49 54
     <block wx:for="{{ListOther}}" wx:key="index">
50 55
       <view class="lineWidthAll FlexRow" wx:if="{{index>0}}">
51 56
         <view class="lineWidth720"></view>
52 57
       </view>
53
-      <view class="panelItem0 panelItem FlexColumn" bindtap='onSearchSelect' data-search="{{item.Key}}" data-searchtype="{{item.Type}}">
54
-        <view class='Text1 FlexRow'>
55
-          <view>{{item.Key}}</view>
56
-          <view class='Text11'></view>
58
+      <view class="panelItemSearch FlexColumn" bindtap='onSearchHistory' data-index="{{index}}"  data-type="null">
59
+        <view class="panelItemSearch1 FlexRow">
60
+          <view class="panelItemSearch11">
61
+            {{item.Key}}
62
+          </view>
63
+          <view class="panelItemSearch12 FlexRow" wx:if="{{item.Type=='shici'}}">
64
+            {{item.TypeName}}
65
+          </view>
66
+        </view>
67
+        <view class="panelItemSearch2 FlexRow" wx:if="{{item.Type=='zici'}}">
68
+          {{item.Remark}}
69
+        </view>
70
+        <view class="panelItemSearch2 FlexRow" wx:if="{{item.Type=='shici'}}">
71
+          {{item.Author}} {{item.Dynasty}}
72
+        </view>
73
+        <view class="panelItemSearch3 FlexRow" wx:if="{{item.Type=='shici'}}">
74
+          {{item.Content}}
57 75
         </view>
58 76
       </view>
59
-
60 77
     </block>
61 78
     <view class='lineFooter'></view>
62 79
   </block>
63 80
 
64
-  <block wx:if="{{List.length>0}}">
65
-    <view class="panelTitle FlexRow">
66
-      <view class="panelTitle1">请选择</view>
81
+  <block wx:if="{{!IsStart && List.length>0}}">
82
+    <view style='height:50rpx;'>
67 83
     </view>
68 84
     <block wx:for="{{List}}" wx:key="index">
69 85
       <view class="lineWidthAll FlexRow" wx:if="{{index>0}}">
70 86
         <view class="lineWidth720"></view>
71 87
       </view>
72
-      <view class="panelItem FlexColumn" bindtap='onSearchSelect' data-search="{{item.Title}}" data-searchtype="{{item.Type}}" data-author="{{item.Author}}">
73
-        <view class='Text1 FlexRow'>
74
-          <view>{{item.Title}}</view>
75
-          <view class='Text11'>{{item.Remark}}</view>
88
+      <view class="panelItemSearch FlexColumn" bindtap='onSearchHistory' data-index="{{index}}"  data-type="many">
89
+        <view class="panelItemSearch1 FlexRow">
90
+          <view class="panelItemSearch11">
91
+            {{item.Key}}
92
+          </view>
93
+          <view class="panelItemSearch12 FlexRow" wx:if="{{item.Type=='shici'}}">
94
+            {{item.TypeName}}
95
+          </view>
96
+        </view>
97
+        <view class="panelItemSearch2 FlexRow" wx:if="{{item.Type=='zici'}}">
98
+          {{item.Remark}}
99
+        </view>
100
+        <view class="panelItemSearch2 FlexRow" wx:if="{{item.Type=='shici'}}">
101
+          {{item.Author}} {{item.Dynasty}}
102
+        </view>
103
+        <view class="panelItemSearch3 FlexRow" wx:if="{{item.Type=='shici'}}">
104
+          {{item.Content}}
76 105
         </view>
77
-        <view class='Text2'>{{item.Content}}</view>
78 106
       </view>
79 107
     </block>
80 108
     <view class='lineFooter'></view>
81 109
   </block>
110
+
111
+
82 112
 </view>

+ 59 - 5
pages/main/searchWeb1.wxss

@@ -125,7 +125,7 @@
125 125
 }
126 126
 
127 127
 
128
-.panelItemSearch {
128
+.panelItemSearch0 {
129 129
   width: 100%;
130 130
   justify-content: flex-start;
131 131
   font-size: 28rpx;
@@ -134,7 +134,7 @@
134 134
   background-color: #fff;
135 135
 }
136 136
 
137
-.panelItemSearch .panelItemSearch1 {
137
+.panelItemSearch0 .panelItemSearch01 {
138 138
   margin-left: 30rpx;
139 139
   font-weight: 400;
140 140
 }
@@ -146,20 +146,22 @@
146 146
   width:720rpx;
147 147
 }
148 148
 
149
-.panelItemSearch .panelItemSearchText1{
149
+.panelItemSearch0 .panelItemSearchText01{
150 150
   width:624rpx;
151 151
   font-size:28rpx;
152 152
   justify-content: flex-start;
153
+  height:100rpx;
154
+  line-height: 100rpx;
153 155
 }
154 156
 
155 157
 
156
-.panelItemSearch .panelItemSearchText11{
158
+.panelItemSearch0 .panelItemSearchText101{
157 159
   color:#787878;
158 160
   font-size:24rpx;
159 161
   margin-right: 10rpx;
160 162
 }
161 163
 
162
-.panelItemSearch .panelItemSearch21{
164
+.panelItemSearch0 .panelItemSearch021{
163 165
   width:96rpx;
164 166
   height:100rpx;
165 167
 }
@@ -168,3 +170,55 @@
168 170
   width:14rpx;
169 171
   height:14rpx;
170 172
 }
173
+
174
+
175
+.panelItemSearch {
176
+  width: 100%;
177
+  min-height: 134rpx;
178
+  background-color: #fff;
179
+  justify-content: flex-start;
180
+  align-items: flex-start;
181
+}
182
+
183
+.panelItemSearch .panelItemSearch1{
184
+  color: #1e1e1e;
185
+  font-weight: 400;
186
+  justify-content: space-between;
187
+  width:100%;
188
+}
189
+
190
+.panelItemSearch .panelItemSearch11{
191
+  width:624rpx;
192
+  font-size:28rpx;
193
+  font-weight: 400;
194
+  margin-left: 30rpx;
195
+  margin-top: 30rpx
196
+}
197
+
198
+
199
+.panelItemSearch .panelItemSearch12{
200
+  border:2rpx solid #0071EF;
201
+  font-size:20rpx;
202
+  text-align: center;
203
+  line-height: 34rpx;
204
+  width:60rpx;
205
+  color:#0071EF;
206
+  margin-right: 30rpx;
207
+  margin-top: 34rpx
208
+}
209
+
210
+.panelItemSearch .panelItemSearch2{
211
+  color: #1e1e1e;
212
+  font-weight: 400;
213
+  justify-content: flex-start;
214
+  margin-left: 30rpx;
215
+  font-size:24rpx;
216
+}
217
+.panelItemSearch .panelItemSearch3{
218
+  color: #787878;
219
+  font-weight: 400;
220
+  justify-content: flex-start;
221
+  margin-left: 30rpx;
222
+  font-size:24rpx;
223
+  margin-bottom: 30rpx;
224
+}

+ 7 - 95
pages/main/searchWeb2.js

@@ -4,7 +4,6 @@ import main from '../../utils/main';
4 4
 const app = getApp();
5 5
 var back = 3;
6 6
 var hasStart = {};
7
-var searchType="",author="";
8 7
 
9 8
 Page({
10 9
   data: {
@@ -17,105 +16,18 @@ Page({
17 16
     that.setData({
18 17
       Containnerheight: main.getWindowHeight(),
19 18
     });
20
-    searchType="";
21
-    if (options.searchType)
22
-      searchType = options.searchType;
23
-    
24
-    author = "";
25
-    if (options.author)
26
-      author = options.author;
27
-    if (options.search) {
28
-      this.getList(options.search);
29
-    }
19
+
30 20
     if (options.back)
31 21
       back = Number(options.back);
32 22
 
23
+    this.getList();
24
+    
33 25
     hasStart = {};
34 26
 
35 27
   },
36
-  getList: function (search) {
37
-
38
-    wx.showLoading({
39
-      title: '查询中',
40
-    });
41
-    var that = this;
42
-    
43
-    var arr = wx.getStorageSync("SearchWord2");
44
-    if (!arr)
45
-      arr = [];
46
-    var obj = {};
47
-    obj.Key = search;
48
-    if (searchType)
49
-      obj.Type = searchType;
50
-    else
51
-      obj.Type = "zici";
52
-    if (author)
53
-      obj.Author = author;
54
-    if (author)
55
-      obj.Author = author;
56
-    var b = false, type = 0;
57
-    back = 3;
58
-    for (var i = 0; i < arr.length; i++) {
59
-      if (arr[i].Key == search && arr[i].Type == searchType && arr[i].Author == author) {
60
-        obj.Value = arr[i].Value;
61
-        arr.splice(i, 1);
62
-        back = 2;
63
-        b = true;
64
-        type = 1
65
-        break;
66
-      }
67
-    }
68
-    if (b) {
69
-      arr.unshift(obj);
70
-      wx.setStorageSync("SearchWord2", arr);
71
-      that.getListFinished(obj.Value);
72
-      wx.hideLoading();
73
-    }
74
-    else{
75
-      var url = 'GetMiaoguoAISearch?UserID=' + app.globalData.userInfo.UserID;
76
-      url +="&Word=" + search;
77
-      if (searchType)
78
-        url += "&SearchType=" + searchType;
79
-      if (author)
80
-        url += "&Author=" + author;
81
-      main.getData(url, function (data) {
82
-        wx.hideLoading();
83
-        searchType="";
84
-        author="";
85
-        if (data) {
86
-          //console.log(data);
87
-
88
-          if (data.List){
89
-            app.globalData.SearchResultList=data.List;
90
-            app.globalData.SearchNull=1;
91
-            wx.navigateBack({
92
-              delta: 1,
93
-            });
94
-          }
95
-          else{
96
-            obj.Value=data;
97
-            if (data.CHN && data.CHN.Author)
98
-              obj.Author=data.CHN.Author;
99
-            if (data.CHN && data.CHN.PeomContent)
100
-              obj.Type="shici";
101
-            arr.unshift(obj);
102
-
103
-            if (arr.length>100){
104
-              arr.pop();
105
-            }
106
-
107
-            wx.setStorageSync("SearchWord2", arr);
108
-            that.getListFinished(data);
109
-          }
110
-        }
111
-        else {
112
-          app.globalData.SearchNull = 1;
113
-          app.globalData.SearchResultList = [];
114
-          wx.navigateBack({
115
-            delta: 1,
116
-          });
117
-        }
118
-      });
28
+  getList: function () {
29
+    if (app.globalData.SearchItem) {
30
+      this.getListFinished(app.globalData.SearchItem);
119 31
     }
120 32
   },
121 33
   getListFinished: function (data) {
@@ -257,7 +169,7 @@ Page({
257 169
               }
258 170
             }
259 171
             else {
260
-              if (item.Tag == "诗词原文") {
172
+              if (item.Tag == "原文") {
261 173
                 for (var j = 0; j < item.Content.length; j++) {
262 174
                   if (item.Content.length == 1)
263 175
                     item.Content[j] = item.Content[j].join("\n");

+ 3 - 3
pages/main/searchWeb2.wxml

@@ -127,7 +127,7 @@
127 127
       <view class="panelTitle1">诗词作者</view>
128 128
     </view>
129 129
     <view class="panelItem FlexRow">
130
-      <view class="{{CSS.CHN_Author.Css1}} panelItemFrame FlexRow" bindtap='getInputData' data-type="normal" data-content="{{Result.CHN.Dynasty}} {{Result.CHN.Author}}" data-css="CHN_Author"  data-tag="诗词作者">
130
+      <view class="{{CSS.CHN_Author.Css1}} panelItemFrame FlexRow" bindtap='getInputData' data-type="normal" data-content="{{Result.CHN.Dynasty}} {{Result.CHN.Author}}" data-css="CHN_Author"  data-tag="作者">
131 131
         <view class="{{CSS.CHN_Author.Css2}} panelSelect0">{{CSS.CHN_Author.Number}}</view>
132 132
         <view class="text1">{{Result.CHN.Dynasty}} {{Result.CHN.Author}}</view>
133 133
       </view>
@@ -141,7 +141,7 @@
141 141
       <view class="panelTitle1">诗词原文</view>
142 142
     </view>
143 143
     <view class="panelItem FlexRow">
144
-      <view class="{{CSS.CHN_PeomContent.Css1}} panelItemFrame FlexRow" bindtap='getInputData' data-type="normal" data-content="{{Result.CHN.PeomContent}}" data-css="CHN_PeomContent" data-tag="诗词原文">
144
+      <view class="{{CSS.CHN_PeomContent.Css1}} panelItemFrame FlexRow" bindtap='getInputData' data-type="normal" data-content="{{Result.CHN.PeomContent}}" data-css="CHN_PeomContent" data-tag="原文">
145 145
         <view class="{{CSS.CHN_PeomContent.Css2}} panelSelect0">{{CSS.CHN_PeomContent.Number}}</view>
146 146
         <view class="text1">
147 147
           <block wx:for="{{Result.CHN.PeomContent}}" wx:key="index" wx:for-item="item1">
@@ -159,7 +159,7 @@
159 159
       <view class="panelTitle1">诗词译文</view>
160 160
     </view>
161 161
     <view class="panelItem FlexRow">
162
-      <view class="{{CSS.CHN_Translation.Css1}} panelItemFrame FlexRow" bindtap='getInputData' data-type="normal" data-content="{{Result.CHN.Translation}}" data-css="CHN_Translation" data-tag="诗词译文">
162
+      <view class="{{CSS.CHN_Translation.Css1}} panelItemFrame FlexRow" bindtap='getInputData' data-type="normal" data-content="{{Result.CHN.Translation}}" data-css="CHN_Translation" data-tag="译文">
163 163
         <view class="{{CSS.CHN_Translation.Css2}} panelSelect0">{{CSS.CHN_Translation.Number}}</view>
164 164
         <view class="text1">{{Result.CHN.Translation}}</view>
165 165
       </view>

+ 2 - 0
project.config.json

@@ -19,6 +19,8 @@
19 19
 		"hidedInDevtools": []
20 20
 	},
21 21
 	"isGameTourist": false,
22
+	"simulatorType": "wechat",
23
+	"simulatorPluginLibVersion": {},
22 24
 	"condition": {
23 25
 		"search": {
24 26
 			"current": -1,

+ 7 - 0
sitemap.json

@@ -0,0 +1,7 @@
1
+{
2
+  "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3
+  "rules": [{
4
+  "action": "allow",
5
+  "page": "*"
6
+  }]
7
+}

+ 23 - 0
utils/main.js

@@ -651,6 +651,28 @@ function saveTempImage(serverUrl, tempUrl) {
651 651
   wx.setStorageSync("TempImageList", list);
652 652
 }
653 653
 
654
+function updateSearchList(obj){
655
+  var arr = wx.getStorageSync("SearchWord2");
656
+  if (!arr)
657
+    arr = [];
658
+  for (var i = 0; i < arr.length; i++) {
659
+    if (arr[i].Key == obj.Key
660
+      && arr[i].Type == obj.Type
661
+      && arr[i].Author == obj.Author) {
662
+      obj.Value = arr[i].Value;
663
+      arr.splice(i, 1);
664
+      break;
665
+    }
666
+  }
667
+  arr.unshift(obj);
668
+
669
+  if (arr.length > 100) {
670
+    arr.pop();
671
+  }
672
+  wx.setStorageSync("SearchWord2", arr);
673
+  app.globalData.SearchItem = obj.Value;
674
+}
675
+
654 676
 function getPinyin(pinyin) {
655 677
   var result = [];
656 678
   var arr = getPinyinArray();
@@ -2172,4 +2194,5 @@ module.exports = {
2172 2194
   saveTempImage: saveTempImage,
2173 2195
   getTempImage: getTempImage,
2174 2196
   getTaskTodayList: getTaskTodayList,
2197
+  updateSearchList: updateSearchList,
2175 2198
 }