155 lines
2.8 KiB
Plaintext
155 lines
2.8 KiB
Plaintext
<template>
|
|
<view class="page">
|
|
<view class="nav-bar">
|
|
<view class="nav-back" @click="goBack">
|
|
<uni-icons type="left" size="22" color="#333"></uni-icons>
|
|
</view>
|
|
<text class="nav-title">心动聊天</text>
|
|
<view class="nav-right"></view>
|
|
</view>
|
|
|
|
<view class="hero">
|
|
<text class="hero-emoji">💬</text>
|
|
<text class="hero-title">心动聊天室</text>
|
|
<text class="hero-sub">玩游戏、破冰互动,轻松交到好朋友</text>
|
|
</view>
|
|
|
|
<view class="section">
|
|
<text class="section-title">热门玩法</text>
|
|
<view class="cell" v-for="(item, i) in rooms" :key="i" @click="enterRoom(item)">
|
|
<text class="cell-name">{{ item.name }}</text>
|
|
<text class="cell-online">{{ item.online }}人在线</text>
|
|
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="tip">
|
|
<text>更多互动房间即将上线,敬请期待~</text>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup lang="uts">
|
|
import { ref } from 'vue'
|
|
|
|
const rooms = ref([
|
|
{ name: '真心话大冒险', online: 128 },
|
|
{ name: '你画我猜', online: 86 },
|
|
{ name: '语音速配', online: 203 }
|
|
] as UTSJSONObject[])
|
|
|
|
const enterRoom = (item : UTSJSONObject) => {
|
|
uni.showToast({ title: '进入「' + (item.getString('name') ?? '') + '」', icon: 'none' })
|
|
}
|
|
|
|
const goBack = () => {
|
|
uni.navigateBack()
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.page {
|
|
display: flex;
|
|
flex-direction: column;
|
|
background-color: #f6f6f6;
|
|
min-height: 100%;
|
|
}
|
|
|
|
.nav-bar {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
padding: 20rpx 24rpx;
|
|
padding-top: 60rpx;
|
|
background-color: #fff;
|
|
}
|
|
|
|
.nav-back {
|
|
width: 60rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.nav-title {
|
|
flex: 1;
|
|
text-align: center;
|
|
font-size: 34rpx;
|
|
font-weight: bold;
|
|
color: #333;
|
|
}
|
|
|
|
.nav-right {
|
|
width: 60rpx;
|
|
}
|
|
|
|
.hero {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
padding: 60rpx 0 40rpx;
|
|
background: linear-gradient(to bottom right, #FF6B6B, #FF8E53);
|
|
}
|
|
|
|
.hero-emoji {
|
|
font-size: 90rpx;
|
|
}
|
|
|
|
.hero-title {
|
|
font-size: 40rpx;
|
|
font-weight: bold;
|
|
color: #fff;
|
|
margin-top: 16rpx;
|
|
}
|
|
|
|
.hero-sub {
|
|
font-size: 24rpx;
|
|
color: rgba(255, 255, 255, 0.9);
|
|
margin-top: 10rpx;
|
|
}
|
|
|
|
.section {
|
|
background-color: #fff;
|
|
margin: 24rpx;
|
|
border-radius: 20rpx;
|
|
padding: 10rpx 24rpx;
|
|
}
|
|
|
|
.section-title {
|
|
display: block;
|
|
font-size: 28rpx;
|
|
font-weight: bold;
|
|
color: #333;
|
|
padding: 20rpx 0 10rpx;
|
|
}
|
|
|
|
.cell {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
padding: 26rpx 0;
|
|
border-top: 1rpx solid #f2f2f2;
|
|
}
|
|
|
|
.cell-name {
|
|
flex: 1;
|
|
font-size: 28rpx;
|
|
color: #333;
|
|
}
|
|
|
|
.cell-online {
|
|
font-size: 24rpx;
|
|
color: #FF6B6B;
|
|
margin-right: 12rpx;
|
|
}
|
|
|
|
.tip {
|
|
text-align: center;
|
|
padding: 30rpx;
|
|
}
|
|
|
|
.tip text {
|
|
font-size: 24rpx;
|
|
color: #aaa;
|
|
}
|
|
</style>
|