xia 4 éve
szülő
commit
a8e8165a37

+ 3 - 2
src/api/config.js

@@ -6,8 +6,9 @@
  * @Description: api配置文件
  */
 const apiConfig = {
-   //baseURL: "https://quickapp.leyuee.com/api",
- baseURL: "https://quickapptest.leyuee.com/api",
+   baseURL: "https://quickapp.leyuee.com/api",
+ //baseURL: "https://quickapptest.leyuee.com/api",
 };
 
 export default apiConfig;
+ 

+ 1 - 1
src/api/fly.js

@@ -47,7 +47,7 @@ fly.interceptors.request.use(async config => {
       config.headers["X-Brand"] = qs.stringify(appDev);
       config.headers["X-Package"] = packages;
       config.headers["X-regId"] = regId;
-      config.headers["X-CodeVersion"] = '1.0.0';
+      config.headers["X-CodeVersion"] = '1.0.1';
       config.headers["X-pushId"] = push_id;
       config.headers["X-Provider"] = provider;
       if (sendOrderId) config.headers["send-order-id"] = sendOrderId;

+ 7 - 1
src/api/index.js

@@ -205,6 +205,12 @@ export const getRank = sex => {
 };
 
 //获取活动详情
-export const getAcitivity = (token) =>{
+export const getAcitivity = token => {
   return fly.get("/activity/detail", { token: token });
+}
+
+//获取热词
+
+export const getHotMain = (pages) => {
+  return fly.get("/books/hotwords", { page: pages});
 }

+ 20 - 19
src/api/utils.js

@@ -7,7 +7,7 @@ import device from "@system.device";
 import request from "@system.request";
 import media from "@system.media";
 import prompt from "@system.prompt";
-import {userOptions} from "./index"
+import { userOptions } from "./index"
 
 // 获取token
 let token = null;
@@ -40,8 +40,8 @@ export const getToken = async () => {
 // 登录
 export const login = async () => {
   requestLoginTime++;
-  if(requestLoginTime!=1){
-    let loginResponed =  await loginPromise();
+  if (requestLoginTime != 1) {
+    let loginResponed = await loginPromise();
   }
   const signKey = "a!A&AFRWT65Nb3NlklezUiqHyQAA@Z8M";
   const packages = 'com.beidao.kuaiying.zsy';
@@ -63,14 +63,14 @@ export const login = async () => {
   });
   let ret = await fly.post("/login", data);
   requestLoginTime = 0;
-  return ret; 
+  return ret;
 };
 
-const loginPromise = () =>{
-  return new Promise((resolve,reject)=>{
-    setTimeout(()=>{
+const loginPromise = () => {
+  return new Promise((resolve, reject) => {
+    setTimeout(() => {
       resolve(true)
-    },800)
+    }, 800)
   })
 }
 
@@ -231,15 +231,16 @@ export const getSendOrderId = (fn) => {
 }
 
 //获取全局配置
-export const getAppConfig = async (self,key) => {
-  let option = self.$app.getAppData('options');
-  if(!option){
-    let data = await userOptions();
-    self.$app.setAppData('options',data); 
-    console.log(data)
-    return self.$app.getAppData('options')[key]
-  }else{
-    return option[key];
+export const getAppConfig = (self) => {
+  return async (key) => {
+    let option = self.$app.getAppData('options');
+    if (!option) {
+      let data = await userOptions();
+      self.$app.setAppData('options', data);
+      return self.$app.getAppData('options')[key];
+    } else {
+      return option[key];
+    }
   }
-  
-}
+}
+

BIN
src/assets/imgs/change_other.png


BIN
src/assets/imgs/rank_grey.png


+ 20 - 0
src/assets/less/index.less

@@ -95,4 +95,24 @@
   height:150px;
   right:20px;
   bottom: 300px;
+}
+.mask{
+  position: fixed;
+  width: 100%;
+  height:100%;
+  flex-direction: column;
+  z-index: 9999;
+  justify-content: center;
+  align-items: center;
+  background-color: rgba(0, 0, 0, .6);
+  .banner{
+    margin-top: - 200px;
+    width:600px;
+
+  }
+  .close-pop{
+    width:70px;
+    height:70px;
+    margin-top:24px;
+  }
 }

+ 7 - 1
src/assets/less/reader.less

@@ -2,7 +2,13 @@
   flex-direction: column;
   background-color: #e6e6e6;
   width: 100%;
-
+  .banner-list{
+    height:300px;
+    image{
+      width: 100%;
+      margin:10px 0;
+    }
+  }
   .reader-title {
     margin: 0 24px;
     padding: 30px 0;

+ 14 - 4
src/assets/less/serach.less

@@ -6,6 +6,7 @@
 		height:30px;
 		line-height: 30px;
 	}
+	
   .history-list {
     flex-wrap: wrap;
     .history-item {
@@ -24,15 +25,24 @@
     flex-direction: column;
     padding: 0 30px;
     .top-wrap {
-      justify-content: space-between;
+			justify-content: space-between;
+			align-items: center;
+			.changed{
+				color: #666;
+				font-size: 24px;
+				font-weight: normal;
+				padding-right: 20px;
+			}
+			image{
+				width:30px;
+				height:30px;
+			}
       text {
         font-weight: bold;
         color: #343434;
         font-size: 32px;
     	}
-			image{
-				width:40px;
-			}
+			
     }
   }
 }

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

@@ -54,7 +54,8 @@ export default {
   &-wrap {
     position: fixed;
     bottom: 200px;
-    height: 80px;
+	height: 80px;
+	z-index: 60;
 		justify-content: center;
 		width: 100%;
 		opacity:0.95;

+ 195 - 31
src/views/Activity/index.ux

@@ -1,17 +1,26 @@
 <import name="x-page" src="../../components/page/page.ux"></import>
 <template>
   <div class="consume-record__wrap">
-    <div class="stack" style="background-color: #ff8b63">
+    <div class="stack" style="background-color: #ff8b63" if={{activity}}>
       <image src="https://cdn-novel.iycdm.com/h5/channelActivity/activity-2020-04-17/20200417173207-bg.jpeg"></image>
       <div class="contain">
-        <div class="charge-item">
-          <text class="title">冲<span>19</span>得<span>19</span></text>
-          <text class="desc">多得3000书币</text>
-        </div>
-        <div class="charge-item">
-          <text class="title">冲<span>19</span>得<span>19</span></text>
-          <text class="desc">多得3000书币</text>
+        <text class="promotion-title">活动时间:{{activity.startTime.substring(0,10)}} 至 {{activity.endTime.substring(0,10)}}</text>
+        <div class="charge-item {{currentIdx==$idx?'charge-on':''}}" for="{{activity.products}}" @click="chooseItem($item,$idx)">
+          <block if="{{$item.type=='YEAR_ORDER'}}">
+            <text class="title"><span>365包年</span></text>
+            <text class="desc">全站小说免费阅读</text>
+          </block>
+          <block elif="{{$item.type=='QUARTER'}}">
+            <text class="title"><span>98元包季</span></text>
+            <text class="desc">全站小说免费阅读</text>
+           
+          </block>
+          <block else>
+            <text class="title">充<span>{{$item.price}}元</span>得<span>{{$item.total}}书币</span></text>
+            <text class="desc">多得{{$item.given}}书币</text>
+          </block>
         </div>
+
         <text class="charge-button" @click="wantCharge">
           立即充值
         </text>
@@ -23,53 +32,169 @@
         <text>3.活动期间不限充值次数</text>
       </div>
     </div>
-    <div class="mask" show={{showPay}}>
+   <!--  <div class="loading-wrap" if="showLoading">
+			<div class="loading-content">
+				<progress type="circular"></progress>
+				<text class="loading-text">{{loadingText}}</text>
+			</div>
+		</div> -->
+    <div class="mask" if={{showPay}} @click="closeMask">
       <div class="pop-pay">
         <div class="title-pay"><text class="index"></text><text>支付方式</text>
-          <image src="../../assets/imgs/close.png"></image>
+          <image src="../../assets/imgs/close.png" @click="closeMask"></image>
         </div>
-        <div class="pay-item">
+        <div class="pay-item" @click="changePayType(0)" if="{{activity.payChannels.wechat=='1'}}">
           <div class="item-left">
             <image src="../../assets/imgs/wechat.png"></image><text>微信支付</text>
           </div>
-          <image src="../../assets/imgs/pay_checked.png" class="checked"></image>
+          <image src="../../assets/imgs/pay_checked.png" class="checked" if={{!payType}}></image>
+          <image src="../../assets/imgs/rank_grey.png" class="checked" if={{payType}}></image>
         </div>
-        <div class="pay-item">
+        <div class="pay-item" @click="changePayType(1)" if="{{activity.payChannels.ali=='1'}}">
           <div class="item-left">
             <image src="../../assets/imgs/zfb.png"></image><text>支付宝支付</text>
           </div>
-          <image src="../../assets/imgs/rank_grey.png" class="checked"></image>
+          <image src="../../assets/imgs/rank_grey.png" class="checked" if={{!payType}}></image>
+          <image src="../../assets/imgs/pay_checked.png" class="checked" if={{payType}}></image>
         </div>
-        <text class="charge-now">sdasdasd asd as</text>
+        <text class="charge-now" @click="goPay">确认充值</text>
       </div>
     </div>
   </div>
 </template>
-
 <script>
 
 import { configWxPay, configAliPay } from "../../helper";
-import { getAcitivity } from "../../api/index";
+import { getAcitivity, getUserInfo, checkWxOrder } from "../../api";
 import { getAppConfig, getToken } from '../../api/utils';
+import router from '@system.router';
+import prompt from '@system.prompt';
+
 export default {
+  public: {
+      token: '',
+      send_order_id: '',
+  },
   private: {
-    showPay:false,
-    activity:null
+    showPay: false,
+    activity: null,
+    payType: 0,
+    currentProduct: null,
+    currentIdx:0,
+    showLoading: false,
   },
   onInit() {
     console.log('sssss')
     //getAppConfig(this);
-    this.getAcitvy();
-  },
-  async getAcitvy(){
-    let token  = await getToken();
-    let activity = await getAcitivity('780a71bfa53bf1940903e070ec639113');
+    this.getUserInfo();
+    setTimeout(()=>{
+      this.getAcitvy();
+    },1000)
     
+    
+  },
+  changePayType(type,evt) {
+    evt.stopPropagation();
+    this.payType = type;
+    return false;
+  },
+  closeMask() {
+    this.showPay = false;
+  },
+  async getAcitvy() {
+    let activity = await getAcitivity(this.token);
+     this.activity = activity;
+    this.currentProduct = this.activity.products[0];
   },
   wantCharge() {
+    this.showPay = true;
+  },
+  async getUserInfo() {
+    let userinfo = await getUserInfo();
+    this.send_order_id = userinfo.send_order_id || this.send_order_id;
+  },
+  chooseItem(product,idx) {
+    this.currentProduct = product;
+    this.currentIdx = idx;
+  },
+  async goPay(evt) {
+    evt.stopPropagation();
+    let cur_pay_type = this.payType;
+    let product_id = this.currentProduct.product_id;
+    let ret = null;
+    if (cur_pay_type == 1) {
+      ret = await configAliPay({ product_id: product_id, send_order_id: this.send_order_id });
+    }
+    else {
+      ret = await configWxPay({ product_id: product_id, send_order_id: this.send_order_id });
+    }
+    // 成功支付后的回调操作
+    if (ret.code === "9000") this.showWaitingWrap(ret);
+    else this.showToastByCode(ret.code);
+  },
+  checkOrder(order_info) {
+    this.showLoading = true;
+    let { data, order } = order_info;
+    let times = 10;
+    /* this.loadingText = `订单查询中...${times}s`;
+    this.timer = setInterval(async () => {
+      if (times === 0) clearInterval(this.timer), this.showToastByCode("6004");
+      else {
+        times--;
+        this.loadingText = `订单查询中...${times}s`;
+        let fb = await checkWxOrder(order);
+        if (fb && typeof fb === "object") clearInterval(this.timer), this.showToastByCode("9000");
+      }
+    }, 1000); */
+    setTimeout(()=>{
+      if (router.getLength() === 1) {
+			router.replace({ uri: "/views/Index" });
+			return true;
+		} else {
+			router.back()
+		}
+    },2000)
+  },
+  showToastByCode(code) {
+    this.showLoading = false;
+    let msg = "支付成功!";
+    switch (code) {
+      case "9000": (msg = "支付成功!", router.back()); break;
+      case "8000": msg = "订单已提交,请等待结果"; break;
+      case "4000": msg = "订单支付失败!"; break;
+      case "5000": msg = "订单重复!"; break;
+      case "6001": msg = "您已取消支付"; break;
+      case "6002": msg = "网络错误!"; break;
+      case "6004": msg = "请联系客服查询订单"; break;
+      default: msg = "请联系客服" + code;
+    }
+    
+    prompt.showToast({ message: msg });
+    
 
-  }
-
+  },
+  showWaitingWrap(order) {
+    prompt.showDialog({
+      title: "支付结果",
+      message: "请确认支付结果",
+      buttons: [
+        {
+          text: "已支付",
+          color: "#EF5952"
+        },
+        {
+          text: "重新选择金额",
+          color: "#999"
+        }
+      ],
+      success: (data) => {
+        if (data.index === 0) this.checkOrder(order);
+      },
+      cancel: () => {
+        console.log("cancel");
+      }
+    });
+  },
 
 
 }
@@ -99,7 +224,7 @@ export default {
   }
   .pay-item {
     justify-content: space-between;
-    padding: 10px 0;
+    padding: 10px 30px;
     .checked {
       width: 40px;
     }
@@ -116,7 +241,7 @@ export default {
   }
   .pop-pay {
     height: 420px;
-    padding: 30px 30px;
+    padding: 30px 0;
     background-color: #fff;
     border-top-left-radius: 18px;
     width: 100%;
@@ -127,6 +252,8 @@ export default {
       margin-bottom: 30px;
       border-bottom: 2px solid #ccc;
       padding-bottom: 30px;
+      padding-left: 30px;
+      padding-right: 30px;
       text {
         color: #333;
         font-weight: bold;
@@ -170,6 +297,12 @@ export default {
     flex-direction: column;
     justify-content: center;
     align-items: center;
+    .promotion-title {
+      font-weight: bold;
+      font-size: 28px;
+      text-align: center;
+      margin: 10px 0 20px 0;
+    }
     .charge-button {
       background-color: #e82b2f;
       width: 600px;
@@ -181,14 +314,17 @@ export default {
       margin-top: 20px;
       border-radius: 60px;
     }
+    
     .charge-item {
       width: 600px;
-      background-color: #ffe4c4;
-      border: 1px solid #e82b2f;
+      background-color:#fff;
+      border:1px solid #e6e6e6;
       color: #333;
       flex-direction: column;
       text-align: center;
-      padding: 10px 0;
+      height: 110px;
+      justify-content: center;
+      align-items: center;
       border-radius: 10px;
       margin: 15px 0;
       .title {
@@ -205,6 +341,34 @@ export default {
         margin-top: 5px;
       }
     }
+    .charge-on{
+      background-color: #ffe4c4;
+      border: 1px solid #e82b2f;
+    }
+  }
+  .loading-wrap {
+    position: fixed;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    background-color: rgba(0, 0, 0, .6);
+    justify-content: center;
+    align-items: center;
+
+    .loading-content {
+      width: 300px;
+      height: 100px;
+      border-radius: 6px;
+      background-color: #fff;
+      flex-direction: column;
+      justify-content: center;
+      align-items: center;
+
+      .loading-text {
+        font-size: 26px;
+      }
+    }
   }
 }
 </style>

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

@@ -65,6 +65,7 @@ export default {
       page = Math.ceil(chapter_sequence / PER_PAGE_NUM)
     }
     this.startpage = page;
+    
     getCatalog({ bid: this.bid, page: page, page_size: PER_PAGE_NUM }).then(r => {
       this.list = r.list
       this.meta = r.meta

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

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

+ 5 - 1
src/views/Home/index.ux

@@ -74,6 +74,7 @@
 
 <script>
 import { getHomeList } from "../../api";
+
 import storage from '@system.storage';
 import router from '@system.router';
 
@@ -109,7 +110,10 @@ export default {
     this.current = index;
   },
   toCategory() {
-    this.$emit('change');
+    //this.$emit('change');
+    router.push({
+      uri: '/views/Search',
+    })
   },
   pageRouter(page) {
     router.push({

+ 76 - 51
src/views/Index/index.ux

@@ -10,8 +10,8 @@
       <tabs class="tab-content" onchange="tabbarChange" index="{{current}}">
         <tab-content>
           <home-page @change="pageSwitch" tabindex="{{current}}"></home-page>
-          <category-page tabindex="{{current}}"></category-page>
-          <shelf-page @change="pageSwitch" tabindex='{{current}}'></shelf-page>
+        
+          <shelf-page @change="pageSwitch" tabindex="{{current}}"></shelf-page>
           <my-page @customer="openCustomer" tabindex="{{current}}"></my-page>
         </tab-content>
       </tabs>
@@ -27,19 +27,28 @@
         </div>
       </div>
     </div>
-    <image src="../../assets/imgs/sign_show.png" class="sign-icon" @click="changeSignPop" if="{{user.is_vip}}" > </image>
-    <image src="../../assets/imgs/rukou.png" class="sign-icon" @click="goTask" if="{{!user.is_vip}}" > </image>
-    <sign-page if="{{showSignPop}}"></sign-page>
-    <short-page if="{{showShortPop}}" @addshort="shortEnd"></short-page>
-    <div class="stack-popup" @click="closeWrap" if="showPopup">
-      <div class="customer-popup">
-        <text class="title">联系客服</text>
-        <text class="desc">
-          复制微信号或者保存二维码到本地至微信添加客服好友
-        </text>
-        <image src="{{cutomerQrcode}}" @longpress="saveImg"></image>
-        <div class="duplication"><text class="duplication-text">微信号:{{cutomerName}}</text><text class="duplication-button" @click="duplication">复制</text></div>
+    <stack>
+      <image src="../../assets/imgs/sign_show.png" class="sign-icon" @click="changeSignPop" if="{{user.is_vip}}"> </image>
+      <image src="../../assets/imgs/rukou.png" class="sign-icon" @click="goTask" if="{{!user.is_vip && home_show}}"> </image>
+
+      <sign-page if="{{showSignPop}}"></sign-page>
+      <short-page if="{{!showActivitys && showShortPop}}" @addshort="shortEnd"></short-page>
+      <div class="stack-popup" @click="closeWrap" if="showPopup">
+        <div class="customer-popup">
+          <text class="title">联系客服</text>
+          <text class="desc">
+            复制微信号或者保存二维码到本地至微信添加客服好友
+          </text>
+          <image src="{{cutomerQrcode}}" @longpress="saveImg"></image>
+          <div class="duplication"><text class="duplication-text">微信号:{{cutomerName}}</text><text class="duplication-button" @click="duplication">复制</text></div>
+        </div>
+      </div>
+      <div class="mask" @click="closeAcitivity" if="{{showActivitys && home_alert}}">
+        <image src="{{home_alert.img}}" class="banner" @click="goActicity"></image>
+        <image src="../../assets/imgs/pop_close.png" class="close-pop" @click="closeAcitivity"></image>
       </div>
+    </stack>
+
     </div>
   </stack>
 </template>
@@ -50,18 +59,20 @@ import prompt from '@system.prompt';
 import device from "@system.device";
 import storage from "@system.storage";
 import it from "../../helper/interface.js";
-import { getCustomQrcode, userAddDsktop,getUserInfo} from '../../api/index.js';
-import { downImg, getStore } from '../../api/utils.js';
+import { getCustomQrcode, userAddDsktop, getUserInfo } from '../../api/index.js';
+import { downImg, getStore, getAppConfig } from '../../api/utils.js';
 import router from "@system.router";
+let getConfig;
 export default {
-  public:{
-    curPage : 0,
+  public: {
+    curPage: 0,
     push_id: ''
   },
   protected: {
     current: 0,
-    user:{}
+    user: {}
   },
+  home_alert: [],
   private: {
     tabbar: [
       {
@@ -71,69 +82,82 @@ export default {
         active_icon: "../../assets/imgs/home_choose.png",
         index: 0
       },
-      // {
-      //   name: "分类",
-      //   title: "书城",
-      //   icon: "../../assets/imgs/category.png",
-      //   active_icon: "../../assets/imgs/category_choose.png",
-      //   index: 1
-      // },
       {
         name: "书架",
         title: "我的书架",
         icon: "../../assets/imgs/shelf.png",
         active_icon: "../../assets/imgs/shelf_choose.png",
-        index: 2
+        index: 1
       },
       {
         name: "我的",
         title: "个人中心",
         icon: "../../assets/imgs/my.png",
         active_icon: "../../assets/imgs/my_choose.png",
-        index: 3
+        index: 2
       }
     ],
     // current: 0,
     showPopup: false,
+    showActivitys: false,
     showSignPop: false,
-    showShortPop: false,
-    cutomerQrcode: '',
-    cutomerName: '',
-    brand:''
+    home_show: 0,
+    home_alert:null
   },
   async onInit() {
     this.$on('dispathEvt', this.changeSignPop);
     this.$watch('current', 'watchCurrent');
-    if(this.push_id){
-       await storage.set({ key: "push_id", value: this.push_id });
+    this.showActivity();
+    if (this.push_id) {
+      await storage.set({ key: "push_id", value: this.push_id });
     }
     //今日已签到过不在弹框签到
     this.getCoustom();
     this.getUser();
-    if(this.curPage && this.curPage > 0 ){
+    if (this.curPage && this.curPage > 0) {
       this.current = this.curPage
     }
+    getConfig = getAppConfig(this);
+    let { home_show } = await getConfig('task_center');
+    this.home_show = home_show;
+    let { home_alert } = await getConfig('position');
+    if(home_alert.length>0){
+      this.home_alert = home_alert[0];
+      this.showActivitys = true;
+    }
+    
     
-
+  },
+  goActicity(){
+    router.push({
+      uri: '/views/Activity',
+      params:this.home_alert.params
+    })
+  },
+  showActivity() {
+    this.showActivitys = 1;
+  },
+  closeAcitivity() {
+    this.showActivitys = 0;
   },
   async onShow() {
     const data = this.$app.getAppData('backfrom');
     let device_info = (await device.getInfo()).data;
-    this.brand = device_info.brand ;
-    if(data=='phone'){
-      this.current = 1;
-      this.$app.setAppData('backfrom','');
+    this.brand = device_info.brand;
+    if (data == 'phone') {
+      this.current = 0;
+      this.$app.setAppData('backfrom', '');
     }
-    
+
     it.getShortCut((value) => {
       this.showShortPop = !value;
     })
-   
+
   },
   shortEnd(value) {
     if (value.detail.msg) {
       prompt.showToast({ message: "用户禁止创建" });
-    }else if(value.detail.installed){
+    } else if (value.detail.installed) {
       prompt.showToast({ message: "添加桌面成功!请前往任务中心领取奖励" });
     }
     this.showShortPop = !value.detail.installed;
@@ -142,18 +166,18 @@ export default {
     console.log("watching", i);
     this.current = i;
   },
-  async getUser(){
+  async getUser() {
     let user = await getUserInfo();
     this.user = user;
   },
-  goTask(){
+  goTask() {
     router.push({
       uri: '/views/Task'
     })
   },
   onBackPress() {
     // 退出逻辑
-    if (this.$app.$def.data.backClickCount === 0  && this.brand!=='vivo') {
+    if (this.$app.$def.data.backClickCount === 0 && this.brand !== 'vivo') {
       this.$app.$def.data.backClickCount++;
       this.$app.$def.createShortcut();
       return true;
@@ -170,10 +194,10 @@ export default {
     this.showShortPop = false;
   },
   async getCoustom() {
-    userAddDsktop(this.$app.$def.data.backClickCount).then(res=>{
+    userAddDsktop(this.$app.$def.data.backClickCount).then(res => {
       //TODO 加桌后统计上报
-    }).catch(r=>{
-       //TODO 失败后统计上报
+    }).catch(r => {
+      //TODO 失败后统计上报
     });
     let res = await getCustomQrcode();
     this.cutomerQrcode = res.url;
@@ -181,10 +205,11 @@ export default {
   },
   tabbarChange(tab) {
     this.current = tab.index;
-    this.$page.setTitleBar({ text: this.tabbar[tab.index].title });
+
+    //this.$page.setTitleBar({ text: this.tabbar[tab.index].title });
   },
   pageSwitch() {
-    this.current = 1;
+    this.current = 0;
   },
   changeSignPop() {
     this.showSignPop = !this.showSignPop;

+ 65 - 62
src/views/Leaderboard/index.ux

@@ -1,74 +1,77 @@
 <import name="x-book" src="../../components/book/book.ux"></import>
 
 <template>
-    <div class="leaderboard-wrap">
-        <div class="type-bar">
-            <block for="type in typeList">
-                <div class="type-item" @click="typeChange(type.index)">
-                    <text class="{{type.index === current ? 'cur' : ''}}">{{type.name}}</text>
-                    <text class="choose-bar" show="{{type.index === current}}"></text>
-                </div>
-            </block>
-        </div>
-        <list>
-            <list-item type="multi" class="book-list__wrap book-list__wrap--multi">
-                <div class="book-list__multi">
-                    <block for="book in list">
-                        <div class="book-item">
-                            <div style="width:60px;margin-right:15px">
-                                <image if="$idx<3" src="{{img[$idx]}}" class="book-index"></image>
-                                <div else class="book-index_follow">
-                                    <text>{{$idx+1}}</text>
-                                </div>
-                            </div>
-                            <x-book multi="{{true}}" width="{{150}}" book="{{book}}">
-                                <div class="book-info__multi">
-                                    <text class="name">{{book.book_name}}</text>
-                                    <text class="intro">{{book.book_summary}}</text>
-                                </div>
-                            </x-book>
-                        </div>
-                    </block>
-                </div>
-            </list-item>
-        </list>
-    </div>
+	<div class="leaderboard-wrap">
+		<div class="type-bar">
+			<block for="type in typeList">
+				<div class="type-item" @click="typeChange(type.index)">
+					<text class="{{type.index === current ? 'cur' : ''}}">{{type.name}}</text>
+					<text class="choose-bar" show="{{type.index === current}}"></text>
+				</div>
+			</block>
+		</div>
+		<list>
+			<block for="book in list">
+				<list-item type="multi" class="book-list__wrap book-list__wrap--multi">
+					<div class="book-list__multi">
+
+						<div class="book-item">
+							<div style="width:60px;margin-right:15px">
+								<image if="$idx<3" src="{{img[$idx]}}" class="book-index"></image>
+								<div else class="book-index_follow">
+									<text>{{$idx+1}}</text>
+								</div>
+							</div>
+							<x-book multi="{{true}}" width="{{150}}" book="{{book}}">
+								<div class="book-info__multi">
+									<text class="name">{{book.book_name}}</text>
+									<text class="intro">{{book.book_summary}}</text>
+								</div>
+							</x-book>
+						</div>
+
+					</div>
+				</list-item>
+			</block>
+		</list>
+	</div>
 </template>
 
 <script>
 import { getRank } from "../../api";
 
 export default {
-    data() {
-        return {
-            typeList: [
-                {
-                    name: "女生",
-                    index: 0
-                },
-                {
-                    name: "男生",
-                    index: 1
-                },
-            ],
-            list: [],
-            current: 0,
-            img: ['../../assets/imgs/rank_1.png', '../../assets/imgs/rank_2.png', '../../assets/imgs/rank_3.png']
-        }
-    },
-    async onInit() {
-        await this.getCityListByTabChange();
-        this.$watch('current', 'getCityListByTabChange')
-    },
-    onShow() { },
-    typeChange(index) {
-        this.current = index;
-    },
-    async getCityListByTabChange(index = 0) {
-        let sex = index ? "1" : "2";
-        let ret = await getRank(sex);
-        this.list = ret;
-    }
+	data() {
+		return {
+			typeList: [
+				{
+					name: "女生",
+					index: 0
+				},
+				{
+					name: "男生",
+					index: 1
+				},
+			],
+			list: [],
+			current: 0,
+			img: ['../../assets/imgs/rank_1.png', '../../assets/imgs/rank_2.png', '../../assets/imgs/rank_3.png']
+		}
+	},
+	async onInit() {
+		await this.getCityListByTabChange();
+		this.$watch('current', 'getCityListByTabChange')
+	},
+	onShow() { },
+	typeChange(index) {
+		this.current = index;
+	},
+	async getCityListByTabChange(index = 0) {
+		let sex = index ? "1" : "2";
+		let ret = await getRank(sex);
+		this.list = ret;
+		console.log(this.list)
+	}
 }
 </script>
 

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

@@ -108,7 +108,7 @@ export default {
     this.loginPhone = loginPhone.replace(reg,'$1****$2');
   },
   watchPropsChange(v) {
-    if (v === 3) this.getUser();
+    if (v === 2) this.getUser();
   },
   showCustomerQrcode() {
     this.$emit('customer');

+ 11 - 1
src/views/Pay/index.ux

@@ -81,8 +81,11 @@
 import router from '@system.router';
 import prompt from '@system.prompt';
 import storage from "@system.storage";
+
 import { getChargeList, getUserInfo, checkWxOrder } from "../../api";
 import { configWxPay, configAliPay } from "../../helper";
+import {  getAppConfig } from '../../api/utils.js';
+let getConfig;
 
 export default {
 	public: {
@@ -94,6 +97,7 @@ export default {
 		fee: ""
 	},
 	private: {
+		pay_back: 0,
 		curPayType: 2,
 		curSelect: 0,
 		balance: 0,
@@ -164,7 +168,13 @@ export default {
 		if (this.push_id) {
 			await storage.set({ key: "push_id", value: this.push_id });
 		}
+		getConfig = getAppConfig(this);
+		let { pay_back_alert_show } = await getConfig('task_center');
+		this.pay_back = pay_back_alert_show;
 		this.initChargeList();
+		
+		
+		console.log(this.pay_back,'23232323')
 	},
 	toPay() {
 		if (this.checked && !this.phone) {
@@ -263,7 +273,7 @@ export default {
 		//this.$app.$def.createShortcut(true);
 	},
 	onBackPress() {
-		if (!this.isVip) {
+		if (!this.isVip && this.pay_back) {
 			prompt.showDialog({
 				title: '温馨提示',
 				message: '每日完成任务,可以免费获取书币~',

+ 31 - 10
src/views/Reader/index.ux

@@ -36,6 +36,15 @@
             <text class="operator catalog" @click="toCatalog">目录</text>
             <text class="operator next" @click="getNextChapter">下一章</text>
           </div>
+          <div class="banner-list" if="{{reader_banner.length>0}}">
+            <swiper class="swipe-bar" autoplay="true" indicator="false">
+              <block for="reader_banner">
+                <div class="swipe-item">
+                  <image class="cover" src="{{$item.img}}" @click="goActivity($item)"></image>
+                </div>
+              </block>
+            </swiper>
+          </div>
         </div>
         <short-page if="{{showShortPop}}" @addshort="shortEnd"></short-page>
         <!-- <wechat-page></wechat-page> -->
@@ -64,7 +73,8 @@ import router from "@system.router";
 import storage from '@system.storage';
 import it from "../../helper/interface.js";
 import { getChapters, getIsonshelf, postUserShelfBooks, chapterOrders, userAddDsktop } from "../../api";
-
+import { getAppConfig } from '../../api/utils.js';
+let getConfig;
 export default {
   // protected: {
   //   bid: '',
@@ -74,13 +84,14 @@ export default {
     bid: '',
     chapter_id: '',
     send_order_id: "",
-    push_id:"",
+    push_id: "",
     canReadecid: "",
     showtoast: false
   },
   private: {
     bookinfo: {},
     content: [],
+    reader_banner: [],
     showShortPop: false,
     readFontSize: 38,
     isNight: 'sun',
@@ -113,8 +124,8 @@ export default {
     if (this.send_order_id) {
       await storage.set({ key: "send_order_id", value: this.send_order_id });
     }
-    if(this.push_id){
-       await storage.set({ key: "push_id", value: this.push_id });
+    if (this.push_id) {
+      await storage.set({ key: "push_id", value: this.push_id });
     }
     /* let s = (await storage.get({ key: "send_order_id" })).data;
     console.log("save send_order_id in storage");
@@ -131,12 +142,22 @@ export default {
     if (font) {
       this.readFontSize = font;
     }
+    getConfig = getAppConfig(this);
+    let { reader_banner } = await getConfig('position');
+    this.reader_banner = reader_banner;
+
     userAddDsktop(this.$app.$def.data.backClickCount).then(res => {
       //TODO 加桌后统计上报
     }).catch(r => {
       //TODO 失败后统计上报
     });
   },
+  goActivity(item) {
+    router.push({
+      uri: item.url,
+      params: item.params
+    })
+  },
   backRouter() {
     it.backCreateShortCut(res => {
       if (res == 'back') router.back()
@@ -214,7 +235,7 @@ export default {
       this.force_add_desk_type = r.force_add_desk_type;
       this.content = r.chapter_content.trim().split(/\n/)
       this.bookinfo = r;
-      
+
       // this.$element('list').scrollTo({ index: 0 })
       this.addShelf();
       this.showtoast = false
@@ -284,10 +305,10 @@ export default {
     })
   },
   addDestop() {
-    it.mustCreateShort((res,code) => {
+    it.mustCreateShort((res, code) => {
       if (res) {
         this.goNext();
-      }else{
+      } else {
         prompt.showToast({ message: '开启加桌权限可以领取新人福利哟~' });
       }
     })
@@ -335,11 +356,11 @@ export default {
         if (router.getLength() === 1) {
           router.replace({ uri: "/views/Index" });
           return true;
-        }else{
-           router.back()
+        } else {
+          router.back()
         }
       }
-     
+
     });
     return true;
   }

+ 39 - 3
src/views/Search/index.ux

@@ -5,7 +5,20 @@
 		<div class="search-top">
 			<input type="text" id="search" class="serach-input" value="{{inputValue}}" @change="changeValue" enterkeytype="search" placeholder="请输入书名" @enterkeyclick="searchBook" style="placeholder-color:#D9D9D9"></input>
 		</div>
-		<div class="search-content" if="{{showHistory}}">
+		<div class="search-content" show="{{showHistory}}">
+			<div class="top-wrap">
+				<text>热门搜索</text>
+				<div @click="nextHot"><text class="changed">换一换</text>
+					<image src="../../assets/imgs/change_other.png" @click="deleteHistory"></image>
+				</div>
+			</div>
+			<div class="history-list" if="{{hotlist.length}}">
+				<text class="history-item" for={{hotlist}} @click="serachItem($item.keyword)">
+					{{$item.keyword}}
+				</text>
+			</div>
+		</div>
+		<div class="search-content" show="{{showHistory}}">
 			<div class="top-wrap">
 				<text>搜索历史</text>
 				<image src="../../assets/imgs/delete.png" @click="deleteHistory"></image>
@@ -37,7 +50,7 @@
 	</div>
 </template>
 <script>
-import { getBooksList } from "../../api";
+import { getBooksList, getHotMain,getUserInfo } from "../../api";
 import { pageLoad } from "../../helper";
 import storage from '@system.storage';
 import prompt from '@system.prompt';
@@ -47,10 +60,12 @@ export default {
 		inputValue: null,
 		showHistory: true,
 		meta: {},
+		hotlist: [],
 		empty: false,
 		list: [],
 		historyList: [],
 		loadingText: "努力搜索ing...",
+		uid:'',
 		filter: {
 			key: "",
 			page_size: 100,
@@ -61,10 +76,30 @@ export default {
 	computed: {
 
 	},
+	nextHot() {
+		if (this.meta.last_page == 1) {
+			return;
+		}
+		if (this.meta.current_page == this.meta.last_page) {
+			this.getData();
+		} else {
+			this.getData(this.meta.current_page + 1);
+		}
+	},
 	async onInit() {
+		let user = await getUserInfo();
+		this.uid = user.id
+		this.getData();
 		let list = (await storage.get({ key: "history" })).data;
 		let sets = JSON.parse(list)
 		if (sets) this.historyList = sets;
+		
+	},
+	async getData(page = 1) {
+		
+		let data = await getHotMain(page);
+		this.hotlist = data.list;
+		this.meta = data.meta;
 	},
 	searchBook(iptValue) {
 		if (!iptValue.value) {
@@ -104,7 +139,7 @@ export default {
 						success: function (data) {
 							_self.historyList = [];
 							_self.
-							prompt.showToast({ message: "删除成功" });
+								prompt.showToast({ message: "删除成功" });
 						},
 					})
 				}
@@ -129,6 +164,7 @@ export default {
 			this.meta = {};
 		}
 		let params = this.filter;
+		params.uid =this.uid;
 		console.log(params);
 		pageLoad(this.meta, getBooksList, params).then(ret => {
 			let newList = isLoad ? this.list : [];

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

@@ -94,7 +94,7 @@ export default {
     this.$watch('tabindex', 'watchPropsChange')
   },
   watchPropsChange(newV, oldV) {
-    if (newV == 2) {
+    if (newV == 1) {
       this.getUserShelfBooks()
     }
   },

+ 9 - 0
src/views/Task/index.ux

@@ -185,6 +185,15 @@ export default {
 		}
 		this.isClick = false;
 	},
+	onBackPress() {
+		if (router.getLength() === 1) {
+			router.replace({ uri: "/views/Index" });
+			return true;
+		} else {
+			router.back()
+		}
+		return true;
+	},
 	goTask(type, path) {
 		let _self = this;
 		if (type == 'add_desk') {