yunshangxie/pages/index/service.vue

228 lines
6.2 KiB
Vue
Raw Normal View History

2023-12-25 17:56:30 +08:00
<template>
2024-05-14 10:20:09 +08:00
<view style="background-color: #EBF4F7;letter-spacing: 1rpx;min-height: 100vh;">
<tn-nav-bar :isBack="false" backTitle="" :bottomShadow="true" backgroundColor="#FFFFFF">
<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
<view style="padding-left: 15rpx;" @click="goBack()">
<text class="tn-icon-left" style="font-size: 40rpx;"></text>
</view>
<view class="tn-margin-top"
style=";text-shadow: 1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;">
2024-04-20 14:57:39 +08:00
2024-05-14 10:20:09 +08:00
<tn-tabs :list="[{name:'协会活动'}]" :current="topCurrent" activeColor="#000" :bold="false"
:fontSize="36"></tn-tabs>
</view>
</view>
</tn-nav-bar>
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin">
<view class="justify-content-item align-content-item" style="width: 100%;">
<view class="tn-flex tn-flex-col-center"
style="border-radius: 100rpx;padding: 10rpx 20rpx 10rpx 20rpx;width: 95%;background-color: rgba(255, 255, 255, 0.9);">
2024-05-21 18:16:48 +08:00
<text
class="tn-icon-search justify-content-item tn-padding-right-xs tn-color-gray tn-text-lg"></text>
2024-05-14 10:20:09 +08:00
<input v-model="content" class="justify-content-item" placeholder="请填写活动标题" name="input"
placeholder-style="color:#AAAAAA" style="width: 90%;"></input>
</view>
</view>
2024-04-20 14:57:39 +08:00
2024-05-14 10:20:09 +08:00
<view>
<view class="justify-content-item tn-text-center">
2024-05-21 18:16:48 +08:00
<tn-button backgroundColor="#3668fc" shape="round" padding="20rpx 20rpx" width="150rpx"
@click="onsubmit()">
2024-05-14 10:20:09 +08:00
<text class="tn-color-white"> </text>
</tn-button>
</view>
</view>
</view>
<tn-tabs :list="tabList" :isScroll="false" :current="current" name="name" @change="tabChange"
activeColor="#3668FC"></tn-tabs>
2024-06-03 18:19:31 +08:00
2024-05-14 10:20:09 +08:00
</view>
2024-06-03 18:19:31 +08:00
2024-05-14 10:20:09 +08:00
<view style="padding-bottom: 30rpx;">
2024-06-03 18:19:31 +08:00
2024-05-14 10:20:09 +08:00
<view style="padding: 30rpx 0rpx;">
<tn-grid align="left" :col="2">
<block v-for="(item,index) in actList">
<tn-grid-item style="width:50%">
<view @click="openUrl('/pages/index/event_info?id='+item.id)"
style="margin-bottom: 30rpx;background-color: #FFF;box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(12,0,5,0.1);position: relative;display: inline-block;width: 350rpx;text-align: center;border-radius: 20rpx;overflow: hidden;">
<view>
2024-05-27 17:40:54 +08:00
<image :src="apiImgUrl+item.activity_image" mode="aspectFill"
style="width: 350rpx;height: 170rpx;">
2024-05-14 10:20:09 +08:00
</image>
</view>
<view style="padding:10rpx 20rpx;font-weight: 400;">
<view class="tn-text-ellipsis " style="text-align: left;">{{ item.activity_name }}
</view>
2024-05-21 18:16:48 +08:00
<view class="tn-flex tn-flex-row-between"
style="font-size: 24rpx;color:#808080;padding: 15rpx 0rpx;">
2024-05-14 10:20:09 +08:00
<view>
2024-05-21 18:16:48 +08:00
<text v-if="item.activity_type==1">协会活动</text>
2024-05-14 10:20:09 +08:00
<text v-if="item.activity_type==2">调查问卷</text>
<text v-if="item.activity_type==3">公益捐赠</text>
<text v-if="item.activity_type==4">学习培训</text>
</view>
2024-06-03 18:19:31 +08:00
2024-05-14 10:20:09 +08:00
</view>
</view>
2024-06-03 18:19:31 +08:00
2024-05-14 10:20:09 +08:00
</view>
</tn-grid-item>
</block>
</tn-grid>
</view>
</view>
2024-05-21 18:16:48 +08:00
<view style="padding-bottom: 120rpx;">
<tn-load-more class="tn-margin-top" :status="load_status"></tn-load-more>
</view>
2024-06-03 18:19:31 +08:00
<tn-tabbar :outHeight="140" :height="120" v-model="currentIndex" :list="tabbarList" activeColor="#3377FF"
inactiveColor="#AAAAAA" activeIconColor="#3377FF" inactiveIconColor="#8A8E99" :animation="true"
:safeAreaInsetBottom="true" @change="switchTabbar"></tn-tabbar>
2024-05-14 10:20:09 +08:00
</view>
2023-12-25 17:56:30 +08:00
</template>
<script>
2024-05-14 10:20:09 +08:00
import {
activityIndex,
} from '@/util/api.js';
import store from '@/store/index.js'
2024-04-20 14:57:39 +08:00
2024-05-14 10:20:09 +08:00
export default {
data() {
//1.线下活动2.调查问卷3.公益捐赠4.学习培训
return {
2024-06-03 18:19:31 +08:00
currentIndex: -1,
// 底部tabbar菜单数据
tabbarList: [{
title: '首页',
activeIcon: '/static/01_1.png',
inactiveIcon: '/static/01.png'
},
{
title: '通讯录',
activeIcon: '/static/02_2.png',
inactiveIcon: '/static/02.png'
},
{
title: '发现',
activeIcon: '/static/03_3.png',
inactiveIcon: '/static/03.png'
},
{
title: '个人中心',
activeIcon: '/static/04_4.png',
inactiveIcon: '/static/04.png'
}
],
2024-05-14 10:20:09 +08:00
current: 0,
load_status: 'loading ',
tabList: [{
name: '全部',
id: 0
}, {
2024-05-21 18:16:48 +08:00
name: '协会活动',
2024-05-14 10:20:09 +08:00
id: 1
}, {
name: '调查问卷',
id: 2
}, {
name: '公益捐赠',
id: 3
}, {
name: '学习培训',
id: 4
}],
apiImgUrl: this.$store.state.imgUrl,
content: '',
topCurrent: 0,
actList: [],
page: 1,
}
},
2024-05-21 18:16:48 +08:00
onLoad(d) {
console.log(d);
if (typeof(d.type) != 'undefined') {
this.current = d.type;
}
2024-05-14 10:20:09 +08:00
this.getActivityIndex();
},
methods: {
2024-06-03 18:19:31 +08:00
switchTabbar(d) {
console.log(d);
uni.$emit('depId', {
index: d
})
uni.navigateBack()
},
2024-05-14 10:20:09 +08:00
onsubmit() {
this.page = 1;
this.actList = [];
this.getActivityIndex();
},
tabChange(d) {
console.log(d);
this.current = d;
this.page = 1;
this.actList = [];
this.getActivityIndex();
},
ReachBottom() {
console.log('service');
this.page = this.page + 1;
this.getActivityIndex();
//this.getIndex();
},
getNewInfo() {
this.current = 0;
this.page = 1;
this.actList = [];
this.getActivityIndex();
},
getActivityIndex() {
var type = this.tabList[this.current].id;
activityIndex({
association_id: store.state.Gid,
page: this.page,
size: 10,
activity_name: this.content,
activity_type: type
})
.then(res => {
console.log(res);
if (res.code == 1) {
this.actList.push(...res.data.ret);
} else {
this.load_status = 'nomore';
}
})
.catch(error => {
uni.showToast({
title: error,
duration: 2000
});
})
},
goBack() {
if (getCurrentPages().length > 1) {
uni.navigateBack()
} else {
uni.redirectTo({
url: '/pages/index/index'
})
2024-04-20 14:57:39 +08:00
2024-05-14 10:20:09 +08:00
}
},
openUrl(e) {
uni.navigateTo({
url: e
})
}
}
}
2023-12-25 17:56:30 +08:00
</script>
2024-04-20 14:57:39 +08:00
<style lang="scss" scoped>
2023-12-25 17:56:30 +08:00
2024-05-14 10:20:09 +08:00
</style>