This commit is contained in:
liuyuan
2025-05-23 17:25:51 +08:00
parent 30042fdfb9
commit d8bfb66827
10 changed files with 205 additions and 48 deletions

View File

@@ -520,7 +520,31 @@
ref="commonAdvertisement"
:list="advertisementList"
></common-advertisement>
<!-- <music-play :playList="myList"></music-play> -->
<uni-popup ref="customModal1" type="dialog">
<view class="my-modal">
<view class="my-modal__hd">考试周结束前需要完成全部评分</view>
<view class="my-modal__bd">
<text class="multi-line-text">{{ msg }}</text>
</view>
<view class="my-modal__ft">
<button @click="confirm1">知道了</button>
</view>
</view>
</uni-popup>
<uni-popup ref="customModal2" type="dialog">
<view class="my-modal">
<view class="my-modal__hd">提示</view>
<view class="my-modal__bd">
<view class="multi-line-text">
<text style=" display: inline-block;" v-for="(item, index) in sysNotices_list" :key="index">{{item.content}}</text>
</view>
</view>
<view class="my-modal__ft">
<button @click="confirm2">知道了</button>
</view>
</view>
</uni-popup>
</view>
</template>
@@ -597,6 +621,10 @@ export default {
fixed: null,
//vip活动
superList: [],
msg: '',
sysNotices_list: [],
idString: ''
};
},
onPageScroll(e) {
@@ -605,10 +633,11 @@ export default {
//第一次加载
onLoad(e) {
uni.hideTabBar();
//提示评分
this.editScoreRemind();
this.getSysNotices();
this.$nextTick(() => {
//提示评分
this.editScoreRemind();
this.getAdvertisement();
});
},
@@ -720,6 +749,52 @@ export default {
"Content-Type": "application/json",
},
})
.then(async (res) => {
if(res.code==0&&res.msg){
this.$refs.customModal1.open();
this.msg = res.msg;
}
});
},
//提醒结课
async getSysNotices() {
await $http
.request({
url: "common/sysNotice/getSysNotices",
method: "POST",
data: { },
header: {
"Content-Type": "application/json",
},
})
.then(async (res) => {
if(res.list&&res.list.length>0){
this.sysNotices_list = res.list;
this.idString = res.list.map(item => item.id).join(', ');
this.$refs.customModal2.open();
}
});
},
//知道了
confirm1(){
this.$refs.customModal1.close();
},
//知道了
confirm2(){
this.$refs.customModal2.close();
this.readSysNotice();
},
//已读记录
async readSysNotice() {
await $http
.request({
url: "common/sysNotice/readSysNotice",
method: "POST",
data: { id: this.idString},
header: {
"Content-Type": "application/json",
},
})
.then(async (res) => {
});
@@ -2133,4 +2208,43 @@ export default {
margin-right: 0;
}
}
/* 完全自由的样式控制 */
.my-modal {
width: 260px;
margin: 0 auto;
background: #fff;
border-radius: 12px;
overflow: hidden;
}
.my-modal__hd {
padding: 20rpx;
font-size: 32rpx;
font-weight: bold;
background: #f8f8f8;
}
.my-modal__bd {
padding: 30rpx;
color: #666;
line-height: 42rpx;
/* 可随意修改内容区域样式 */
font-size: 28rpx;
border-bottom: 1px solid #eee;
overflow-y: scroll;
height: 150px;
max-height: 150px;
}
.my-modal__ft button {
padding: 10rpx;
flex: 1;
font-size: 30rpx;
margin: 0;
border-radius: 0;
background: none;
color: #258feb;
}
.multi-line-text{
white-space: pre-line; /* 保留换行符并自动换行 */
}
</style>