更新
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="view-page" :style="{backgroundImage : `url('${ThemeData?.app_bg ?? $config.PRIMARY_BGURL}')`}">
|
||||
<view class="view-page" :style="{backgroundImage : `url('${ThemeData?.app_bg ?? $config.PRIMARY_BGURL}')`}">
|
||||
<navBar :style="{marginTop: `${statusBarHeight}${uni.getSystemInfoSync().platform === 'ios' ? 'px': 'dp'}`}"
|
||||
:navTitle="'公会中心'" :emitBack="true" @backEvent="back">
|
||||
<template #rightView>
|
||||
@@ -17,9 +17,13 @@
|
||||
搜索
|
||||
</view>
|
||||
</view>
|
||||
<view class="swipe-view">
|
||||
|
||||
</view>
|
||||
<swiper class="swipe-view" circular :autoplay="true" :interval="2000" :duration="500">
|
||||
<swiper-item v-for="item in swiperList" :key="item">
|
||||
<view class="swiper-item uni-bg-red">
|
||||
<img :src="item.image" alt="" />
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view class="title">
|
||||
热门公会
|
||||
</view>
|
||||
@@ -43,28 +47,29 @@
|
||||
<view class="chairman-portrait">
|
||||
<img :src="data.user_avatar" alt="暂无头像" />
|
||||
</view>
|
||||
<view class="truncate-three">
|
||||
<view class="chairman-name">
|
||||
{{data.user_name}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-button">
|
||||
<!-- <view class="apply-button">
|
||||
<!-- <view class="apply-button">
|
||||
申请
|
||||
</view> -->
|
||||
<view class="online-view">
|
||||
<div v-show="data.guild_user_list.length">
|
||||
<div class="avatars-container" v-for="ele in data.guild_user_list.slice(0,3)" :key="ele.id">
|
||||
<view class="avatar">
|
||||
<view v-show="data.guild_user_list.length">
|
||||
<view class="avatars-container">
|
||||
<view class="avatar" v-for="ele in data.guild_user_list.slice(0,3)" :key="ele.id">
|
||||
<img :src="ele.avatar" alt="" />
|
||||
</view>
|
||||
</div>
|
||||
<view class="online-people truncate-three">
|
||||
{{data.num}}人
|
||||
</view>
|
||||
</div>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="online-people">
|
||||
{{data.num}}人
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -97,7 +102,8 @@
|
||||
listData: [],
|
||||
UnionByUser: null,
|
||||
statusBarHeight: 0,
|
||||
ThemeData:null
|
||||
ThemeData: null,
|
||||
swiperList: []
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@@ -109,12 +115,22 @@
|
||||
if (uni.getStorageSync('token')) {
|
||||
this.getList()
|
||||
this.getInfo()
|
||||
this.getSwiper()
|
||||
}
|
||||
this.statusBarHeight = h
|
||||
uni.setStorageSync('BarHeight', h)
|
||||
if(uni.getStorageSync('Theme_Data')) {
|
||||
if (uni.getStorageSync('Theme_Data')) {
|
||||
this.ThemeData = JSON.parse(uni.getStorageSync('Theme_Data'))
|
||||
}
|
||||
// 监听事件,事件名如 'refreshList'
|
||||
uni.$on('refreshList', (data) => {
|
||||
this.refreshList(); // 执行刷新方法
|
||||
// 如果传递了数据,可以从 data 中获取
|
||||
});
|
||||
},
|
||||
onUnload() {
|
||||
// 页面卸载时移除事件监听,避免内存泄漏和重复监听
|
||||
uni.$off('refreshList');
|
||||
},
|
||||
onReachBottom() {
|
||||
if (!this.loading && !this.noMore) {
|
||||
@@ -131,6 +147,11 @@
|
||||
this.listData = []
|
||||
this.getList()
|
||||
},
|
||||
refreshList() {
|
||||
this.searchValue = ''
|
||||
this.search()
|
||||
this.getInfo()
|
||||
},
|
||||
closeWeb() {
|
||||
const platform = uni.getSystemInfoSync().platform;
|
||||
// console.log(platform, '打印设备参数')
|
||||
@@ -146,6 +167,18 @@
|
||||
window.Android.closeWeb();
|
||||
}
|
||||
},
|
||||
async getSwiper() {
|
||||
http.get('/api/banner/get_banner_list', {
|
||||
token: uni.getStorageSync('token') ?? '',
|
||||
show_type: 5
|
||||
}).then(response => {
|
||||
const {
|
||||
data,
|
||||
code
|
||||
} = response
|
||||
this.swiperList = code ? data : []
|
||||
})
|
||||
},
|
||||
async getInfo() {
|
||||
http.get('/api/Guild/is_guild_member', {
|
||||
token: uni.getStorageSync('token') ?? ''
|
||||
@@ -205,8 +238,8 @@
|
||||
});
|
||||
},
|
||||
copyData(text) {
|
||||
if(text) {
|
||||
|
||||
if (text) {
|
||||
|
||||
if (uni.getSystemInfoSync().platform === 'h5') {
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.value = text;
|
||||
@@ -214,7 +247,7 @@
|
||||
textarea.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(textarea);
|
||||
|
||||
|
||||
uni.showToast({
|
||||
title: '复制成功',
|
||||
icon: 'none',
|
||||
@@ -251,7 +284,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.view-page {
|
||||
// padding: 32rpx;
|
||||
// min-height: 100vh;
|
||||
@@ -260,9 +293,11 @@
|
||||
// background-image: url('@/static/image/help/bg.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
.minUnicon{
|
||||
|
||||
.minUnicon {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0 32rpx;
|
||||
}
|
||||
@@ -325,12 +360,12 @@
|
||||
.swipe-view {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
background-color: antiquewhite;
|
||||
// background-color: antiquewhite;
|
||||
border-radius: 14rpx;
|
||||
margin-top: 36rpx;
|
||||
background-image: url('/static/image/swiper.jpg');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
// background-image: url('/static/image/swiper.jpg');
|
||||
// background-repeat: no-repeat;
|
||||
// background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.title {
|
||||
@@ -383,7 +418,7 @@
|
||||
|
||||
/* 会长样式 */
|
||||
.chairman {
|
||||
width: 106rpx;
|
||||
min-width: 106rpx;
|
||||
height: 36rpx;
|
||||
padding: 0 12rpx;
|
||||
color: #fff;
|
||||
@@ -395,9 +430,12 @@
|
||||
position: relative;
|
||||
left: 10rpx;
|
||||
margin: 32rpx 0;
|
||||
.truncate-three{
|
||||
display: inline-flex;
|
||||
|
||||
.truncate-three {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.chairman-portrait {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
@@ -413,6 +451,10 @@
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.chairman-name {
|
||||
margin-left: 0.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
.id-title {
|
||||
@@ -448,6 +490,7 @@
|
||||
/* 右边按钮 */
|
||||
.right-button {
|
||||
text-align: center;
|
||||
|
||||
.apply-button {
|
||||
display: inline-block;
|
||||
background: var(--primary-color);
|
||||
@@ -481,6 +524,12 @@
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
font-size: 24rpx;
|
||||
text-align: left;
|
||||
display: inline-block;
|
||||
/* width: 6ch; */
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
word-break: keep-all;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user