Quellcode durchsuchen

Merge branch 'master' of iqiyoo:zhuishuyun_quickapp_front

gdy96 vor 5 Jahren
Ursprung
Commit
aa48b78c8f

+ 0 - 2
src/api/fly.js

@@ -28,14 +28,12 @@ fly.interceptors.request.use(async config => {
     if (config.method === "POST") {
       config.body=qs.stringify(config.body);
     } 
-    console.log('请求开始!',config);
     return config;
   } else return config;
 });
 
 fly.interceptors.response.use(
   res => {
-    console.log('响应开始',res);
     if (!res.data.code) {
       return res.data.data;
     } else if (res.data.code === 10023) {

+ 1 - 1
src/api/utils.js

@@ -87,7 +87,7 @@ const refreshToken = () => {
 
 // 检查token的有效期
 const checkToken = t => {
-  return new Date() < t.time;
+  return new Date().valueOf() < t.time;
 };
 
 // 设置token

+ 2 - 1
src/components/sign/index.ux

@@ -40,10 +40,11 @@ export default {
 	async sign() {
 		let res = await userSign();
 		this.signData = res;
-		this.signList.forEach(item => {
+		this.signList.forEach((item,index) => {
 			if (item.day <= res.days) {
         item.iconType = 'checked';
       }
+      item.fee = res.day_list[index];
     });
    
 	},

+ 11 - 2
src/helper/interface.js

@@ -14,7 +14,15 @@ const getDeviceInfo = () => {
     }
   })
 }
-
+//获取是否创建图标
+const getShortCut = (fn) =>{
+  shortcut.hasInstalled({
+    success: (ret) => {
+      if(!ret) fn();
+    }
+  })
+  
+}
 // 判断用户是否创建图标
 const hasCreateShortCut = (isPayPage = false) => {
   shortcut.hasInstalled({
@@ -71,5 +79,6 @@ export default {
   shortcut,
   getDeviceInfo,
   hasCreateShortCut,
-  showMenu
+  showMenu,
+  getShortCut
 }

+ 11 - 3
src/views/Category/index.ux

@@ -68,7 +68,12 @@ import { pageLoad } from "../../helper";
 import storage from '@system.storage';
 
 export default {
-  props: {},
+  props: {
+    tabindex: {
+      type: Number,
+      default: 0
+    }
+  },
   data() {
     return {
       channel: [],
@@ -159,9 +164,12 @@ export default {
       console.log("e", e);
     })
   },
-  onInit() {
-    this.getCategory();
+  watchPropsChange(v) {
+    if (v === 1) this.getCategory();
   },
+  onInit() {
+    this.$watch('tabindex', 'watchPropsChange');
+  }
 }
 </script>
 

+ 8 - 3
src/views/Home/index.ux

@@ -71,7 +71,12 @@ import { getHomeList } from "../../api";
 import storage from '@system.storage';
 
 export default {
-  props: {},
+  props: {
+    tabindex: {
+      type: Number,
+      default: 0
+    }
+  },
   data() {
     return {
       typeList: [
@@ -89,8 +94,8 @@ export default {
       current: 0
     }
   },
-  onInit() {
-    this.getCityListByTabChange();
+  async onInit() {
+    await this.getCityListByTabChange();
     this.$watch('current', 'getCityListByTabChange')
   },
   typeChange(index) {

+ 10 - 3
src/views/Index/index.ux

@@ -9,10 +9,10 @@
     <div class="index-wrap">
       <tabs class="tab-content" onchange="tabbarChange" index="{{current}}">
         <tab-content>
-          <home-page @change="pageSwitch"></home-page>
-          <category-page></category-page>
+          <home-page @change="pageSwitch" tabindex="{{current}}"></home-page>
+          <category-page tabindex="{{current}}"></category-page>
           <shelf-page @change="pageSwitch" tabindex='{{current}}'></shelf-page>
-          <my-page @customer="openCustomer"></my-page>
+          <my-page @customer="openCustomer" tabindex="{{current}}"></my-page>
         </tab-content>
       </tabs>
       <div class="fixed-tabbar">
@@ -46,6 +46,7 @@
 <script>
 import clipboard from '@system.clipboard';
 import prompt from '@system.prompt';
+import it from "../../helper/interface.js";
 import { getCustomQrcode } from '../../api/index.js';
 import { downImg, getStore } from '../../api/utils.js';
 export default {
@@ -95,6 +96,12 @@ export default {
     }
     this.getCoustom();
   },
+  onShow(){
+    it.getShortCut(()=>{
+      this.showShortPop = true;
+
+    })
+  },
   onBackPress() {
     // 退出逻辑
     if (this.$app.$def.data.backClickCount === 0) {

+ 10 - 2
src/views/My/index.ux

@@ -68,19 +68,27 @@
 import router from "@system.router";
 import { getUserInfo } from "../../api/index";
 export default {
-  props: {},
+  props: {
+    tabindex: {
+      type: Number,
+      default: 0
+    }
+  },
   data() {
     return {
       user: {}
     }
   },
   onInit() {
-    this.getUser();
+    this.$watch('tabindex', 'watchPropsChange');
   },
   async getUser() {
     let user = await getUserInfo();
     this.user = user;
   },
+  watchPropsChange(v) {
+    if (v === 3) this.getUser();
+  },
   showCustomerQrcode() {
     this.$emit('customer');
   },

+ 7 - 0
src/views/Reader/index.ux

@@ -24,6 +24,7 @@
 
 <script>
 import router from "@system.router";
+import it from "../../helper/interface.js";
 import { getChapters, getIsonshelf, postUserShelfBooks, chapterOrders } from "../../api";
 
 export default {
@@ -43,6 +44,12 @@ export default {
       this.showShortPop = true;
     }
   },
+   onShow(){
+    it.getShortCut(()=>{
+      this.showShortPop = true;
+
+    })
+  },
   addShelf() {
     console.log("add shelf");
     getIsonshelf({ bid: this.bid }).then(r => {

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

@@ -88,7 +88,8 @@ export default {
     }
   },
   onInit() {
-    this.getUserShelfBooks()
+    console.log("tabindex:", this.tabindex);
+    // this.getUserShelfBooks()
     this.$watch('isDelMode', 'listenMode')
     this.$watch('tabindex', 'watchPropsChange')
   },