Parcourir la source

back while pay success

Zhengxiaowei il y a 5 ans
Parent
commit
542c2b156f
4 fichiers modifiés avec 17 ajouts et 4 suppressions
  1. 9 1
      src/views/Index/index.ux
  2. 4 0
      src/views/Pay/index.ux
  3. 3 3
      src/views/Reader/index.ux
  4. 1 0
      src/views/Shelf/index.ux

+ 9 - 1
src/views/Index/index.ux

@@ -50,6 +50,9 @@ import it from "../../helper/interface.js";
 import { getCustomQrcode } from '../../api/index.js';
 import { downImg, getStore } from '../../api/utils.js';
 export default {
+  protected: {
+    current: 0
+  },
   private: {
     tabbar: [
       {
@@ -81,7 +84,7 @@ export default {
         index: 3
       }
     ],
-    current: 0,
+    // current: 0,
     showPopup: false,
     showSignPop: false,
     showShortPop: false,
@@ -90,6 +93,7 @@ export default {
   },
   onInit() {
     this.$on('dispathEvt', this.changeSignPop);
+    this.$watch('current', 'watchCurrent');
     //今日已签到过不在弹框签到
     this.getCoustom();
   },
@@ -104,6 +108,10 @@ export default {
     }
     this.showShortPop = !value.detail.installed;
   },
+  watchCurrent(i) {
+    console.log("watching", i);
+    this.current = i;
+  },
   onBackPress() {
     // 退出逻辑
     if (this.$app.$def.data.backClickCount === 0) {

+ 4 - 0
src/views/Pay/index.ux

@@ -66,6 +66,7 @@
 </template>
 
 <script>
+import router from '@system.router';
 import prompt from '@system.prompt';
 import { getChargeList, getUserInfo, checkWxOrder } from "../../api";
 import { configWxPay, configAliPay } from "../../helper";
@@ -125,6 +126,9 @@ export default {
     if (cur_pay_type === 1) {
       let ret = await configAliPay({ product_id: product_id, bid: this.bid, send_order_id: this.send_order_id });
       this.showToastByCode(ret.code);
+      if (ret.code === "9000") {
+        router.back();
+      }
     }
     else {
       let wx_ret = await configWxPay({ product_id: product_id, bid: this.bid, send_order_id: this.send_order_id });

+ 3 - 3
src/views/Reader/index.ux

@@ -3,14 +3,14 @@
 <template>
   <div id="reader-content">
     <div class="reader-wrap" id='list'>
-      <div type='title' class="reader-title">
+      <div class="reader-title">
         <text class="title">{{bookinfo.chapter_name}}</text>
         <!-- <text class="add-shelf" @click="addShelf">加入书架</text> -->
       </div>
-      <div type='content' class="reader-content">
+      <div class="reader-content">
         <text class="chapter-text" for='content'>{{$item}}</text>
       </div>
-      <div type='button' class="reader-operator">
+      <div class="reader-operator">
         <text class="operator prev" @click="getPrevChapter">上一章</text>
         <text class="operator catalog" @click="toCatalog">目录</text>
         <text class="operator next" @click="getNextChapter">下一章</text>

+ 1 - 0
src/views/Shelf/index.ux

@@ -106,6 +106,7 @@ export default {
       })
       this.booksize = r.length
       this.mockList = r
+      console.log(this.mockList);
     })
   },
   deleteBook(book) {