XiaBx 3 年 前
コミット
a67a1be6d1

+ 0 - 65
.eslintrc.json

@@ -1,65 +0,0 @@
-{
-  "env": {
-    "commonjs": true
-  },
-  "extends": "eslint:recommended",
-  "parser": "babel-eslint",
-  "parserOptions": {
-    "sourceType": "module",
-    "ecmaFeatures": {
-      "experimentalObjectRestSpread": true,
-      "jsx": true
-    }
-  },
-  "globals": {
-    "loadData": false, 
-    "saveData": false,
-    "history": false,
-    "console": false,
-    "setTimeout": false,
-    "clearTimeout": false,
-    "setInterval": false,
-    "clearInterval": false
-  },
-  "plugins": [
-    "hybrid"
-  ],
-  "rules": {
-    "indent": [
-      "warn",
-      2
-    ],
-    "no-console": [
-      "warn",
-      {
-        "allow": [
-          "info",
-          "warn",
-          "error"
-        ]
-      }
-    ],
-    "no-unused-vars": [
-      "warn",
-      {
-        "varsIgnorePattern": "prompt"
-      }
-    ],
-    "quotes": [
-      "warn",
-      "single",
-      {
-        "avoidEscape": true,
-        "allowTemplateLiterals": true
-      }
-    ],
-    "linebreak-style": [
-      "warn",
-      "unix"
-    ],
-    "semi": [
-      "warn",
-      "never"
-    ]
-  }
-}

+ 0 - 8
babel.config.js

@@ -1,8 +0,0 @@
-module.exports = function(api) {
-  api.cache(true)
-  return {
-    presets: ['@babel/preset-env'],
-    plugins: ['@babel/plugin-transform-modules-commonjs'],
-    babelrcRoots: ['.', 'node_modules']
-  }
-}

+ 0 - 8
babel.config.old.20191028_165807.js

@@ -1,8 +0,0 @@
-module.exports = function(api) {
-  api.cache(true)
-  return {
-    presets: ['@babel/preset-env'],
-    plugins: ['@babel/plugin-transform-modules-commonjs'],
-    babelrcRoots: ['.', 'node_modules']
-  }
-}

BIN
fa-toolkit-2.6.0-Stable.301.tgz


BIN
node_modules.zip


ファイルの差分が大きいため隠しています
+ 1357 - 5770
package-lock.json


+ 35 - 18
package.json

@@ -2,35 +2,52 @@
   "name": "zsy_quick_app",
   "version": "1.0.0",
   "description": "",
-  "subversion": {
-    "toolkit": "0.2.2"
-  },
   "scripts": {
+    "start": "hap server --watch",
+    "server": "hap server",
     "build": "hap build",
     "release": "hap release",
-    "server": "hap server",
     "watch": "hap watch",
-    "postinstall": "hap postinstall",
     "debug": "hap debug",
-    "hap-update": "hap update",
-    "fa-build": "node node_modules/webpack/bin/webpack.js --config ./node_modules/fa-toolkit/webpack.config.js",
-    "fa-watch": "node node_modules/webpack/bin/webpack.js --watch --config ./node_modules/fa-toolkit/webpack.config.js",
-    "fa-release": "node ./node_modules/cross-env/src/bin/cross-env.js uglifyjs=true sign=release node_modules/webpack/bin/webpack.js --config ./node_modules/fa-toolkit/webpack.config.js"
+    "gen": "node ./scripts/gen/index.js",
+    "precommit-msg": "echo '🚧 start pre-commit checks ...' && exit 0",
+    "prettier": "node ./scripts/selfCloseInputTag.js && prettier --write \"src/**/*.{js,ux,less,scss,css}\"",
+    "prettier-watcher": "onchange '**/*.md' \"src/**/**/*.{js,ux,less,scss,css}\" -- prettier --write {{changed}}"
   },
   "devDependencies": {
+    "@babel/runtime": "^7.12.5",
     "@types/quickapp": "npm:quickapp-interface@^1.0.0",
-    "babel-eslint": "^10.0.1",
-    "cross-env": "^7.0.2",
-    "eslint": "^5.12.1",
-    "eslint-plugin-hybrid": "0.0.5",
-    "less": "^3.10.3",
-    "less-loader": "^5.0.0",
-    "sass-loader": "^8.0.2"
+    "colors": "^1.4.0",
+    "husky": "^4.3.0",
+    "less": "^4.1.2",
+    "less-loader": "^10.2.0",
+    "lint-staged": "^10.5.1",
+    "onchange": "^5.2.0",
+    "prettier": "^1.15.3",
+    "prettier-plugin-ux": "^0.3.0"
   },
   "dependencies": {
-    "flyio": "^0.6.14",
-    "hap-toolkit": "0.7.1"
+    "flyio": "^0.6.14"
+  },
+  "prettier": {
+    "singleQuote": true,
+    "semi": false,
+    "printWidth": 80,
+    "proseWrap": "never",
+    "tabWidth": 2
+  },
+  "husky": {
+    "hooks": {
+      "pre-commit": "yarn run precommit-msg && lint-staged"
+    }
+  },
+  "lint-staged": {
+    "**/**.{ux,js,json,pcss,md,vue}": [
+      "prettier --write",
+      "git add"
+    ]
   },
+  "keywords": [],
   "browserslist": [
     "chrome 65"
   ]

+ 8 - 0
sitemap.json

@@ -0,0 +1,8 @@
+{
+  "rules": [
+    {
+      "rule": "enable",
+      "page": "*"
+    }
+  ]
+}

+ 9 - 9
src/components/book/book.ux

@@ -34,7 +34,7 @@
 </template>
 
 <script>
