239 lines
		
	
	
		
			4.9 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			239 lines
		
	
	
		
			4.9 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
| <template>
 | |
|   <div class="bbs">
 | |
|     <div v-if="list.length">
 | |
|       <div class="bbs-title">
 | |
|         <span>共</span>
 | |
|         <i>{{ list.length }}</i>
 | |
|         <span>条动态</span>
 | |
|       </div>
 | |
|       <div class="bbs-item" v-for="(item, index) in list" :key="index">
 | |
|         <div class="bbs-item__info">
 | |
|           <div class="bbs-item__info--top">
 | |
|             <div class="left">
 | |
|               <img :src="item.avatar" />
 | |
|               <h2>{{ item.name }}</h2>
 | |
|             </div>
 | |
|             <i>{{ item.createTime }}</i>
 | |
|           </div>
 | |
|           <div class="bbs-item__info--content">
 | |
|             <p>{{ item.content }}</p>
 | |
|             <ai-uploader v-if="item.images && item.images.length" :instance="instance" :value="item.images" :limit="9" disabled></ai-uploader>
 | |
|             <!-- <div class="text-button" @click="remove(item.id)">删除动态</div> -->
 | |
|           </div>
 | |
|         </div>
 | |
|       </div>
 | |
|     </div>
 | |
|     <ai-empty class="empty" v-else></ai-empty>
 | |
|   </div>
 | |
| </template>
 | |
| 
 | |
| <script>
 | |
|   export default {
 | |
|     name: 'Add',
 | |
| 
 | |
|     props: {
 | |
|       id: String,
 | |
|       instance: Function
 | |
|     },
 | |
| 
 | |
|     data () {
 | |
|       return {
 | |
|         list: []
 | |
|       }
 | |
|     },
 | |
| 
 | |
|     created () {
 | |
|       this.getInfo(this.id)
 | |
|     },
 | |
| 
 | |
|     methods: {
 | |
|       getInfo (id) {
 | |
|         this.instance.post(`/app/appvillageactivitypost/list?size=1000&activityId=${id}`).then(res => {
 | |
|           if (res.code === 0) {
 | |
|             this.list = res.data.records.map(v => {
 | |
|               return {
 | |
|                 ...v,
 | |
|                 images: v.images ? JSON.parse(v.images) : []
 | |
|               }
 | |
|             })
 | |
|           }
 | |
|         })
 | |
|       },
 | |
| 
 | |
|       remove(id) {
 | |
|         this.$confirm('确定删除该数据?').then(() => {
 | |
|           this.instance.post(`/app/appvillageactivitypost/delete?id=${id}`).then((res) => {
 | |
|             if (res.code == 0) {
 | |
|               this.$message.success('删除成功!')
 | |
|               this.getList()
 | |
|             }
 | |
|           })
 | |
|         })
 | |
|       }
 | |
|     }
 | |
|   }
 | |
| </script>
 | |
| 
 | |
| <style scoped lang="scss">
 | |
