diff --git a/pages/union/setGroup.vue b/pages/union/setGroup.vue index 2c04e86c..eab8b232 100644 --- a/pages/union/setGroup.vue +++ b/pages/union/setGroup.vue @@ -1,7 +1,8 @@ @@ -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,36 +212,43 @@ 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; text-align: center; /* 适配iPhoneX等刘海屏 */ padding-bottom: calc(20rpx + env(safe-area-inset-bottom)); - + .confirm-button { padding: 0 50rpx; - + .button { display: block; width: 100%; height: 84rpx; border-radius: 106rpx; line-height: 84rpx; - background: var(--primary-color); - color: var(--font-button-color); + background: var(--primary-color); + color: var(--font-button-color); text-align: center; font-family: Source Han Sans CN, Source Han Sans CN; font-weight: 400; } } } + .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;