-import router from "@system.router";
+import router from '@system.router'
 
 export default {
   props: {
@@ -87,30 +87,30 @@ export default {
     }
   },
   getBooks(book) {
-    if (this.prevent) return;
-    console.log("click_book", book);
+    if (this.prevent) return
+
     if (this.read) {
       router.push({
-        uri: "/views/Reader",
+        uri: '/views/Reader',
         params: {
           bid: book.book_id,
           chapter_id: book.recent_cid
         }
       })
-      return;
+      return
     }
     if (this.similar) {
       router.replace({
-        uri: "/views/Detail",
+        uri: '/views/Detail',
         params: {
-          bid: book.book_id || ""
+          bid: book.book_id || ''
         }
       })
     } else {
       router.push({
-        uri: "/views/Detail",
+        uri: '/views/Detail',
         params: {
-          bid: book.book_id || ""
+          bid: book.book_id || ''
         }
       })
     }

+ 74 - 76
src/helper/interface.js

@@ -1,185 +1,183 @@
-import app from "@system.app";
-import device from "@system.device";
-import prompt from "@system.prompt";
-import shortcut from "@system.shortcut";
-import router from "@system.router";
-import push from '@service.push';
+import app from '@system.app'
+import device from '@system.device'
+import prompt from '@system.prompt'
+import shortcut from '@system.shortcut'
+import router from '@system.router'
+import push from '@service.push'
 
-const SHORT_CUT_FORBIDDEN_INFO = "User forbidden";
+const SHORT_CUT_FORBIDDEN_INFO = 'User forbidden'
 
 // 获取设备信息
 const getDeviceInfo = () => {
   device.getDeviceId({
     success: ret => {
-      console.log(ret);
+      console.log(ret)
     }
-  });
-};
+  })
+}
 
 //获取订阅推送
 const getPushRedId = fn => {
   push.subscribe({
     success: ret => {
-      fn && fn(ret.regId);
+      fn && fn(ret ? ret.regId : '')
     }
-  });
-};
+  })
+}
 
 //获取应用信息
 const getAppInfo = () => {
-  const appInfo = app.getInfo();
-  return appInfo;
-};
+  const appInfo = app.getInfo()
+  return appInfo
+}
 
 //获取provider
 const getProvider = () => {
-  const provider = push.getProvider();
-  return provider;
-};
+  const provider = push.getProvider()
+  return provider
+}
 
 //获取设备明细
 const getAppDev = fn => {
   device.getInfo({
     success: ret => {
-      fn && fn(ret);
+      fn && fn(ret)
     }
-  });
-};
+  })
+}
 //校验手机号
 const validatePhone = phone => {
-  const VALIDATE_REG = /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[0-9]|18[0-9]|14[57]|19[89])[0-9]{8}$/;
-  const isMobile = VALIDATE_REG.test(phone);
-  return isMobile;
-};
+  const VALIDATE_REG = /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[0-9]|18[0-9]|14[57]|19[89])[0-9]{8}$/
+  const isMobile = VALIDATE_REG.test(phone)
+  return isMobile
+}
 //获取是否创建图标
 const getShortCut = fn => {
   shortcut.hasInstalled({
     success: ret => {
-      fn(ret);
+      fn(ret)
     }
-  });
-};
+  })
+}
 // 判断用户是否创建图标
 const hasCreateShortCut = (isPayPage = false, fn) => {
   shortcut.hasInstalled({
     success: ret => {
       if (!ret) {
         shortcut.install({
-          message: "添加【追书云】到桌面,方便下次阅读",
+          message: '添加【追书云】到桌面,方便下次阅读',
           success: () => {
-            prompt.showToast("添加成功!");
-            fn && fn(true);
+            prompt.showToast('添加成功!')
+            fn && fn(true)
           },
           fail: code => {
-            fn && fn(false);
-            if (code === SHORT_CUT_FORBIDDEN_INFO && !isPayPage) app.exit();
+            fn && fn(false)
+            if (code === SHORT_CUT_FORBIDDEN_INFO && !isPayPage) app.exit()
           }
-        });
+        })
       } else {
-        fn && fn(false);
+        fn && fn(false)
       }
     }
-  });
-};
+  })
+}
 
 //弱加桌
-const loseLevelShortCut = (fn) =>{
+const loseLevelShortCut = fn => {
   shortcut.hasInstalled({
     success: ret => {
       if (!ret) {
         shortcut.install({
-          message: "添加【追书云】到桌面,方便下次阅读",
+          message: '添加【追书云】到桌面,方便下次阅读',
           complete: () => {
-            fn && fn(true);
-          },
-        });
+            fn && fn(true)
+          }
+        })
       } else {
-        fn && fn(false);
+        fn && fn(false)
       }
     }
-  });
+  })
 }
 
 //强制加桌
-const mustCreateShort = (fn) => {
+const mustCreateShort = fn => {
   shortcut.hasInstalled({
     success: ret => {
       if (!ret) {
         shortcut.install({
-          message: "添加【追书云】到桌面,方便下次阅读",
+          message: '添加【追书云】到桌面,方便下次阅读',
           success: () => {
-            prompt.showToast("添加成功!");
-            fn && fn(true);
+            prompt.showToast('添加成功!')
+            fn && fn(true)
           },
           fail: code => {
-            fn && fn(false,code);
-            prompt.showToast("取消操作");
+            fn && fn(false, code)
+            prompt.showToast('取消操作')
           }
-        });
+        })
       } else {
-        fn && fn(false);
+        fn && fn(false)
       }
     }
-  });
-
+  })
 }
 
 //用于返回时提醒加桌
-const backCreateShortCut = (fn) => {
+const backCreateShortCut = fn => {
   shortcut.hasInstalled({
     success: ret => {
       if (!ret) {
         shortcut.install({
-          message: "添加【追书云】到桌面,方便下次阅读",
+          message: '添加【追书云】到桌面,方便下次阅读',
           success: () => {
-            prompt.showToast("添加成功!");
+            prompt.showToast('添加成功!')
             fn && fn('back')
           },
           fail: code => {
             console.log('我失败了我失败了')
             fn && fn('back')
           }
-        });
+        })
       } else {
         fn && fn('back')
       }
     }
-  });
-};
-
+  })
+}
 
 // 右上角菜单点击
 const showMenu = () => {
-  const appInfo = app.getInfo();
+  const appInfo = app.getInfo()
   prompt.showContextMenu({
-    itemList: ["保存桌面", "关于", "取消"],
-    success: function (ret) {
+    itemList: ['保存桌面', '关于', '取消'],
+    success: function(ret) {
       switch (ret.index) {
         case 0:
           // 保存桌面
-          hasCreateShortCut();
-          break;
+          hasCreateShortCut()
+          break
         case 1:
           // 关于
           router.push({
-            uri: "/views/About",
+            uri: '/views/About',
             params: {
               name: appInfo.name,
               icon: appInfo.icon
             }
-          });
-          break;
+          })
+          break
         case 2:
           // 取消
-          break;
+          break
         default:
           prompt.showToast({
-            message: "错误"
-          });
+            message: '错误'
+          })
       }
     }
-  });
-};
+  })
+}
 
 export default {
   shortcut,
@@ -195,4 +193,4 @@ export default {
   getProvider,
   mustCreateShort,
   loseLevelShortCut
-};
+}

ファイルの差分が大きいため隠しています
+ 8 - 6
src/manifest.json


+ 172 - 111
src/views/Activity/index.ux

@@ -1,25 +1,44 @@
 <import name="x-page" src="../../components/page/page.ux"></import>
 <template>
   <div class="consume-record__wrap">
