修改pk自动提交增加一个参数,增加签到判断

This commit is contained in:
田岩
2025-11-21 15:15:14 +08:00
parent 3f2b007560
commit 6b8f5bf226
14 changed files with 204 additions and 185 deletions
+35 -33
View File
@@ -18,36 +18,40 @@
</view>
</template>
<view class="scroll-Y">
<view class="item" v-for="(item, index) in data_list" @click="gotoMessageList">
<view class="item" v-for="(item, index) in data_list" @click="gotoMessageList(item)">
<view class="icon">
<image class="img_100" :src="imageMap[item.noticeTyp]" mode="widthFix"></image>
</view>
<view class="right">
<view class="top">
<view class="title">
{{ item.noticeTitle }}
</view>
<view class="time">
{{ item.ctTime?.substr(0, 16) }}
{{ item.noticeName }}
</view>
</view>
<view class="bottom">
<view class="note ellipsis-text">
{{ item.noticeContent }}
<view class="time">
{{ item.msgTm?.substr(0, 16) }}
</view>
<view class="read_div" v-if="item?.isRead === '01'"></view>
<!-- <view class="note ellipsis-text">
{{ item.noticeContent }}
</view> -->
<view class="read_div" v-if="item?.isMsg === 'Y'"></view>
</view>
</view>
</view>
</view>
</z-paging>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { queryTraPersonalMessageNoticePaging, readNotice, oneTimeRead, queryMessageNoticeClass } from '@/api/messageNotification.js';
import {
queryTraPersonalMessageNoticePaging,
readNotice,
oneTimeRead,
queryMessageNoticeClass
} from '@/api/messageNotification.js';
import common from '../../common/common';
import type_01 from '@/static/images/messageNotification/type_01.png';
import type_02 from '@/static/images/messageNotification/type_02.png';
@@ -57,19 +61,19 @@
import type_06 from '@/static/images/messageNotification/type_06.png';
import type_07 from '@/static/images/messageNotification/type_07.png';
import useZpaging from '@/composables/useZpaging.js';
const pagingRef = ref(null)
const pagingRef = ref(null);
const data_list = ref([]);
// const { pagingRef, queryList, data_list, reload } = useZpaging({
// fetchFunction: noticeMessageCount
// });
const queryList = () => {
queryMessageNoticeClass().then((body) => {
pagingRef.value.completeByTotal(body, 8);
})
}
queryMessageNoticeClass().then(({ body }) => {
data_list.value = body;
pagingRef.value.completeByTotal(body, body.length);
});
};
const imageMap = {
'01': type_01,
'02': type_02,
@@ -77,13 +81,13 @@
'04': type_04,
'05': type_05,
'06': type_06,
'07': type_07,
'07': type_07
};
const gotoMessageList = (item) => {
common.navigateTo('/pages/messageNotification/list?type=' + item.noticeTyp);
};
const gotoMessageList = () => {
common.navigateTo('/pages/messageNotification/list?type=1')
}
const oneClickReadMessage = () => {
const state = data_list.value.every((res) => res.isRead === '02');
if (state) {
@@ -177,7 +181,13 @@
width: 78rpx;
height: 78rpx;
}
.time {
font-size: 23rpx;
color: #999999;
line-height: 30rpx;
text-align: right;
font-style: normal;
}
.right {
margin-left: 16rpx;
flex: 1;
@@ -195,14 +205,6 @@
text-align: left;
font-style: normal;
}
.time {
font-size: 23rpx;
color: #999999;
line-height: 30rpx;
text-align: right;
font-style: normal;
}
}
.bottom {
+19 -12
View File
@@ -29,10 +29,10 @@
</view>
</view>
</view>
<view class="note-div" v-if="typeValue !== '07'">{{ item.noticeContent }}</view>
<view class="note-div" v-if="typeValue !== '06'">{{ item.noticeContent }}</view>
<view class="badge-div" v-else>
<image src="/src/static/images/test/xz.png" mode="widthFix" class="badge-img"></image>
<view class="badge-name">恭喜你获得X徽章</view>
<image-preview v-if="item.ossAddr" :src="item.ossAddr" mode="widthFix" class="badge-img"></image-preview>
<view class="badge-name">{{ item.noticeContent }}</view>
</view>
</view>
</view>
@@ -68,23 +68,30 @@
};
const titleMap = {
'01': '课程提醒',
'02': '',
'02': '任务完成提醒',
'03': '积分获取',
'04': '',
'05': '',
'06': '',
'07': '积分上架'
'04': '任务时间提醒',
'05': '新任务提醒',
'06': '徽章获取',
'07': '积分兑换'
};
const typeValue = ref('');
const img = computed(() => imageMap[typeValue.value] ?? '');
const title = computed(() => titleMap[typeValue.value] ?? '');
const itemClick = (item) => {
if(typeValue.value === '06') {
common.navigateTo('/pages/pointsRedemption/index?id=');
if (typeValue.value === '07') {
// 积分兑换跳转
if (item.noticeBusId) {
common.navigateTo('/pages/pointsRedemption/index?id=' + item.noticeBusId);
} else {
common.msg('活动id不存在');
}
}
}
};
onLoad((e) => {
typeValue.value = e.type ?? '07';
typeValue.value = e.type;
});
</script>