Browse Source

更新企微和ip屏蔽

zqwang 2 years ago
parent
commit
38228435c1

+ 7 - 0
src/api/index.js

@@ -284,3 +284,10 @@ export const advReplaceBookInfo = (send_order_id) => {
 export const hasPendingTask = (params) => {
 export const hasPendingTask = (params) => {
   return fly.get("/user/hasPendingTask", { ...params });
   return fly.get("/user/hasPendingTask", { ...params });
 }
 }
+
+
+
+// ip 屏蔽或书籍屏蔽后的替换书籍获取
+export const advShield= (send_order_id, platform,checkout_tx) => {
+  return fly.get("sendOrder/advShield", { send_order_id: send_order_id,platform:platform,checkout_tx,checkout_tx});
+}

+ 61 - 0
src/assets/less/catalog.less

@@ -51,4 +51,65 @@
       font-size: 26px;
       font-size: 26px;
     }
     }
   }
   }
+}
+
+.mustToask {
+  position: fixed;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  background-color: rgba(0, 0, 0, 0.56);
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  z-index: 2;
+  .mustBox {
+    height: 594px;
+    width: 694px;
+    flex-direction: column;
+    border-radius: 15px;
+    text-align: center;
+    justify-content: center;
+    align-items: center;
+    image {
+      height: 100%;
+      width: 100%;
+    }
+  }
+
+}
+
+.qiweiMustBox {
+  height: 594px;
+  width: 694px;
+  border-radius: 15px;
+
+  image {
+    height: 100%;
+    width: 100%;
+  }
+
+  image {
+    height: 100%;
+    width: 100%;
+  }
+
+}
+
+.close-box {
+  // background-color: #1a1a1a;
+  position: absolute;
+  right: 1px;
+  border-radius: 15px;
+  margin-top: 80px;
+  height: 100px;
+  width: 100px;
+  justify-content: center;
+  align-items: center;
+
+  image {
+    height: 40px;
+    width: 40px;
+  }
 }
 }

+ 32 - 0
src/assets/less/reader.less

@@ -224,3 +224,35 @@
     }
     }
   }
   }
 }
 }
+
+
+.qiweiMustBox{
+  height: 594px;
+  width: 694px;
+  border-radius: 15px;
+  image {
+    height: 100%;
+    width: 100%;
+  }
+image {
+  height: 100%;
+  width: 100%;
+}
+
+}
+
+.close-box{
+// background-color: #1a1a1a;
+position:absolute;
+right: 1px;
+border-radius: 15px;
+margin-top: 80px;
+height: 100px;
+width: 100px;
+justify-content: center;
+align-items: center;
+image {
+  height: 40px;
+  width: 40px;
+}
+}

+ 19 - 1
src/helper/interface.js

@@ -183,6 +183,22 @@ const getAppName = () => {
   return appInfo.name;
   return appInfo.name;
 }
 }
 
 
+const  getDevManufacturer = async () => {
+  let data = (await device.getInfo()).data;
+  return data.manufacturer;
+  // console.log('dataaaaaaaaa',data);
+}
+
+const getHasShortcut = async () => {
+  
+  let data = (await shortcut.hasInstalled()).data;
+
+  if (data == true) {
+    return true;
+  }
+  return false;
+}
+
 export default {
 export default {
   shortcut,
   shortcut,
   getDeviceInfo,
   getDeviceInfo,
@@ -197,5 +213,7 @@ export default {
   getProvider,
   getProvider,
   mustCreateShort,
   mustCreateShort,
   loseLevelShortCut,
   loseLevelShortCut,
-  getAppName
+  getAppName,
+  getDevManufacturer,
+  getHasShortcut,
 }
 }

+ 7 - 1
src/manifest.json

@@ -140,6 +140,9 @@
       },
       },
       "views/Share": {
       "views/Share": {
         "component": "index"
         "component": "index"
+      },
+      "views/Dispatch": {
+        "component": "index"
       }
       }
     },
     },
     "widgets": {}
     "widgets": {}
@@ -308,7 +311,10 @@
           "menuBar": false
           "menuBar": false
         },
         },
         "titleBar": true
         "titleBar": true
+      },
+      "views/Dispatch": {
+        "titleBarText": ""
       }
       }
     }
     }
   }
   }
-}
+}

+ 26 - 6
src/views/Activity/index.ux

