|
@@ -3,7 +3,12 @@
|
|
|
:title="title"
|
|
|
:scrollY="maskStyle.height < 0"
|
|
|
@onSafeAreaChange="onSafeAreaChange"
|
|
|
+ bgColor="#f8f8f8"
|
|
|
>
|
|
|
+ <div class="vip" v-if="isVip">
|
|
|
+ <span>您已解锁本科目所有内容(科目{{ day.time }}天会员)</span>
|
|
|
+ <span>有效期至:{{ day.timeStr }}</span>
|
|
|
+ </div>
|
|
|
<uni-collapse
|
|
|
ref="collapse"
|
|
|
v-model="value"
|
|
@@ -76,9 +81,13 @@ const maskStyle = ref({
|
|
|
height: 0,
|
|
|
width: 0,
|
|
|
});
|
|
|
-
|
|
|
+const isVip = ref(0);
|
|
|
const chaptersList = ref([]);
|
|
|
const freeChaptersList = ref([]);
|
|
|
+const day = ref({
|
|
|
+ time: 0,
|
|
|
+ timeStr: "",
|
|
|
+});
|
|
|
|
|
|
// 点击学习按钮
|
|
|
const onClickButton = (item) => {
|
|
@@ -124,6 +133,20 @@ const onClickMask = () => {
|
|
|
|
|
|
onShow(async () => {
|
|
|
const id = getRoute().params.id;
|
|
|
+ request("api/question_bank/question_reception/share_subject_vip/info", {
|
|
|
+ subject_id: id,
|
|
|
+ }).then((res) => {
|
|
|
+ isVip.value = res.data.is_vip;
|
|
|
+ const { vip_end_time, vip_start_time } = res.data;
|
|
|
+ day.value = {
|
|
|
+ // 计算有多少天
|
|
|
+ time: (vip_end_time - vip_start_time) / 60 / 60 / 24,
|
|
|
+ // 格式化 'yyyy-dd-mm'
|
|
|
+ timeStr: new Date(vip_end_time * 1000)
|
|
|
+ .toLocaleDateString()
|
|
|
+ .replace(/\//g, "-"),
|
|
|
+ };
|
|
|
+ });
|
|
|
const res = await request(
|
|
|
"api/question_bank/question_reception/chapter/get_all_chapter",
|
|
|
{
|
|
@@ -141,7 +164,6 @@ onShow(async () => {
|
|
|
// 付费章节
|
|
|
chaptersList.value = payList;
|
|
|
title.value = getRoute().params.title;
|
|
|
- console.log(freeList);
|
|
|
});
|
|
|
</script>
|
|
|
|
|
@@ -155,6 +177,22 @@ onShow(async () => {
|
|
|
color: #000000;
|
|
|
}
|
|
|
|
|
|
+.vip {
|
|
|
+ width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ background: url(https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/06/CAQLLie6UhF9ti3PEzDc1EYlP27oUJpBsY5aTDDe.png);
|
|
|
+ margin-bottom: 16px;
|
|
|
+ padding: 8rpx 16rpx;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 5rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #ffffff;
|
|
|
+ background-size: 100% 100%;
|
|
|
+}
|
|
|
+
|
|
|
.content {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|