wangfukang 2 weeks ago
parent
commit
04cc88f6f2
  1. 11
      package1/ieBrowser/chatList.vue
  2. 5
      package1/ieBrowser/fate.vue
  3. 92
      package1/ieBrowser/index.vue
  4. 14
      package1/ieBrowser/messages.vue

11
package1/ieBrowser/chatList.vue

@ -100,13 +100,13 @@
id: item.id, id: item.id,
roomId: item.roomId, roomId: item.roomId,
targetUserId: item.targetUserId, targetUserId: item.targetUserId,
type: item.mode || 'i', type: item.currentMode || item.mode || 'i',
name: item.anonymousName || '半匿名漂流者', name: item.anonymousName || '半匿名漂流者',
avatar: item.avatarText || (item.mode === 'e' ? '光' : '月'), avatar: item.avatarText || ((item.currentMode || item.mode) === 'e' ? '光' : '月'),
avatarUrl: item.avatarUrl || '', avatarUrl: item.avatarUrl || '',
time: this.formatTime(item.createTime), time: this.formatTime(item.createTime),
duration: this.formatDuration(item.durationSeconds), duration: this.formatDuration(item.durationSeconds),
feeling: item.feeling || item.summary || '你们已经匹配成功,可以继续这段轻陪伴。', feeling: item.intro || item.feeling || item.summary || '你们已经匹配成功,可以继续这段轻陪伴。',
tags: this.parseTags(item.tags), tags: this.parseTags(item.tags),
unread: item.unreadCount > 0 || item.hasUnread === true unread: item.unreadCount > 0 || item.hasUnread === true
} }
@ -118,7 +118,8 @@
'&roomId=' + item.roomId + '&roomId=' + item.roomId +
'&targetUserId=' + (item.targetUserId || '') + '&targetUserId=' + (item.targetUserId || '') +
'&name=' + encodeURIComponent(item.name || '半匿名漂流者') + '&name=' + encodeURIComponent(item.name || '半匿名漂流者') +
'&avatar=' + encodeURIComponent(item.type || '◌') + '&avatar=' + encodeURIComponent(item.avatar || item.type || '◌') +
'&avatarUrl=' + encodeURIComponent(item.avatarUrl || '') +
'&quote=' + encodeURIComponent(item.feeling || '') '&quote=' + encodeURIComponent(item.feeling || '')
}) })
}, },
@ -152,6 +153,8 @@
item.name = profile.anonymousName || item.name item.name = profile.anonymousName || item.name
item.avatar = profile.avatarText || item.avatar item.avatar = profile.avatarText || item.avatar
item.avatarUrl = profile.avatarUrl || '' item.avatarUrl = profile.avatarUrl || ''
item.type = profile.currentMode || item.type
item.feeling = profile.intro || item.feeling
}) })
await Promise.all(tasks) await Promise.all(tasks)
}, },

5
package1/ieBrowser/fate.vue

@ -70,11 +70,12 @@
const date = new Date(item.createTime) const date = new Date(item.createTime)
return { return {
id: item.id, id: item.id,
type: item.mode || 'i', targetUserId: item.targetUserId,
type: item.currentMode || item.mode || 'i',
name: item.anonymousName || '半匿名漂流者', name: item.anonymousName || '半匿名漂流者',
time: this.formatTime(item.createTime), time: this.formatTime(item.createTime),
rawDate: Number.isNaN(date.getTime()) ? null : date, rawDate: Number.isNaN(date.getTime()) ? null : date,
feeling: item.feeling || item.summary || '这次连接只留下了一点情绪轨迹。', feeling: item.intro || item.feeling || item.summary || '这次连接只留下了一点情绪轨迹。',
remeet: item.remeetAvailable === 1 remeet: item.remeetAvailable === 1
} }
}, },

92
package1/ieBrowser/index.vue

