355 lines
8.6 KiB
Vue
355 lines
8.6 KiB
Vue
<template class="content">
|
||
<!-- 顶部导航栏 -->
|
||
<up-navbar leftText="" title="" :placeholder="true" :safeAreaInsetTop="true" :bgColor="bgColor">
|
||
<template class="img1BOX" #left>
|
||
<view class="leftinfo" @click="queryTime">
|
||
<span class="lefttext">时间</span>
|
||
<image
|
||
style=" margin-left: 10rpx; transform: rotate(-45deg); /* 旋转45度 */ width: 15rpx; height: 15rpx;"
|
||
:src="tu21"></image>
|
||
</view>
|
||
</template>
|
||
<template #center>
|
||
<div class="navbarcenter"><span>热门活动</span></div>
|
||
</template>
|
||
</up-navbar>
|
||
<view class="bgc"></view>
|
||
<!-- 搜索栏 -->
|
||
<view class="sousuoBox1 flex alignCenter justifyBetween">
|
||
<view class="sousuoBox flex alignCenter justifyBetween" @click="toESearch">
|
||
<view class="souBOx flex alignCenter">
|
||
<image :src="tu22" class="img3"></image>
|
||
<span class="shuruText">电音节节日活动</span>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<!-- tabs标签 -->
|
||
<view class="tabsinfo flex alignCenter justifyCenter">
|
||
<up-tabs :list="list4" lineWidth="24" lineHeight="4" @click="tabsClick" lineColor="#B3D7FF" :activeStyle="{
|
||
color: '#000000',
|
||
fontSize: '30rpx',
|
||
transform: 'scale(1.05)'
|
||
}" :inactiveStyle="{
|
||
color: '#999999',
|
||
fontSize: '28rpx',
|
||
transform: 'scale(1.05)'
|
||
}" itemStyle=" width: 185rpx; padding-bottom:18rpx;">
|
||
</up-tabs>
|
||
</view>
|
||
|
||
|
||
|
||
<!-- 列表信息 -->
|
||
<view>
|
||
<ActiInfoList v-model="actiInfoList" @scrolltolower="scrolltolower"></ActiInfoList>
|
||
</view>
|
||
<view v-if="show">
|
||
<up-datetime-picker
|
||
hasInput
|
||
:show="show"
|
||
v-model="newData"
|
||
mode="date"
|
||
@cancel="close"
|
||
@confirm="confirm"
|
||
></up-datetime-picker>
|
||
</view>
|
||
<view>
|
||
</view>
|
||
</template>
|
||
<script setup>
|
||
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/activityInfo/info";
|
||
|
||
import ActiInfoList from '../common/activityList/index.vue'
|
||
import { onShow, onLoad ,onPullDownRefresh} from '@dcloudio/uni-app'
|
||
import { getDicts } from "@/api/system/dict/data"
|
||
import { ref, reactive, getCurrentInstance, toRefs } from 'vue'
|
||
import { useStore } from 'vuex';
|
||
const timeFormat = uni.$u.timeFormat;
|
||
const { proxy } = getCurrentInstance();
|
||
const newData = ref(new Date().getTime());
|
||
const iconConfig = proxy.iconConfig;
|
||
const tu21 = iconConfig.tu21;
|
||
const tu22 = iconConfig.tu22;
|
||
const tu51 = iconConfig.tu51;
|
||
const tu52 = iconConfig.tu52;
|
||
const tu53 = iconConfig.tu53;
|
||
const show = ref(false)
|
||
const total = ref()
|
||
const imgInfo = ref("")
|
||
const search = ref("电音节节日活动")
|
||
// 创建响应式数据 ref('#001f3f')
|
||
const bgColor = ref('rgba(170, 0, 0, 0)');
|
||
const store = useStore()
|
||
const list4 = reactive([
|
||
{ name: '全部',state:9 },
|
||
{ name: '未开始',state:1 },
|
||
{ name: '进行中',state:2 },
|
||
{ name: '已结束',state:0 }
|
||
]);
|
||
const actiInfoList = ref([]);
|
||
const data = reactive({
|
||
form: {},
|
||
queryParams: {
|
||
pageNum: 1,
|
||
pageSize: 5,
|
||
launchUserId: null,
|
||
accendCondition: null,
|
||
acName: null,
|
||
acTitle: null,
|
||
acContent: null,
|
||
startTime: null,
|
||
startTime1: null,
|
||
endTime: null,
|
||
state: null,
|
||
addres: null,
|
||
longitude: null,
|
||
latitude: null,
|
||
file: null,
|
||
elroll: null,
|
||
acQrcode: null,
|
||
tab: null,
|
||
readCount: null,
|
||
transmitCount: null,
|
||
likeCount: null,
|
||
commentCount: null,
|
||
favoriteCount: null,
|
||
postTop: null,
|
||
type: null,
|
||
anonymity: null,
|
||
auditor: null,
|
||
auditStatus: null,
|
||
auditTime: null,
|
||
auditAdvice: null,
|
||
cut: null,
|
||
},
|
||
rules: {
|
||
auditStatus: [
|
||
{ required: true, message: "状态0正常1待脱敏 2待审核 3脱敏未通过 4 审核未通过 5草稿不能为空", trigger: "change" }
|
||
],
|
||
}
|
||
});
|
||
const { queryParams, form, rules } = toRefs(data);
|
||
// 表单重置
|
||
function reset() {
|
||
form.value = {
|
||
id: null,
|
||
launchUserId: null,
|
||
accendCondition: null,
|
||
acName: null,
|
||
acTitle: null,
|
||
acContent: null,
|
||
startTime: null,
|
||
startTime1: null,
|
||
endTime: null,
|
||
state: null,
|
||
addres: null,
|
||
longitude: null,
|
||
latitude: null,
|
||
file: null,
|
||
elroll: null,
|
||
acQrcode: null,
|
||
tab: null,
|
||
readCount: null,
|
||
transmitCount: null,
|
||
likeCount: null,
|
||
commentCount: null,
|
||
favoriteCount: null,
|
||
postTop: null,
|
||
type: null,
|
||
anonymity: null,
|
||
createTime: null,
|
||
auditor: null,
|
||
auditStatus: null,
|
||
auditTime: null,
|
||
auditAdvice: null,
|
||
cut: null,
|
||
delFlag: null
|
||
};
|
||
proxy.resetForm("infoRef");
|
||
}
|
||
// 下拉刷新
|
||
onPullDownRefresh((options) => {
|
||
console.log("下拉刷新,",options);
|
||
getList();
|
||
})
|
||
const queryTime = () => {
|
||
show.value = true
|
||
}
|
||
//日期选择
|
||
const confirm = (e) => {
|
||
queryParams.value.startTime1 = timeFormat(e.value, 'yyyy-mm-dd');
|
||
show.value = false
|
||
getList()
|
||
}
|
||
const close = () =>{
|
||
queryParams.value.startTime1=null
|
||
show.value = false
|
||
}
|
||
//tabs
|
||
const tabsClick =(e) =>{
|
||
if(e.state == 9){
|
||
queryParams.value.state = null;
|
||
|
||
}else{
|
||
queryParams.value.state = e.state;
|
||
}
|
||
getList();
|
||
}
|
||
/** 查询活动详情列表 */
|
||
function getList() {
|
||
queryParams.value.params = {};
|
||
queryParams.value.pageNum = 1
|
||
queryParams.value.pageSize = 5
|
||
listInfo(queryParams.value).then(response => {
|
||
uni.stopPullDownRefresh()
|
||
actiInfoList.value = response.rows;
|
||
|
||
total.value = response.total;
|
||
});
|
||
}
|
||
onLoad((options) => {
|
||
|
||
getList();
|
||
|
||
})
|
||
|
||
onShow(() => {
|
||
console.log('Page onShow')
|
||
})
|
||
|
||
// 在data中添加isLoading标志
|
||
const isLoading = ref(false);
|
||
|
||
const scrolltolower = async () => {
|
||
// 检查是否还有更多数据可以加载
|
||
if (queryParams.value.pageNum * queryParams.value.pageSize < total.value) {
|
||
// 防止在数据加载时重复触发
|
||
if (isLoading.value) return;
|
||
isLoading.value = true;
|
||
|
||
queryParams.value.pageNum += 1;
|
||
try {
|
||
const response = await listInfo(queryParams.value);
|
||
// 使用Array.prototype.push.apply将新数据追加到actiInfoList中
|
||
Array.prototype.push.apply(actiInfoList.value, response.rows);
|
||
console.log(actiInfoList.value);
|
||
} catch (error) {
|
||
console.error("加载更多数据时发生错误:", error);
|
||
} finally {
|
||
isLoading.value = false;
|
||
}
|
||
} else {
|
||
// 可以在这里处理没有更多数据的情况,例如显示提示信息
|
||
console.log("没有更多数据了");
|
||
}
|
||
};
|
||
|
||
|
||
|
||
function toESearch() {
|
||
console.log("toESearch");
|
||
proxy.$tab.navigateTo('/pages/search/activitySearch')
|
||
}
|
||
|
||
</script>
|
||
<style lang="scss">
|
||
page{
|
||
background-color: #FBFBFB;
|
||
|
||
}
|
||
|
||
|
||
.leftinfo {
|
||
display: flex;
|
||
align-items: flex-end;
|
||
}
|
||
|
||
.content {
|
||
position: relative;
|
||
|
||
.img1BOX {
|
||
padding-left: 32rpx;
|
||
display: flex;
|
||
align-content: center;
|
||
|
||
.lefttext {
|
||
font-weight: 400;
|
||
width: 58rpx;
|
||
height: 30rpx;
|
||
font-size: 30rpx;
|
||
text-align: left;
|
||
color: #000000 100%;
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
|
||
.img2BOX {
|
||
display: flex;
|
||
align-items: center;
|
||
|
||
}
|
||
|
||
.navbarcenter {
|
||
font-weight: 400;
|
||
width: 146rpx;
|
||
height: 36rpx;
|
||
font-size: 36rpx;
|
||
text-align: left;
|
||
color: #000000 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.bgc {
|
||
width: 750rpx;
|
||
height: 500rpx;
|
||
background: linear-gradient(
|
||
180deg, /* 渐变方向,从上到下 */
|
||
#C9F6F5 0%, /* 起始颜色 */
|
||
#F8F8E2 80%, /* 中间颜色 */
|
||
#FBFBFB 100% /* 结束颜色 */
|
||
);
|
||
position: fixed;
|
||
top: 0rpx;
|
||
left: 0rpx;
|
||
}
|
||
|
||
.sousuoBox1 {
|
||
margin: 10rpx 32rpx;
|
||
|
||
}
|
||
|
||
.sousuoBox {
|
||
width: 684rpx;
|
||
height: 68rpx;
|
||
border: #B3D7FF solid 2rpx;
|
||
border-radius: 30rpx 30rpx 30rpx 30rpx;
|
||
background: #ffffff80;
|
||
z-index: 1;
|
||
}
|
||
|
||
.souBOx {
|
||
width: 684rpx;
|
||
margin-left: 32rpx;
|
||
}
|
||
|
||
.sousuoBox .souBOx .shuruText {
|
||
margin-left: 20rpx;
|
||
font-weight: 400;
|
||
font-size: 28rpx;
|
||
color: #999999 !important;
|
||
}
|
||
|
||
.img3 {
|
||
width: 38rpx;
|
||
height: 38rpx;
|
||
}
|
||
|
||
.tabsinfo {
|
||
|
||
height: 80rpx;
|
||
margin: 0 32rpx;
|
||
}
|
||
</style> |