Ver código fonte

增加公共颜色变量

增加公共颜色变量
zqwang 2 anos atrás
pai
commit
69e8e9e52b

+ 8 - 1
.quickapp.preview.json

@@ -1,6 +1,13 @@
 {
   "modeOptions": {
     "current": -1,
-    "list": []
+    "list": [
+      {
+        "name": "ts",
+        "pathName": "views/Free",
+        "query": "",
+        "id": 0
+      }
+    ]
   }
 }

+ 1 - 1
src/api/index.js

@@ -24,7 +24,7 @@ export const getCategory = () => {
 }
 
 // 获取书库
-export const getBooksList = params => {
+export const booksList = params => {
   return fly.get('/books/library', params)
 }
 

+ 6 - 5
src/assets/less/category.less

@@ -1,10 +1,11 @@
+@import "./global.less";
 .category-wrap {
   background-color: #fff;
   flex-direction: column;
   height: 100%;
   .page_title {
     height: 112px;
-    background-color: #BD8757;
+    background-color: @theme;
     text {
       padding: 0 30px;
       font-size: 36px;
@@ -29,14 +30,14 @@
           color: #999999;
         }
         .cur_bar {
-          color: #BD8757;
+          color: @theme;
           font-size: 36px;
           font-weight: bold;
         }
         .choose-bar {
           width: 38px;
           height: 4px;
-          background-color: #BD8757;
+          background-color: @theme;
           border-radius: 2px;
           margin-top: 10px;
         }
@@ -116,8 +117,8 @@
 
       & .cur {
         font-weight: bold;
-        color: #BD8757;
-        border: 1px solid #BD8757;
+        color: @theme;
+        border: 1px solid @theme;
       }
     }
   }

+ 11 - 4
src/components/yinsi/policy.ux

@@ -4,10 +4,11 @@
         <text
           style="font-weight: 400;margin-top: 40px;text-indent:60px;margin-left: 20px;margin-right: 20px"
           >欢迎使用{{app_name}}~你需要阅读并同意<a
-            style="color: #79BA70;"
+            class="text-style"
             @click="gotoPrivacy"
             >《隐私政策》</a
-          >和<a style="color: #79BA70" @click="gotoRouter">《用户协议》</a
+            
+          >和<a  class="text-style" @click="gotoRouter">《用户协议》</a
           >方可使用{{app_name}}提供的阅读服务,是否同意?</text
         >
 
@@ -57,7 +58,13 @@ export default {
   }
 }
 </script>