@ -1,5 +1,5 @@
<template> <template>
<view class="ie-page"> <view class="ie-page" :class="{ 'low-performance': lowPowerMode }">
<view class="ambient ambient-a"></view> <view class="ambient ambient-a"></view>
<view class="ambient ambient-b"></view> <view class="ambient ambient-b"></view>
<view class="top-safe" :style="{ height: menuButtonInfo.top + 'px' }"></view> <view class="top-safe" :style="{ height: menuButtonInfo.top + 'px' }"></view>
@ -20,6 +20,9 @@
<view class="planet-ring"></view> <view class="planet-ring"></view>
<view class="planet-icon"></view> <view class="planet-icon"></view>
</view> </view>
<view class="perf-toggle" :class="{ active: lowPowerMode }" @tap="toggleLowPowerMode">
{{ lowPowerMode ? '流畅' : '性能' }}
</view>
</view> </view>
<view class="drift-field"> <view class="drift-field">
@ -147,6 +150,7 @@
showProfile: false, showProfile: false,
profileReady: false, profileReady: false,
profile: {}, profile: {},
lowPowerMode: false,
targetMode: 'any', targetMode: 'any',
targetGender: 'any', targetGender: 'any',
activeDriftText: '', activeDriftText: '',
@ -241,6 +245,7 @@
if (uni.getMenuButtonBoundingClientRect) { if (uni.getMenuButtonBoundingClientRect) {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
} }
this.lowPowerMode = uni.getStorageSync('ieLowPowerMode') === '1'
this.pickCompanion() this.pickCompanion()
this.loadHome() this.loadHome()
this.animateAwakeCount(this.awakeCount) this.animateAwakeCount(this.awakeCount)
@ -273,9 +278,9 @@
this.awakeCount = 118 + Math.floor(Math.random() * 28) this.awakeCount = 118 + Math.floor(Math.random() * 28)
this.waitingCount = 39 + Math.floor(Math.random() * 18) this.waitingCount = 39 + Math.floor(Math.random() * 18)
this.animateAwakeCount(this.awakeCount) this.animateAwakeCount(this.awakeCount)
}, 4200) }, this.lowPowerMode ? 9000 : 4200)
} }
if (!this.galaxyTimer) { if (!this.lowPowerMode && !this.galaxyTimer) {
this.galaxyTimer = setInterval(() => { this.galaxyTimer = setInterval(() => {
this.galaxyAutoAngle = (this.galaxyAutoAngle + 3.8) % 360 this.galaxyAutoAngle = (this.galaxyAutoAngle + 3.8) % 360
}, 160) }, 160)
@ -303,6 +308,10 @@
if (this.countTimer) { if (this.countTimer) {
clearInterval(this.countTimer) clearInterval(this.countTimer)
} }
if (this.lowPowerMode) {
this.displayAwakeCount = target
return
}
const start = this.displayAwakeCount const start = this.displayAwakeCount
const diff = target - start const diff = target - start
let step = 0 let step = 0
@ -321,6 +330,13 @@
const list = this.companions[this.currentMode] const list = this.companions[this.currentMode]
this.matchedPerson = list[Math.floor(Math.random() * list.length)] this.matchedPerson = list[Math.floor(Math.random() * list.length)]
}, },
toggleLowPowerMode() {
this.lowPowerMode = !this.lowPowerMode
uni.setStorageSync('ieLowPowerMode', this.lowPowerMode ? '1' : '0')
this.stopPageTimers()
this.startPageTimers()
uni.showToast({ title: this.lowPowerMode ? '已开启流畅模式' : '已开启氛围动效', icon: 'none' })
},
async loadHome() { async loadHome() {
const home = await ieHome() const home = await ieHome()
if (!home) return if (!home) return
@ -1152,6 +1168,28 @@
box-shadow: 0 24rpx 70rpx rgba(96,112,160,.13); box-shadow: 0 24rpx 70rpx rgba(96,112,160,.13);
} }
.perf-toggle {
position: absolute;
right: 0;
top: 148rpx;
z-index: 4;
height: 48rpx;
line-height: 48rpx;
padding: 0 18rpx;
border-radius: 999rpx;
color: rgba(22,27,46,.58);
background: rgba(255,255,255,.72);
border: 1rpx solid rgba(255,255,255,.86);
box-shadow: 0 12rpx 32rpx rgba(96,112,160,.1);
font-size: 20rpx;
font-weight: 800;
}
.perf-toggle.active {
color: #11162a;
background: #a9ffe7;
}
.drift-field { .drift-field {
position: relative; position: relative;
z-index: 2; z-index: 2;
@ -2108,4 +2146,52 @@
from { filter: hue-rotate(0deg); } from { filter: hue-rotate(0deg); }
to { filter: hue-rotate(18deg); } to { filter: hue-rotate(18deg); }
} }
.low-performance::before,
.low-performance::after,
.low-performance .ambient,
.low-performance .wave-line,
.low-performance .liquid,
.low-performance .soul-particle,
.low-performance .galaxy-ring,
.low-performance .orbit-planet::after,
.low-performance .mood-dock::before,
.low-performance .tab-glow {
display: none !important;
}
.low-performance .drift-fragment,
.low-performance .galaxy-breath,
.low-performance .galaxy-body,
.low-performance .planet-sub,
.low-performance .start-match-btn,
.low-performance .count-num,
.low-performance .typing-cursor {
animation: none !important;
transition: none !important;
}
.low-performance .signal-planet {
transform: translate(-50%, -50%) scale(.9);
}
.low-performance .galaxy-body {
box-shadow:
0 18rpx 48rpx rgba(108,92,231,.14),
inset 8rpx 10rpx 24rpx rgba(255,255,255,.52);
}
.low-performance .mood-dock,
.low-performance .target-dock,
.low-performance .bottom-actions,
.low-performance .drift-fragment,
.low-performance .match-mask,
.low-performance .profile-mask,
.low-performance .sub-line {
backdrop-filter: none !important;
}
.low-performance .drift-fragment:nth-of-type(n+5) {
display: none;
}
</style> </style>

