Kaynağa Gözat

feat: 添加规则

huangziyang 5 gün önce
ebeveyn
işleme
c52111dd74

+ 21 - 0
pages.json

@@ -49,6 +49,13 @@
         "navigationBarTitleText": "权益阅读页面"
       }
     },
+    {
+      "path": "pages/richpage/rule",
+      "style": {
+        "navigationStyle": "custom",
+        "navigationBarTitleText": "权益阅读页面"
+      }
+    },
     {
       "path": "pages/challenge/registration",
       "style": {
@@ -202,6 +209,13 @@
         "navigationBarTitleText": "签到打卡"
       }
     },
+    {
+      "path": "pages/punch/jiangli",
+      "style": {
+        "navigationStyle": "custom",
+        "navigationBarTitleText": "签到打卡"
+      }
+    },
     {
       "path": "pages/learn/dayPractice",
       "style": {
@@ -215,6 +229,13 @@
         "navigationStyle": "custom",
         "navigationBarTitleText": "历史真题"
       }
+    },
+    {
+      "path": "pages/index/highFire",
+      "style": {
+        "navigationStyle": "custom",
+        "navigationBarTitleText": "高频考题"
+      }
     }
   ],
   "globalStyle": {

+ 23 - 0
pages/index/highFire.vue

@@ -0,0 +1,23 @@
+<script setup>
+import Container from "../../components/Container/Container.vue";
+</script>
+<template>
+  <Container
+    :scrollStyle="{
+      padding: 0,
+    }"
+    title="高频考题"
+  >
+    <img
+      class="bg"
+      src="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/06/IZu3eQHkb2JYcMtBKUbUB5BLg504HRgdoT9aminz.png"
+      alt=""
+    />
+  </Container>
+</template>
+<style scoped lang="scss">
+.bg {
+  width: 100%;
+  height: 1448rpx;
+}
+</style>

+ 24 - 2
pages/index/index.vue

@@ -52,7 +52,8 @@
           <div class="left">
             <span class="text-16" style="font-weight: bold">每日一练</span>
             <span class="text-12 text-t9"
-              >今日已有<span class="text-primary">48</span>人打卡</span
+              >今日已有<span class="text-primary">{{ total }}</span
+              >人打卡</span
             >
           </div>
           <div
@@ -96,7 +97,14 @@
             <div class="te">10年真题卷</div>
             <div class="cricle">{{ ">" }}</div>
           </div>
-          <div class="children gaopin">
+          <div
+            class="children gaopin"
+            @click="
+              router.push({
+                url: '/pages/index/highFire',
+              })
+            "
+          >
             <div>高频考点</div>
             <div class="te">经典拿分题</div>
             <div class="cricle">{{ ">" }}</div>
@@ -226,6 +234,8 @@ const goto_notice_list = (link_url) => {
   });
 };
 