-    <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="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">
-        <text class="promotion-title" if="{{activity.isForever!='1'}}">活动时间:{{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)">
+        <text class="promotion-title" if="{{activity.isForever!='1'}}"
+          >活动时间:{{ 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="limit {{currentIdx==$idx?'checked':''}}">限充{{$item.limit}}次</text>
+            <text class="limit {{currentIdx==$idx?'checked':''}}"
+              >限充{{ $item.limit }}次</text
+            >
             <text class="title"><span>365包年</span></text>
             <text class="desc">全站小说免费阅读</text>
           </block>
           <block elif="{{$item.type=='QUARTER'}}">
-             <text class="limit {{currentIdx==$idx?'checked':''}}">限充{{$item.limit}}次</text>
+            <text class="limit {{currentIdx==$idx?'checked':''}}"
+              >限充{{ $item.limit }}次</text
+            >
             <text class="title"><span>98元包季</span></text>
             <text class="desc">全站小说免费阅读</text>
           </block>
           <block else>
-            <text class="limit {{currentIdx==$idx?'checked':''}}">限充{{$item.limit}}次</text>
-            <text class="title">充<span>{{$item.price}}元</span>得<span>{{$item.total}}书币</span></text>
-            <text class="desc">多得{{$item.given}}书币</text>
+            <text class="limit {{currentIdx==$idx?'checked':''}}"
+              >限充{{ $item.limit }}次</text
+            >
+            <text class="title"
+              >充<span>{{ $item.price }}元</span>得<span
+                >{{ $item.total }}书币</span
+              ></text
+            >
+            <text class="desc">多得{{ $item.given }}书币</text>
           </block>
         </div>
 
@@ -33,30 +52,57 @@
         <text>2.书币为虚拟物品,一经充值不得退款</text>
       </div>
     </div>
-   <!--  <div class="loading-wrap" if="showLoading">
+    <!--  <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="mask" if="{{showPay}}" @click="closeMask">
       <div class="pop-pay">
-        <div class="title-pay"><text class="index"></text><text>支付方式</text>
+        <div class="title-pay">
+          <text class="index"></text><text>支付方式</text>
           <image src="../../assets/imgs/close.png" @click="closeMask"></image>
         </div>
-        <div class="pay-item" @click="changePayType(0)" if="{{activity.payChannels.wechat=='1'}}">
+        <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>
+            <image src="../../assets/imgs/wechat.png"></image
+            ><text>微信支付</text>
           </div>
-          <image src="../../assets/imgs/pay_checked.png" class="checked" if={{!payType}}></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>
+          <image
+            src="../../assets/imgs/rank_grey.png"
+            class="checked"
+            if="{{payType}}"
+          ></image>
         </div>
-        <div class="pay-item" @click="changePayType(1)" if="{{activity.payChannels.ali=='1'}}">
+        <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>
+            <image src="../../assets/imgs/zfb.png"></image
+            ><text>支付宝支付</text>
           </div>
-          <image src="../../assets/imgs/rank_grey.png" class="checked" if={{!payType}}></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>
+          <image
+            src="../../assets/imgs/pay_checked.png"
+            class="checked"
+            if="{{payType}}"
+          ></image>
         </div>
         <text class="charge-now" @click="goPay">确认充值</text>
       </div>
@@ -64,78 +110,82 @@
   </div>
 </template>
 <script>
-
-import { configWxPay, configAliPay } from "../../helper";
-import { getAcitivity, getUserInfo, checkWxOrder } from "../../api";
-import { getAppConfig, getToken } from '../../api/utils';
-import router from '@system.router';
-import prompt from '@system.prompt';
+import { configWxPay, configAliPay } from '../../helper'
+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: '',
+    token: '',
+    send_order_id: ''
   },
   private: {
     showPay: false,
     activity: null,
     payType: 0,
     currentProduct: null,
-    currentIdx:0,
-    showLoading: false,
+    currentIdx: 0,
+    showLoading: false
   },
   onInit() {
     //getAppConfig(this);
-    this.getUserInfo();
-    setTimeout(()=>{
-      this.getAcitvy();
-    },1000)
-    
-    
+    this.getUserInfo()
+    setTimeout(() => {
+      this.getAcitvy()
+    }, 1000)
   },
-  changePayType(type,evt) {
-    evt.stopPropagation();
-    this.payType = type;
-    return false;
+  changePayType(type, evt) {
+    evt.stopPropagation()
+    this.payType = type
+    return false
   },
   closeMask() {
-    this.showPay = false;
+    this.showPay = false
   },
   async getAcitvy() {
-    let activity = await getAcitivity(this.token);
-     this.activity = activity;
-    this.currentProduct = this.activity.products[0];
+    let activity = await getAcitivity(this.token)
+    this.activity = activity
+    this.currentProduct = this.activity.products[0]
   },
   wantCharge() {
-    this.showPay = true;
+    this.showPay = true
   },
   async getUserInfo() {
-    let userinfo = await getUserInfo();
-    this.send_order_id = userinfo.send_order_id || this.send_order_id;
+    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;
+  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;
+    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, activity_token:this.token });
-    }
-    else {
-      ret = await configWxPay({ product_id: product_id, send_order_id: this.send_order_id,  activity_token:this.token});
+      ret = await configAliPay({
+        product_id: product_id,
+        send_order_id: this.send_order_id,
+        activity_token: this.token
+      })
+    } else {
+      ret = await configWxPay({
+        product_id: product_id,
+        send_order_id: this.send_order_id,
+        activity_token: this.token
+      })
     }
     // 成功支付后的回调操作
-    if (ret.code === "9000") this.showWaitingWrap(ret);
-    else this.showToastByCode(ret.code);
+    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.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");
@@ -146,57 +196,68 @@ export default {
         if (fb && typeof fb === "object") clearInterval(this.timer), this.showToastByCode("9000");
       }
     }, 1000); */
-    setTimeout(()=>{
+    setTimeout(() => {
       if (router.getLength() === 1) {
-			router.replace({ uri: "/views/Index" });
-			return true;
-		} else {
-			router.back()
-		}
-    },2000)
+        router.replace({ uri: '/views/Index' })
+        return true
+      } else {
+        router.back()
+      }
+    }, 2000)
   },
   showToastByCode(code) {
-    this.showLoading = false;
-    let msg = "支付成功!";
+    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;
+      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 });
-    
 
+    prompt.showToast({ message: msg })
   },
   showWaitingWrap(order) {
     prompt.showDialog({
-      title: "支付结果",
-      message: "请确认支付结果",
+      title: '支付结果',
+      message: '请确认支付结果',
       buttons: [
         {
-          text: "已支付",
-          color: "#EF5952"
+          text: '已支付',
+          color: '#EF5952'
         },
         {
-          text: "重新选择金额",
-          color: "#999"
+          text: '重新选择金额',
+          color: '#999'
         }
       ],
-      success: (data) => {
-        if (data.index === 0) this.checkOrder(order);
+      success: data => {
+        if (data.index === 0) this.checkOrder(order)
       },
       cancel: () => {
-        console.log("cancel");
+        console.log('cancel')
       }
-    });
-  },
-
-
+    })
+  }
 }
 </script>
 
@@ -257,7 +318,7 @@ export default {
       text {
         color: #333;
         font-weight: bold;
-        font-size: 32x;
+        font-size: 32px;
       }
       image {
         width: 30px;
@@ -272,25 +333,25 @@ export default {
   image {
     width: 100%;
   }
-  .charge-item{
+  .charge-item {
     position: relative;
-    .limit{
+    .limit {
       width: 100px;
       height: 38px;
       font-size: 20px;
       line-height: 38px;
       text-align: center;
-      background-color: #E6E6E6;
-      color: #B3B3B3;
+      background-color: #e6e6e6;
+      color: #b3b3b3;
       border-bottom-left-radius: 10px;
       border-top-right-radius: 10px;
       position: absolute;
-      right:0;
-      top:0;
+      right: 0;
+      top: 0;
     }
-    .checked{
-       color:#fff;
-      background-color: #E82B2F;
+    .checked {
+      color: #fff;
+      background-color: #e82b2f;
     }
   }
   .rule {
@@ -335,11 +396,11 @@ export default {
       margin-top: 20px;
       border-radius: 60px;
     }
-    
+
     .charge-item {
       width: 600px;
-      background-color:#fff;
-      border:1px solid #e6e6e6;
+      background-color: #fff;
+      border: 1px solid #e6e6e6;
       color: #333;
       flex-direction: column;
       text-align: center;
@@ -362,7 +423,7 @@ export default {
         margin-top: 5px;
       }
     }
-    .charge-on{
+    .charge-on {
       background-color: #ffe4c4;
       border: 1px solid #e82b2f;
     }
@@ -373,7 +434,7 @@ export default {
     bottom: 0;
     left: 0;
     right: 0;
-    background-color: rgba(0, 0, 0, .6);
+    background-color: rgba(0, 0, 0, 0.6);
     justify-content: center;
     align-items: center;
 

+ 128 - 100
src/views/Index/index.ux

@@ -8,8 +8,8 @@
   <stack class="stack-wrap">
     <div class="index-wrap">
       <tabs class="tab-content" onchange="tabbarChange" index="{{current}}">
-        <tab-content> 
-           <shelf-page @change="pageTohome" tabindex="{{current}}"></shelf-page>
+        <tab-content>
+          <shelf-page @change="pageTohome" tabindex="{{current}}"></shelf-page>
           <home-page @change="pageSwitch" tabindex="{{current}}"></home-page>
           <my-page @customer="openCustomer" tabindex="{{current}}"></my-page>
         </tab-content>
@@ -19,8 +19,13 @@
         <div class="tabbar-item__wrap">
           <block for="tab in tabbar">
             <div class="tabbar-item " @click="tabbarChange(tab)">
-              <image src="{{tab.index === current ? tab.active_icon : tab.icon}}"></image>
-              <text class="{{tab.index === current ? 'tabbar-name__cur' : ''}}">{{tab.name}}</text>
+              <image
+                src="{{tab.index === current ? tab.active_icon : tab.icon}}"
+              ></image>
+              <text
+                class="{{tab.index === current ? 'tabbar-name__cur' : ''}}"
+                >{{ tab.name }}</text
+              >
             </div>
           </block>
         </div>
@@ -28,10 +33,19 @@
     </div>
     <stack>
       <!-- <image src="../../assets/imgs/sign_show.png" class="sign-icon" @click="changeSignPop"> </image> -->
-      <image src="../../assets/imgs/rukou.png" class="sign-icon" @click="goTask" if="{{home_show}}"> </image>
+      <image
+        src="../../assets/imgs/rukou.png"
+        class="sign-icon"
+        @click="goTask"
+        if="{{home_show}}"
+      >
+      </image>
 
       <sign-page if="{{showSignPop}}"></sign-page>
-      <short-page if="{{!showActivitys && showShortPop}}" @addshort="shortEnd"></short-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>
@@ -39,36 +53,49 @@
             复制微信号或者保存二维码到本地至微信添加客服好友
           </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 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
+        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>
 
 <script>
-import clipboard from '@system.clipboard';
-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, getAppConfig } from '../../api/utils.js';
-import router from "@system.router";
-let getConfig;
+import clipboard from '@system.clipboard'
+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, getAppConfig } from '../../api/utils.js'
+import router from '@system.router'
+let getConfig
 export default {
   public: {
     curPage: 1,
     push_id: '',
     bid: '',
     chapter_id: '',
-    send_order_id: "",
+    send_order_id: '',
     link_url: ''
   },
   protected: {
@@ -77,28 +104,29 @@ export default {
   },
   home_alert: [],
   private: {
-    tabbar: [{
-      name: "书架",
-      title: "我的书架",
-      icon: "../../assets/imgs/shelf.png",
-      active_icon: "../../assets/imgs/shelf_choose.png",
-      index: 0
-    },
-    {
-      name: "精选",
-      title: "追书云",
-      icon: "../../assets/imgs/home.png",
-      active_icon: "../../assets/imgs/home_choose.png",
-      index: 1
-    },
+    tabbar: [
+      {
+        name: '书架',
+        title: '我的书架',
+        icon: '../../assets/imgs/shelf.png',
+        active_icon: '../../assets/imgs/shelf_choose.png',
+        index: 0
+      },
+      {
+        name: '精选',
+        title: '追书云',
+        icon: '../../assets/imgs/home.png',
+        active_icon: '../../assets/imgs/home_choose.png',
+        index: 1
+      },
 
-    {
-      name: "我的",
-      title: "个人中心",
-      icon: "../../assets/imgs/my.png",
-      active_icon: "../../assets/imgs/my_choose.png",
-      index: 2
-    }
+      {
+        name: '我的',
+        title: '个人中心',
+        icon: '../../assets/imgs/my.png',
+        active_icon: '../../assets/imgs/my_choose.png',
+        index: 2
+      }
     ],
     // current: 0,
     showPopup: false,
@@ -108,35 +136,35 @@ export default {
     home_show: 0,
     home_alert: null,
     back_alert: 0,
-    isInit: false,
+    isInit: false
   },
   async onInit() {
-    let isFromPush = false;
-    this.$on('dispathEvt', this.changeSignPop);
-    this.$watch('current', 'watchCurrent');
+    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 });
+      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 });
+      await storage.set({ key: 'send_order_id', value: this.send_order_id })
     }
     //今日已签到过不在弹框签到
 
     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');
+    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;
+      this.home_alert = home_alert[0]
+      this.showActivitys = true
     }
-    let { sign_out_app_show } = await getConfig('add_desk_alert');
-    this.back_alert = sign_out_app_show;
-    this.getCoustom();
-    this.getUser();
+    let { sign_out_app_show } = await getConfig('add_desk_alert')
+    this.back_alert = sign_out_app_show
+    this.getCoustom()
+    this.getUser()
   },
   goActicity() {
     router.push({
@@ -145,51 +173,52 @@ export default {
     })
   },
   showActivity() {
-    this.showActivitys = true;
+    this.showActivitys = true
   },
   closeAcitivity() {
-    this.showActivitys = false;
+    this.showActivitys = false
   },
   toMyRead(evt) {
     console.log(evt.detail.count)
   },
   async onShow() {
-    const hasInit = this.$app.getAppData('hasInit');
+    const hasInit = this.$app.getAppData('hasInit')
     if (hasInit) {
-      this.$broadcast('refreshData', { current: this.current });
+      this.$broadcast('refreshData', { current: this.current })
     }
-    it.getShortCut((value) => {
-      this.showShortPop = !value;
+    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) {
-      prompt.showToast({ message: "用户禁止创建" });
+      prompt.showToast({ message: '用户禁止创建' })
     } else if (value.detail.installed) {
-      prompt.showToast({ message: "添加桌面成功!请前往任务中心领取奖励" });
+      prompt.showToast({ message: '添加桌面成功!请前往任务中心领取奖励' })
     }
-    this.showShortPop = !value.detail.installed;
+    this.showShortPop = !value.detail.installed
   },
   watchCurrent(i) {
-    console.log("watching", i);
-    this.current = i;
+    console.log('watching', i)
+    this.current = i
   },
   async getUser() {
-    let user = await getUserInfo();
-    this.user = user;
-    this.isInit = true;
+    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,
+        send_order_id: this.send_order_id
       }
       setTimeout(() => {
         router.push({
@@ -197,8 +226,6 @@ export default {
           params: params
         })
       }, 800)
-
-
     }
   },
   goTask() {
@@ -209,63 +236,64 @@ export default {
   onBackPress() {
     // 退出逻辑
     if (this.$app.$def.data.backClickCount === 0 && this.back_alert == 1) {
-      this.$app.$def.data.backClickCount++;
-      this.$app.$def.createShortcut();
-      return true;
+      this.$app.$def.data.backClickCount++
+      this.$app.$def.createShortcut()
+      return true
     }
   },
 
-
   changeShortCut() {
-    this.showShortPop = false;
+    this.showShortPop = false
   },
   async getCoustom() {
-    userAddDsktop(this.$app.$def.data.backClickCount).then(res => {
-      //TODO 加桌后统计上报
-    }).catch(r => {
-      //TODO 失败后统计上报
-    });
-    let res = await getCustomQrcode();
-    this.cutomerQrcode = res.url;
-    this.cutomerName = res.name;
+    userAddDsktop(this.$app.$def.data.backClickCount)
+      .then(res => {
+        //TODO 加桌后统计上报
+      })
+      .catch(r => {
+        //TODO 失败后统计上报
+      })
+    let res = await getCustomQrcode()
+    this.cutomerQrcode = res.url
+    this.cutomerName = res.name
   },
   tabbarChange(tab) {
-    this.current = tab.index;
+    this.current = tab.index
     //this.$page.setTitleBar({ text: this.tabbar[tab.index].title });
   },
   pageSwitch() {
-    this.current = 0;
+    this.current = 0
   },
   pageTohome() {
-    this.current = 1;
+    this.current = 1
   },
   changeSignPop() {
-    this.showSignPop = !this.showSignPop;
+    this.showSignPop = !this.showSignPop
   },
   closeWrap() {
-    this.showPopup = false;
+    this.showPopup = false
   },
   //复制客服微信
   duplication() {
     clipboard.set({
       text: this.cutomerName,
-      success: function (data) {
+      success: function(data) {
         prompt.showToast({
           message: '复制成功!'
         })
-      },
+      }
     })
   },
   //长按保存图片
   saveImg() {
-    downImg(this.cutomerQrcode);
+    downImg(this.cutomerQrcode)
   },
   openCustomer() {
-    this.showPopup = true;
+    this.showPopup = true
   }
 }
 </script>
 
 <style lang="less">
-@import "../../assets/less/index.less";
+@import '../../assets/less/index.less';
 </style>

+ 41 - 40
src/views/Phone/index.ux

@@ -40,9 +40,9 @@
         @click="changeStatus()"
       ></image>
       <div class="agreement-text">
-        <text @click="changeStatus()">我已阅读并同意</text
-        ><text class="red" @click="pageChange('Agreement')">用户服务协议</text
-        ><text class="red" @click="pageChange('Privacy')">用户隐私政策</text>
+        <text @click="changeStatus()">我已阅读并同意</text>
+        <text class="red" @click="pageChange('Agreement')">用户服务协议</text>
+        <text class="red" @click="pageChange('Privacy')">用户隐私政策</text>
       </div>
     </div>
     <input
@@ -54,11 +54,11 @@
   </div>
 </template>
 <script>
-import it from '../../helper/interface.js';
-import { sendCode, userBind } from '../../api/index';
-import router from '@system.router';
-import prompt from '@system.prompt';
-import storage from '@system.storage';
+import it from '../../helper/interface.js'
+import { sendCode, userBind } from '../../api/index'
+import router from '@system.router'
+import prompt from '@system.prompt'
+import storage from '@system.storage'
 
 export default {
   private: {
@@ -68,22 +68,22 @@ export default {
     code: null,
     isOnBind: false,
     isOnsend: false,
-    checked: false,
-  },
-  onInit() {
-
+    checked: false
   },
+  onInit() {},
   async sendMsg() {
     if (this.isOnsend) {
-      return false;
+      return false
     }
-    this.isOnsend = true;
-    let result = it.validatePhone(this.mobile);
+    this.isOnsend = true
+    let result = it.validatePhone(this.mobile)
     if (result) {
-      let res = await sendCode({ phone: this.mobile }).catch((err) => { this.isOnsend = false });
+      let res = await sendCode({ phone: this.mobile }).catch(err => {
+        this.isOnsend = false
+      })
       if (res) {
-        this.isOnsend = false;
-        this.countDown();
+        this.isOnsend = false
+        this.countDown()
       }
     } else {
       prompt.showToast({
@@ -92,25 +92,25 @@ export default {
     }
   },
   updateMobile(e) {
-    this.mobile = e.value;
+    this.mobile = e.value
   },
   updateMessage(e) {
-    this.code = e.value;
+    this.code = e.value
   },
   changeStatus() {
-    this.checked = !this.checked;
+    this.checked = !this.checked
   },
   //倒计时
   countDown() {
-    this.hasSend = true;
+    this.hasSend = true
     let time = setInterval(() => {
-      this.duration--;
+      this.duration--
       if (this.duration < 1) {
-        clearInterval(time);
-        this.duration = 120;
-        this.hasSend = false;
+        clearInterval(time)
+        this.duration = 120
+        this.hasSend = false
       }
-    }, 1000);
+    }, 1000)
   },
   pageChange(page) {
     router.push({
@@ -128,42 +128,43 @@ export default {
       prompt.showToast({
         message: '请输入手机号和验证码'
       })
-      return false;
+      return false
     }
     if (!it.validatePhone(this.mobile)) {
       prompt.showToast({
         message: '手机号码格式不正确'
       })
-      return false;
+      return false
     }
     if (this.isOnBind) {
-      return false;
+      return false
     }
-    this.isOnBind = true;
+    this.isOnBind = true
     let params = {
       phone: this.mobile,
       code: this.code,
       version: '2.0'
     }
 
-    let res = await userBind(params).catch((err) => { this.isOnBind = false; });
+    let res = await userBind(params).catch(err => {
+      this.isOnBind = false
+    })
     if (res) {
-      this.isOnBind = false;
-      await storage.set({ key: "hasLogin", value: 'hasLogin' });
-      await storage.set({ key: "loginPhone", value: this.mobile });
+      this.isOnBind = false
+      await storage.set({ key: 'hasLogin', value: 'hasLogin' })
+      await storage.set({ key: 'loginPhone', value: this.mobile })
 
-      this.$app.setAppData('backfrom', 'phone');
+      this.$app.setAppData('backfrom', 'phone')
       prompt.showToast({
         message: '登录成功!'
       })
       setTimeout(() => {
-        router.back();
+        router.back()
       }, 1500)
     }
   }
-
 }
 </script>
 <style lang="less">
-@import "../../assets/less/phone.less";
-</style>
+@import '../../assets/less/phone.less';
+</style>

+ 21 - 45
src/views/Shelf/index.ux

@@ -1,15 +1,7 @@
 <import name="x-book" src="../../components/book/book.ux"></import>
- 
+
 <template>
   <div class="shelf-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> -->
     <div
       class="shelf-total {{current === 1 ? 'shelf-total__inRecent' : ''}}"
       if="{{mockList.length>0}}"
@@ -60,21 +52,7 @@
     </block>
     <block else>
       <list class="recent-list" if="{{mockList.length>0 && isinit}}">
-        <!-- <list-item type="recent-item" class="recent-item">
-            <stack>
-              <x-book multi="{{true}}" book='{{$item}}' read='{{true}}' width="{{150}}">
-                <div class="book-info__wrap">
-                  <text class="name">{{$item.book_name}}</text>
-                  <text class="lastest">最新 {{$item.last_chapter}}</text>
-                  <text class="last-read">最近阅读 {{$item.chapter_name}}</text>
-                </div>
-              </x-book>
-              <div class="book-del__item" show="{{isDelMode}}" @click='deleteBook($item)'>
-                <image src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/img/delete.png"></image>
-                <text>删除</text>
-              </div>
-            </stack>
-          </list-item> --><list-item type="recent-item" class="recent-item">
+        <list-item type="recent-item" class="recent-item">
           <div class="shelf-books__wrap">
             <block for="mockList">
               <div class="book-item__wrap {{(($idx + 1)%3 === 0) ? 'm0' : ''}}">
@@ -117,14 +95,14 @@
 </template>
 
 <script>
-import { getUserShelfBooks, deleteShelfBook, getReadrecord } from "../../api";
+import { getUserShelfBooks, deleteShelfBook, getReadrecord } from '../../api'
 
 export default {
   props: {
     tabindex: {
       type: Number,
       default: 0
-    },
+    }
   },
   data() {
     return {
@@ -132,27 +110,27 @@ export default {
       current: 1,
       isinit: false,
       isDelMode: false,
-      modeText: "管理",
+      modeText: '管理',
       mockList: [],
       booksize: 0,
       typeList: [
         {
-          name: "我的书架",
+          name: '我的书架',
           index: 0
         },
         {
-          name: "最近阅读",
+          name: '最近阅读',
           index: 1
         }
-      ],
+      ]
     }
   },
   onInit() {
-    console.log("tabindex:", this.tabindex);
+    console.log('tabindex:', this.tabindex)
     // this.getUserShelfBooks()
     this.$watch('isDelMode', 'listenMode')
-    this.$watch('tabindex', 'watchPropsChange');
-    this.$on('refreshData', this.broadevt);
+    this.$watch('tabindex', 'watchPropsChange')
+    this.$on('refreshData', this.broadevt)
   },
   watchPropsChange(newV, oldV) {
     if (newV == 0) {
@@ -167,7 +145,7 @@ export default {
   getUserShelfBooks(isDel = false) {
     getReadrecord().then(r => {
       if (!isDel) {
-        this.isDelMode = false;
+        this.isDelMode = false
       }
       r.map(m => {
         m.cover_url = m.cover
@@ -176,9 +154,9 @@ export default {
         delete m.cid
       })
       this.booksize = r.length
-      this.mockList = r;
-      this.isinit = true;
-      console.log(this.mockList);
+      this.mockList = r
+      this.isinit = true
+      console.log(this.mockList)
     })
   },
   deleteBook(book) {
@@ -187,22 +165,20 @@ export default {
     })
   },
   changeMode() {
-    this.isDelMode = !this.isDelMode;
+    this.isDelMode = !this.isDelMode
   },
   listenMode(v) {
-    this.modeText = v ? '' : '管理';
+    this.modeText = v ? '' : '管理'
   },
   toCategory() {
-    this.$emit('change');
-
+    this.$emit('change')
   },
   typeChange(index) {
-    this.current = index;
-  },
+    this.current = index
+  }
 }
 </script>
 
 <style lang="less">
-@import "../../assets/less/shelf.less";
+@import '../../assets/less/shelf.less';
 </style>
-

+ 322 - 284
src/views/Task/index.ux

@@ -1,294 +1,332 @@
 <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="sign-section">
-			<div class="sign-title" @click="showRules"><text>已连续签到{{signData.signDay}}天</text>
-				<image src="../../assets/imgs/question.png"></image>
-			</div>
-			<text class="sign-desc">连续签到可持续获得高额奖励</text>
-			<div class="sign-line">
-				<div class="sign-line__item " for="{{signList}}">
-					<div class="line__item_wrap">
-							<text class="sign-line__fee">+{{$item.fee}}</text>
-							<image src="../../assets/imgs/sign_{{$item.iconType}}.jpg"></image>
-					</div>
-					<text class="sign-line__day">{{$item.day}}天</text>
-				</div>
-			</div>
-			<text class="sign-button" @click="signToday" if="{{!signData.is_sign}}">
-				立即签到
-			</text>
-			<text class="sign-button-disabled" if="{{signData.is_sign}}">
-				已签到
-			</text>
-		</div>
-		<!-- <div class="reader-leaver">
-			<div class="l-top"><text class="l-title">最近阅读</text><text class="l-more" @click="goMore">查看更多记录></text></div>
-			<div class="recent-list">
-				<block for="book in mockList">
-					<x-book multi="{{false}}" width="{{180}}" lines="{{true}}" read='{{true}}' book="{{book}}">
-						<div class="read-recent"><text>{{book.chapter_name}}</text></div>
-					</x-book>
+  <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="sign-section">
+      <div class="sign-title" @click="showRules">
+        <text>已连续签到{{ signData.signDay }}天</text>
+        <image src="../../assets/imgs/question.png"></image>
+      </div>
+      <text class="sign-desc">连续签到可持续获得高额奖励</text>
+      <div class="sign-line">
+        <div class="sign-line__item " for="{{signList}}">
+          <div class="line__item_wrap">
+            <text class="sign-line__fee">+{{ $item.fee }}</text>
+            <image src="../../assets/imgs/sign_{{$item.iconType}}.jpg"></image>
+          </div>
+          <text class="sign-line__day">{{ $item.day }}天</text>
+        </div>
+      </div>
+      <text class="sign-button" @click="signToday" if="{{!signData.is_sign}}">
+        立即签到
+      </text>
+      <text class="sign-button-disabled" if="{{signData.is_sign}}">
+        已签到
+      </text>
+    </div>
 
-				</block>
-			</div>
-		</div> -->
-		<div class="task-section">
-			<!-- <div class="task-section__tab">
-				<text class="{{type=='new'?'on':''}}" @click="changeTab('new')">新手任务</text>
-				<text class="{{type=='day'?'on':''}}" @click="changeTab('day')">日常福利</text>
-			</div>
-			<div class="banner">
-				<image src="https://cdn-novel.iycdm.com/quickapp/task/day_task.png" show="{{type=='day'}}"></image>
-				<image src="https://cdn-novel.iycdm.com/quickapp/task/new_task.png" show="{{type=='new'}}"></image>
-			</div> -->
-		
-			<div class="task-section__list">
-				<text class="task-section__list_new" >新手必做任务</text>
-				<div class="list-item" for="{{newList}}" @click="compeletTask($item.status,$item.type,$item.id,$item.path)">
-				
-					<div class="content">		
-						<div><text>{{$item.name}}</text>
-							<div class="task-award">
-								<image src="../../assets/imgs/sign_coin.jpg"></image><text>+{{$item.value}}积分<text>
-							</div>
-						</div>
-					
-						<text class="content-desc">{{$item.desc}}</text>
-					</div>
-					<text class="button-status {{ $item.status==0 ? 'wait': ($item.status==1 ? 'get' : 'disabled') }}">
-						{{$item.status==0?'去完成':$item.status==1?'领取':'已领取'}}
-					</text>
-				</div>
-			</div>
-			<div class="task-section__list">
-				<text class="task-section__list_new" >日常福利</text>
-				<div class="list-item" for="{{dayList}}" @click="compeletTask($item.status,$item.type,$item.id,$item.path)">
-		
-					<div class="content">
-						<div><text>{{$item.name}}</text>
-							<div class="task-award">
-								<image src="../../assets/imgs/sign_coin.jpg"></image><text>+{{$item.value}}积分<text>
-							</div>
-						</div>
-						<text class="content-desc">{{$item.desc}}</text>
-					</div>
-					<text class="button-status {{ $item.status==0 ? 'wait': ($item.status==1 ? 'get' : 'disabled') }}">
-						{{$item.status==0?'去完成':$item.status==1?'领取':'已领取'}}
-					</text>
-				</div>
-			</div>
-		</div>
-		<div class="mask" show="{{showRule}}">
-			<div class="rule">
-				<text class="rule-title">签到规则</text>
-				<text class="detail">1.每7天为一个签到周期,用户连续签满7天,完成一个签到周期,下次签到重新计算签到周期 </text>
-				<text class="detail">2.用户连续签到获得的奖励更高,若中途漏签,则从第一天开始重新计算签到周期 </text>
-			</div>
-			<image src="../../assets/imgs/pop_close.png" class="close-icon" @click="closeRule"></image>
-		</div>
-		<div class="mask" if="{{SignSuccess}}">
-			<div class="sign-banner">
-				<text class="sign-banner__text"><span>获得</span><span class="orange">{{ currentFee}}</span><span>书币</span></text>
-			</div>
-			<image src="../../assets/imgs/pop_close.png" class="close-icon" @click="closeSign"></image>
-		</div>
-	</div>
+    <div class="task-section">
+      <div class="task-section__list">
+        <text class="task-section__list_new">新手必做任务</text>
+        <div
+          class="list-item"
+          for="{{newList}}"
+          @click="compeletTask($item.status, $item.type, $item.id, $item.path)"
+        >
+          <div class="content">
+            <div>
+              <text>{{ $item.name }}</text>
+              <div class="task-award">
+                <image src="../../assets/imgs/sign_coin.jpg"></image
+                ><text>+{{ $item.value }}积分</text>
+              </div>
+            </div>
+
+            <text class="content-desc">{{ $item.desc }}</text>
+          </div>
+          <text
+            class="button-status {{ $item.status==0 ? 'wait': ($item.status==1 ? 'get' : 'disabled') }}"
+          >
+            {{
+              $item.status == 0
+                ? '去完成'
+                : $item.status == 1
+                ? '领取'
+                : '已领取'
+            }}
+          </text>
+        </div>
+      </div>
+      <div class="task-section__list">
+        <text class="task-section__list_new">日常福利</text>
+        <div
+          class="list-item"
+          for="{{dayList}}"
+          @click="compeletTask($item.status, $item.type, $item.id, $item.path)"
+        >
+          <div class="content">
+            <div>
+              <text>{{ $item.name }}</text>
+              <div class="task-award">
+                <image src="../../assets/imgs/sign_coin.jpg"></image
+                ><text>+{{ $item.value }}积分</text>
+              </div>
+            </div>
+            <text class="content-desc">{{ $item.desc }}</text>
+          </div>
+          <text
+            class="button-status {{ $item.status==0 ? 'wait': ($item.status==1 ? 'get' : 'disabled') }}"
+          >
+            {{
+              $item.status == 0
+                ? '去完成'
+                : $item.status == 1
+                ? '领取'
+                : '已领取'
+            }}
+          </text>
+        </div>
+      </div>
+    </div>
+    <div class="mask" show="{{showRule}}">
+      <div class="rule">
+        <text class="rule-title">签到规则</text>
+        <text class="detail"
+          >1.每7天为一个签到周期,用户连续签满7天,完成一个签到周期,下次签到重新计算签到周期
+        </text>
+        <text class="detail"
+          >2.用户连续签到获得的奖励更高,若中途漏签,则从第一天开始重新计算签到周期
+        </text>
+      </div>
+      <image
+        src="../../assets/imgs/pop_close.png"
+        class="close-icon"
+        @click="closeRule"
+      ></image>
+    </div>
+    <div class="mask" if="{{SignSuccess}}">
+      <div class="sign-banner">
+        <text class="sign-banner__text"
+          ><span>获得</span><span class="orange">{{ currentFee }}</span
+          ><span>书币</span></text
+        >
+      </div>
+      <image
+        src="../../assets/imgs/pop_close.png"
+        class="close-icon"
+        @click="closeSign"
+      ></image>
+    </div>
+  </div>
 </template>
 <script>
-import { userTaskList, userAddDsktop, getTaskAward, getSignInfo, noVipSign, taskBook, getReadrecord } from "../../api/index";
-import router from "@system.router";
-import shortcut from "@system.shortcut";
-import storage from "@system.storage";
-import prompt from '@system.prompt';
+import {
+  userTaskList,
+  userAddDsktop,
+  getTaskAward,
+  getSignInfo,
+  noVipSign,
+  taskBook,
+  getReadrecord
+} from '../../api/index'
+import router from '@system.router'
+import shortcut from '@system.shortcut'
+import storage from '@system.storage'
+import prompt from '@system.prompt'
 export default {
-	public: {
-		push_id: '',
-		send_order_id: ''
-	},
-	protected: {
-		signList: [
-		],
-		currentFee: 0,
-		signData: {},
-		showRule: false,
-		SignSuccess: false,
-		dayList: [],
-		newList: [],
-		type: 'new',
-		bannerList: [],
-		isClick: false,
-		mockList: [],
-	},
-	computed: {
-		currentList() {
-			let curList = this.type == 'new' ? this.newList : this.dayList;
-			return curList;
-		},
-	},
-	async onInit() {
-		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.getBook();
-		this.getSignList();
-		this.getRordList();
-	},
-	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;
-	},
-	async getSignList() {
-		let signList = [];
-		let signData = await getSignInfo();
-		signData.reward_list.map((item, idx) => {
-			signList.push({ day: idx + 1, iconType: idx < signData.sign_day ? 'checked' : 'coin', fee: item })
-		})
-		signData.signDay = signData.sign_day;
-		this.currentFee = signData.reward_list[Number(signData.sign_day)];
-		this.signList = signList;
-		this.signData = signData;
-	},
-	async getTaskList() {
-		//每次展示刷新当前任务
-		let list = await userTaskList().catch((err) => { console.log(err) });
-		let dayList = list.date_tasks;
-		let newList = list.new_user_tasks;
-		//TODO数组处理
-		this.dayList = dayList;
-		this.newList = newList;
-	},
-	// changeTab(type) {
-	// 	this.type = type;
-	// },
-	closeRule() {
-		this.showRule = false;
-	},
-	showRules() {
-		this.showRule = true;
-	},
-	goMore() {
-		router.push({ uri: "/views/Index?curPage=1" });
-	},
-	signToday() {
-		noVipSign().then(res => {
-			this.signList[this.signData.sign_day].iconType = 'checked'
-			this.SignSuccess = true;
-			this.signData.signDay++;
-			this.signData.sign_day++;
-			this.signData.is_sign = true;
-			prompt.showToast("恭喜您签到成功!");
-		})
-	},
-	pageRouter(page) {
-		router.push({
-			uri: page.redirect_url,
-			params: {
-				bid: page.bid,
-				chapter_id: page.cid
-			}
-		})
-	},
-	closeSign() {
-		this.SignSuccess = false;
-	},
-	async compeletTask(status, type, id, path) {
-		if (this.isClick) return false;
-		this.isClick = true;
-		if (status == 2) {
-			this.isClick = false;
-			return false;
-		} else if (status == 0) {
-			this.isClick = false;
-			this.goTask(type, path)
-		} else {
-			let data = await getTaskAward(id);
-			this.getTaskList();
-			this.isClick = false;
-			prompt.showToast("领取成功!");
-		}
-		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') {
-			shortcut.hasInstalled({
-				success: ret => {
-					if (!ret) {
-						shortcut.install({
-							message: "添加【追书云】到桌面,方便下次阅读",
-							success: () => {
-								prompt.showToast("添加成功!");
-								userAddDsktop(1).then(res => {
-									_self.getTaskList();
-								}).catch(r => {
-									//TODO 失败后统计上报
-								});
-
-							},
-							fail: code => {
-								console.log(code)
-							}
-						});
-					} else {
-						userAddDsktop(1).then(res => {
-							_self.getTaskList();
-						}).catch(r => {
-							//TODO 失败后统计上报
-						});
-					}
-				}
-			});
-
-		} else if (path && path != '') {
-			router.push({
-				uri: path
-			})
-		}
-
-	}
-
+  public: {
+    push_id: '',
+    send_order_id: ''
+  },
+  protected: {
+    signList: [],
+    currentFee: 0,
+    signData: {},
+    showRule: false,
+    SignSuccess: false,
+    dayList: [],
+    newList: [],
+    type: 'new',
+    bannerList: [],
+    isClick: false,
+    mockList: []
+  },
+  computed: {
+    currentList() {
+      let curList = this.type == 'new' ? this.newList : this.dayList
+      return curList
+    }
+  },
+  async onInit() {
+    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.getBook()
+    this.getSignList()
+    this.getRordList()
+  },
+  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
+  },
+  async getSignList() {
+    let signList = []
+    let signData = await getSignInfo()
+    signData.reward_list.map((item, idx) => {
+      signList.push({
+        day: idx + 1,
+        iconType: idx < signData.sign_day ? 'checked' : 'coin',
+        fee: item
+      })
+    })
+    signData.signDay = signData.sign_day
+    this.currentFee = signData.reward_list[Number(signData.sign_day)]
+    this.signList = signList
+    this.signData = signData
+  },
+  async getTaskList() {
+    //每次展示刷新当前任务
+    let list = await userTaskList().catch(err => {
+      console.log(err)
+    })
+    let dayList = list.date_tasks
+    let newList = list.new_user_tasks
+    //TODO数组处理
+    this.dayList = dayList
+    this.newList = newList
+  },
+  // changeTab(type) {
+  // 	this.type = type;
+  // },
+  closeRule() {
+    this.showRule = false
+  },
+  showRules() {
+    this.showRule = true
+  },
+  goMore() {
+    router.push({ uri: '/views/Index?curPage=1' })
+  },
+  signToday() {
+    noVipSign().then(res => {
+      this.signList[this.signData.sign_day].iconType = 'checked'
+      this.SignSuccess = true
+      this.signData.signDay++
+      this.signData.sign_day++
+      this.signData.is_sign = true
+      prompt.showToast('恭喜您签到成功!')
+    })
+  },
+  pageRouter(page) {
+    router.push({
+      uri: page.redirect_url,
+      params: {
+        bid: page.bid,
+        chapter_id: page.cid
+      }
+    })
+  },
+  closeSign() {
+    this.SignSuccess = false
+  },
+  async compeletTask(status, type, id, path) {
+    if (this.isClick) return false
+    this.isClick = true
+    if (status == 2) {
+      this.isClick = false
+      return false
+    } else if (status == 0) {
+      this.isClick = false
+      this.goTask(type, path)
+    } else {
+      let data = await getTaskAward(id)
+      this.getTaskList()
+      this.isClick = false
+      prompt.showToast('领取成功!')
+    }
+    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') {
+      shortcut.hasInstalled({
+        success: ret => {
+          if (!ret) {
+            shortcut.install({
+              message: '添加【追书云】到桌面,方便下次阅读',
+              success: () => {
+                prompt.showToast('添加成功!')
+                userAddDsktop(1)
+                  .then(res => {
+                    _self.getTaskList()
+                  })
+                  .catch(r => {
+                    //TODO 失败后统计上报
+                  })
+              },
+              fail: code => {
+                console.log(code)
+              }
+            })
+          } else {
+            userAddDsktop(1)
+              .then(res => {
+                _self.getTaskList()
+              })
+              .catch(r => {
+                //TODO 失败后统计上报
+              })
+          }
+        }
+      })
+    } else if (path && path != '') {
+      router.push({
+        uri: path
+      })
+    }
+  }
 }
 </script>
 <style lang="less">
-@import "../../assets/less/task.less";
+@import '../../assets/less/task.less';
 </style>
-
-

ファイルの差分が大きいため隠しています
+ 0 - 5823
yarn.lock