@@ -116,6 +116,7 @@
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
+  import it from '../../helper/interface.js'
 import { configWxPay, configAliPay } from '../../helper'
 import { configWxPay, configAliPay } from '../../helper'
 import {
 import {
   getAcitivity,
   getAcitivity,
@@ -173,8 +174,11 @@ export default {
     this.activity = activity
     this.activity = activity
     this.currentProduct = this.activity.products[0]
     this.currentProduct = this.activity.products[0]
   },
   },
-  wantCharge() {
-    if (!(this.send_order_id || (this.haslogin && this.loginPhone))) {
+  async wantCharge() {
+    // console.log("this.send_order_id",this.send_order_id,"this.haslogin",this.haslogin,'this,loginphone',this.loginPhone);
+     let manufacturer = (await it.getDevManufacturer()).toLowerCase();
+    if (!(this.send_order_id || (this.haslogin && this.loginPhone)) &&
+      (manufacturer == 'xiaomi' || manufacturer == 'vivo')) {
       prompt.showDialog({
       prompt.showDialog({
         title: '友情提示',
         title: '友情提示',
         message: '您还未绑定手机号,请绑定手机号后在进行相关操作',
         message: '您还未绑定手机号,请绑定手机号后在进行相关操作',
@@ -189,7 +193,9 @@ export default {
             uri: '/views/Phone'
             uri: '/views/Phone'
           })
           })
         },
         },
-        cancel: function() {}
+        cancel: function() {
+          console.log('取消绑定')
+        }
       })
       })
     } else {
     } else {
       this.showPay = true
       this.showPay = true
@@ -201,9 +207,12 @@ export default {
       this.haslogin = (await storage.get({ key: 'hasLogin' })).data
       this.haslogin = (await storage.get({ key: 'hasLogin' })).data
       let userinfo = await getUserInfo()
       let userinfo = await getUserInfo()
       if (userinfo) {
       if (userinfo) {
+        console.log('userinfo', userinfo)
         this.send_order_id = userinfo.send_order_id
         this.send_order_id = userinfo.send_order_id
       }
       }
-    } catch (e) {}
+    } catch (e) {
+      //  console.log('11111111111111',e);
+    }
   },
   },
   chooseItem(product, idx) {
   chooseItem(product, idx) {
     this.currentProduct = product
     this.currentProduct = product
@@ -274,13 +283,16 @@ export default {
     } catch (err) {
     } catch (err) {
       console.lg(err)
       console.lg(err)
     }
     }
+    // console.log('11111111111111111111111-onshow');
     if (this.need_check_order && this.pay_order_id) {
     if (this.need_check_order && this.pay_order_id) {
       this.checkOrderNew(this.pay_order_id)
       this.checkOrderNew(this.pay_order_id)
     }
     }
   },
   },
   async checkOrderNew(order) {
   async checkOrderNew(order) {
+    console.log('需要查询订单', order)
     // this.showLoading = true;
     // this.showLoading = true;
     let fb = await checkWxOrder(order)
     let fb = await checkWxOrder(order)
+    // console.log('查询结果:',fb);
     //  this.showToastByCode('9000')
     //  this.showToastByCode('9000')
     if (fb && typeof fb === 'object') {
     if (fb && typeof fb === 'object') {
       this.showToastByCode('9000')
       this.showToastByCode('9000')
@@ -297,7 +309,9 @@ export default {
         this.pay_success = true
         this.pay_success = true
         try {
         try {
           advertOrders(this.trade_no)
           advertOrders(this.trade_no)
-        } catch (e) {}
+        } catch (e) {
+          console.log(e)
+        }
         msg = '支付成功!'
         msg = '支付成功!'
         break
         break
       case '8000':
       case '8000':
@@ -341,10 +355,13 @@ export default {
       success: data => {
       success: data => {
         if (data.index === 0) this.checkOrder(order)
         if (data.index === 0) this.checkOrder(order)
       },
       },
-      cancel: () => {}
+      cancel: () => {
+        console.log('cancel')
+      }
     })
     })
   },
   },
   onBackPress() {
   onBackPress() {
+    // console.log(this.pay_success,this.pay_success);
     if (!this.pay_success) {
     if (!this.pay_success) {
       let taht = this
       let taht = this
       if (this.isPendingTask) {
       if (this.isPendingTask) {
@@ -388,6 +405,7 @@ export default {
     try {
     try {
       let page = router.getState()
       let page = router.getState()
       let allPage = router.getPages()
       let allPage = router.getPages()
+      // console.log('page = ',page,'all pages',allPage,'length',allPage.length);
       for (var k = allPage.length - 1; k >= 0; k--) {
       for (var k = allPage.length - 1; k >= 0; k--) {
         if (
         if (
           allPage[k].name != page.name &&
           allPage[k].name != page.name &&
@@ -400,7 +418,9 @@ export default {
       }
       }
     } catch (e) {
     } catch (e) {
       backPage = {}
       backPage = {}
+      // console.log('back err',e);
     }
     }
+    // console.log(backPage,backPage.length,typeof backPage);
     if (JSON.stringify(backPage) === '{}') {
     if (JSON.stringify(backPage) === '{}') {
       router.replace({ uri: '/views/Index' })
       router.replace({ uri: '/views/Index' })
     } else {
     } else {

+ 60 - 6
src/views/Catalog/index.ux

@@ -1,4 +1,6 @@
 <template>
 <template>
+  <div>
+     <stack class="shelf">
   <list
   <list
     id="catalog"
     id="catalog"
     class="catalog-wrap"
     class="catalog-wrap"
@@ -17,7 +19,7 @@
           >{{ $item.chapter_name }}</text
           >{{ $item.chapter_name }}</text
         >
         >
         <image
         <image
-          show="{{$item.chapter_is_vip}}"
+          show="{{$item.chapter_is_vip}}" 
           src="../../assets/imgs/book-vip.png"
           src="../../assets/imgs/book-vip.png"
         ></image>
         ></image>
       </list-item>
       </list-item>
@@ -30,10 +32,20 @@
       <text>已经到底了</text>
       <text>已经到底了</text>
     </list-item>
     </list-item>
   </list>
   </list>
+  </stack>
+   <div class="mustToask" show="{{showWorkWechatTost}}">
+      <div class="qiweiMustBox">
+        <image src="../../assets/imgs/add_work_wechat.png"  @click="goToWorkWeachat" ></image>
+        <!-- <div class="add-area" @click="goToWorkWeachat" :style="{{workWeachatHight}}"></div> -->
+        <div class="close-box" @click="closeWorkWeachat" show="{{force_add_work_wechat_type === 1}}"> 
+          <image src="../../assets/imgs/close.png"></image>
+        </div>
+       
+  </div>
 </template>
 </template>
 
 
 <script>
 <script>
-import { getCatalog } from '../../api'
+import { getCatalog, getWorkWechatInfo } from '../../api'
 import router from '@system.router'
 import router from '@system.router'
 import prompt from '@system.prompt'
 import prompt from '@system.prompt'
 import storage from '@system.storage'
 import storage from '@system.storage'
@@ -46,6 +58,7 @@ export default {
     chapter_id: '',
     chapter_id: '',
     chapter_sequence: '',
     chapter_sequence: '',
     fromReader: false
     fromReader: false
+
   },
   },
   private: {
   private: {
     list: [],
     list: [],
@@ -54,11 +67,21 @@ export default {
     startpage: 1,
     startpage: 1,
     loading: false,
     loading: false,
     end: false,
     end: false,
-    send_order_id: false
+    send_order_id: false,
+    hasClickWorkWechat: false, // 是否跳转过企微
+    showWorkWechatTost: false,
+    select_info:{}
   },
   },
   async onInit() {
   async onInit() {
     let send_order_id = (await storage.get({ key: 'send_order_id' })).data
     let send_order_id = (await storage.get({ key: 'send_order_id' })).data
     if (send_order_id) this.send_order_id = send_order_id
     if (send_order_id) this.send_order_id = send_order_id
+
+    let clilck_work_wechat = (await storage.get({ key: "has_click_work_wechat_"  + this.bid })).data;
+    if (clilck_work_wechat) {
+      this.hasClickWorkWechat = true;
+    }
+  
+
     // let page = 1
     // let page = 1
     // var chapter_sequence_index = 0
     // var chapter_sequence_index = 0
     // if (this.chapter_sequence) {
     // if (this.chapter_sequence) {
@@ -109,7 +132,13 @@ export default {
       })
       })
       return
       return
     }
     }
-    if (!this.send_order_id && info.next_chapter_status == 2) {
+    if(info.force_add_work_wechat_type >  0 && !this.hasClickWorkWechat){
+        this.select_info = info;
+        this.showWorkWechatTost = true;
+        return false;
+    }
+  
+    if (!this.send_order_id && info.next_chapter_status == 2 && info.next_price > 0) {
       prompt.showDialog({
       prompt.showDialog({
         title: '温馨提示',
         title: '温馨提示',
         message: `阅读本章将消耗${info.next_price}书币哟~`,
         message: `阅读本章将消耗${info.next_price}书币哟~`,
@@ -124,7 +153,7 @@ export default {
           }
           }
         ],
         ],
         success: function (data) {
         success: function (data) {
-          if (data.index == 0) {
+          if (data.index === 0) {
             router.replace({
             router.replace({
               uri: '/views/Reader',
               uri: '/views/Reader',
               params: {
               params: {
@@ -207,7 +236,32 @@ export default {
       router.back()
       router.back()
     }
     }
     return true
     return true
-  }
+  }, async  goToWorkWeachat() {
+   
+    let $this = this;
+    await storage.set({ key: "has_click_work_wechat_"  + this.bid, value: 1 });
+    this.showWorkWechatTost = false;
+    this.hasClickWorkWechat = true;
+    if (this.select_info.force_add_work_wechat_url) {
+      router.push({
+        uri: this.select_info.force_add_work_wechat_url
+      })
+     
+      let $this = this;
+        setTimeout(() => {
+          $this.jumpReader($this.select_info);
+        }, 3000)
+    }else{
+      this.jumpReader(this.select_info);
+    }
+   
+  }, async closeWorkWeachat() {
+    await storage.set({ key: "has_click_work_wechat_"  + this.bid, value: 2 });
+    this.showWorkWechatTost = false;
+    this.hasClickWorkWechat = true;
+      this.jumpReader(this.select_info);
+    }
+
 }
 }
 </script>
 </script>
 
 

+ 36 - 9
src/views/Pay/index.ux

@@ -104,6 +104,7 @@
 import router from '@system.router'
 import router from '@system.router'
 import prompt from '@system.prompt'
 import prompt from '@system.prompt'
 import storage from '@system.storage'
 import storage from '@system.storage'
+import it from '../../helper/interface.js'
 
 
 import {
 import {
   getChargeList,
   getChargeList,
@@ -120,7 +121,7 @@ let getConfig
 export default {
 export default {
   public: {
   public: {
     push_id: '',
     push_id: '',
-    isPendingTask:false
+    isPendingTask: true
   },
   },
   protected: {
   protected: {
     bid: '',
     bid: '',
@@ -212,7 +213,7 @@ export default {
     this.pay_back = pay_back_alert_show
     this.pay_back = pay_back_alert_show
     this.initChargeList()
     this.initChargeList()
   },
   },
-  toPay() {
+  oldtoPay() {
     if (!(this.send_order_id || (this.haslogin && this.loginPhone))) {
     if (!(this.send_order_id || (this.haslogin && this.loginPhone))) {
       prompt.showDialog({
       prompt.showDialog({
         title: '友情提示',
         title: '友情提示',
@@ -238,6 +239,36 @@ export default {
       }, 1000)
       }, 1000)
     }
     }
   },
   },
+  async toPay() {
+    let manufacturer = (await it.getDevManufacturer()).toLowerCase()
+    if (
+      !(this.send_order_id || (this.haslogin && this.loginPhone)) &&
+      (manufacturer == 'xiaomi' || manufacturer == 'vivo')
+    ) {
+      prompt.showDialog({
+        title: '友情提示',
+        message: '您还未绑定手机号,请绑定手机号后在进行相关操作',
+        buttons: [
+          {
+            text: '前往绑定',
+            color: '#33dd44'
+          }
+        ],
+        success: function(data) {
+          router.push({
+            uri: '/views/Phone'
+          })
+        },
+        cancel: function() {
+          console.log('取消绑定')
+        }
+      })
+    } else {
+      this.throttle(() => {
+        this.payFunc()
+      }, 1000)
+    }
+  },
   async payFunc() {
   async payFunc() {
     let cur_pay_type = this.curPayType
     let cur_pay_type = this.curPayType
     let product_id = this.rechargeList[this.curSelect].product_id
     let product_id = this.rechargeList[this.curSelect].product_id
@@ -390,11 +421,8 @@ export default {
     return true
     return true
   },
   },
   async getActivity() {
   async getActivity() {
-    // let back = await getBannerData(5);
-    // console.log(back,JSON.stringify(back) === "{}",JSON.stringify(back));
-    let back = []
-    if (JSON.stringify(back) === '{}' || JSON.stringify(back) === '[]') {
-      console.log('000000000000000000000')
+    let back = await getBannerData(5)
+    if (JSON.stringify(back) === '{}') {
       let taht = this
       let taht = this
       if (this.isPendingTask) {
       if (this.isPendingTask) {
         prompt.showDialog({
         prompt.showDialog({
@@ -432,7 +460,6 @@ export default {
         params: back.param
         params: back.param
       })
       })
     }
     }
-    return true
   },
   },
   getLastpage() {
   getLastpage() {
     let backPage = {}
     let backPage = {}
@@ -502,4 +529,4 @@ export default {
 
 
 <style lang="less">
 <style lang="less">
 @import '../../assets/less/pay.less';
 @import '../../assets/less/pay.less';
-</style>
+</style>

+ 157 - 144
src/views/Reader/index.ux

@@ -1,6 +1,6 @@
 <import name="short-page" src="../../components/short/index.ux"></import>
 <import name="short-page" src="../../components/short/index.ux"></import>
  <import name="wechat-page" src="../../components/wechat/index.ux"></import> 
  <import name="wechat-page" src="../../components/wechat/index.ux"></import> 
-<import name="recom-page" src="../../components/book/read_recom.ux"></import>
+  <import name="recom-page" src="../../components/book/read_recom.ux"></import>
 <template>
 <template>
   <div id="reader-content">
   <div id="reader-content">
     <stack>   
     <stack>   
@@ -14,7 +14,7 @@
          <div class="reader-title">
          <div class="reader-title">
           <text class="title" style="color:{{isNight=='night'?'#666':'#333'}}">{{bookinfo.chapter_name}}</text>
           <text class="title" style="color:{{isNight=='night'?'#666':'#333'}}">{{bookinfo.chapter_name}}</text>
           <!-- <text class="add-shelf" @click="addShelf">加入书架1</text> -->
           <!-- <text class="add-shelf" @click="addShelf">加入书架1</text> -->
-        </div>
+        </div> 
         
         
         <div class="reader-content">
         <div class="reader-content">
           <div class="readContent" @click="showMore"><text class="chapter-text" for='content' style="color:{{currentColor.fontColor}};font-size:{{`${readFontSize}px`}}">{{$item}}</text></div>
           <div class="readContent" @click="showMore"><text class="chapter-text" for='content' style="color:{{currentColor.fontColor}};font-size:{{`${readFontSize}px`}}">{{$item}}</text></div>
@@ -65,24 +65,31 @@
                  <text class="operator catalog" @click="toCatalog">目录</text>
                  <text class="operator catalog" @click="toCatalog">目录</text>
           </div>
           </div>
     </div>
     </div>
-    <!--  -->
     <div class="mustToask" show="{{showMustTost}}">
     <div class="mustToask" show="{{showMustTost}}">
       <div class="mustBox">
       <div class="mustBox">
         <image src="../../assets/imgs/addImg.png" @click="addDestop"></image>
         <image src="../../assets/imgs/addImg.png" @click="addDestop"></image>
       </div>
       </div>
     </div>
     </div>
+    <div class="mustToask" show="{{showWorkWechatTost}}">
+      <div class="qiweiMustBox">
+        <image src="../../assets/imgs/add_work_wechat.png"  @click="goToWorkWeachat" ></image>
+        <!-- <div class="add-area" @click="goToWorkWeachat" :style="{{workWeachatHight}}"></div> -->
+        <div class="close-box" @click="closeWorkWeachat" show="{{force_add_work_wechat_type === 1}}"> 
+          <image src="../../assets/imgs/close.png"></image>
+        </div>
+       
+    </div>
   </div>
   </div>
 
 
 </template>
 </template>
 
 
-
 <script>
 <script>
 import prompt from '@system.prompt';
 import prompt from '@system.prompt';
 import router from "@system.router";
 import router from "@system.router";
 import storage from '@system.storage';
 import storage from '@system.storage';
 import pkg from '@system.package'
 import pkg from '@system.package'
 import it from "../../helper/interface.js";
 import it from "../../helper/interface.js";
-import { getChapters, getIsonshelf, postUserShelfBooks, chapterOrders, userAddDsktop,noAdvBookInfo, recommendBooks,advReplaceBookInfo} from "../../api";
+import { getChapters, getIsonshelf, postUserShelfBooks, chapterOrders, userAddDsktop, noAdvBookInfo, recommendBooks, advReplaceBookInfo } from "../../api";
 import { getAppConfig } from '../../api/utils.js';
 import { getAppConfig } from '../../api/utils.js';
 let getConfig;
 let getConfig;
 export default {
 export default {
@@ -91,9 +98,9 @@ export default {
   //   chapter_id: ''
   //   chapter_id: ''
   // },
   // },
   public: {
   public: {
+    workWeachatHight: "",
     bid: '',
     bid: '',
-    tx_bid:"",
-    ad_bid:"",
+    tx_bid: "",
     chapter_id: '',
     chapter_id: '',
     send_order_id: "",
     send_order_id: "",
     push_id: "",
     push_id: "",
@@ -104,22 +111,25 @@ export default {
     back_pkg: '',
     back_pkg: '',
     platform: '',
     platform: '',
     isShowBackBtn: false,
     isShowBackBtn: false,
-    recom_list:[],
-    isShowBackRecom:false,
-    last_recom_bid:"",
+    recom_list: [],
+    isShowBackRecom: false,
+    last_recom_bid: "",
   },
   },
   private: {
   private: {
-
     bookinfo: {},
     bookinfo: {},
     content: [],
     content: [],
     reader_banner: [],
     reader_banner: [],
     showShortPop: false,
     showShortPop: false,
     readFontSize: 38,
     readFontSize: 38,
     isNight: 'sun',
     isNight: 'sun',
-    back_nums:0,
+    back_nums: 0,
     hasShort: false,
     hasShort: false,
     showSetting: false,
     showSetting: false,
     force_add_desk_type: 0,
     force_add_desk_type: 0,
+    force_add_work_wechat_type: 0, // 企微
+    hasClickWorkWechat: false, // 是否跳转过企微
+    showWorkWechatTost: false,
+    workWechatUrl: "",
     showMustTost: false,
     showMustTost: false,
     back_reader: 0,
     back_reader: 0,
     colorList: [
     colorList: [
@@ -146,27 +156,25 @@ export default {
     }
     }
   },
   },
   async onInit() {
   async onInit() {
-
+    // 企微点击读取
+    let clilck_work_wechat = (await storage.get({ key: "has_click_work_wechat_"  + this.bid })).data;
+    if (clilck_work_wechat) {
+      this.hasClickWorkWechat = true;
+    }
+   
     if (this.platform) {
     if (this.platform) {
-      await storage.set({ key: "currue_tx_bid", value: this.bid });
-      this.tx_bid = this.bid;
       await storage.set({ key: "platform", value: this.platform });
       await storage.set({ key: "platform", value: this.platform });
     } else {
     } else {
       let platform = (await storage.get({ key: "platform" })).data;
       let platform = (await storage.get({ key: "platform" })).data;
       if (platform) this.platform = platform;
       if (platform) this.platform = platform;
-      let tx_bid = (await storage.get({ key: "currue_tx_bid" })).data;
-      if(tx_bid){
-        this.tx_bid = tx_bid;
-      }else{
-        this.tx_bid = "";
-      }
+  
     }
     }
-    if(!this.last_recom_bid || this.last_recom_bid == ""){
+    if (!this.last_recom_bid || this.last_recom_bid == "") {
       let last_recom_bid = (await storage.get({ key: "last_recom_bid" })).data;
       let last_recom_bid = (await storage.get({ key: "last_recom_bid" })).data;
-       if(last_recom_bid ){
-        this.last_recom_bid  = last_recom_bid ;
-      }else{
-        this.last_recom_bid  = "";
+      if (last_recom_bid) {
+        this.last_recom_bid = last_recom_bid;
+      } else {
+        this.last_recom_bid = "";
       }
       }
     }
     }
     if (this.back_name) {
     if (this.back_name) {
@@ -196,21 +204,7 @@ export default {
     if (this.push_id) {
     if (this.push_id) {
       await storage.set({ key: "push_id", value: this.push_id });
       await storage.set({ key: "push_id", value: this.push_id });
     }
     }
-    if (this.send_order_id) {
-      this.ad_bid = this.bid;
-      await storage.set({ key: "currue_ad_bid", value: this.bid });
-      await storage.set({ key: "send_order_id", value: this.send_order_id });
-      
-    } else {
-      let send_order_id = (await storage.get({ key: "send_order_id" })).data;
-      if (send_order_id) this.send_order_id = send_order_id;
-      let ad_bid = (await storage.get({ key: "currue_ad_bid" })).data;
-      if(ad_bid){
-        this.ad_bid = ad_bid;
-      }else{
-        this.ad_bid = "";
-      }
-    }
+   
     this.back_name = decodeURI(this.back_name)
     this.back_name = decodeURI(this.back_name)
     if (this.platform && (this.platform == 'tx_adq' || this.platform == 'tx_adq_new')) {
     if (this.platform && (this.platform == 'tx_adq' || this.platform == 'tx_adq_new')) {
       if (this.back_url) {
       if (this.back_url) {
@@ -232,27 +226,20 @@ export default {
 
 
           }
           }
         })
         })
-      }else{
-        if(this.tx_bid == this.bid){
-          let realBook = await noAdvBookInfo(this.send_order_id > 0 ? this.send_order_id :-1);
-          if(realBook && realBook.bid && realBook.bid && realBook.cid){
-            this.bid = realBook.bid;
-            this.chapter_id = realBook.cid;
-          }
-        }
-      }
+      } 
 
 
-    }else{
-      //  如果书籍id为派单书籍id则检测是否需要替换书籍
-      if(this.send_order_id > 0 && this.ad_bid == this.bid){
-        let realBook = await advReplaceBookInfo(this.send_order_id);
-        // let realBook = {};
-        if(realBook && realBook.bid && realBook.bid && realBook.cid){
-          this.bid = realBook.bid;
-          this.chapter_id = realBook.cid;
-        }
-      }
-    }
+    } 
+    // else {
+    //   //  如果书籍id为派单书籍id则检测是否需要替换书籍
+    //   if (this.send_order_id > 0 && this.ad_bid == this.bid) {
+    //     let realBook = await advReplaceBookInfo(this.send_order_id);
+    //     // let realBook = {};
+    //     if (realBook && realBook.bid && realBook.bid && realBook.cid) {
+    //       this.bid = realBook.bid;
+    //       this.chapter_id = realBook.cid;
+    //     }
+    //   }
+    // }
 
 
     /* let s = (await storage.get({ key: "send_order_id" })).data;
     /* let s = (await storage.get({ key: "send_order_id" })).data;
     console.log("save send_order_id in storage");
     console.log("save send_order_id in storage");
@@ -294,25 +281,34 @@ export default {
     })
     })
   },
   },
   backRouter() {
   backRouter() {
+    this.back_reader = 1;
+    let that = this;
     if (this.back_reader == 1) {
     if (this.back_reader == 1) {
+      if (this.back_nums == 0 && this.recom_list.length > 0) {
+        this.showShortPop = false;
+        this.back_nums = 2;
+        this.isShowBackRecom = true;
+        return true;
+      }
+      if (this.back_nums == 2) {
+        if (!this.hasShort) {
+          this.showShortPop = true;
+        }
+        this.back_nums = 3;
+        this.isShowBackRecom = false;
+        return true;
+      }
+
       it.backCreateShortCut(res => {
       it.backCreateShortCut(res => {
         if (res == 'back') {
         if (res == 'back') {
-          if (router.getLength() === 1) {
-            router.replace({ uri: "/views/Index" });
-            return true;
-          } else {
-            router.back()
-          }
+          that.getLastPage();
+          return true;
         }
         }
       });
       });
     } else {
     } else {
-      if (router.getLength() === 1) {
-        router.replace({ uri: "/views/Index" });
-        return true;
-      } else {
-        router.back()
-      }
+      that.getLastPage();
     }
     }
+    return true;
   },
   },
   async onShow() {
   async onShow() {
     it.getShortCut((value) => {
     it.getShortCut((value) => {
@@ -389,9 +385,10 @@ export default {
     console.log("router length:", router.getLength());
     console.log("router length:", router.getLength());
     getChapters({ bid: bid, chapter_id: chapter_id }).then(r => {
     getChapters({ bid: bid, chapter_id: chapter_id }).then(r => {
       this.force_add_desk_type = r.force_add_desk_type;
       this.force_add_desk_type = r.force_add_desk_type;
+      this.force_add_work_wechat_type = r.force_add_work_wechat_type;
+      this.workWechatUrl = r.force_add_work_wechat_url
       this.content = r.chapter_content.trim().split(/\n/)
       this.content = r.chapter_content.trim().split(/\n/)
       this.bookinfo = r;
       this.bookinfo = r;
-
       // this.$element('list').scrollTo({ index: 0 })
       // this.$element('list').scrollTo({ index: 0 })
       this.addShelf();
       this.addShelf();
       this.showtoast = false
       this.showtoast = false
@@ -406,8 +403,8 @@ export default {
           this.showtoast = false
           this.showtoast = false
           // this.$element('list').scrollTo({ index: 0 })
           // this.$element('list').scrollTo({ index: 0 })
         }).catch(f => {
         }).catch(f => {
-          // console.log('f code')
-          // console.log(f.data)
+          console.log('f code')
+          console.log(f.data)
           this.showtoast = false
           this.showtoast = false
           if (f.data.code == '10014' || f.data.code == '10015' || f.data.code == '10016') {
           if (f.data.code == '10014' || f.data.code == '10015' || f.data.code == '10016') {
             this.getChapters(bid, this.canReadecid)
             this.getChapters(bid, this.canReadecid)
@@ -474,22 +471,39 @@ export default {
   getNextChapter(evt) {
   getNextChapter(evt) {
     evt.stopPropagation();
     evt.stopPropagation();
     let _this = this;
     let _this = this;
-    if (this.force_add_desk_type == 1) {
-      it.getShortCut(res => {
-        if (!res) { this.showMustTost = true; } else {
+    if (!this.hasClickWorkWechat && this.force_add_work_wechat_type > 0) {
+      // 需要处理企微
+      if (this.force_add_desk_type == 1) {
+        // 强加桌
+        it.getShortCut(res => {
+          if (!res) { this.showMustTost = true; } else {
+            this.showWorkWechatTost = true;
+            // this.goNext();
+          }
+        })
+      } else {
+        this.showWorkWechatTost = true;
+      }
+    } else {
+      // 无需弹窗企微
+      if (this.force_add_desk_type == 1) {
+        it.getShortCut(res => {
+          if (!res) { this.showMustTost = true; } else {
+            this.goNext();
+          }
+        })
+      } else if (this.force_add_desk_type == 2) {
+        it.loseLevelShortCut(res => {
           this.goNext();
           this.goNext();
-        }
-      })
-    } else if (this.force_add_desk_type == 2) {
-      it.loseLevelShortCut(res => {
+        })
+      } else {
         this.goNext();
         this.goNext();
-      })
-    } else {
-      this.goNext();
+      }
     }
     }
+
   },
   },
   goNext() {
   goNext() {
-    let self =this;
+    let self = this;
     if (this.bookinfo.next_cid == 0) {
     if (this.bookinfo.next_cid == 0) {
       router.push({
       router.push({
         uri: "/views/Raderover",
         uri: "/views/Raderover",
@@ -546,74 +560,73 @@ export default {
 
 
   },
   },
   onBackPress() {
   onBackPress() {
-    this.back_reader = 1;
-    let that = this;
-    if (this.back_reader == 1) {
-      if(this.back_nums == 0 && this.recom_list.length > 0){
-          this.showShortPop = false;
-          this.back_nums = 2;
-          this.isShowBackRecom = true;
-          return true;
-      }
-      if(this.back_nums == 2){
-          if(!this.hasShort){
-            this.showShortPop = true;
-          }
-          this.back_nums = 3;
-          this.isShowBackRecom = false;
-          return true;
-      }
-
-      it.backCreateShortCut(res => {
-        if (res == 'back') {
-          that.getLastPage();
-          return true;
-        }
-      });
-    } else {
-      that.getLastPage();
-    }
-
-    that.getLastPage();
+    this.backRouter();
+    // that.getLastPage();
     return true;
     return true;
-  },async changeRecomEnd(data){
-    if(data.detail.op == "change_book"){
+  }, async changeRecomEnd(data) {
+    if (data.detail.op == "change_book") {
       this.getRecomList(1);
       this.getRecomList(1);
-      
-    }else if(data.detail.op =="close"){
+
+    } else if (data.detail.op == "close") {
       this.isShowBackRecom = false;
       this.isShowBackRecom = false;
+      this.back_nums = 3;
+      if (!this.hasShort) {
+        this.back_nums = 2;
+      }
+
     }
     }
-  },async getRecomList(isChang=0){
-    let recom_list =  await recommendBooks(this.last_recom_bid);
-    if(recom_list.length > 0){
+  }, async getRecomList(isChang = 0) {
+    let recom_list = await recommendBooks(this.last_recom_bid);
+    if (recom_list.length > 0) {
       this.recom_list = recom_list;
       this.recom_list = recom_list;
-      this.last_recom_bid = recom_list[recom_list.length-1].book_id;
+      this.last_recom_bid = recom_list[recom_list.length - 1].book_id;
     }
     }
-    if(isChang == 1 || !this.last_recom_bid || this.last_recom_bid == ''){
-        await storage.set({ key: "last_recom_bid", value: this.last_recom_bid });
+    if (isChang == 1 || !this.last_recom_bid || this.last_recom_bid == '') {
+      await storage.set({ key: "last_recom_bid", value: this.last_recom_bid });
     }
     }
-  
+
     // console.log(this.recom_list.length);
     // console.log(this.recom_list.length);
     // if(this.recom_list.length == 3){
     // if(this.recom_list.length == 3){
     //   return true;
     //   return true;
     // }
     // }
-    
-  },getLastPage(){
-      let page = router.getState();
-      let allPage = router.getPages();
-      let back = {};
-      for (var i = allPage.length - 1; i >= 0; i--)
-      {
-        if (allPage[i].name != page.name) {
-          back = allPage[i];
-          break;
-        }
-      }
-      if(JSON.stringify(back) === '{}'){
-        router.replace({ uri: "/views/Index" });
-      }else{
-        router.back(back);
+
+  }, getLastPage() {
+    let page = router.getState();
+    let allPage = router.getPages();
+    let back = {};
+    for (var i = allPage.length - 1; i >= 0; i--) {
+      if (allPage[i].name != page.name  && allPage[i].name != "views/Dispatch") {
+        back = allPage[i];
+        break;
       }
       }
+    }
+    if (JSON.stringify(back) === '{}') {
+      router.replace({ uri: "/views/Index" });
+    } else {
+      router.back(back);
+    }
+  }, async  goToWorkWeachat() {
+    await storage.set({ key: "has_click_work_wechat_"  + this.bid, value: 1 });
+    this.showWorkWechatTost = false;
+    this.hasClickWorkWechat = true;
+    if (this.workWechatUrl) {
+      router.push({
+        uri: this.workWechatUrl
+      })
+      let $this = this;
+        setTimeout(() => {
+          $this.goNext();
+        }, 10000)
+    }else{
+       this.goNext();
+    }
+   
+  }, async closeWorkWeachat() {
+    await storage.set({ key: "has_click_work_wechat_"  + this.bid, value: 2 });
+    this.showWorkWechatTost = false;
+    this.hasClickWorkWechat = true;
+    this.goNext();
+
   }
   }
 }
 }
 
 
@@ -621,4 +634,4 @@ export default {
 
 
 <style lang="less">
 <style lang="less">
 @import '../../assets/less/reader.less';
 @import '../../assets/less/reader.less';
-</style>
+</style>