活动列表页面简单联调
parent
3bbf2694b9
commit
cb56e36bf3
|
@ -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'
|
||||
})
|
||||
}
|
||||
|
|
1
main.js
1
main.js
|
@ -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'
|
||||
|
|
|
@ -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: '天津电子信息职业技术学院操场东面'
|
||||
})
|
||||
// 在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("没有更多数据了");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -190,10 +208,7 @@ function toESearch() {
|
|||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.fixed-header {
|
||||
|
||||
|
||||
}
|
||||
.fixed-header {}
|
||||
|
||||
|
||||
.leftinfo {
|
||||
|
|
|
@ -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(",");
|
||||
// 使用map方法处理每个元素,给每个元素增加domainName前缀
|
||||
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue