Browse Source

充值跳转

zhaoli 3 years ago
parent
commit
a31b1d876b
2 changed files with 16 additions and 10 deletions
  1. 12 6
      src/view/pay.vue
  2. 4 4
      src/view/reader.vue

+ 12 - 6
src/view/pay.vue

@@ -406,7 +406,7 @@
   </div>
 </template>
 <script>
-import { Pay, HelpPayQrcode, Reader } from "./namespace.js";
+import { Pay, HelpPayQrcode, Reader, Person } from "./namespace.js";
 // import product from "../mock/pay.js";
 import { MessageBox } from "mint-ui";
 import {
@@ -513,8 +513,10 @@ export default {
       );
     },
     popup() {
-      const from_where = this.$route.query.from_where;
+      // const from_where = this.$route.query.from_where;
       const msg = "";
+      const bid = this.$route.query.book_id;
+      const cid = this.$route.query.chapter_id;
       if(this.$route.query.isRecharge){
         MessageBox({
           title: "支付确认",
@@ -527,16 +529,20 @@ export default {
           showConfirmButton: true //是否显示确认按钮
         }).then(action => {
           if (action === "confirm") {
-            if (from_where && from_where === 1){
+            console.log('123',bid && cid)
+            if (bid && cid){
               this.$router.replace({
                 name: Reader.name,
                 query: {
-                  bid: this.$route.query.book_id,
-                  cid: this.$route.query.chapter_id
+                  bid,
+                  cid
                 }
               });
             }else {
-              this.$router.back();
+              // this.$router.back();
+              this.$router.replace({
+                name: Person.name,
+              });
             }
           }
         })

+ 4 - 4
src/view/reader.vue

@@ -494,7 +494,7 @@ export default {
         .catch(r => {
           this.loading = false;
           const data = r.data.data;
-          const from_where = 1; // from_where判断从(阅读器or个人中心)到充值页,1代表从阅读器到充值页,不传代表从个人中心到充值页
+          // const from_where = 1; // from_where判断从(阅读器or个人中心)到充值页,1代表从阅读器到充值页,不传代表从个人中心到充值页
           switch (r.data.code) {
             case 10012:
               if (this.is_update) {
@@ -523,7 +523,7 @@ export default {
               break;
             case 10015:
               Chapter1(data).then(r => {
-                this.$router.push({ name: Pay.name, query: data, from_where });
+                this.$router.push({ name: Pay.name, query: data });
               });
               break;
             case 10016:
@@ -556,7 +556,7 @@ export default {
             case 10019:
               Book3(r.data.data)
                 .then(r => {
-                  this.$router.push({ name: Pay.name, query: data, from_where });
+                  this.$router.push({ name: Pay.name, query: data });
                 })
                 .catch(e => {
                   if (e === "close") {
@@ -571,7 +571,7 @@ export default {
             case 10021:
               this.$router.push({
                 name: Pay.name,
-                query: { ...data, code: r.data.code, from_where }
+                query: { ...data, code: r.data.code }
               });
               break;
             case 10022: