bayi 2 år sedan
förälder
incheckning
74ea918bc9

+ 16 - 2
pages/childClassify/index.js

@@ -104,7 +104,7 @@ Page({
     })
     if (!this.data.historySearch.includes(this.data.text)) {
       this.setData({
-        historySearch: [this.data.text, ...this.data.historySearch].slice(0, 10)
+        historySearch: [this.data.text, ...this.data.historySearch].slice(0, 20)
       })
       wx.setStorageSync('search', this.data.historySearch)
     }
@@ -128,10 +128,24 @@ Page({
       return item != currentTarget.dataset.text
     })
     this.setData({
-      historySearch: newList.slice(0, 10)
+      historySearch: newList.slice(0, 20)
     })
     wx.setStorageSync('search', this.data.historySearch)
   },
+  clearHistory() {
+    wx.showModal({
+      title: '温馨提示',
+      content: '历史记录清除后无法恢复,是否清除全部记录',
+      success: (res) => {
+        if (res.confirm) {
+          this.setData({
+            historySearch: []
+          })
+          wx.setStorageSync('search', this.data.historySearch)
+        }
+      }
+    })
+  },
   goRead({
     currentTarget
   }) {

+ 6 - 0
pages/childClassify/index.less

@@ -196,6 +196,12 @@
         padding: 0rpx 20rpx;
       }
     }
+
+    .clearHistory {
+      padding: 20rpx 0rpx;
+      text-align: center;
+      font-size: 28rpx;
+    }
   }
 }
 

+ 3 - 0
pages/childClassify/index.wxml

@@ -24,6 +24,9 @@
         ×
       </view>
     </view>
+    <view class="clearHistory" bindtap="clearHistory" wx:if="{{historySearch.length>0}}">
+      清除搜索记录
+    </view>
   </view>
   <!-- 内容区域 -->
   <scroll-view wx:if="{{list.length>0}}" class="worksList" style="{{childType?'padding-top:10rpx':''}}" scroll-y="true"

+ 5 - 0
pages/childClassify/index.wxss

@@ -171,6 +171,11 @@
   line-height: 40rpx;
   padding: 0rpx 20rpx;
 }
+.classBox .historyList .clearHistory {
+  padding: 20rpx 0rpx;
+  text-align: center;
+  font-size: 28rpx;
+}
 .empty {
   margin-top: 300rpx;
 }

+ 1 - 1
pages/friend/index.wxml

@@ -19,7 +19,7 @@
         <view class="infoBox">
           <view class="top">
             <view class="nickName"> {{item.user.nickName||item.user.eid}}</view>
-            <view class="state" data-uid='{{item.user.uid}}' data-isEachOther="{{item.isEachOther}}" bindtap="setFans">
+            <view class="state" data-uid='{{item.user.uid}}' data-isEachOther="{{item.isEachOther}}" catchtap="setFans">
               <view class="stateText already" wx:if="{{currentType==1}}">
                 {{item.isEachOther?'互相关注':'已关注'}}
               </view>

+ 1 - 1
pages/reading/index.wxml

@@ -15,7 +15,7 @@
     <!-- 水印 -->
     <image src="{{videoInfo.readMaskTemplate.imgPath}}" class="watermark" />
     <video id="myVideo" src="{{videoPath}}" bindended='videoEnd' show-center-play-btn="{{readingReset}}"
-      controls="{{!state&&!readingReset}}" muted="{{muted}}"></video>
+      custom-cache="{{false}}" controls="{{!state&&!readingReset}}" muted="{{muted}}"></video>
   </view>
   <view class="audio" bindtap='videoPlay' wx:else>
     <image src="{{videoInfo.userRead.coverImg}}" class="audioBg" mode="" />

+ 16 - 2
pages/searchFriend/index.js

@@ -44,7 +44,7 @@ Page({
     this.resetData()
     if (!this.data.historySearch.includes(this.data.text)) {
       this.setData({
-        historySearch: [this.data.text, ...this.data.historySearch].slice(0, 10)
+        historySearch: [this.data.text, ...this.data.historySearch].slice(0, 20)
       })
     }
     wx.setStorageSync('userSearch', this.data.historySearch)
@@ -56,10 +56,24 @@ Page({
       return item != currentTarget.dataset.text
     })
     this.setData({
-      historySearch: newList.slice(0, 10)
+      historySearch: newList.slice(0, 20)
     })
     wx.setStorageSync('userSearch', this.data.historySearch)
   },
+  clearHistory() {
+    wx.showModal({
+      title: '温馨提示',
+      content: '历史记录清除后无法恢复,是否清除全部记录',
+      success: (res) => {
+        if (res.confirm) {
+          this.setData({
+            historySearch: []
+          })
+          wx.setStorageSync('search', this.data.historySearch)
+        }
+      }
+    })
+  },
   loadMore() {
     if (!this.data.text) {
       return

+ 6 - 0
pages/searchFriend/index.less

@@ -62,6 +62,12 @@
         padding: 0rpx 20rpx;
       }
     }
+
+    .clearHistory {
+      padding: 20rpx 0rpx;
+      text-align: center;
+      font-size: 28rpx;
+    }
   }
 
   .box {

+ 3 - 0
pages/searchFriend/index.wxml

@@ -18,6 +18,9 @@
         ×
       </view>
     </view>
+    <view class="clearHistory" bindtap="clearHistory" wx:if="{{historySearch.length>0}}">
+      清除搜索记录
+    </view>
   </view>
   <view class="box">
     <view class="follow" wx:for="{{list}}" wx:key="index" bindtap="jumpUserInfo" data-uid='{{item.uid}}'>

+ 5 - 0
pages/searchFriend/index.wxss

@@ -53,6 +53,11 @@
   line-height: 40rpx;
   padding: 0rpx 20rpx;
 }
+.searchFriend .historyList .clearHistory {
+  padding: 20rpx 0rpx;
+  text-align: center;
+  font-size: 28rpx;
+}
 .searchFriend .box {
   padding-bottom: 20rpx;
   margin-top: 100rpx;