+const total = ref(0);
+
 onMounted(async () => {
   const params = getRoute().params;
   if (params.scene) {
@@ -268,6 +278,18 @@ onMounted(async () => {
     showModal.value = true;
   }
 
+  request(
+    "api/question_bank/question_reception/check_in/get_check_in_total"
+  ).then((res) => {
+    total.value = res.data.total;
+  });
+
+  request(
+    "api/question_bank/question_reception/check_in/get_user_check_info"
+  ).then((res) => {
+    success.value = res.data.current_day_is_check;
+  });
+
   calculateDays();
   timer = setInterval(() => {
     calculateDays();

+ 8 - 1
pages/learn/dayPractice.vue

@@ -135,6 +135,13 @@ onMounted(() => {
   title.value = params.title;
   getList(pageParams.value);
 });
+
+const a = () => {
+  request("api/question_bank/question_reception/check_in/user_share_record", {
+    type: 1,
+  });
+  showShare.value = true;
+};
 </script>
 
 <template>
@@ -197,7 +204,7 @@ onMounted(() => {
     <template #footer>
       <view class="footer">
         <view class="button plain" @click="showReport = false">答题解析</view>
-        <view class="button" @click="showShare = true">炫耀一下</view>
+        <view class="button" @click="a">炫耀一下</view>
       </view>
     </template>
   </Container>

+ 49 - 2
pages/punch/index.vue

@@ -5,6 +5,7 @@ import Modal from "../../components/Modal/Modal.vue";
 import { ref } from "vue";
 import { request } from "../../utils/request";
 import { onShow } from "@dcloudio/uni-app";
+import { router } from "../../utils/router";
 const prizeList = ref([
   {
     id: "coupon88",
@@ -56,6 +57,10 @@ const onDone = (_, origin) => {
     content: origin.name,
   });
 };
+const nameData = ref({
+  name: '',
+  id: 0
+})
 
 const getList = async () => {
   const getlottery = await request(
@@ -74,6 +79,14 @@ const getList = async () => {
       name: item.reward_name,
     };
   });
+  const d = await request('api/question_bank/question_reception/check_in/get_user_check_info')
+  const t = ['first', 'second', 'third', 'fourth']
+  data.value = data.value.map((i, index) => ({
+    ...i,
+    status: d.data[t[index] + '_day_status'],
+  }))
+  const time = await request('api/question_bank/question_reception/check_in/get_valid_activity')
+  nameData.value = time.data
 };
 const showModal = ref({
   show: false,
@@ -82,10 +95,14 @@ const qiandao = async () => {
   const res = await request(
     "api/question_bank/question_reception/check_in/set_user_record",
     {
-      activity_id: 1,
+      activity_id: nameData.value.id,
     }
   );
   if (res.code === "error") return;
+  uni.showToast({
+    title: '打卡成功',
+    icon: 'none'
+  })
   if (day.value === data.value.length) {
     const reward = await request(
       "api/question_bank/question_reception/lottery_sign_in/get_reward"
@@ -95,6 +112,7 @@ const qiandao = async () => {
       ...reward.data,
     };
   }
+  getList()
 };
 
 onShow(getList);
@@ -111,6 +129,7 @@ onShow(getList);
       />
     </template>
     <div class="items">
+      <div style="width: 100%; margin-bottom: 32rpx; font-weight: bold;font-size: 28rpx;color: #7D3800;">{{ nameData.name }}</div>
       <div class="gifs">
         <div
           v-for="item in data"
@@ -177,6 +196,14 @@ onShow(getList);
       <div style="color: #fff">剩余 {{ lottery }} 次</div>
     </div>
   </Container>
+  <div class="fixed-right">
+    <div class="item" @click="router.push({
+      url: '/pages/richpage/rule'
+    })">规则</div>
+    <div class="item"  @click="router.push({
+      url: '/pages/punch/jiangli'
+    })">奖励</div>
+  </div>
   <Modal v-model:open="showModal.show">
     <template #custom>
       <div class="css">
@@ -198,6 +225,26 @@ onShow(getList);
   </Modal>
 </template>
 <style lang="scss" scoped>
+.fixed-right {
+  position: fixed;
+  top: 20%;
+  right: 0;
+  display: flex;
+  flex-direction: column;
+  gap: 20rpx;
+  .item {
+    width: 64rpx;
+height: 42rpx;
+background: rgba(0,0,0,0.5);
+border-radius: 500rpx 0rpx 0rpx 500rpx;
+display: flex;
+align-items: center;
+justify-content: center;
+font-weight: 500;
+font-size: 24rpx;
+color: #FFFFFF;
+  }
+}
 .b {
   background: linear-gradient(90deg, #ff8f18 0%, #fe6002 100%);
   border-radius: 200rpx 200rpx 200rpx 200rpx;
@@ -262,7 +309,7 @@ onShow(getList);
 
 
 .items {
-  background: url(https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/06/9rtXotBySN0yiKmoyT0d41QPox63L3F8Gpdvyt00.png)
+  background: url(https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/06/mWqxGK0BDpfayEeb7bRwOP0oEZVOZsTgXdIQKXp3.png)
     no-repeat;
   background-size: 100% 100%;
   width: 654rpx;

+ 92 - 0
pages/punch/jiangli.vue

@@ -0,0 +1,92 @@
+<script setup name="order">
+import Container from "@/components/Container/Container.vue";
+import { request } from "@/utils/request";
+import { ref, onMounted } from "vue";
+import utils from "@/utils/common";
+
+const orderList = ref([]);
+
+onMounted(async () => {
+  const res = await request(
+    "api/question_bank/question_reception/lottery_winning_record/list",
+    {
+      page: 1,
+      limit: 999,
+    }
+  );
+  orderList.value = res.data.data;
+});
+</script>
+
+<template>
+  <Container
+    title="订单记录"
+    bgColor="#f8f8f8"
+    :empty="!orderList.length"
+    headerColor="#fff"
+    text="暂无订单记录"
+  >
+    <view class="Container">
+      <view class="card" v-for="item in orderList" :key="item.reward_id">
+        <view class="left">
+          <view class="name">{{ item.reward_name }}</view>
+          <view>中奖时间: {{ utils.timestampToString(item.insert_time) }}</view>
+        </view>
+        <!-- <view class="right">
+          <view class="price" v-if="item.order_preferential_price > 0"
+            >¥{{ item.order_preferential_price }}</view
+          >
+          <view class="price" v-if="item.order_preferential_price < 0.01"
+            >赠送</view
+          >
+          <view class="line" v-if="item.order_original_price > 0">{{
+            item.order_original_price
+          }}</view>
+          <view class="line" v-if="item.order_preferential_price < 0.01"></view>
+        </view> -->
+      </view>
+    </view>
+  </Container>
+</template>
+
+<style scoped lang="scss">
+@import "@/uni.scss";
+.Container {
+  display: flex;
+  flex-direction: column;
+  gap: 16rpx;
+
+  .card {
+    background-color: #fff;
+    padding: 24rpx 16rpx;
+    border-radius: 16rpx;
+    display: flex;
+    justify-content: space-between;
+    border-radius: 16rpx;
+    font-family: PingFang SC, PingFang SC;
+    font-weight: 500;
+    font-size: 28rpx;
+
+    .left {
+      display: flex;
+      flex-direction: column;
+      gap: 8rpx;
+      color: #666666;
+
+      .name {
+        color: $primary;
+      }
+    }
+
+    .right {
+      .price {
+        color: $error;
+      }
+      .line {
+        color: #999;
+        text-decoration: line-through;
+      }
+    }
+  }
+}
+</style>

+ 8 - 1
pages/regulations/practice.vue

@@ -156,6 +156,13 @@ const lookReport = async (d, s) => {
   };
 };
 
+const a = () => {
+  request("api/question_bank/question_reception/check_in/user_share_record", {
+    type: 2,
+  });
+  showShare.value = true;
+};
+
 onMounted(() => {
   Time.start();
   const params = getRoute().params;
@@ -224,7 +231,7 @@ onMounted(() => {
     <template #footer>
       <view class="footer">
         <view class="button plain" @click="showReport = false">答题解析</view>
-        <view class="button" @click="showShare = true">炫耀一下</view>
+        <view class="button" @click="a">炫耀一下</view>
       </view>
     </template>
   </Container>

+ 48 - 0
pages/richpage/rule.vue

@@ -0,0 +1,48 @@
+<script setup>
+import Container from "../../components/Container/Container.vue";
+import { onShow } from "@dcloudio/uni-app";
+import { request } from "../../utils/request";
+import { getRoute } from "../../utils/router";
+import uvParse from "../../uni_modules/uv-parse/components/uv-parse/uv-parse.vue";
+import { ref } from "vue";
+
+const replaceImageDimensions = (str) =>
+  str
+    .replace(
+      /<img([^>]*?)style="([^"]*?)width:\s*[^;]+;\s*height:\s*[^;]+;([^"]*?)"([^>]*?)\/?>/g,
+      '<img$1style="$2width:100%;height:100%;$3"$4/>'
+    )
+    .replace(
+      /<img([^>]*?)width="[^"]*"([^>]*?)height="[^"]*"([^>]*?)\/?>/g,
+      '<img$1width="100%"$2height="100%"$3/>'
+    );
+const context = ref("");
+const titles = ref("规则");
+onShow(() => {
+  /**
+   * service_rights=会员服务权益,
+   * automatic_renewal_agreement=自动续费协议
+   * examination_countdown=倒计时,
+   * challenge_activities=奖学金挑战信息
+   */
+  const { title } = getRoute().params;
+  if (title) {
+    titles.value = title;
+  }
+  request(
+    "api/question_bank/question_reception/check_in/get_valid_activity"
+  ).then((res) => {
+    context.value = res.data.detail || "";
+  });
+});
+</script>
+<template>
+  <Container :title="titles">
+    <uvParse class="text" :content="replaceImageDimensions(context)"></uvParse>
+  </Container>
+</template>
+<style scoped lang="scss">
+.text {
+  line-height: 2;
+}
+</style>