活动列表页面简单联调

main
26947 2024-06-05 19:52:43 +08:00
parent 3bbf2694b9
commit cb56e36bf3
4 changed files with 158 additions and 101 deletions

View File

@ -12,7 +12,7 @@ export function listInfo(query) {
// 查询活动详情详细
export function getInfo(id) {
return request({
url: '/activityInfo/info/' + id,
url: '/activityInfo/info/app/' + id,
method: 'get'
})
}

View File

@ -4,6 +4,7 @@ import store from './store' // store
import { install } from './plugins' // plugins
import './permission.js' // permission
import iconConfig from './utils/icon/icon.js'
// main.js
import uviewPlus from 'uview-plus'
import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'

View File

@ -40,7 +40,7 @@
</view>
</view>
<!-- 列表信息 -->
<view >
<view>
<ActiInfoList v-model="actiInfoList" @scrolltolower="scrolltolower"></ActiInfoList>
</view>
@ -52,7 +52,7 @@ import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/activityI
import ActiInfoList from '../common/activityList/index.vue'
import { onShow, onLoad } from '@dcloudio/uni-app'
import { getDicts } from "@/api/system/dict/data"
import { ref, reactive, getCurrentInstance,toRefs } from 'vue'
import { ref, reactive, getCurrentInstance, toRefs } from 'vue'
import { useStore } from 'vuex';
const { proxy } = getCurrentInstance();
const iconConfig = proxy.iconConfig;
@ -157,8 +157,10 @@ function getList() {
queryParams.value.params = {};
listInfo(queryParams.value).then(response => {
console.log(response);
actiInfoList.value = response.rows;
response.rows.forEach(item => {
actiInfoList.value.push(item)
})
total.value = response.total;
});
}
@ -170,15 +172,31 @@ onShow(() => {
console.log('Page onShow')
})
const scrolltolower = () => {
console.log("scrolltolower");
actiInfoList.value.push({
title: '怎么评论爱德华·艾尔加这位音乐家及其他的作品,欢迎大家发表自己的看法?',
startTime: '2023-05-01 15:00',
endTime: '2023-05-01 16:00',
state: '2',
addrs: '天津电子信息职业技术学院操场东面'
})
// dataisLoading
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.applyactiInfoList
Array.prototype.push.apply(actiInfoList.value, response.rows);
console.log(actiInfoList.value);
} catch (error) {
console.error("加载更多数据时发生错误:", error);
} finally {
isLoading.value = false;
}
} else {
//
console.log("没有更多数据了");
}
};
@ -190,10 +208,7 @@ function toESearch() {
</script>
<style lang="scss">
.fixed-header {
}
.fixed-header {}
.leftinfo {

View File

@ -33,12 +33,14 @@
</view>
</view>
<view class="infox">
<view class="infoavatar"><up-avatar size="60rpx" :src="QNDomain + actiInfoList.launchAvatarsurl"></up-avatar>
<view class="infoavatar">
<up-avatar size="60rpx" :src="QNDomain+actiInfoList.avatarInfo"/>
<view style="margin-left: 24rpx;">
<view class="launchName">{{ actiInfoList.nickName }}</view>
<view class="launchAddres">{{ actiInfoList.infoSchool }}</view>
</view>
<view>
<view class="launchName">{{ actiInfoList.launchName }}</view>
<view class="launchAddres">{{ actiInfoList.launchAddres }}</view>
</view>
<view class="elroll">已报名{{ actiInfoList.elroll }}</view>
</view>
<view class="infox2">
@ -49,6 +51,7 @@
</template>
<script setup>
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/activityInfo/info";
import { getDicts } from "@/api/system/dict/data"
import { onShow, onLoad } from '@dcloudio/uni-app'
import { ref, reactive, getCurrentInstance,toRefs } from 'vue'
import { useStore } from 'vuex';
@ -64,6 +67,7 @@ const style = ref({
})
const activityState = ref([])//
const open = ref(false)
const title = ref('确认签到');
const content = ref('请您确认活动签到,祝您玩的愉快!');
@ -74,12 +78,20 @@ const bgColor = ref('');
const store = useStore()
const QNDomain = store.state.user.QNDomain
const actiInfoList = ref({});
function getAvatar (){
console.log("头像:",QNDomain + actiInfoList.value.avatarInfo)
return QNDomain + actiInfoList.value.avatarInfo
}
onLoad((options) => {
const _id = options.id
getInfo(_id).then(response => {
actiInfoList.value = response.data;
console.log("actiInfoList:",actiInfoList.value);
});
getDicts('activity_state').then(e => {
activityState.value = e.data
})
})
const leftClick = () => {
proxy.$tab.navigateBack(1)
@ -101,7 +113,6 @@ const btnClick = () => {
}
const toimage = (url) => {
console.log(QNDomain);
if (typeof url === 'string') {
let info = url.split(",");
// 使mapdomainName
@ -125,7 +136,10 @@ function cancel() {
open.value = !open.value
}
const getDictLabelByValue = (state) => {
const dict = activityState.value.find((dict) => dict.dictValue === state);
return dict ? dict : '未知状态';
};
</script>
<style lang="scss">
.navbarcenter {
@ -195,6 +209,30 @@ function cancel() {
height: 80rpx;
margin: 0 auto;
.btnText {
font-weight: 400;
width: 120rpx;
font-size: 30rpx;
color: #00CCBE !important;
}
}
.state2 {
width: 686rpx;
height: 80rpx;
margin: 0 auto;
.btnText {
font-weight: 400;
width: 120rpx;
font-size: 30rpx;
color: #00CCBE !important;
}
}
.state3 {
width: 686rpx;
height: 80rpx;
margin: 0 auto;
.btnText {
font-weight: 400;
width: 120rpx;
@ -225,6 +263,9 @@ function cancel() {
background-color: white;
/* 背景色设置为白色,防止透明背景导致内容重叠可见 */
z-index: 10;
.infoavatar{
display: flex;
}
}
.infox2 {