Browse Source

修复时间展示的bug

master
blue 2 years ago
parent
commit
26fca28d04
  1. 3
      im-ui/src/api/date.js
  2. 2
      im-uniapp/common/date.js
  3. 2
      im-uniapp/components/chat-item/chat-item.vue

3
im-ui/src/api/date.js

@ -21,8 +21,7 @@ let toTimeText = (timeStamp, simple) => {
//不属于今年 //不属于今年
timeText = formatDateTime(dateTime); timeText = formatDateTime(dateTime);
if(simple){ if(simple){
console.log(timeText) timeText = timeText.substr(2,8);
timeText = timeText.substr(2,5);
} }
} }
return timeText; return timeText;

2
im-uniapp/common/date.js

@ -21,7 +21,7 @@ let toTimeText = (timeStamp, simple) => {
//不属于今年 //不属于今年
timeText = formatDateTime(dateTime); timeText = formatDateTime(dateTime);
if(simple){ if(simple){
timeText = timeText.substr(2,5); timeText = timeText.substr(2,8);
} }
} }
return timeText; return timeText;

2
im-uniapp/components/chat-item/chat-item.vue

@ -7,7 +7,7 @@
<view class="chat-right"> <view class="chat-right">
<view class="chat-name"> <view class="chat-name">
<view class="chat-name-text">{{chat.showName}}</view> <view class="chat-name-text">{{chat.showName}}</view>
<view class="chat-time">{{$date.toTimeText(chat.lastSendTime)}}</view> <view class="chat-time">{{$date.toTimeText(chat.lastSendTime,true)}}</view>
</view> </view>
<view class="chat-content"> <view class="chat-content">
<view class="chat-at-text">{{atText}}</view> <view class="chat-at-text">{{atText}}</view>

Loading…
Cancel
Save