This commit is contained in:
yziiy
2025-12-03 19:29:25 +08:00
parent 0b1c5b39bd
commit a0d6d62356

View File

@@ -1,7 +1,8 @@
<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}')`}">
<!-- <headerHeight /> -->
<navBar :style="{marginTop: `${statusBarHeight}${uni.getSystemInfoSync().platform === 'ios' ? 'px': 'dp'}`}" :navTitle="'群聊设置'" :emitBack="true" @backEvent="back">
<navBar :style="{marginTop: `${statusBarHeight}${uni.getSystemInfoSync().platform === 'ios' ? 'px': 'dp'}`}"
:navTitle="'群聊设置'" :emitBack="true" @backEvent="back">
</navBar>
<view class="content" v-if="detailData">
<view class="name-view flex-line">
@@ -37,17 +38,21 @@
</view>
<!-- 编辑 -->
<view class="edit-name">
<uni-easyinput v-model="guildName" :disabled="detailData.is_deacon !== 1 " primaryColor="#999" :inputBorder="false" :styles="styles" :placeholderStyle="placeholderStyle" placeholder="请输入内容"></uni-easyinput>
<uni-easyinput v-model="guildName" :disabled="detailData.is_deacon !== 1 " primaryColor="#999"
:inputBorder="false" :styles="styles" :placeholderStyle="placeholderStyle"
placeholder="请输入内容"></uni-easyinput>
</view>
<view class="edit-notice">
<view class="notice-title">
群聊公告
</view>
<view class="notice-view">
<uni-easyinput primaryColor="#999" :inputBorder="false" :disabled="detailData.is_deacon !== 1 " :styles="styles" :placeholderStyle="placeholderStyle" type="textarea" autoHeight v-model="detailData.notification" placeholder="请输入群聊公告"></uni-easyinput>
<uni-easyinput primaryColor="#999" :inputBorder="false" :disabled="detailData.is_deacon !== 1 "
:styles="styles" :placeholderStyle="placeholderStyle" type="textarea" autoHeight
v-model="detailData.notification" placeholder="请输入群聊公告"></uni-easyinput>
</view>
</view>
<view class="footer"v-if="detailData.is_deacon === 1">
<view class="footer" v-if="detailData.is_deacon === 1">
<view class="confirm-button" @click="confirmInfo">
<view class="button">
确认保存
@@ -55,6 +60,9 @@
</view>
</view>
</view>
<uni-popup ref="message" type="message">
<uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
</uni-popup>
</view>
</template>
@@ -72,41 +80,46 @@
data() {
return {
logo,
guildId:null,
notice:'',
guildId: null,
notice: '',
value: '',
guildName:'',
detailData:null,
guildName: '',
detailData: null,
styles: {
color: '#333',
borderColor: 'none'
},
statusBarHeight:0,
formType: 0,
statusBarHeight: 0,
placeholderStyle: "color:321;font-size:14px",
ThemeData:null
ThemeData: null,
msgType: "",
messageText: ""
}
},
onLoad(options) {
const {
id,
guildId,h
guildId,
h
} = options
uni.setStorageSync('token', id)
this.guildId = guildId || ''
this.formType = type
if (uni.getStorageSync('token')) {
this.getInfo()
}
this.statusBarHeight = h || uni.getStorageSync('BarHeight')
if(uni.getStorageSync('Theme_Data')) {
if (uni.getStorageSync('Theme_Data')) {
this.ThemeData = JSON.parse(uni.getStorageSync('Theme_Data'))
}
},
methods:{
methods: {
// 关闭当前公会中心页面
back() {
this.closeWeb()
},
closeWeb(){
closeWeb() {
const platform = uni.getSystemInfoSync().platform;
if (platform === 'ios') {
// 通过 messageHandlers 调用 iOS 原生方法
@@ -128,24 +141,23 @@
code
} = response
this.detailData = data || null
if(data) {
this.detailData.user_list = data.user_list.slice(0,4)
if (data) {
this.detailData.user_list = data.user_list.slice(0, 4)
}
this.guildName = data.name || null
}).catch(error => {
});
}).catch(error => {});
},
memberList(){
memberList() {
uni.navigateTo({
url: `/pages/union/memberList?guildId=${this.guildId}`
});
},
async confirmInfo(){
async confirmInfo() {
if (this.guildName === '') {
uni.showToast({
title: "请输入群聊名称",
icon: 'none'
});
this.messageText = "请输入群聊名称"
this.msgType = 'error'
this.$refs.message.open()
return
}
const parameter = {
@@ -167,26 +179,22 @@
if (code) {
setTimeout(() => {
uni.hideLoading()
uni.showToast({
title: "提交成功",
icon: 'none',
mask: true
});
this.messageText = "提交成功"
this.msgType = 'success'
this.$refs.message.open()
this.getInfo()
}, 1000)
} else {
uni.showToast({
title: "提交失败",
icon: 'none'
});
this.messageText = "提交失败"
this.msgType = 'error'
this.$refs.message.open()
uni.hideLoading()
}
}).catch(error => {
uni.showToast({
title: "提交失败",
icon: 'error'
});
this.messageText = "提交失败"
this.msgType = 'error'
this.$refs.message.open()
uni.hideLoading()
});
}
@@ -204,12 +212,18 @@
background-size: 100% 100%;
min-height: 100vh;
font-family: Source Han Sans CN, Source Han Sans CN;
.text-container {
width: 150rpx; /* 指定容器宽度 */
white-space: nowrap; /* 防止文本换行 */
overflow: hidden; /* 隐藏溢出的文本 */
text-overflow: ellipsis; /* 显示省略号 */
width: 150rpx;
/* 指定容器宽度 */
white-space: nowrap;
/* 防止文本换行 */
overflow: hidden;
/* 隐藏溢出的文本 */
text-overflow: ellipsis;
/* 显示省略号 */
}
.footer {
// background: #f0f0f0;
padding: 20rpx;
@@ -234,6 +248,7 @@
}
}
}
.image-view {
width: 100rpx;
height: 100rpx;
@@ -297,15 +312,17 @@
}
}
}
.edit-name{
.edit-name {
margin-top: 24rpx;
background: #EFF2F8;
padding: 24rpx;
border-radius: 22rpx;
}
.edit-notice{
.notice-title{
.edit-notice {
.notice-title {
padding: 24rpx 0;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
@@ -315,7 +332,8 @@
font-style: normal;
text-transform: none;
}
.notice-view{
.notice-view {
background: #EFF2F8;
padding: 24rpx;
border-radius: 22rpx;