feat: 星之界打手端UI与提现/充值/排行榜等页面同步更新
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,18 @@
|
||||
import { openCustomerServiceChat, resolveKefuIconUrl } from '../../utils/kefu-nav.js';
|
||||
|
||||
const CS_HOUR_START = 8;
|
||||
const CS_HOUR_END = 23;
|
||||
|
||||
function getCsOnlineStatus() {
|
||||
const hour = new Date().getHours();
|
||||
const online = hour >= CS_HOUR_START && hour < CS_HOUR_END;
|
||||
return {
|
||||
csOnline: online,
|
||||
csHoursText: '8:00-23:00',
|
||||
csStatusText: online ? '在线' : '在线时间',
|
||||
};
|
||||
}
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
bottom: { type: String, value: '200rpx' },
|
||||
@@ -11,6 +24,9 @@ Component({
|
||||
csUnread: 0,
|
||||
floatY: 520,
|
||||
iconUrl: '',
|
||||
csOnline: false,
|
||||
csHoursText: '8:00-23:00',
|
||||
csStatusText: '在线时间',
|
||||
},
|
||||
|
||||
lifetimes: {
|
||||
@@ -27,6 +43,7 @@ Component({
|
||||
app.on('configApplied', this._configHandler);
|
||||
}
|
||||
this.syncCsUnread();
|
||||
this._syncOnlineStatus();
|
||||
},
|
||||
detached() {
|
||||
const app = getApp();
|
||||
@@ -47,10 +64,14 @@ Component({
|
||||
this._syncIcon();
|
||||
this._syncFromGlobal();
|
||||
this.syncCsUnread();
|
||||
this._syncOnlineStatus();
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
_syncOnlineStatus() {
|
||||
this.setData(getCsOnlineStatus());
|
||||
},
|
||||
_syncIcon() {
|
||||
const url = resolveKefuIconUrl(getApp());
|
||||
if (url && url !== this.data.iconUrl) {
|
||||
|
||||
Reference in New Issue
Block a user