-<style>
+
+<style lang="less">
+  @import "../../assets/less/global.less";
+.text-style{
+    color:@theme;
+}
+
 .label {
   justify-content: center;
   align-items: center;
@@ -78,7 +85,7 @@ export default {
   height: 80px;
   text-align: center;
   border-bottom-right-radius: 30px;
-  background-color: #79BA70;
+  background-color: @theme;
   color: white;
 }
 .cancel {

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

@@ -3,7 +3,6 @@
 
 <template>
   <div class="category-wrap">
-    <div class="page_title"><text>分类</text></div>
     <div class="tab_bar">
       <div class="filter-item">
         <div class="filter-item__list">
@@ -20,30 +19,12 @@
               ></text>
             </div>
           </block>
-          <div class="filter-item_warp" @click="toPage('Free')">
-            <text>限时免费</text>
-          </div>
         </div>
       </div>
     </div>
 
     <list class="list-content" @scrollbottom="onReachBottom">
-      <!-- <list-item type="tab" class="tab_bar"> </list-item> -->
-
-      <!-- <list-item type="search" class="search-bar">
-        <div class="search-bar__wrap">
-          <input
-            id="search"
-            type="text"
-            enterkeytype="search"
-            placeholder="请输入书名或者作者"
-            @enterkeyclick="bookSearch"
-          />
-          <image
-            src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/img/search.png"
-          ></image>
-        </div>
-      </list-item> -->
+   
       <list-item type="filter" class="filter-wrap">
         <div class="filter-item">
           <!-- <text class="filter-item__name">类型</text> -->
@@ -84,24 +65,17 @@
             <div class="book-info">
               <text class="name">{{ $item.book_name }}</text>
               <text class="intro">{{ $item.book_summary }}</text>
-              <!-- <text class="status">豪门虐情 完结</text>
-              <text class="words">字数:1231231</text>
-              <div class="update">
-                <text>最新:</text>
-                <text class="lastest">第213章 我是最后一章</text>
-                <image src="../../assets/imgs/book-vip.png"></image>
-              </div> -->
             </div>
           </x-book>
         </list-item>
       </block>
-      <list-item style="height:120px;"></list-item>
+      <list-item onappear="getBooksList" style="height:120px;"></list-item>
     </list>
   </div>
 </template>
 
 <script>
-import { getCategory, getBooksList } from '../../api'
+import { getCategory, booksList } from '../../api'
 import { pageLoad } from '../../helper'
 import storage from '@system.storage'
 import router from '@system.router'
@@ -127,7 +101,7 @@ export default {
         category_id: '',
         order_field: 'recommend_index',
         order_seq: 'asc',
-        page_size: 100,
+        page_size: 10,
         page: 1,
         status: 1
       },
@@ -138,13 +112,13 @@ export default {
   },
   onReachBottom() {
     // 请求更多数据
-    this.getBooksArray()
+    this.getBooksList()
   },
   async getCategory() {
     this.category = this.initCategory(await getCategory())
     console.log("this.category:", this.category);
     await this.initChannel(this.category)
-    this.getBooksArray()
+    this.getBooksList()
   },
   async initChannel(category) {
     this.filter.channel_id = +(await storage.get({ key: 'sex' })).data
@@ -171,14 +145,14 @@ export default {
     this.filter[field] = value
     if (field === 'channel_id')
       this.filter.category_id = this.category[value].id
-    this.getBooksArray(false)
+    this.getBooksList(false)
   },
   bookSearch(iptValue) {
     this.filter.key = iptValue.value
-    this.getBooksArray(false)
+    this.getBooksList(false)
     this.$element('search').focus({ focus: false })
   },
-  getBooksArray(isLoad = true) {
+  getBooksList(isLoad = true) {
     this.empty = false
     this.loadingText = '加载ing...'
     this.filter.page = (this.meta.current_page || 0) + 1
@@ -187,7 +161,7 @@ export default {
       this.meta = {}
     }
     let params = this.filter
-    pageLoad(this.meta, getBooksList, params)
+    pageLoad(this.meta, booksList, params)
       .then(ret => {
         let newList = isLoad ? this.list : []
         let dataList = ret.list

+ 1 - 109
src/views/Free/index.ux

@@ -93,113 +93,5 @@ export default {
 </script>
 
 <style lang="less">
-.free-title {
-  margin: 30px 0;
-  justify-content: center;
-  text {
-    width: 600px;
-    height: 60px;
-    line-height: 60px;
-    text-align: center;
-    background-color: rgba(239, 89, 82, 0.1);
-    border: 1px solid rgba(239, 89, 82, 1);
-    color: #ef5952;
-    font-size: 26px;
-    border-radius: 30px;
-  }
-}
-.book-list__wrap {
-  background-color: #fff;
-  // margin-top: 24px;
-  padding: 0 24px;
-  flex-direction: column;
-
-  .book-list__title {
-    padding: 30px 0;
-    align-items: center;
-
-    text {
-      color: #333;
-      font-size: 32px;
-    }
-  }
-}
-
-.book-list {
-  flex: 1;
-  flex-direction: row;
-  flex-wrap: wrap;
-  justify-content: space-between;
-}
-.book-list__multi {
-  margin-top: 30px;
-  flex-direction: column;
-
-  .book-item {
-    margin-bottom: 30px;
-  }
-
-  .book-info__multi {
-    flex: 1;
-    flex-direction: column;
-    justify-content: flex-start;
-    align-items: flex-start;
-    margin-left: 38px;
-    // margin-bottom: 40px;
-
-    .name {
-      font-size: 32px;
-      color: #333;
-      lines: 1;
-      text-overflow: ellipsis;
-    }
-
-    .intro {
-      font-size: 24px;
-      color: #666;
-      lines: 3;
-      text-overflow: ellipsis;
-      margin-top: 36px;
-      line-height: 36px;
-    }
-  }
-}
-.blank_img {
-  width: 100%;
-  height: 100%;
-  align-items: center;
-  justify-content: center;
-  image {
-    width: 500px;
-  }
-}
-.type-bar {
-  width: 100%;
-  .type-item {
-    flex: 1;
-    justify-content: center;
-    align-items: center;
-    flex-direction: column;
-    position: relative;
-    text {
-      font-size: 30px;
-      color: #E5401C;
-      // padding: 34px 0;
-    }
-
-    .cur {
-      color: #E5401C;
-      font-size: 36px;
-      font-weight: bold;
-    }
-
-    .choose-bar {
-      width: 38px;
-      height: 4px;
-      background-color: #E5401C;
-      border-radius: 2px;
-      margin-top: 10px;
-    }
-  }
-}
+@import './style.less';
 </style>

+ 109 - 0
src/views/Free/style.less

@@ -0,0 +1,109 @@
+@import url('../../assets/less/global.less');
+.free-title {
+    margin: 30px 0;
+    justify-content: center;
+    text {
+      width: 600px;
+      height: 60px;
+      line-height: 60px;
+      text-align: center;
+      background-color: rgba(178, 245, 115, 0.1);
+      border: 1px solid  @theme;;
+      color:  @theme;
+      font-size: 26px;
+      border-radius: 30px;
+    }
+  }
+  .book-list__wrap {
+    background-color: #fff;
+    // margin-top: 24px;
+    padding: 0 24px;
+    flex-direction: column;
+  
+    .book-list__title {
+      padding: 30px 0;
+      align-items: center;
+  
+      text {
+        color: #333;
+        font-size: 32px;
+      }
+    }
+  }
+  
+  .book-list {
+    flex: 1;
+    flex-direction: row;
+    flex-wrap: wrap;
+    justify-content: space-between;
+  }
+  .book-list__multi {
+    margin-top: 30px;
+    flex-direction: column;
+  
+    .book-item {
+      margin-bottom: 30px;
+    }
+  
+    .book-info__multi {
+      flex: 1;
+      flex-direction: column;
+      justify-content: flex-start;
+      align-items: flex-start;
+      margin-left: 38px;
+      // margin-bottom: 40px;
+  
+      .name {
+        font-size: 32px;
+        color: #333;
+        lines: 1;
+        text-overflow: ellipsis;
+      }
+  
+      .intro {
+        font-size: 24px;
+        color: #666;
+        lines: 3;
+        text-overflow: ellipsis;
+        margin-top: 36px;
+        line-height: 36px;
+      }
+    }
+  }
+  .blank_img {
+    width: 100%;
+    height: 100%;
+    align-items: center;
+    justify-content: center;
+    image {
+      width: 500px;
+    }
+  }
+  .type-bar {
+    width: 100%;
+    .type-item {
+      flex: 1;
+      justify-content: center;
+      align-items: center;
+      flex-direction: column;
+      position: relative;
+      text {
+        font-size: 30px;
+        color: @theme;
+      }
+  
+      .cur {
+        color:  @theme;
+        font-size: 36px;
+        font-weight: bold;
+      }
+  
+      .choose-bar {
+        width: 38px;
+        height: 4px;
+        background-color: @theme;
+        border-radius: 2px;
+        margin-top: 10px;
+      }
+    }
+  }

+ 2 - 19
src/views/Home/index.ux

@@ -2,7 +2,6 @@
 
 <template>
   <div class="home-wrap">
-    <!-- <div class="home_title"><text>精选</text></div> -->
     <div class="home_title">
       <div class="type-wrap_content">
         <div class="type-wrap">
@@ -14,26 +13,10 @@
               <text class="choose-bar" show="{{type.index === current}}"></text>
             </div>
           </block>
-          <!-- <text class="feebar-text"  @click="toPage('Free')">限时免费</text> -->
         </div>
-        <!-- <div class="search-bar">
-          <div class="search-bar__wrap">
-            <text @click="toCategory">请输入书名或者作者名</text
-            ><image
-              src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/img/search.png"
-            ></image>
-          </div>
-        </div> -->
+      
       </div>
     </div>
-    <!-- <div class="type-bar">
-      <div class="search-bar__wrap">
-        <text @click="toCategory">请输入书名或者作者名</text
-        ><image
-          src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/img/search.png"
-        ></image>
-      </div>
-    </div> -->
     <list class="list-content">
       <list-item type="swipe" class="swipe-bar">
         <swiper class="swipe-bar" autoplay="true" indicator="false">
@@ -64,7 +47,7 @@
       </list-item>
 
       <block for="bookObj in list">
-        <list-item type="simple" class="book-list__wrap" if="$idx % 2 === 0">
+        <list-item type="simple" class="book-list__wrap" if="$idx % 2 === 1">
           <div class="book-list_content">
             <div class="book-list__title">
               <text class="border"></text>

+ 1 - 33
src/views/Task/index.ux

@@ -1,21 +1,6 @@
 <import name="x-book" src="../../components/book/book.ux"></import>
 <template>
-  <div class="task-page">
-    <div class="task-banner">
-      <div class="swiper-container">
-        <swiper class="swipe-bar" autoplay="true" indicator="false">
-          <block for="book in bannerList">
-            <div class="swipe-item">
-              <image
-                class="cover"
-                src="{{book.banner_url}}"
-                @click="pageRouter(book)"
-              ></image>
-            </div>
-          </block>
-        </swiper>
-      </div>
-    </div>
+  <div class="task-page">   
     <div class="sign-section">
       <div class="sign-title" @click="showRules">
         <text>已连续签到{{ signData.signDay }}天</text>
@@ -186,17 +171,6 @@ export default {
   onShow() {
     this.getTaskList()
   },
-  // async getRordList() {
-  // 	getReadrecord().then(r => {
-  // 		r.map(m => {
-  // 			m.cover_url = m.cover
-  // 			m.recent_cid = m.cid
-  // 			delete m.cover
-  // 			delete m.cid
-  // 		})
-  // 		r.length > 3 ? this.mockList = r.slice(0, 3) : this.mockList = r;
-  // 	})
-  // },
   async getBook() {
     let bookList = await taskBook()
     this.bannerList = bookList
@@ -227,9 +201,6 @@ export default {
     this.dayList = dayList
     this.newList = newList
   },
-  // changeTab(type) {
-  // 	this.type = type;
-  // },
   closeRule() {
     this.showRule = false
   },
@@ -325,7 +296,6 @@ export default {
       try{
         let page = router.getState();
         let allPage = router.getPages();
-        // console.log('page = ',page,'all pages',allPage,'length',allPage.length);
         for(var k = allPage.length -1; k >=  0;k--){
           if(allPage[k].name != page.name && allPage[k].name != "views/Phone" && allPage[k].name != "views/Pay" && allPage[k].name != "views/Activity"){
             backPage = allPage[k];
@@ -334,9 +304,7 @@ export default {
         }
       } catch(e){
         backPage = {};
-        // console.log('back err',e);
       }
-      // console.log(backPage,backPage.length,typeof backPage);
       if(JSON.stringify(backPage) === '{}'){
          router.replace({ uri: "/views/Index" });
       }else{