Files
YwxAppThink/addon/wxchat/YwxMakeFriends/pages/group-chat/index.uvue
T

187 lines
3.5 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 groups" :key="i" @click="joinGroup(item)">
<view class="avatar">{{ item.tag }}</view>
<view class="cell-info">
<text class="cell-name">{{ item.name }}</text>
<text class="cell-sub">{{ item.member }}人 · {{ item.desc }}</text>
</view>
<button class="join-btn">加入</button>
</view>
</view>
<view class="tip">
<text>创建群聊、群管理功能即将上线~</text>
</view>
</view>
</template>
<script setup lang="uts">
import { ref } from 'vue'
const groups = ref([
{ name: '同城脱单互助', tag: '脱', member: 326, desc: '缘分从这里开始' },
{ name: '深夜树洞', tag: '夜', member: 198, desc: '倾诉你的小秘密' },
{ name: '游戏开黑交友', tag: '游', member: 512, desc: '边玩边聊' }
] as UTSJSONObject[])
const joinGroup = (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, #4CD964, #34C759);
}
.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: 24rpx 0;
border-top: 1rpx solid #f2f2f2;
}
.avatar {
width: 80rpx;
height: 80rpx;
border-radius: 20rpx;
background-color: #4CD964;
color: #fff;
font-size: 32rpx;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
margin-right: 24rpx;
}
.cell-info {
flex: 1;
display: flex;
flex-direction: column;
}
.cell-name {
font-size: 28rpx;
color: #333;
font-weight: bold;
}
.cell-sub {
font-size: 22rpx;
color: #999;
margin-top: 6rpx;
}
.join-btn {
background-color: #4CD964;
color: #fff;
border: none;
border-radius: 40rpx;
font-size: 24rpx;
padding: 8rpx 28rpx;
}
.tip {
text-align: center;
padding: 30rpx;
}
.tip text {
font-size: 24rpx;
color: #aaa;
}
</style>