...
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
<view class="announce">
|
||||
<!-- 有列表 -->
|
||||
<u-skeleton rows="2" :loading="loading" avatar :rows="5" v-if="announcements.length>0">
|
||||
<view v-for="(item,index) in announcements" :key="index" class="item"
|
||||
@longpress="actions(item.announcement_id)">
|
||||
<view v-for="(item,index) in announcements" :key="index" class="item" @longpress="actions(item.announcement_id)">
|
||||
<view class="content-a"><span>置顶</span>{{ item.content }}</view>
|
||||
<view class="user">
|
||||
<u-avatar :src="item.user.portraitUrl" size="40rpx" />
|
||||
@@ -16,14 +15,13 @@
|
||||
|
||||
<!-- 没有列表 -->
|
||||
<view class="no-lists" v-else>
|
||||
<u-image class="cover" radius="4" width="400rpx" height="400rpx"
|
||||
:src="require('@/static/imgs/no-level-list.png')" :lazy-load="true" />
|
||||
<u-image class="cover" radius="4" width="400rpx" height="400rpx" :src="require('@/static/imgs/no-level-list.png')" :lazy-load="true" />
|
||||
<span>暂无公告内容~</span>
|
||||
</view>
|
||||
|
||||
<!-- 弹出 -->
|
||||
<u-action-sheet :actions="actionMap" :title="actionTitle" cancelText="取消" @close="hideAction"
|
||||
@select="handleAction" :show="actionShow" />
|
||||
<u-action-sheet :actions="actionMap" :title="actionTitle" :show="actionShow" cancelText="取消" @close="actionShow = false" @select="handleAction" />
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -38,12 +36,14 @@
|
||||
data() {
|
||||
return {
|
||||
targetId: '',
|
||||
announcements: [],
|
||||
groupAnnouncementId: '', // 选择公告 id
|
||||
announcements: [], // 公告列表
|
||||
loading: true,
|
||||
isAdmin: false,
|
||||
actionShow: false,
|
||||
actionMap: [],
|
||||
actionTitle: '请选择',
|
||||
list: [{name: '选项一'}, {name: '选项二'}],
|
||||
actionMap: [{key: 1,name: '编辑',disabled: false}, {key: 2,name: '删除',disabled: false}, {key: 3,name: '置顶',disabled: false}],
|
||||
actionTitle: '请选择操作',
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
@@ -70,15 +70,28 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取公告信息
|
||||
initData() {
|
||||
getGroupAnnouncements(this.targetId).then(res => {
|
||||
console.log(res)
|
||||
this.announcements = res
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
actions(id){
|
||||
console.log(id)
|
||||
// 选择公告 并显示操作弹窗
|
||||
actions(id) {
|
||||
this.groupAnnouncementId = id
|
||||
this.actionShow = true
|
||||
},
|
||||
// 选择了操作出发事件
|
||||
handleAction(e) {
|
||||
console.log('addadfs', e)
|
||||
UNI.showToast({
|
||||
title:e,
|
||||
icon:"none"
|
||||
})
|
||||
},
|
||||
// 删除公告
|
||||
onDelete(aId) {
|
||||
uni.showModal({
|
||||
title: '删除公告',
|
||||
@@ -152,7 +165,8 @@
|
||||
-webkit-line-clamp: 3;
|
||||
overflow: hidden;
|
||||
line-height: 1.5;
|
||||
span{
|
||||
|
||||
span {
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
border-radius: 10rpx;
|
||||
|
||||
Reference in New Issue
Block a user