فهرست منبع

fix:修复体验版接口调用问题

huangziyang 1 هفته پیش
والد
کامیت
622ab6a56a

+ 1 - 1
components/Topic/TopicExam.vue

@@ -283,7 +283,7 @@ const onBeforePageChange = (index) => {
     {
       catalogue_id: getRoute().params.id,
       real_topic_id: props.real_topic_id,
-      is_correct: item.isRight,
+      is_correct: item.isRight ? 1 : 0,
       answer: item.selectAns.join(","),
     },
     "post"

+ 0 - 1
components/Topic/TopicPractice.vue

@@ -308,7 +308,6 @@ const questionSubmit = (item) => {
     item.selectAns.map((q) => q.value),
     item.ansList.map((q) => q.label)
   );
-  console.log(item);
 
   request("api/question_bank/question_reception/topic/answer_topic", {
     id: item.id,

+ 4 - 3
pages/real/history.vue

@@ -29,7 +29,7 @@
     >
 
     <view class="title-exam">考试记录</view>
-    <view class="exam-history">
+    <view class="exam-history" v-if="list.length">
       <view
         class="i"
         :class="index !== list.length - 1 && 'no-laster'"
@@ -48,10 +48,11 @@
 </template>
 
 <script setup name="history">
-import { ref, onMounted } from "vue";
+import { ref } from "vue";
 import Container from "../../components/Container/Container.vue";
 import { getRoute, router } from "../../utils/router";
 import { request } from "../../utils/request";
+import { onShow } from "@dcloudio/uni-app";
 
 const userInfo = ref({
   userpic: "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/uni@2x.png",
@@ -68,7 +69,7 @@ const onClick = () => {
     },
   });
 };
-onMounted(async () => {
+onShow(async () => {
   const res = await request(
     "api/question_bank/question_reception/real_topic/get_user_all_real_paper",
     {

+ 22 - 57
pages/recharge/index.vue

@@ -5,49 +5,17 @@
       <view class="content">
         <!-- 套餐选择 -->
         <view class="plan-list">
-          <view class="p"
-            ><view
-              class="plan-card"
-              :class="activeCurrent === 1 && 'active'"
-              @click="activeCurrent = 1"
-            >
-              <view class="plan-title">
-                {{ data[1]?.package_name }}
-                <text class="plan-tag" v-if="data[1]?.is_automatic_renewal">首月</text>
-              </view>
-              <view class="plan-price">
-                <text class="price">{{
-                  data[1]?.automatic_renewal_first_price
-                }}</text>
-                <view class="plan-origin"
-                  >¥{{ data[1]?.package_original_price }}</view
-                >
-              </view>
-            </view>
-            <view
-              class="plan-tip"
-              v-if="data[1]?.is_automatic_renewal"
-              :style="{
-                opacity: activeCurrent === 1 ? 1 : 0,
-              }"
-              >每期自动续费{{
-                data[1]?.automatic_renewal_price
-              }}元,可取消</view
-            ></view
-          >
-
           <view
             class="plan-card"
-            :class="activeCurrent === 0 && 'active'"
-            @click="activeCurrent = 0"
+            v-for="(item, index) in data"
+            :class="activeCurrent === index && 'active'"
+            @click="activeCurrent = index"
           >
-            <view class="plan-title">{{ data[0]?.package_name }}</view>
+            <view class="plan-title">{{ item?.package_name }}</view>
             <view class="plan-price">
-              <text class="price">{{
-                data[0]?.package_preferential_price
-              }}</text>
+              <text class="price">{{ item?.package_preferential_price }}</text>
               <view class="plan-origin"
-                >¥{{ data[0]?.package_original_price }}</view
+                >¥{{ item?.package_original_price }}</view
               >
             </view>
           </view>
@@ -55,15 +23,12 @@
 
         <!-- 权益展示 -->
         <div class="title">权益展示</div>
-        <view class="benefit" v-show="activeCurrent === 1">
-          <view v-for="item in data[1]?.binding_rights_info" :key="item.id">{{
-            item.authority_title
-          }}</view>
-        </view>
-        <view class="benefit" v-show="activeCurrent === 0">
-          <view v-for="item in data[0]?.binding_rights_info" :key="item.id">{{
-            item.authority_title
-          }}</view>
+        <view class="benefit">
+          <view
+            v-for="item in data[activeCurrent]?.binding_rights_info"
+            :key="item.id"
+            >{{ item.authority_title }}</view
+          >
         </view>
       </view>
       <!-- 底部按钮 -->
@@ -112,16 +77,16 @@ import ext from "../../ext.json";
 
 const instance = getCurrentInstance();
 
-const activeCurrent = ref(1);
+const activeCurrent = ref(0);
 const isSelected = ref([0]);
 const data = ref([]);
 
 const onSubmit = () => {
-  // if (!isSelected.value[0])
-  //   return uni.showToast({
-  //     icon: "none",
-  //     title: "请阅读并确认",
-  //   });
+  if (!isSelected.value[0])
+    return uni.showToast({
+      icon: "none",
+      title: "请阅读并确认",
+    });
   uni.login({
     provider: instance.proxy.$mpPlatform.substring(3),
     success: async ({ code }) => {
@@ -219,8 +184,7 @@ onMounted(async () => {
   gap: 52rpx;
   color: #666666;
   &.active {
-    color: $uni-primary;
-    border-color: $uni-primary;
+    border-color: #e7c8ac;
   }
   .plan-title {
     font-size: 28rpx;
@@ -246,6 +210,7 @@ onMounted(async () => {
     .price {
       font-size: 60rpx;
       font-weight: bold;
+      color: $error;
       ::before {
         content: "¥";
         font-size: 32rpx;
@@ -317,7 +282,7 @@ onMounted(async () => {
 
 .open-btn {
   width: 100%;
-  background: $uni-primary;
+  background: linear-gradient( 90deg, #F0DFCD 0%, #E7C8AC 100%);
   color: #fff;
   font-size: 32rpx;
   border-radius: 12rpx;
@@ -328,7 +293,7 @@ onMounted(async () => {
   border: none;
   margin-top: 0;
   &:active {
-    background: $uni-primary-disable;
+    background: linear-gradient( 90deg, #F0DFCD 0%, #E7C8AC 100%);
   }
 }
 </style>

+ 2 - 1
pages/regulations/index.vue

@@ -83,6 +83,7 @@ import { ref, getCurrentInstance, onMounted } from "vue";
 import { getRect, arrayToTree } from "../../utils";
 import { getRoute, router } from "../../utils/router";
 import { request } from "../../utils/request";
+import { onShow } from "@dcloudio/uni-app";
 const title = ref("");
 const collapse = ref(null);
 const popup = ref(null);
@@ -138,7 +139,7 @@ const onClickMask = () => {
   })
 };
 
-onMounted(async () => {
+onShow(async () => {
   const id = getRoute().params.id;
   const res = await request(
     "api/question_bank/question_reception/chapter/get_all_chapter",

+ 14 - 3
pages/regulations/practice.vue

@@ -47,7 +47,10 @@ const getList = async (params) => {
   );
   if (!i.data) {
     const r = await request(
-      "api/question_bank/question_reception/topic/set_user_new_exercise_paper"
+      "api/question_bank/question_reception/topic/set_user_new_exercise_paper",
+      {
+        chapter_id: getRoute().params.id,
+      }
     );
     user_exercise_paper_id.value = r.data;
   } else {
@@ -58,6 +61,7 @@ const getList = async (params) => {
     {
       ...params,
       id: getRoute().params.id,
+      user_exercise_paper_id: user_exercise_paper_id.value,
     }
   );
   total.value = res.data.total;
@@ -121,10 +125,17 @@ const onStar = (item) =>
     });
   });
 
-const lookReport = (d, s) => {
+const lookReport = async (d, s) => {
   data.value = d;
-  showReport.value = true;
   const totalTime = Time.end();
+  await request(
+    "api/question_bank/question_reception/topic/user_submit_exercise_paper",
+    {
+      user_exercise_paper_id: user_exercise_paper_id.value,
+      chapter_id: getRoute().params.id,
+    }
+  );
+  showReport.value = true;
   submitter.value = {
     ...s,
     totalTime,

+ 1 - 1
pages/user/share.vue

@@ -33,7 +33,7 @@ const onSaveImage = () => {
 
 onMounted(() => {
   // 生成二维码
-  request("api/question_bank/question_reception/user_share/get_invite_poster", {
+  request("api/question_bank/question_reception/user_share/get_invite_qrcode", {
     page_url: "/pages/index/index",
   }).then((res) => {
     console.log(res);