xia 4 years ago
parent
commit
0e70a3da8a

+ 3 - 3
src/manifest.json

@@ -1,8 +1,8 @@
 {
   "package": "com.beidao.kuaiying.zsy",
   "name": "追书云",
-  "versionName": "1.0.26",
-  "versionCode": "27",
+  "versionName": "1.0.30",
+  "versionCode": "31",
   "minPlatformVersion": "1040",
   "icon": "/assets/imgs/logo.png",
   "features": [
@@ -165,7 +165,7 @@
       "views/Agreement": {
         "titleBarText": "用户协议",
         "menu": false
-      },
+      }, 
       "views/Search": {
         "titleBarText": "搜索",
         "menu": false

+ 14 - 12
src/views/Continue/index.ux

@@ -4,33 +4,35 @@
 	</div>
 </template>
 <script>
-
 import router from '@system.router';
 import storage from '@system.storage';
-
 export default {
-	private: {
-
-
+	public: {
+		send_order_id: "",
+		push_id: "",
+		showtoast: false
 	},
-	onInit() {
+	async onInit() {
+		if (this.push_id) {
+			await storage.set({ key: "push_id", value: this.push_id });
+		}
 		this.getLastCharpt();
 	},
 
 	async getLastCharpt() {
 		let params = (await storage.get({ key: "lastCapter" })).data;
-		if(params){
+		if (params) {
 			router.replace({
 				uri: "/views/Reader",
 				params: JSON.parse(params)
 			})
-		 }else{
-			 router.replace({
+		} else {
+			router.replace({
 				uri: "/views/Index",
 			})
-		 }
-		
+		}
+
 	}
 
-}
+} 
 </script>

+ 1 - 1
src/views/Detail/index.ux

@@ -97,7 +97,7 @@ export default {
           bid: this.book.book_id,
         }
       })
-      return
+      return false;
     }
     let chapter_id = cid;
     router.push({

+ 45 - 16
src/views/Index/index.ux

@@ -10,7 +10,7 @@
       <tabs class="tab-content" onchange="tabbarChange" index="{{current}}">
         <tab-content>
           <home-page @change="pageSwitch" tabindex="{{current}}"></home-page>
-        
+
           <shelf-page @change="pageSwitch" tabindex="{{current}}"></shelf-page>
           <my-page @customer="openCustomer" tabindex="{{current}}"></my-page>
         </tab-content>
@@ -66,7 +66,11 @@ let getConfig;
 export default {
   public: {
     curPage: 0,
-    push_id: ''
+    push_id: '',
+    bid: '',
+    chapter_id: '',
+    send_order_id: "",
+    link_url: ''
   },
   protected: {
     current: 0,
@@ -103,19 +107,22 @@ export default {
     showShortPop: false,
     showSignPop: false,
     home_show: 0,
-    home_alert:null,
-    back_alert:0,
-    isInit:false,
+    home_alert: null,
+    back_alert: 0,
+    isInit: false,
   },
   async onInit() {
+    let isFromPush = false;
     this.$on('dispathEvt', this.changeSignPop);
     this.$watch('current', 'watchCurrent');
     if (this.push_id) {
       await storage.set({ key: "push_id", value: this.push_id });
     }
+    if (this.send_order_id) {
+      await storage.set({ key: "send_order_id", value: this.send_order_id });
+    }
     //今日已签到过不在弹框签到
-    this.getCoustom();
-    this.getUser();
+
     if (this.curPage && this.curPage > 0) {
       this.current = this.curPage
     }
@@ -123,18 +130,19 @@ export default {
     let { home_show } = await getConfig('task_center');
     this.home_show = home_show;
     let { home_alert } = await getConfig('position');
-    if(home_alert.length>0){
+    if (home_alert.length > 0) {
       this.home_alert = home_alert[0];
       this.showActivitys = true;
     }
-    let {sign_out_app_show} = await getConfig('add_desk_alert');
+    let { sign_out_app_show } = await getConfig('add_desk_alert');
     this.back_alert = sign_out_app_show;
-    
+    this.getCoustom();
+    this.getUser();
   },
-  goActicity(){
+  goActicity() {
     router.push({
       uri: '/views/Activity',
-      params:this.home_alert.params
+      params: this.home_alert.params
     })
   },
   showActivity() {
@@ -145,13 +153,18 @@ export default {
   },
   async onShow() {
     const hasInit = this.$app.getAppData('hasInit');
-    if(hasInit){
-      this.$broadcast('refreshData',{current:this.current});
+    if (hasInit) {
+      this.$broadcast('refreshData', { current: this.current });
     }
     it.getShortCut((value) => {
       this.showShortPop = !value;
+      if(value){
+        this.$app.$def.data.backClickCount = 1
+      }else{
+        this.$app.$def.data.backClickCount = 0
+      }
     })
-    this.$app.setAppData('hasInit', true);  
+    this.$app.setAppData('hasInit', true);
   },
   shortEnd(value) {
     if (value.detail.msg) {
@@ -169,6 +182,22 @@ export default {
     let user = await getUserInfo();
     this.user = user;
     this.isInit = true;
+    if (this.send_order_id && this.link_url) {
+      let params = {
+        push_id: this.push_id,
+        bid: this.bid,
+        chapter_id: this.chapter_id,
+        send_order_id: this.send_order_id,
+      }
+      setTimeout(() => {
+        router.push({
+          uri: this.link_url,
+          params: params
+        })
+      }, 800)
+
+
+    }
   },
   goTask() {
     router.push({
@@ -177,7 +206,7 @@ export default {
   },
   onBackPress() {
     // 退出逻辑
-    if (this.$app.$def.data.backClickCount === 0 && this.back_alert==1) {
+    if (this.$app.$def.data.backClickCount === 0 && this.back_alert == 1) {
       this.$app.$def.data.backClickCount++;
       this.$app.$def.createShortcut();
       return true;

+ 41 - 22
src/views/My/index.ux

@@ -4,11 +4,11 @@
       <image src="{{user.head_img}}"></image>
       <div class="uesr-info__message"><text>ID:{{user.id}}<span if="haslogin && loginPhone">(Tel:{{loginPhone}})</span></text><text class="vip-card" if={{user.is_vip}}>免费阅读卡还剩{{user.vip_days}}</text></div>
     </div>
-    <div class="operator-item__wrap" >
+    <div class="operator-item__wrap">
       <div class="operator-item" @click="pageChange('Task')" if={{!user.is_vip}}>
         <div class="item-name">
           <image src="../../assets/imgs/task.png"></image>
-          <text class="orange" >做任务,得奖励</text>
+          <text class="orange">做任务,得奖励</text>
         </div>
         <div class="info-text">
           <image class="arrow" src="../../assets/imgs/arrow-right.png"></image>
@@ -63,7 +63,7 @@
         <div class="item-name">
           <image src="../../assets/imgs/binding.png"></image>
           <text if="{{!(haslogin && loginPhone)}}"> 登录绑定</text>
-          <text else >退出登录</text>
+          <text else>退出登录</text>
         </div>
         <div class="info-text">
           <text if="{{!(haslogin && loginPhone)}}"></text>
@@ -92,27 +92,32 @@ export default {
       user: {},
       haslogin: undefined,
       loginPhone: undefined,
+      send_order_id: '',
     }
   },
   async onInit() {
     this.$watch('tabindex', 'watchPropsChange');
-     this.$on('refreshData',this.broadevt);
+    this.$on('refreshData', this.broadevt);
   },
   async getUser() {
     let user = await getUserInfo();
     var reg = /^(\d{3})\d*(\d{4})$/;
-    user.dtel = user.phone.replace(reg,'$1****$2')
+    user.dtel = user.phone.replace(reg, '$1****$2')
     this.user = user;
     let haslogin = (await storage.get({ key: "hasLogin" })).data;
-    let loginPhone= (await storage.get({ key: "loginPhone" })).data; 
+    let loginPhone = (await storage.get({ key: "loginPhone" })).data;
     this.haslogin = haslogin;
-    this.loginPhone = loginPhone.replace(reg,'$1****$2');
+    this.loginPhone = loginPhone.replace(reg, '$1****$2');
   },
-  watchPropsChange(v) {
-    if (v === 2) this.getUser();
+  async watchPropsChange(v) {
+    if (v === 2) {
+      let s = (await storage.get({ key: "send_order_id" })).data;
+      if (s) this.send_order_id = s;
+      this.getUser();
+    }
   },
-  broadevt(evt){
-    if(evt.detail.current==2){
+  broadevt(evt) {
+    if (evt.detail.current == 2) {
       this.getUser()
     }
   },
@@ -124,16 +129,30 @@ export default {
       this.loginOut();
       return false;
     }
-    router.push({
-      uri: `/views/${page}`
-    })
+    if (page == 'Pay') {
+      if (this.send_order_id || this.user.phone) {
+        router.push({
+          uri: `/views/${page}`
+        })
+      } else{
+        router.push({
+          uri: `/views/Phone`
+        })
+      }
+    } else {
+      router.push({
+        uri: `/views/${page}`
+      })
+    }
+
+
   },
   toUrl(url) {
     router.push({
       uri: url
     })
   },
-   loginOut() {
+  loginOut() {
     let self = this;
     prompt.showDialog({
       title: '提示',
@@ -149,31 +168,31 @@ export default {
         }
       ],
       success: function (data) {
-        if(data.index==1){
+        if (data.index == 1) {
           prompt.showToast({
             message: '取消操作'
           })
-        }else{
+        } else {
           prompt.showToast({
-          message: '退出成功'
+            message: '退出成功'
           })
           console.log(data)
           storage.delete({
             key: 'hasLogin',
-            success: function(data) {
+            success: function (data) {
               self.getUser();
               console.log('handling success')
             },
-            fail: function(data, code) {
+            fail: function (data, code) {
               console.log(`handling fail, code = ${code}`)
             }
           })
           storage.delete({
             key: 'loginPhone',
-            success: function(data) {
+            success: function (data) {
               console.log('handling success')
             },
-            fail: function(data, code) {
+            fail: function (data, code) {
               console.log(`handling fail, code = ${code}`)
             }
           })

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

@@ -186,6 +186,11 @@ export default {
       this.showSetting = false;
       this.showShortPop = !value;
       this.hasShort = value;
+      if(value){
+        this.$app.$def.data.backClickCount = 1
+      }else{
+        this.$app.$def.data.backClickCount = 0
+      }
     })
     let params = {
       bid: this.bid,