|   .bbs {
 | |
|     padding-top: 16px;
 | |
| 
 | |
|     :deep( .ai-detail__content ){
 | |
|       background: #F3F6F9;
 | |
|     }
 | |
| 
 | |
|     :deep( .ai-empty__bg ){
 | |
|       margin-top: 0;
 | |
|     }
 | |
| 
 | |
|     .text-button {
 | |
|       cursor: pointer;
 | |
|       color: #5088FF;
 | |
|       font-size: 14px;
 | |
| 
 | |
|       &:hover {
 | |
|         opacity: 0.8;
 | |
|       }
 | |
|     }
 | |
| 
 | |
|     .bbs-replay {
 | |
|       margin-top: 16px;
 | |
|       padding: 0 16px;
 | |
|       background: #F5F6F7;
 | |
| 
 | |
|       .bbs-replay__item {
 | |
|         padding: 16px 0;
 | |
|         border-bottom: 1px solid #DDDDDD;
 | |
| 
 | |
|         .text-button {
 | |
|           margin-left: 48px;
 | |
|         }
 | |
| 
 | |
|         & > p {
 | |
|           line-height: 19px;
 | |
|           margin: 8px 0 8px 48px;
 | |
|           font-size: 14px;
 | |
|           color: #333333;
 | |
|         }
 | |
| 
 | |
|         .bbs-replay__item--top {
 | |
|           display: flex;
 | |
|           align-items: center;
 | |
| 
 | |
|           img {
 | |
|             width: 40px;
 | |
|             height: 40px;
 | |
|             margin-right: 8px;
 | |
|             border-radius: 50%;
 | |
|           }
 | |
| 
 | |
|           .right {
 | |
|             display: flex;
 | |
|             align-items: center;
 | |
|             justify-content: space-between;
 | |
|             flex: 1;
 | |
| 
 | |
|             .right-user {
 | |
|               display: flex;
 | |
|               align-items: center;
 | |
|             }
 | |
| 
 | |
|             h2 {
 | |
|               color: #333333;
 | |
|               font-size: 14px;
 | |
|             }
 | |
| 
 | |
|             i {
 | |
|               padding: 0 4px;
 | |
|               font-style: normal;
 | |
|               font-size: 14px;
 | |
|               color: #999999;
 | |
|             }
 | |
| 
 | |
|             span {
 | |
|               color: #999999;
 | |
|               font-size: 14px;
 | |
|             }
 | |
|           }
 | |
|         }
 | |
| 
 | |
|         &:last-child {
 | |
|           border: none;
 | |
|         }
 | |
|       }
 | |
|     }
 | |
| 
 | |
|     .bbs-item__info {
 | |
|       .bbs-item__info--content {
 | |
|         padding-left: 64px;
 | |
| 
 | |
|         p {
 | |
|           font-size: 14px;
 | |
|           color: #333333;
 | |
|           margin-bottom: 10px;
 | |
|           line-height: 19px;
 | |
|         }
 | |
|       }
 | |
| 
 | |
|       .bbs-item__info--top {
 | |
|         display: flex;
 | |
|         justify-content: space-between;
 | |
|         align-items: center;
 | |
|         margin-bottom: 6px;
 | |
|         padding-left: 16px;
 | |
| 
 | |
|         .left {
 | |
|           display: flex;
 | |
|           align-items: center;
 | |
| 
 | |
|           img {
 | |
|             width: 40px;
 | |
|             height: 40px;
 | |
|             margin-right: 8px;
 | |
|             border-radius: 50%;
 | |
|           }
 | |
| 
 | |
|           h2 {
 | |
|             color: #333333;
 | |
|             font-size: 14px;
 | |
|           }
 | |
|         }
 | |
| 
 | |
|         i {
 | |
|           color: #999999;
 | |
|           font-size: 14px;
 | |
|           font-style: normal;
 | |
|         }
 | |
|       }
 | |
|     }
 | |
| 
 | |
|     .bbs-title {
 | |
|       display: flex;
 | |
|       align-items: center;
 | |
|       height: 56px;
 | |
|       line-height: 1;
 | |
|       margin: 0 0 16px;
 | |
|       padding: 0px 16px;
 | |
|       background: #FFFFFF;
 | |
|       color: #333333;
 | |
|       font-size: 16px;
 | |
|       border-radius: 4px;
 | |
|       border: 1px solid #D8E0E8;
 | |
| 
 | |
|       i {
 | |
|         padding: 0 4px;
 | |
|         color: #5088FF;
 | |
|         font-style: normal;
 | |
|       }
 | |
|     }
 | |
| 
 | |
|     .bbs-item {
 | |
|       margin-bottom: 16px;
 | |
|       padding: 16px;
 | |
|       background: #FFFFFF;
 | |
|       border-radius: 4px;
 | |
|       border: 1px solid #D8E0E8;
 | |
|     }
 | |
|   }
 | |
| </style>
 |