14
package1/ieBrowser/messages.vue

@ -11,7 +11,8 @@
<view class="sub">这里不是聊天列表只放未完成的陪伴</view> <view class="sub">这里不是聊天列表只放未完成的陪伴</view>
</view> </view>
<view class="room-card" v-for="item in requests" :key="item.id" @tap="openRecord(item)"> <view class="room-card" v-for="item in requests" :key="item.id" @tap="openRecord(item)">
<view class="avatar">{{ item.avatar }}</view> <image class="avatar-img" v-if="item.avatarUrl" :src="item.avatarUrl" mode="aspectFill"></image>
<view class="avatar" v-else>{{ item.avatar }}</view>
<view class="main"> <view class="main">
<view class="name">{{ item.name }}</view> <view class="name">{{ item.name }}</view>
<view class="desc">{{ item.desc }}</view> <view class="desc">{{ item.desc }}</view>
@ -51,10 +52,11 @@
id: item.id, id: item.id,
roomId: item.roomId, roomId: item.roomId,
targetUserId: item.targetUserId, targetUserId: item.targetUserId,
mode: item.mode || 'i', mode: item.currentMode || item.mode || 'i',
name: item.anonymousName || '半匿名漂流者', name: item.anonymousName || '半匿名漂流者',
avatar: item.mode === 'e' ? '光' : '月', avatar: item.avatarText || ((item.currentMode || item.mode) === 'e' ? '光' : '月'),
desc: (item.unreadCount > 0 ? `${item.unreadCount} 条未读 · ` : '') + (remeet ? '可以从聊天记录继续这段对话。' : (item.summary || '这段聊天已保留在记录里。')), avatarUrl: item.avatarUrl || '',
desc: (item.unreadCount > 0 ? `${item.unreadCount} 条未读 · ` : '') + (item.intro || (remeet ? '可以从聊天记录继续这段对话。' : (item.summary || '这段聊天已保留在记录里。'))),
remeet remeet
} }
}, },
@ -81,6 +83,7 @@
'&targetUserId=' + (item.targetUserId || '') + '&targetUserId=' + (item.targetUserId || '') +
'&name=' + encodeURIComponent(item.name || '半匿名漂流者') + '&name=' + encodeURIComponent(item.name || '半匿名漂流者') +
'&avatar=' + encodeURIComponent(item.avatar || '◌') + '&avatar=' + encodeURIComponent(item.avatar || '◌') +
'&avatarUrl=' + encodeURIComponent(item.avatarUrl || '') +
'&quote=' + encodeURIComponent(item.desc || '') '&quote=' + encodeURIComponent(item.desc || '')
}) })
} }
@ -99,7 +102,8 @@
.sub { margin-top: 12rpx; color: rgba(21,26,45,.5); font-size: 25rpx; } .sub { margin-top: 12rpx; color: rgba(21,26,45,.5); font-size: 25rpx; }
.room-card { display: flex; align-items: center; margin-top: 26rpx; padding: 28rpx; border-radius: 36rpx; background: rgba(255,255,255,.64); border: 1rpx solid rgba(255,255,255,.86); box-shadow: 0 22rpx 60rpx rgba(96,112,160,.12); } .room-card { display: flex; align-items: center; margin-top: 26rpx; padding: 28rpx; border-radius: 36rpx; background: rgba(255,255,255,.64); border: 1rpx solid rgba(255,255,255,.86); box-shadow: 0 22rpx 60rpx rgba(96,112,160,.12); }
.room-card.active { background: rgba(17,22,42,.92); color: #fff; } .room-card.active { background: rgba(17,22,42,.92); color: #fff; }
.pulse, .avatar { width: 78rpx; height: 78rpx; margin-right: 20rpx; border-radius: 50%; text-align: center; line-height: 78rpx; background: #a9ffe7; color: #11162a; font-weight: 800; } .pulse, .avatar, .avatar-img { width: 78rpx; height: 78rpx; margin-right: 20rpx; border-radius: 50%; }
.avatar { text-align: center; line-height: 78rpx; background: #a9ffe7; color: #11162a; font-weight: 800; }
.pulse { animation: breath 2.4s ease-in-out infinite; } .pulse { animation: breath 2.4s ease-in-out infinite; }
.main { flex: 1; } .main { flex: 1; }
.name { font-size: 29rpx; font-weight: 800; } .name { font-size: 29rpx; font-weight: 800; }

Loading…
Cancel
Save