活动列表页面简单联调

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) { export function getInfo(id) {
return request({ return request({
url: '/activityInfo/info/' + id, url: '/activityInfo/info/app/' + id,
method: 'get' method: 'get'
}) })
} }

View File

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

View File

@ -40,7 +40,7 @@
</view> </view>
</view> </view>
<!-- 列表信息 --> <!-- 列表信息 -->
<view > <view>
<ActiInfoList v-model="actiInfoList" @scrolltolower="scrolltolower"></ActiInfoList> <ActiInfoList v-model="actiInfoList" @scrolltolower="scrolltolower"></ActiInfoList>
</view> </view>
@ -52,7 +52,7 @@ import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/activityI
import ActiInfoList from '../common/activityList/index.vue' import ActiInfoList from '../common/activityList/index.vue'
import { onShow, onLoad } from '@dcloudio/uni-app' import { onShow, onLoad } from '@dcloudio/uni-app'
import { getDicts } from "@/api/system/dict/data" 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'; import { useStore } from 'vuex';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const iconConfig = proxy.iconConfig; const iconConfig = proxy.iconConfig;
@ -75,92 +75,94 @@ const list4 = reactive([
]); ]);
const actiInfoList = ref([]); const actiInfoList = ref([]);
const data = reactive({ const data = reactive({
form: {}, form: {},
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 5, pageSize: 5,
launchUserId: null, launchUserId: null,
accendCondition: null, accendCondition: null,
acName: null, acName: null,
acTitle: null, acTitle: null,
acContent: null, acContent: null,
startTime: null, startTime: null,
endTime: null, endTime: null,
state: null, state: null,
addres: null, addres: null,
longitude: null, longitude: null,
latitude: null, latitude: null,
file: null, file: null,
elroll: null, elroll: null,
acQrcode: null, acQrcode: null,
tab: null, tab: null,
readCount: null, readCount: null,
transmitCount: null, transmitCount: null,
likeCount: null, likeCount: null,
commentCount: null, commentCount: null,
favoriteCount: null, favoriteCount: null,
postTop: null, postTop: null,
type: null, type: null,
anonymity: null, anonymity: null,
auditor: null, auditor: null,
auditStatus: null, auditStatus: null,
auditTime: null, auditTime: null,
auditAdvice: null, auditAdvice: null,
cut: null, cut: null,
}, },
rules: { rules: {
auditStatus: [ auditStatus: [
{ required: true, message: "状态0正常1待脱敏 2待审核 3脱敏未通过 4 审核未通过 5草稿不能为空", trigger: "change" } { required: true, message: "状态0正常1待脱敏 2待审核 3脱敏未通过 4 审核未通过 5草稿不能为空", trigger: "change" }
], ],
} }
}); });
const { queryParams, form, rules } = toRefs(data); const { queryParams, form, rules } = toRefs(data);
// //
function reset() { function reset() {
form.value = { form.value = {
id: null, id: null,
launchUserId: null, launchUserId: null,
accendCondition: null, accendCondition: null,
acName: null, acName: null,
acTitle: null, acTitle: null,
acContent: null, acContent: null,
startTime: null, startTime: null,
endTime: null, endTime: null,
state: null, state: null,
addres: null, addres: null,
longitude: null, longitude: null,
latitude: null, latitude: null,
file: null, file: null,
elroll: null, elroll: null,
acQrcode: null, acQrcode: null,
tab: null, tab: null,
readCount: null, readCount: null,
transmitCount: null, transmitCount: null,
likeCount: null, likeCount: null,
commentCount: null, commentCount: null,
favoriteCount: null, favoriteCount: null,
postTop: null, postTop: null,
type: null, type: null,
anonymity: null, anonymity: null,
createTime: null, createTime: null,
auditor: null, auditor: null,
auditStatus: null, auditStatus: null,
auditTime: null, auditTime: null,
auditAdvice: null, auditAdvice: null,
cut: null, cut: null,
delFlag: null delFlag: null
}; };
proxy.resetForm("infoRef"); proxy.resetForm("infoRef");
} }
/** 查询活动详情列表 */ /** 查询活动详情列表 */
function getList() { function getList() {
queryParams.value.params = {}; queryParams.value.params = {};
listInfo(queryParams.value).then(response => { listInfo(queryParams.value).then(response => {
console.log(response); actiInfoList.value = response.rows;
actiInfoList.value = response.rows; response.rows.forEach(item => {
total.value = response.total; actiInfoList.value.push(item)
}); })
total.value = response.total;
});
} }
onLoad((options) => { onLoad((options) => {
getList(); getList();
@ -170,15 +172,31 @@ onShow(() => {
console.log('Page onShow') console.log('Page onShow')
}) })
const scrolltolower = () => { // dataisLoading
console.log("scrolltolower"); const isLoading = ref(false);
actiInfoList.value.push({
title: '怎么评论爱德华·艾尔加这位音乐家及其他的作品,欢迎大家发表自己的看法?', const scrolltolower = async () => {
startTime: '2023-05-01 15:00', //
endTime: '2023-05-01 16:00', if (queryParams.value.pageNum * queryParams.value.pageSize < total.value) {
state: '2', //
addrs: '天津电子信息职业技术学院操场东面' 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> </script>
<style lang="scss"> <style lang="scss">
.fixed-header { .fixed-header {}
}
.leftinfo { .leftinfo {

View File

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