Browse Source

FIX

修复搜索高亮bug,移除退出登录
RegMs If 4 năm trước cách đây
mục cha
commit
99115b97a7

+ 4 - 0
miniprogram/components/itemCard/itemCard.js

@@ -23,6 +23,10 @@ Component({
    */
   methods: {
     getPublisherInfo: function () {
+      const pages = getCurrentPages()
+      if (pages[pages.length - 1].route === 'pages/publisher/publisher') {
+        return
+      }
       wx.navigateTo({
         url: '/pages/publisher/publisher',
       }).then(res => {

+ 1 - 1
miniprogram/pages/message/message.js

@@ -225,7 +225,7 @@ Page({
       })
     } else {
       const eventChannel = this.getOpenerEventChannel()
-      eventChannel.on('loadCommonData', res => {
+      eventChannel.once('loadCommonData', res => {
         this.setData({
           messageId: res.data._id,
         })

+ 4 - 2
miniprogram/pages/message/message.wxml

@@ -15,11 +15,13 @@
       </view>
 
       <view class="title-time">
-        <view class="title">{{messageInfo.name}}</view>
+        <view class="title">
+          <rich-text nodes="{{messageInfo.name}}"></rich-text>
+        </view>
         <view class="time primary-text-color">{{messageInfo.publish_time}}</view>
       </view>
       <view wx:if="{{messageInfo.detail}}" class="text">
-        <text>{{messageInfo.detail}}</text>
+        <rich-text nodes="{{messageInfo.detail}}"></rich-text>
       </view>
 
       <view class="line primary-background-color"></view>

+ 1 - 1
miniprogram/pages/publisher/publisher.js

@@ -140,7 +140,7 @@ Page({
       })
     } else {
       const eventChannel = this.getOpenerEventChannel()
-      eventChannel.on('loadCommonData', res => {
+      eventChannel.once('loadCommonData', res => {
         this.setData({
           publisherId: res.data._id,
           publisherInfo: res.data

+ 1 - 1
miniprogram/pages/publisherDetail/publisherDetail.js

@@ -38,7 +38,7 @@ Page({
       })
     } else {
       const eventChannel = this.getOpenerEventChannel()
-      eventChannel.on('loadCommonData', res => {
+      eventChannel.once('loadCommonData', res => {
         this.setData({
           publisherId: res.data._id,
           publisherInfo: res.data

+ 2 - 0
miniprogram/pages/search/search.js

@@ -107,6 +107,7 @@ Page({
         res.result.list[i] = util.dbToMsg(res.result.list[i])
         res.result.list[i].name = res.result.list[i].name.replace(new RegExp(this.data.searchText, 'gi'), '<span style="color: #009195;">$&</span>')
         res.result.list[i].brief = res.result.list[i].brief.replace(new RegExp(this.data.searchText, 'gi'), '<span style="color: #009195;">$&</span>')
+        res.result.list[i].detail = res.result.list[i].detail.replace(new RegExp(this.data.searchText, 'gi'), '<span style="color: #009195;">$&</span>')
       }
       this.setData({
         searchResult: res.result.list,
@@ -143,6 +144,7 @@ Page({
         res.result.list[i] = util.dbToMsg(res.result.list[i])
         res.result.list[i].name = res.result.list[i].name.replace(new RegExp(this.data.searchText, 'gi'), '<span style="color: #009195;">$&</span>')
         res.result.list[i].brief = res.result.list[i].brief.replace(new RegExp(this.data.searchText, 'gi'), '<span style="color: #009195;">$&</span>')
+        res.result.list[i].detail = res.result.list[i].detail.replace(new RegExp(this.data.searchText, 'gi'), '<span style="color: #009195;">$&</span>')
       }
       this.setData({
         searchResult: this.data.searchResult.concat(res.result.list),

+ 0 - 6
miniprogram/pages/setting/setting.js

@@ -9,12 +9,6 @@ Page({
     notiFormType: ['数字', '红点', '不显示']
   },
 
-  logout: function () {
-    app.globalData.hasUserInfo = false
-    app.globalData.userNotFound = true
-    wx.navigateBack()
-  },
-
   onLoad: function () {
     if (app.globalData.hasUserInfo) {
       this.setData({

+ 1 - 9
miniprogram/pages/setting/setting.wxml

@@ -43,12 +43,4 @@
   <image class="btn-icon" mode="aspectFit" src="/images/user/setting.png"></image>
   <view class="btn-text primary-text">收到消息振动</view>
   <switch class="btn-arrow secondary-text" checked="{{vibrate}}" bindchange="vibrateChange" />
-</view> -->
-
-<view class="block" hover-class="btn-hover" bindtap="logout">
-  <view class="left">
-    <image class="btn-icon" mode="aspectFit" src="/images/user/feedback.png"></image>
-    <view>退出登录</view>
-  </view>
-  <view>></view>
-</view>
+</view> -->