浏览代码

Merge branch 'ht_3.3' into debug_ht

yujinwen 1 月之前
父节点
当前提交
917a4224f9
共有 2 个文件被更改,包括 88 次插入1 次删除
  1. 9 1
      src/router/index.js
  2. 79 0
      src/views/PayBack.vue

+ 9 - 1
src/router/index.js

@@ -29,7 +29,15 @@ const routes = [
       title:'风险测评'
     },
   },
-
+  // 支付回跳页面
+  {
+    path:'/payBack',
+    component:()=>import('@/views/PayBack.vue'),
+    name:'PayBack',
+    meta:{
+      title:'订单支付'
+    },
+  },
   {
     path: "/:pathMatch(.*)",
     name: "error",

+ 79 - 0
src/views/PayBack.vue

@@ -0,0 +1,79 @@
+<script setup>
+import { ref, onMounted } from 'vue';
+
+const countdown = ref(3); // 倒计时初始值,单位:秒
+let countdownInterval = null; // 倒计时器
+
+function handleBack() {
+  countdown.value = 0
+  clearInterval(countdownInterval); // 清除倒计时器
+  wx.miniProgram.switchTab({
+    url: `/pages/index/index`,
+  });
+}
+
+function startCountdown() {
+  countdownInterval = setInterval(() => {
+    countdown.value--;
+    if (countdown.value <= 0) {
+      clearInterval(countdownInterval); // 清除倒计时器
+      handleBack(); // 返回首页
+    }
+  }, 1000);
+}
+
+onMounted(() => {
+  startCountdown(); // 启动倒计时
+});
+</script>
+
+<template>
+  <div class="evaluation-result-page">
+    <div class="success-img">
+      <img src="@/assets/imgs/evaluation-successful.png" alt="" class="img" />
+    </div>
+    <div class="success-text">
+      <p>您已完成支付,</p>
+      <p>请点击返回首页或等待页面自动返回!</p>
+    </div>
+    <t-button
+      class="btn"
+      theme="primary"
+      block
+      shape="round"
+      @click="handleBack"
+    >
+      <span class="go-back">返回首页</span>
+      <span v-if="countdown > 0">{{ countdown }}s</span>
+    </t-button>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+.evaluation-result-page {
+  .success-img {
+    width: 100%;
+    margin-top: 200px;
+    display: flex;
+    justify-content: center;
+    .img {
+      width: 640px;
+      height: 480px;
+    }
+  }
+  .success-text {
+    color: #053CC9;
+    margin-top: 50px;
+    text-align: center;
+  }
+  .btn {
+    position: fixed;
+    left: 10vw;
+    width: 80vw;
+    bottom: 300px;
+    .go-back {
+      margin-right: 10px;
+    }
+  }
+}
+</style>