瀏覽代碼

fix: 修复bug

huangziyang 1 天之前
父節點
當前提交
3506ac8189

+ 5 - 0
components/Container/Container.vue

@@ -73,6 +73,10 @@ const props = defineProps({
     type: Boolean,
     default: false,
   },
+  themeColor: {
+    type: String,
+    default: "#333",
+  }
 });
 
 const emit = defineEmits(["onSafeAreaChange", "onScroll"]);
@@ -191,6 +195,7 @@ defineExpose({
         @clickLeft="onBack"
         :border="border"
         :title="title"
+        :color="themeColor"
         fixed
         :backgroundColor="headerColor"
       />

+ 1 - 1
components/ShareTemplate/ShareTemplate.vue

@@ -5,7 +5,7 @@ import lPainterImage from "@/uni_modules/lime-painter/components/l-painter-image
 import lPainterText from "@/uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue";
 import { ref, onMounted } from "vue";
 import { request } from "../../utils/request";
-import { getRoute, objToUrlParams } from "../../utils/router";
+import { getRoute } from "../../utils/router";
 
 const painter = ref(null);
 const prosp = defineProps({

+ 5 - 0
components/Topic/TopicExam.vue

@@ -363,6 +363,11 @@ const handleSelect = ({ pid, checked, index, style }) => {
   data.value[pid].selectAns = data.value[pid].questions
     .filter((q) => q.checked)
     .map((q) => q.value);
+
+  data.value[pid].isRight = ansIsRight(
+    data.value[pid].selectAns,
+    data.value[pid].ansList.map((q) => q.label)
+  );
 };
 
 const handlePage = (item, index, type) => {

+ 2 - 19
components/Topic/TopicPracticeEnd.vue

@@ -4,6 +4,7 @@
     :scrollY="true"
     :scroll-into-view="`item-${nowIndex}`"
     :title="title"
+    :onBack="onBack"
     @onSafeAreaChange="onSafeAreaChange"
     v-bind="$attrs"
     v-if="!open"
@@ -228,25 +229,7 @@ const emit = defineEmits([
 
 const onBack = () =>
   new Promise((resolve) => {
-    if (!data.value.length) {
-      resolve(true);
-      return;
-    }
-    const isEndQuestion =
-      nowIndex.value === props.total - 1 &&
-      data.value[nowIndex.value].showResult;
-
-    if (isEndQuestion) {
-      submitter.value = {
-        ...submitter.value,
-        text: "查看报告",
-        context:
-          "您的答题报告已准备就绪!退出后将无法查看本次分析结果,且不保留本次答题记录,确定要放弃吗?",
-        isEndQuestion,
-      };
-    }
-    open.value = true;
-    r = resolve;
+    resolve("/pages/learn/index");
   });
 
 const onClose = () => r(true);

+ 15 - 7
pages.json

@@ -172,7 +172,15 @@
     	"style" : 
     	{
 			"navigationStyle": "custom",
-    		"navigationBarTitleText" : ""
+    		"navigationBarTitleText" : "支付成功"
+    	}
+    },
+    {
+    	"path" : "pages/success/error",
+    	"style" : 
+    	{
+			"navigationStyle": "custom",
+    		"navigationBarTitleText" : "支付失败"
     	}
     }
   ],
@@ -197,12 +205,12 @@
         "selectedIconPath": "static/icons/home_select.png",
         "text": "首页"
       },
-      {
-        "pagePath": "pages/learn/index",
-        "iconPath": "static/icons/learn.png",
-        "selectedIconPath": "static/icons/learn_select.png",
-        "text": "学习本"
-      },
+      // {
+      //   "pagePath": "pages/learn/index",
+      //   "iconPath": "static/icons/learn.png",
+      //   "selectedIconPath": "static/icons/learn_select.png",
+      //   "text": "学习本"
+      // },
       {
         "pagePath": "pages/challenge/index",
         "iconPath": "static/icons/challenge.png",

+ 2 - 2
pages/challenge/index.vue

@@ -29,7 +29,7 @@ const isPay = ref(true);
 
 const p = ref(0);
 onShow(async () => {
-  const res = request(
+  const res = await request(
     "api/question_bank/question_reception/challenge_registration_log/detail"
   );
   if (res.data) return;
@@ -71,7 +71,7 @@ const toAdd = async () => {
 .bg {
   width: 100%;
   height: 1734rpx;
-  background: url("https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/IFolqhKEbaTWdBgII6gjvqMKrf8WUbbgEpoeRH5t.png");
+  background: url("https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/06/Mta1ISg62sk0DW7GfkD2qGxwa0uQ2p4NH4gUC5op.png");
   background-size: cover;
   padding: 32rpx;
   box-sizing: border-box;

+ 1 - 1
pages/learn/index.vue

@@ -163,7 +163,7 @@ const requestFavo = () => {
   });
 };
 const toFavorite = () => {
-  router.push({
+  router.redirectTo({
     url: "/pages/learn/favorite",
     params: {
       chapter_id: currentTab.value,

+ 1 - 0
pages/real/exam.vue

@@ -178,6 +178,7 @@ onMounted(async () => {
     bgColor="url('https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/7i6ROn34tZGe8QR4gaWDP1ZzyPYjqlvPgLLFRmIe.png')"
     bottomBorder
     v-else-if="!showShare && showReport"
+    themeColor="#fff"
     bottomBgColor="#fff"
     title="练习报告"
   >

+ 3 - 2
pages/recharge/index.vue

@@ -103,6 +103,7 @@ import CustomerService from "@/components/CustomerService/CustomerService.vue";
 import { ref, onMounted, getCurrentInstance } from "vue";
 import { request } from "../../utils/request";
 import ext from "../../ext.json";
+import { router } from "../../utils/router";
 
 const instance = getCurrentInstance();
 
@@ -144,10 +145,10 @@ const onSubmit = () => {
         signType: e.data.signType, //签名算法MD5
         paySign: e.data.paySign, //签名,
         success(res) {
-          console.log(res);
+          router.redirectTo('/pages/success/paysuccess')
         },
         fail(err) {
-          console.log(err);
+          router.redirectTo('/pages/success/error')
         },
       });
     },

+ 1 - 0
pages/regulations/practice.vue

@@ -183,6 +183,7 @@ onMounted(() => {
     bgColor="url('https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/7i6ROn34tZGe8QR4gaWDP1ZzyPYjqlvPgLLFRmIe.png')"
     bottomBorder
     v-else-if="!showShare && showReport"
+    themeColor="#fff"
     bottomBgColor="#fff"
     title="练习报告"
   >

+ 67 - 0
pages/success/error.vue

@@ -0,0 +1,67 @@
+<template>
+  <Container
+    class="body-content"
+    title="支付失败"
+    bgColor="#F8F8F8"
+    :onBack="onBack"
+  >
+    <view class="info-area">
+      <image
+        class="success-icon"
+        src="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/06/3vShBotzJZS3S9dogDOAf1P8J6CvXW2EzE24tXq6.png"
+        mode="aspectFill"
+      ></image>
+    </view>
+    <view class="button-group">
+      <view type="default" class="btn" @click="back">返回首页</view>
+    </view>
+  </Container>
+</template>
+
+<script setup>
+import Container from "../../components/Container/Container.vue";
+import { router } from "../../utils/router";
+const onBack = () => new Promise((resolve) => resolve("/pages/user/index"));
+const back = () => {
+  router.switchTab("/pages/user/index");
+};
+</script>
+
+<style scoped lang="scss">
+.success-icon {
+  width: 180rpx;
+  height: 180rpx;
+  margin-bottom: 80rpx;
+  margin-top: 50rpx;
+}
+
+/* 中间说明区域 */
+.info-area {
+  flex: 2;
+  text-align: center;
+  margin: 0 20rpx;
+}
+
+.info-text {
+  font-size: 28rpx;
+  color: #666;
+}
+
+/* 底部按钮组 */
+.button-group {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.btn {
+  border-radius: 40rpx;
+  font-size: 32rpx;
+  line-height: 84rpx;
+  display: block;
+  border: 1rpx solid green;
+  text-align: center;
+  width: 94%;
+  margin: auto;
+}
+</style>

+ 1 - 1
pages/success/paysuccess.vue

@@ -27,7 +27,7 @@ const back = () => {
 };
 </script>
 
-<style scoped lang="stylus">
+<style scoped lang="scss">
 
 .success-icon {
   width: 180rpx;