123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <template>
- <view class="container">
- <view class="list-box">
- <view class="list-item-box" v-for="item in list" :key="item.id" @click="onDynamicClick(item)">
- <view class="main-box">
- <view class="icon-box">
- <cover-image class="icon" :src="`https://sylwt.top/api/visitor/resources/image?name=/ydl/menber-center/notice/icon-1.jpg`"></cover-image>
- </view>
- <view class="content-box">
- <view class="title">
- {{item.title}}
- </view>
- <view class="text">
- {{item.desc}}
- </view>
- </view>
- <view class="other-box">
- <view class="date">
- {{item.date}}
- </view>
- </view>
- </view>
- <view class="line-box"></view>
- </view>
- </view>
- </view>
- </template>
- <script setup>
- import { ref } from 'vue'
- import { onLoad } from '@dcloudio/uni-app'
-
- const uToast = ref()
-
- const searchInputStyle = {
- backgroundColor: '#E5E5E5'
- }
- const searchForm = ref({
- keyword: ''
- })
- const list = ref([
- {
- "id": "1",
- "title": "参观科技博览会",
- "desc": "20名协会成员于10月15日参加了全国科技博览会,收获颇丰。此次活动增进了大家对科技前沿的认识。",
- "date": "2023-10-16"
- },
- {
- "id": "2",
- "title": "举办文化交流活动",
- "desc": "我们于10月22日成功举行了文化交流活动,各个文化团体分享了他们的传统和故事,气氛热烈。",
- "date": "2023-10-23"
- },
- {
- "id": "3",
- "title": "秋季运动会开幕",
- "desc": "10月29日上午,协会在体育场举办了秋季运动会,吸引了众多会员参与,为大家提供了锻炼身体的机会。",
- "date": "2023-10-30"
- },
- {
- "id": "4",
- "title": "爱心捐赠活动",
- "desc": "协会发起的爱心捐赠活动于11月1日正式启动,希望大家积极参与,共同为需要帮助的人贡献一份力量。",
- "date": "2023-11-01"
- },
- {
- "id": "5",
- "title": "庆祝协会成立周年",
- "desc": "我们将于12月5日庆祝协会成立五周年,届时会举办庆祝晚会,欢迎所有成员莅临共庆佳节!",
- "date": "2023-11-02"
- }
- ])
- function onDynamicClick(dynamic) {
- uni.navigateTo({
- url: `/pages/dynamic/dynamicDetail/dynamicDetail?id=${dynamic.id}&title=${dynamic.title}`
- })
- }
- </script>
- <style lang="scss" scoped>
- .container {
- height: 100vh;
- width: 100vw;
- background-color: $uni-bg-color;
- padding: 0 20rpx;
-
- .search-box {
- margin-bottom: 20rpx;
- ::v-deep(.u-search) {
- background-color: #e5e5e5;
- border-radius: 50rpx;
-
- .u-action {
- width: 18%;
- background-color: $uni-color-primary;
- border-radius: 50rpx;
- color: $uni-text-color-inverse;
- margin-right: 8rpx;
- font-size: 28rpx;
- line-height: 50rpx;
- letter-spacing: 3rpx;
- text-align: center;
- }
- }
- }
-
- .list-box {
- padding: 0 20rpx;
- .list-item-box {
- .main-box {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 30rpx 0;
-
- &:active {
- background-color: $uni-bg-color-hover;
- }
- .icon-box {
- width: 15%;
- display: flex;
- justify-content: center;
- align-items: center;
- .icon {
- width: 70rpx;
- height: 70rpx;
- }
- }
- .content-box {
- width: 67%;
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- gap: 10rpx;
- .title {
- height: calc(70% - 5rpx);
- font-size: $uni-title-font-size-2;
- font-weight: bold;
- }
- .text {
- height: calc(30% - 5rpx);
- font-size: $uni-font-size-3;
- color: $uni-text-color-grey;
- @include text-overflow();
- }
- }
- .other-box {
- width: 18%;
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- align-items: center;
- gap: 10rpx;
- .date {
- font-size: $uni-font-size-3;
- color: $uni-text-color-grey;
- }
- .tag {
- font-size: $uni-font-size-3;
- width: 42rpx;
- background-color: $uni-color-error;
- color: $uni-text-color-inverse;
- border-radius: 20rpx;
- text-align: center;
- }
- }
- }
- .line-box {
- height: 1rpx;
- width: 80%;
- background-color: #E5E5E5;
- margin: 0 auto;
- }
- }
- }
- }
-
-
- </style>
|