[
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n"
  },
  {
    "path": ".eslintignore",
    "content": "dist/*\n"
  },
  {
    "path": ".eslintrc.js",
    "content": "module.exports = {\n  root: true,\n  parser: 'babel-eslint',\n  parserOptions: {\n    sourceType: 'module'\n  },\n  env: {\n    browser: true\n  },\n  // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style\n  extends: 'standard',\n  // required to lint *.wpy files\n  plugins: [\n    'html'\n  ],\n  settings: {\n    'html/html-extensions': ['.html', '.wpy']\n  },\n  // add your custom rules here\n  'rules': {\n    // allow paren-less arrow functions\n    'arrow-parens': 0,\n    // allow async-await\n    'generator-star-spacing': 0,\n    // allow debugger during development\n    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,\n    'space-before-function-paren': 0\n  }\n}\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules\ndist\n.DB_store\n"
  },
  {
    "path": ".prettierrc",
    "content": "{\n  \"singleQuote\": true\n}\n"
  },
  {
    "path": ".wepycache",
    "content": "{\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/wepy/lib/wepy.js\":1517904283000,\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/wepy-async-function/index.js\":1517302333000,\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/wepy-com-toast/toast.wpy\":1488432898000,\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/wepy/lib/app.js\":1517904282000,\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/wepy/lib/page.js\":1517904283000,\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/wepy/lib/component.js\":1517904283000,\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/wepy/lib/event.js\":1517904283000,\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/wepy/lib/base.js\":1517904282000,\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/wepy/lib/util.js\":1517904283000,\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/wepy/lib/mixin.js\":1517904283000,\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/wepy-async-function/global.js\":1517302333000,\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/promise-polyfill/promise.js\":1511627065000,\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/regenerator-runtime/runtime.js\":1493390741000,\"/Users/molang/Documents/Front-end/xiaochengxu/mp-jishengji/node_modules/wepy/lib/native.js\":1517904283000}"
  },
  {
    "path": ".wepyignore",
    "content": "node_modules\ndist\n.DB_store\n*.wpy___jb_tmp___\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2018 Molang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# 记生计 [小程序]\n\n一款日常生活记录类的工具小程序，通过wepyjs构建,包含计划、账本、圈子、榜单和个人中心等模块。\n\n状态：未完成\n\n## 玩耍：\n\n1. Fork 或 `git clone https://github.com/seymoe/mp-jishengji.git` 或 download\n2. `cd mp-jishengji && npm install`\n3. `wepy build --watch` (如果未安装wepy-cli,请先安装,见[WePY](https://tencent.github.io/wepy/index.html))\n4. 微信开发者工具目录选择dist\n\n---\n\n+ 计划\n\n<img style=\"display:block;margin-bottom: 15px\" width=\"375\" src=\"https://github.com/ximolang/mp-jishengji/raw/master/readme_img/plan.png\"/>\n\n+ 账本\n\n<img style=\"display:block;margin-bottom: 15px\" width=\"375\" src=\"https://github.com/ximolang/mp-jishengji/raw/master/readme_img/bill.png\"/>\n\n+ 我的\n\n<img width=\"375\" src=\"https://github.com/ximolang/mp-jishengji/raw/master/readme_img/me.png\"/>\n\n## 想法：\n\n本项目本来是作为私有仓库开发，但感觉独乐乐不如众乐乐，本小程序经过本人调研两天时间，结合个人开发者类目许可要求以及目前上线的众小程序来看，综合而来的想法，我相信做出这个小程序，无论如何都能获得一部分用户，或多或少。个人开发者完全可以尝试，特别是想利用wepy构建小程序练手的前端er来说。顺便求fork、star。\n\n## 计划：\n\n+ 完善圈子、榜单等相关页面开发\n+ 构建后端API，实现发圈、完成计划，记账等功能的数据存储支持\n+ 增加数据统计与图标分析\n+ 完善功能，优化细节\n\n## License\nMIT\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"jishengji-miniapp\",\n  \"version\": \"0.0.1\",\n  \"description\": \"A WePY project\",\n  \"main\": \"dist/app.js\",\n  \"scripts\": {\n    \"dev\": \"wepy build --watch\",\n    \"build\": \"cross-env NODE_ENV=production wepy build --no-cache\",\n    \"dev:web\": \"wepy build --output web\",\n    \"clean\": \"find ./dist -maxdepth 1 -not -name 'project.config.json' -not -name 'dist' | xargs rm -rf\",\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"wepy\": {\n    \"module-a\": false,\n    \"./src/components/list\": \"./src/components/wepy-list.wpy\"\n  },\n  \"author\": \"ximolang\",\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"wepy\": \"^1.6.0\",\n    \"wepy-async-function\": \"^1.4.4\",\n    \"wepy-com-toast\": \"^1.0.2\"\n  },\n  \"devDependencies\": {\n    \"babel-eslint\": \"^7.2.1\",\n    \"babel-plugin-transform-class-properties\": \"^6.24.1\",\n    \"babel-plugin-transform-decorators-legacy\": \"^1.3.4\",\n    \"babel-plugin-transform-export-extensions\": \"^6.22.0\",\n    \"babel-plugin-transform-object-rest-spread\": \"^6.26.0\",\n    \"babel-preset-env\": \"^1.6.1\",\n    \"cross-env\": \"^5.1.3\",\n    \"eslint\": \"^3.18.0\",\n    \"eslint-config-standard\": \"^7.1.0\",\n    \"eslint-friendly-formatter\": \"^2.0.7\",\n    \"eslint-plugin-html\": \"^2.0.1\",\n    \"eslint-plugin-promise\": \"^3.5.0\",\n    \"eslint-plugin-standard\": \"^2.0.1\",\n    \"wepy-eslint\": \"^1.5.3\",\n    \"wepy-compiler-babel\": \"^1.5.1\",\n    \"wepy-compiler-less\": \"^1.3.10\"\n  }\n}\n"
  },
  {
    "path": "src/app.wpy",
    "content": "<style lang=\"less\">\npage{\n  height: 100%;\n  background-color: #f9fbff;\n}\n@font-face {\n  font-family: 'iconfont';  /* project id 573053 */\n  src: url('//at.alicdn.com/t/font_573053_6w688di648xxyldi.eot');\n  src: url('//at.alicdn.com/t/font_573053_6w688di648xxyldi.eot?#iefix') format('embedded-opentype'),\n  url('//at.alicdn.com/t/font_573053_6w688di648xxyldi.woff') format('woff'),\n  url('//at.alicdn.com/t/font_573053_6w688di648xxyldi.ttf') format('truetype'),\n  url('//at.alicdn.com/t/font_573053_6w688di648xxyldi.svg#iconfont') format('svg');\n}\n</style>\n\n<script>\nimport wepy from 'wepy'\nimport 'wepy-async-function'\n\nexport default class extends wepy.app {\n  config = {\n    pages: [\n      'pages/index',\n      'pages/ranking',\n      'pages/bill/addone',\n      'pages/plan',\n      'pages/plan/clock',\n      'pages/bill',\n      'pages/me'\n      // 子页面\n    ],\n    window: {\n      backgroundTextStyle: 'light',\n      navigationBarBackgroundColor: '#138cff',\n      navigationBarTitleText: 'WeChat',\n      navigationBarTextStyle: 'white',\n      backgroundColor: '#138cff'\n    },\n    tabBar: {\n      color: '#757982',\n      selectedColor: '#138cff',\n      borderStyle: 'white',\n      backgroundColor: '#fff',\n      list: [\n        {\n          pagePath: 'pages/plan',\n          text: '计划',\n          iconPath: 'images/tabbar/plan.png',\n          selectedIconPath: 'images/tabbar/plan-on.png'\n        },\n        {\n          pagePath: 'pages/bill',\n          text: '账本',\n          iconPath: 'images/tabbar/bill.png',\n          selectedIconPath: 'images/tabbar/bill-on.png'\n        },\n        {\n          pagePath: 'pages/index',\n          text: '圈子',\n          iconPath: 'images/tabbar/index.png',\n          selectedIconPath: 'images/tabbar/index-on.png'\n        },\n        {\n          pagePath: 'pages/ranking',\n          text: '榜单',\n          iconPath: 'images/tabbar/ranking.png',\n          selectedIconPath: 'images/tabbar/ranking-on.png'\n        },\n        {\n          pagePath: 'pages/me',\n          text: '我的',\n          iconPath: 'images/tabbar/me.png',\n          selectedIconPath: 'images/tabbar/me-on.png'\n        }\n      ]\n    }\n  }\n\n  globalData = {\n    userInfo: null\n  }\n\n  constructor () {\n    super()\n    this.use('requestfix')\n  }\n\n  onLaunch() {\n    this.testAsync()\n  }\n\n  sleep (s) {\n    return new Promise((resolve, reject) => {\n      setTimeout(() => {\n        resolve('promise resolved')\n      }, s * 1000)\n    })\n  }\n\n  async testAsync () {\n    const data = await this.sleep(3)\n    console.log(data)\n  }\n\n  getUserInfo(cb) {\n    const that = this\n    if (this.globalData.userInfo) {\n      return this.globalData.userInfo\n    }\n    wepy.getUserInfo({\n      success (res) {\n        that.globalData.userInfo = res.userInfo\n        cb && cb(res.userInfo)\n      }\n    })\n  }\n}\n</script>\n"
  },
  {
    "path": "src/components/bill/cateslide.wpy",
    "content": "<template>\n  <scroll-view class=\"scrollbox\" scroll-y>\n    <view class=\"box\">\n      <repeat for=\"{{ list }}\" key=\"index\" index=\"index\" item=\"item\">\n        <view class=\"item {{ cateType == item.type && cateId == item.cateId ? 'active' : '' }}\"\n          @tap=\"selectCate({{item.type}}, {{item.cateId}})\">\n          <view class=\"icon icon-{{ item.type }}-{{ item.cateId }}\"></view>\n          <text>{{ item.cateName }}</text>\n        </view>\n      </repeat>\n    </view>\n  </scroll-view>\n</template>\n\n<script>\n  import wepy from 'wepy'\n  export default class CateSlide extends wepy.component {\n    props = {\n      list: {\n        type: Array,\n        default: []\n      }\n    }\n\n    data = {\n      cateType: '',\n      cateId: ''\n    }\n\n    methods = {\n      selectCate(type, id) {\n        if (!type || !id) {\n          console.error('未能获取到类别信息')\n          return\n        }\n        this.cateType = type\n        this.cateId = id\n        this.$emit('selectCate', type, id)\n      }\n    }\n  }\n</script>\n\n<style lang=\"less\">\n  .scrollbox{\n    height: 640rpx;\n  }\n  .box{\n    display: flex;\n    justify-content: flex-start;\n    flex-wrap: wrap;\n    box-sizing: border-box;\n    padding: 0 30rpx;\n    .item{\n      height: 130rpx;\n      padding-bottom: 20rpx;\n      display: flex;\n      flex-direction: column;\n      justify-content: center;\n      width: 16.66%;\n      text-align: center;\n      box-sizing: border-box;\n      text{\n        font-size: 24rpx;\n        color: #333;\n      }\n    }\n    .active{\n      .icon{\n        background-color: #138cff;\n      }\n      .icon::after{\n        color: #fff;\n      }\n      text{\n        color: #138cff;\n      }\n    }\n  }\n  .icon{\n    margin: 0 auto 8rpx auto;\n    width: 70rpx;\n    height: 70rpx;\n    border-radius: 100%;\n    background-color: #f8f8f8;\n  }\n  .icon::after{\n    font-family: \"iconfont\" !important;\n    font-size: 38rpx;\n    line-height:70rpx;\n    color: #333;\n  }\n  \n  .icon-pay-1::after{\n    content: '\\e600';\n  }\n</style>\n"
  },
  {
    "path": "src/components/bill/listitem.wpy",
    "content": "<template>\n  <view class=\"listitem\" data-id=\"{{ obj.id }}\">\n    <image src=\"{{ obj.image }}\"></image>\n    <text class=\"title\">{{ obj.title }}</text>\n    <text class=\"mount\">{{ obj.mount }}</text>\n  </view>\n</template>\n\n<script>\n  import wepy from 'wepy'\n  export default class ListItem extends wepy.component {\n    props = {\n      obj: {\n        type: Object,\n        default: {}\n      }\n    }\n\n    methods = {}\n  }\n</script>\n\n<style lang=\"less\">\n  .listitem{\n    display: flex;\n    justify-content: space-between;\n    padding: 16rpx 30rpx 16rpx 0rpx;\n    margin-left: 30rpx;\n    border-bottom: 1rpx solid #f0f0f0;\n    image{\n      margin-right: 20rpx;\n      display: block;\n      width: 60rpx;\n      height: 60rpx;\n      border-radius: 100%;\n    }\n    text{\n      display: block;\n      line-height: 60rpx;\n      font-size: 28rpx;\n    }\n    .title{\n      flex: 1;\n    }\n  }\n</style>\n"
  },
  {
    "path": "src/components/bill/listsection.wpy",
    "content": "<template>\n  <view class=\"listsection\">\n    <view class=\"header\">\n      <view class=\"left\">\n        <text>{{ item.info.date }}</text>\n        <text>{{ item.info.day }}</text>\n      </view>\n      <view class=\"right\">\n        <text>收入：{{ item.info.totalIncome }}</text>\n        <text>支出：{{ item.info.totalPay }}</text>\n      </view>\n    </view>\n    <view class=\"body\">\n      <repeat for=\"{{ item.list }}\" key=\"index\" index=\"index\" item=\"obj\">\n        <listitem :obj=\"obj\"></listitem>\n      </repeat>\n    </view>\n  </view>\n</template>\n\n<script>\n  import wepy from 'wepy'\n  import ListItem from './listitem'\n  export default class ListSection extends wepy.component {\n    props = {\n      item: {\n        type: Object,\n        default: {}\n      }\n    }\n\n    components = {\n      listitem: ListItem\n    }\n  }\n</script>\n\n<style lang=\"less\">\n  .listsection{\n    .header{\n      height: 60rpx;\n      padding: 0 30rpx;\n      display: flex;\n      justify-content: space-between;\n      border-bottom: 1rpx solid #f0f0f0;\n      >view{\n        display: flex;\n        justify-content: space-between;\n        text{\n          line-height: 60rpx;\n          color: #666;\n          font-size: 26rpx;\n        }\n      }\n      .left > text:first-child, .right > text:first-child {\n        margin-right: 20rpx;\n      }\n    }\n    .body{\n\n    }\n  }\n</style>\n"
  },
  {
    "path": "src/components/counter.wpy",
    "content": "<style lang=\"less\">\n  .counter {\n    text-align: left;\n    font-size: 12px;\n  }\n  .count {\n    font-size: 18px;\n    font-weight: bold;\n    &.red {\n      color: red;\n    }\n    &.green {\n      color: green;\n    }\n  }\n</style>\n<template>\n  <view class=\"counter {{style}}\">\n    <button @tap=\"plus\" size=\"mini\">  +  </button>\n    <button @tap=\"minus\" size=\"mini\">  -  </button>\n    <text class=\"count\" :class=\"{red: num > 55, green: num < 45}\"> {{num}} </text>\n  </view>\n</template>\n<script>\n  import wepy from 'wepy'\n\n  export default class Counter extends wepy.component {\n    props = {\n      num: {\n        type: [Number, String],\n        coerce: function (v) {\n          return +v\n        },\n        default: 50\n      }\n    }\n\n    data = {\n    }\n    events = {\n      'index-broadcast': (...args) => {\n        let $event = args[args.length - 1]\n        console.log(`${this.$name} receive ${$event.name} from ${$event.source.$name}`)\n      }\n    }\n\n    watch = {\n      num (curVal, oldVal) {\n        console.log(`旧值：${oldVal}，新值：${curVal}`)\n      }\n    }\n\n    methods = {\n      plus () {\n        this.num = this.num + 1\n        console.log(this.$name + ' plus tap')\n\n        this.$emit('index-emit', 1, 2, 3)\n      },\n      minus () {\n        this.num = this.num - 1\n        console.log(this.$name + ' minus tap')\n      }\n    }\n  }\n</script>\n"
  },
  {
    "path": "src/components/group.wpy",
    "content": "<style type=\"less\">\n  .group {}\n</style>\n<template>\n  <view class=\"group\">\n    <text class=\"id\">{{grouplist.id}}. </text>\n    <text class=\"name\" @tap=\"tap\">{{grouplist.name}}</text>\n    <view>\n      <repeat for=\"{{grouplist.list}}\" item=\"item\">\n        <groupitem :gitem=\"item\"></groupitem>\n      </repeat>\n    </view>\n  </view>\n</template>\n<script>\n  import wepy from 'wepy'\n  import GroupItem from './groupitem'\n\n  export default class Group extends wepy.component {\n    props = {\n      grouplist: {},\n      index: {}\n    }\n\n    components = {\n      groupitem: GroupItem\n    }\n    methods = {\n      tap () {\n        this.grouplist.name = `Parent Random(${Math.random()})`\n        console.log(`Clicked Group ${this.$index}, ID is ${this.grouplist.id}`)\n      }\n    }\n  }\n</script>\n"
  },
  {
    "path": "src/components/groupitem.wpy",
    "content": "<style type=\"less\">\n.groupitem {\n}\n</style>\n<template>\n  <view class=\"groupitem\">\n    --<text class=\"id\">{{gitem.childid}}.</text>\n    <text class=\"name\" @tap=\"tap\"> {{gitem.childname}}</text>\n  </view>\n</template>\n<script>\n  import wepy from 'wepy'\n\n  export default class GroupItem extends wepy.component {\n    props = {\n      gitem: {}\n    }\n    data = {\n    }\n    methods = {\n      tap () {\n        this.gitem.childname = `Child Random(${Math.random()})`\n        console.log(`Clicked Group ${this.$parent.$index}. Item ${this.$index}, ID is ${this.gitem.childid}`)\n      }\n    }\n  }\n</script>\n"
  },
  {
    "path": "src/components/index/listitem.wpy",
    "content": "<template>\n  <view class=\"list-item\">\n    <view class=\"header\">\n      <view class=\"left\">\n        <image src=\"{{ avatar }}\"></image>\n        <text>{{ username }}</text>\n      </view>\n    </view>\n    <view class=\"main\">\n      <text class=\"\">{{ content }}</text>\n      <image wx:if=\"{{ image }}\" src=\"{{ image }}\"></image>\n    </view>\n    <view class=\"footer\">\n      <view class=\"like\">{{ likes }} 赞</view>\n      <view class=\"right\">\n        <text>{{ createtime }}</text>\n      </view>\n    </view>\n  </view>\n</template>\n\n<script>\n  import wepy from 'wepy'\n  export default class ListItem extends wepy.component {\n    props = {\n      id: {\n        type: Number,\n        default: 0\n      },\n      image: {\n        type: String,\n        default: ''\n      },\n      content: {\n        type: String,\n        default: ''\n      },\n      username: {\n        type: String,\n        default: ''\n      },\n      createtime: {\n        type: String,\n        default: ''\n      },\n      likes: {\n        type: Number,\n        default: 0\n      },\n      avatar: {\n        type: String,\n        default: ''\n      }\n    }\n\n    methods = {\n      bindDoPlan(id, title) {\n        if (!id || !title) return\n\n        // 跳转至计时器界面\n        this.$parent.$navigate('./plan/clock', { planId: id, planTitle: title })\n      }\n    }\n  }\n</script>\n\n<style lang=\"less\">\n  .list-item{\n    padding: 0 30rpx;\n    margin-bottom: 20rpx;\n    background-color: #fff;\n    .header{\n      display: flex;\n      justify-content: space-between;\n      font-size: 26rpx;\n      color: #666;\n      border-bottom: 1rpx solid #f3f3f3;\n      .left{\n        display: flex;\n        image, text{\n          display: block;\n          height: 60rpx;\n          line-height: 60rpx;\n        }\n        image{\n          margin: 10rpx 20rpx 10rpx 0;\n          height: 40rpx;\n          width: 40rpx;\n          border-radius: 100%;\n        }\n      }\n    }\n    .main{\n      text{\n        font-weight: bold;\n        font-size: 28rpx;\n        color: #000;\n      }\n      image{\n        display: block;\n        width: 100%;\n      }\n    }\n    .footer{\n      display: flex;\n      justify-content: space-between;\n      font-size: 26rpx;\n      color: #666;\n      .like{\n        height: 50rpx;\n        line-height: 50rpx;\n      }\n    }\n  }\n</style>\n"
  },
  {
    "path": "src/components/list.wpy",
    "content": "<style lang=\"less\">\n  .mylist:odd {\n    color: red;\n  }\n  .mylist:even {\n    color: green;\n  }\n</style>\n<template>\n  <view class=\"list\">\n  <view>\n    <button @tap=\"add\" size=\"mini\">添加列表</button>\n  </view>\n    <block wx:for-items=\"{{list}}\" wx:for-index=\"index\" wx:for-item=\"item\" wx:key=\"id\">\n      <view @tap=\"tap\" class=\"mylist\">\n        <text>{{item.id}}</text>: {{item.title}}\n      </view>\n    </block>\n  </view>\n</template>\n<script>\n  import wepy from 'wepy'\n\n  export default class List extends wepy.component {\n    data = {\n      list: [\n        {\n          id: '0',\n          title: 'loading'\n        }\n      ]\n    }\n\n    events = {\n      'index-broadcast': (...args) => {\n        let $event = args[args.length - 1]\n        console.log(`${this.$name} receive ${$event.name} from ${$event.source.name}`)\n      }\n    }\n\n    methods = {\n      tap () {\n        // this.num = this.num + 1\n        console.log(this.$name + ' tap')\n      },\n      add () {\n        let len = this.list.length\n        this.list.push({id: len + 1, title: 'title_' + len})\n      }\n    }\n\n    onLoad () {\n    }\n  }\n</script>\n"
  },
  {
    "path": "src/components/panel.wpy",
    "content": "<style lang=\"less\">\n  .panel {\n    width: 100%;\n    margin-top: 20rpx;\n    text-align: left;\n    font-size: 12px;\n    padding-top: 20rpx;\n    padding-left: 50rpx;\n    padding-bottom: 20rpx;\n    border: 1px solid #ccc;\n\n    .title {\n      padding-bottom: 20rpx;\n      font-size: 14px;\n      font-weight: bold;\n    }\n    .info {\n      padding: 15rpx;\n    }\n    .testcounter {\n      margin-top: 15rpx;\n      position: absolute;\n    }\n    .counterview {\n      margin-left: 120rpx;\n    }\n  }\n</style>\n<template>\n  <view class=\"panel\">\n    <slot name=\"title\">\n      Title\n    </slot>\n    <slot>\n    </slot>\n  </view>\n</template>\n<script>\n  import wepy from 'wepy'\n\n  export default class Panel extends wepy.component {\n  }\n</script>\n"
  },
  {
    "path": "src/components/plan/listitem.wpy",
    "content": "<template>\n  <view class=\"listitem\">\n    <view class=\"image\">\n      <image src=\"{{ image }}\"></image>\n    </view>\n    <text class=\"title\">{{ title }}</text>\n    <text class=\"remark\">{{ remark }}</text>\n    <text class=\"hours\">执行 {{ times }} 次,共 {{ hours }} 小时</text>\n    <text class=\"time\">该计划于 {{ createtime }} 创建</text>\n\n    <view class=\"btn-do\" @tap=\"bindDoPlan({{ id }}, {{ title }})\">\n      <text wx:if=\"{{ times <= 0 }}\">开始执行</text>\n      <text wx:else>继续执行</text>\n    </view>\n  </view>\n</template>\n\n<script>\n  import wepy from 'wepy'\n\n  export default class ListItem extends wepy.component {\n    props = {\n      id: {\n        type: Number,\n        default: 0\n      },\n      image: {\n        type: String,\n        default: ''\n      },\n      title: {\n        type: String,\n        default: ''\n      },\n      remark: {\n        type: String,\n        default: ''\n      },\n      createtime: {\n        type: String,\n        default: ''\n      },\n      times: {\n        type: Number,\n        default: 0\n      },\n      hours: {\n        type: Number,\n        default: 0\n      }\n    }\n\n    methods = {\n      bindDoPlan(id, title) {\n        if (!id || !title) return\n\n        // 跳转至计时器界面\n        this.$parent.$navigate('./plan/clock', { planId: id, planTitle: title })\n      }\n    }\n  }\n</script>\n\n<style lang=\"less\">\n  .listitem {\n    position: relative;\n    display: flex;\n    align-items: center;\n    flex-direction: column;\n    width: 100%;\n    height: 100%;\n    background-color: #fff;\n    box-sizing: border-box;\n    border-radius: 5px;\n    box-shadow: 0 0 12px 2px rgba(0,0,0,.08);\n    .image{\n      margin-top: 60rpx;\n      display: block;\n      width: 200rpx;\n      height: 200rpx;\n      image {\n        display: block;\n        width: 200rpx;\n        height: 200rpx;\n      }\n    }\n    .title{\n      font-weight: bold;\n      font-size: 36rpx;\n      margin-top: 30rpx;\n    }\n    .remark{\n      font-size: 28rpx;\n      padding: 30rpx;\n      text-align:justify;\n    }\n    .time,.hours{\n      display: block;\n      font-size: 26rpx;\n      color: #666;\n    }\n    .time{\n      position: absolute;\n      bottom: 60rpx;\n    }\n    .hours{\n      position: absolute;\n      bottom: 100rpx;\n      font-weight: bold;\n    }\n    .btn-do{\n      position: absolute;\n      bottom: 180rpx;\n      width: 35%;\n      height: 70rpx;\n      line-height: 70rpx;\n      text-align: center;\n      background-color: #138cff;\n      color: #fff;\n      font-size: 28rpx;\n      transition: background-color 0.3s;\n    }\n    .btn-do:active{\n      background-color: #0f7ce3;\n    }\n  }\n</style>\n"
  },
  {
    "path": "src/components/wepy-list.wpy",
    "content": "<style lang=\"less\">\n    .mylist:odd {\n        color: red;\n    }\n    .mylist:even {\n        color: green;\n    }\n</style>\n<template>\n    <view class=\"wepy-list\">\n        <view>\n            <button @tap=\"add\" size=\"mini\">添加列表another</button>\n        </view>\n        <block wx:for-items=\"{{list}}\" wx:for-index=\"index\" wx:for-item=\"item\" wx:key=\"id\">\n            <view @tap=\"tap\" class=\"mylist\">\n                <text>{{item.id}}</text>: {{item.title}}\n            </view>\n        </block>\n    </view>\n</template>\n<script>\n  import wepy from 'wepy'\n\n  export default class ListAnother extends wepy.component {\n    data = {\n      list: [\n        {\n          id: '0',\n          title: 'loading'\n        }\n      ]\n    }\n\n    events = {\n      'index-broadcast': (...args) => {\n        let $event = args[args.length - 1]\n        console.log(`${this.$name} receive ${$event.name} from ${$event.source.name}`)\n      }\n    }\n\n    methods = {\n      tap () {\n        // this.num = this.num + 1\n        console.log(this.$name + ' tap')\n      },\n      add () {\n        let len = this.list.length\n        this.list.push({id: len + 1, title: 'title_' + len})\n      }\n    }\n\n    onLoad () {\n    }\n  }\n</script>\n"
  },
  {
    "path": "src/index.template.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n  <meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\n  <meta name=\"format-detection\" content=\"telephone=no\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\">\n  <meta content=\"telephone=no\" name=\"format-detection\">\n\n  <title>转 WEB DEMO</title>\n  <style>\n      html, body, #app {height: 100%;}\n  </style>\n</head>\n<body>\n  <div id=\"app\">\n    <router-view></router-view>\n    <script src=\"./index.js\"></script>\n  </div>\n</body>\n</html>\n"
  },
  {
    "path": "src/mixins/test.js",
    "content": "import wepy from 'wepy'\n\nexport default class testMixin extends wepy.mixin {\n  data = {\n    mixin: 'This is mixin data.'\n  }\n  methods = {\n    tap () {\n      this.mixin = 'mixin data was changed'\n      console.log('mixin method tap')\n    }\n  }\n\n  onShow() {\n    console.log('mixin onShow')\n  }\n\n  onLoad() {\n    console.log('mixin onLoad')\n  }\n}\n"
  },
  {
    "path": "src/pages/bill/addone.wpy",
    "content": "<template>\n  <view class=\"wrap\">\n    <view class=\"typewrap\">\n      <view class=\"typebar\">\n        <view class=\"{{ bill.typeId === '1' ? 'active' : '' }}\" @tap=\"toggleType(1)\">\n          <text>支出</text>\n        </view>\n        <view class=\"{{ bill.typeId === '2' ? 'active' : '' }}\" @tap=\"toggleType(2)\">\n          <text>收入</text>\n        </view>\n      </view>\n    </view>\n\n    <!-- 输入框区域 -->\n    <view class=\"input-area\">\n      <view class=\"money\">\n        <input type=\"digit\" placeholder=\"￥\" confirm-type=\"done\" @input=\"bindInputMoney\" @blur=\"bindBlurMoney\"/>\n      </view>\n      <view class=\"remark\">\n        <input type=\"text\" placeholder=\"备注信息:\" />\n      </view>\n      <view class=\"btns-wrap\">\n        <view class=\"btn-confirm\" @tap=\"confirmAdd\">\n          <text>确定</text>\n        </view>\n        <view class=\"btn-cancel\" @tap=\"bindToBillpage\">\n          <text>取消</text>\n        </view>\n      </view>\n    </view>\n\n    <!-- 类别图标列表 -->\n    <view class=\"catewrap\">\n      <cateslide\n        :list.sync=\"cateList\"\n        @selectCate.user=\"chooseCate\"></cateslide>\n    </view>\n\n  </view>\n\n</template>\n\n<script>\n  import wepy from 'wepy'\n  import CateSlide from '@/components/bill/cateslide'\n  import { log } from '@/utils/util'\n  import { payCateList, incomeCateList } from '@/utils/config'\n\n  export default class AddOne extends wepy.page {\n    config = {\n      navigationBarTitleText: '记账'\n    }\n\n    data = {\n      cateList: payCateList,\n      bill: {\n        typeId: '1'\n      },\n      form: {\n        cateType: '',\n        cateId: '',\n        money: 0,\n        remark: ''\n      }\n    }\n\n    components = {\n      cateslide: CateSlide\n    }\n\n    methods = {\n      // 切换记账方式\n      toggleType(t) {\n        if (t === '1' && this.bill.typeId === '2') {\n          this.bill.typeId = t\n          this.cateList = payCateList\n          this.form.cateType = ''\n          this.form.cateId = ''\n        } else if (t === '2' && this.bill.typeId === '1') {\n          this.bill.typeId = t\n          this.cateList = incomeCateList\n          this.form.cateType = ''\n          this.form.cateId = ''\n        }\n      },\n\n      // 选择收入或支出类别\n      chooseCate(type, id) {\n        log('type', type)\n        log('id', id)\n        this.form.cateType = type\n        this.form.cateId = id\n      },\n\n      // 输入金额变化得到值\n      bindInputMoney(e) {\n        let val = e.detail.value\n        if (val.indexOf('￥') === 0) {\n          return '￥' + val.slice(1)\n        } else if (val === '') {\n          return ''\n        }\n        return '￥' + val\n      },\n\n      bindBlurMoney(e) {\n        let val = e.detail.value\n        if (val.indexOf('￥') === 0) {\n          val = parseFloat(val.slice(1))\n        } else {\n          val = 0\n        }\n        this.form.money = val\n      },\n\n      bindBlurRemark(e) {\n        let val = e.detail.value.trim()\n        if (val !== '') {\n          val = val.replace(/<\\/?[^>]*>/g, '')\n        }\n        this.form.remark = val\n      },\n\n      // 确认记账\n      confirmAdd() {\n        let { money } = this.form\n        if (money <= 0) {\n          // 提示金额不能为0\n          wx.showToast({\n            title: this.bill.typeId === '1' ? '没花钱不能记哦' : '没收钱不能记哦',\n            icon: 'success',\n            duration: 2000\n          })\n          return false\n        }\n\n        // 发送Post请求记录\n      },\n\n      // 取消 返回账本页\n      bindToBillpage() {\n        this.$switch('../bill')\n      }\n    }\n\n    onLoad() {\n      // log('账单页面加载成功')\n      // 设置当前月份\n      // const _cdate = formatTime(new Date()).slice(0, 2)\n      // this.calenderArr = _cdate\n      // this.$apply()\n    }\n  }\n</script>\n\n<style lang=\"less\">\n  .wrap{\n    position: relative;\n    height: 100%;\n    background-color: #fff;\n  }\n  .typewrap{\n    padding: 30rpx 0;\n  }\n  .typebar{\n    display: flex;\n    width: 50%;\n    margin: 0 auto;\n    height: 60rpx;\n    view{\n      width: 50%;\n      line-height: 60rpx;\n      text-align: center;\n      font-size: 28rpx;\n      background-color: #fff;\n      transition: background-color .3s;\n      box-sizing: border-box;\n      border: 2rpx solid #138cff;\n      text{\n        color: #138cff;\n      }\n    }\n    view:first-child{\n      border-top-left-radius: 6rpx;\n      border-bottom-left-radius: 6rpx;\n    }\n    view:last-child{\n      border-top-right-radius: 6rpx;\n      border-bottom-right-radius: 6rpx;\n    }\n    .active{\n      background-color: #138cff;\n      text{\n        color: #fff;\n      }\n    }\n  }\n  .input-area{\n    padding: 0 50rpx;\n    margin-bottom: 30rpx;\n    border-bottom: 6rpx solid #138cff;\n  }\n  .money{\n    padding-bottom: 6rpx;\n    border-bottom: 1rpx solid #f3f3f3;\n    input{\n      height: 120rpx;\n      line-height: 120rpx;\n      font-size: 70rpx;\n    }\n  }\n  .remark{\n    padding-bottom: 6rpx;\n    border-bottom: 1rpx solid #f3f3f3;\n    input{\n      height: 70rpx;\n      line-height: 70rpx;\n      font-size: 30rpx;\n    }\n  }\n\n  .btns-wrap{\n    display: flex;\n  }\n\n  .btn-confirm, .btn-cancel{\n    margin: 30rpx 0;\n    width: 150rpx;\n    height: 60rpx;\n    line-height: 60rpx;\n    text-align: center;\n    border-radius: 4rpx;\n    text{\n      font-size: 26rpx;\n    }\n  }\n  .btn-confirm{\n    margin-right: 30rpx;\n    background-color: #138cff;\n    color: #fff;\n  }\n  .btn-cancel{\n    background-color: #f8f8f8;\n  }\n</style>\n"
  },
  {
    "path": "src/pages/bill.wpy",
    "content": "<template>\n  <view class=\"wrap\">\n    <!-- 顶部统计信息 -->\n    <view class=\"topinfo\" id=\"topInfo\">\n      <view class=\"calender\">\n        <text>{{ calenderArr[0] }}年</text>\n        <picker mode=\"date\" value=\"{{date}}\" fields=\"month\" start=\"2018-01-01\" end=\"2020-01-01\" @change=\"bindDateChange\">\n          <view class=\"picker\">\n            <text class=\"bold\">{{ calenderArr[1] }}</text>\n            <view class=\"iconfont icon-pulldown\"></view>\n          </view>\n        </picker>\n      </view>\n      <view class=\"income\">\n        <text>收入</text>\n        <text class=\"bold\">{{ moneyStat.income }}</text>\n      </view>\n      <view class=\"pay\">\n        <text>支出</text>\n        <text class=\"bold\">{{ moneyStat.pay }}</text>\n      </view>\n    </view>\n\n    <!-- 滚动区域 -->\n    <scroll-view class=\"scroll-view\" scroll-y style=\"height:{{ scrollHeight }}px\">\n      <view class=\"list-wrap\">\n        <repeat for=\"{{ detailList }}\" key=\"index\" index=\"index\" item=\"item\">\n          <listsection :item=\"item\"></listsection>\n        </repeat>\n      </view>\n    </scroll-view>\n\n    <!-- 记一笔 -->\n    <view class=\"btn-addbill\" @tap=\"bindToAddpage\">\n      <text>记</text>\n    </view>\n  </view>\n\n</template>\n\n<script>\n  import wepy from 'wepy'\n  import ListSection from '@/components/bill/listsection'\n  import { log, getSystem, formatTime } from '@/utils/util'\n\n  export default class Bill extends wepy.page {\n    config = {\n      navigationBarTitleText: '账本'\n    }\n\n    data = {\n      calenderArr: ['2018', '02'],   // 当前年月\n      moneyStat: {\n        income: '2000.00',   // 收入\n        pay: '890.00'       // 支出\n      },\n      detailList: [\n        {\n          info: {\n            date: '02月25日',\n            day: '星期日',\n            totalIncome: 0,\n            totalPay: 0\n          },\n          list: [\n            {\n              id: 1,\n              image: '/images/reading.png',\n              title: '餐饮',\n              remark: '',\n              mount: -12\n            },\n            {\n              id: 2,\n              image: '/images/reading.png',\n              title: '兼职',\n              remark: '',\n              mount: 20\n            },\n            {\n              id: 1,\n              image: '/images/reading.png',\n              title: '餐饮',\n              remark: '',\n              mount: -12\n            },\n            {\n              id: 2,\n              image: '/images/reading.png',\n              title: '兼职',\n              remark: '',\n              mount: 20\n            }\n          ]\n        },\n        {\n          info: {\n            date: '02月25日',\n            day: '星期日',\n            totalIncome: 0,\n            totalPay: 0\n          },\n          list: [\n            {\n              id: 1,\n              image: '/images/reading.png',\n              title: '餐饮',\n              remark: '',\n              mount: -12\n            },\n            {\n              id: 2,\n              image: '/images/reading.png',\n              title: '兼职',\n              remark: '',\n              mount: 20\n            }\n          ]\n        },\n        {\n          info: {\n            date: '02月25日',\n            day: '星期日',\n            totalIncome: 0,\n            totalPay: 0\n          },\n          list: [\n            {\n              id: 1,\n              image: '/images/reading.png',\n              title: '餐饮',\n              remark: '',\n              mount: -12\n            },\n            {\n              id: 2,\n              image: '/images/reading.png',\n              title: '兼职',\n              remark: '',\n              mount: 20\n            }\n          ]\n        },\n        {\n          info: {\n            date: '02月25日',\n            day: '星期日',\n            totalIncome: 0,\n            totalPay: 0\n          },\n          list: [\n            {\n              id: 1,\n              image: '/images/reading.png',\n              title: '餐饮',\n              remark: '',\n              mount: -12\n            },\n            {\n              id: 2,\n              image: '/images/reading.png',\n              title: '兼职',\n              remark: '',\n              mount: 20\n            }\n          ]\n        }\n      ],\n      // 滚动区域信息\n      scrollHeight: 0\n    }\n\n    components = {\n      listsection: ListSection\n    }\n\n    methods = {\n      // 选择日期\n      bindDateChange(e) {\n        let dateStr = e.detail.value\n        this.calenderArr = dateStr.split('-')\n        this.$apply()\n\n        // 发送接口请求当前月份的数据\n      },\n\n      // 跳转到记账页面\n      bindToAddpage() {\n        this.$navigate('./bill/addone')\n      }\n    }\n\n    onLoad() {\n      log('账单页面加载成功')\n      const sys = getSystem()\n      wx.createSelectorQuery().select('#topInfo').boundingClientRect((rect) => {\n        let h = rect.height\n        h = h > 0 ? h : 70\n        this.scrollHeight = sys.wh - h\n        this.$apply()\n      }).exec()\n\n      // 设置当前月份\n      const _cdate = formatTime(new Date()).slice(0, 2)\n      this.calenderArr = _cdate\n      this.$apply()\n    }\n  }\n</script>\n\n<style lang=\"less\">\n  .wrap{\n    position: relative;\n    height: 100%;\n  }\n  .topinfo{\n    display: flex;\n    justify-content: space-around;\n    height: 140rpx;\n    padding: 18rpx 0;\n    background-color: #138cff;\n    box-sizing: border-box;\n    z-index: 10;\n    text{\n      text-align: center;\n      display: block;\n      color: #fff;\n    }\n    > view > text:first-child{\n      margin-bottom: 10rpx;\n      font-size: 28rpx;\n    }\n    .bold{\n      font-size: 40rpx;\n      font-weight: bold;\n    }\n  }\n  .picker{\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    .icon-pulldown::after{\n      font-family: \"iconfont\" !important;\n      font-size: 32rpx;\n      color: #fff;\n      content: '\\e629';\n    }\n  }\n\n  .scroll-view{\n    width: 100%;\n    box-sizing: border-box;\n  }\n  .list-wrap{\n    padding-bottom: 130rpx;\n  }\n\n  .btn-addbill{\n    position: fixed;\n    right: 30rpx;\n    bottom: 15rpx;\n    height: 100rpx;\n    width: 100rpx;\n    line-height: 100rpx;\n    text-align: center;\n    background-color: rgba(19, 140, 255, .9);\n    border-radius: 100%;\n    box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.15);\n    text{\n      font-size: 26rpx;\n      color: #fff;\n    }\n  }\n</style>\n"
  },
  {
    "path": "src/pages/index.wpy",
    "content": "<template>\n  <!-- <view class=\"container\">\n    <view class=\"userinfo\" @tap=\"handleViewTap\">\n      <image class=\"userinfo-avatar\" src=\"{{ userInfo.avatarUrl }}\" background-size=\"cover\"/>\n      <view class=\"userinfo-nickname\">{{ userInfo.nickName }}</view>\n    </view>\n\n    <panel>\n      <view class=\"title\" slot=\"title\">测试数据绑定</view>\n\n      <text class=\"info\">{{normalTitle}}</text>\n      <text class=\"info\">{{setTimeoutTitle}}</text>\n      <text class=\"info\">{{mixin}}</text>\n      <text class=\"info\">{{mynum}}</text>\n      <text class=\"info\">{{now}}</text>\n      <button @tap=\"plus('a')\" size=\"mini\">  +  </button>\n    </panel>\n\n    <panel>\n      <view class=\"title\" slot=\"title\">其它测试</view>\n      <button @tap=\"toast\" size=\"mini\">第三方组件</button>\n      <button @tap=\"communicate\" size=\"mini\">组件通信</button>\n      <button @tap=\"tap\" size=\"mini\">混合TAP事件</button>\n    </panel>\n\n    <panel>\n      <view class=\"title\" slot=\"title\">测试并发网络请求</view>\n      <view>返回结果: <text>{{netrst}}</text></view>\n      <button @tap=\"request\" size=\"mini\"> 点我发起10个请求 </button>\n    </panel>\n\n    <panel>\n      <view class=\"title\" slot=\"title\">测试组件</view>\n\n      <text class=\"testcounter\">计数组件1: </text>\n      <view class=\"counterview\">\n        <counter1 @index-emit.user=\"counterEmit\" />\n      </view>\n\n      <text class=\"testcounter\">计数组件2: </text>\n\n      <view class=\"counterview\">\n        <counter2 :num.sync=\"mynum\"></counter2>\n      </view>\n    </panel>\n\n    <panel>\n      <view class=\"title\" slot=\"title\">测试组件Repeat</view>\n      <repeat for=\"\" index=\"index\" item=\"item\" key=\"key\">\n        <group :grouplist=\"item\" :indexa=\"index\"></group>\n      </repeat>\n    </panel>\n\n    <panel>\n      <view class=\"title\" slot=\"title\">测试列表</view>\n      <list></list>\n    </panel>\n\n    <toast />\n  </view> -->\n  <view class=\"wrap\">\n    <repeat for=\"{{ dynamicList }}\" key=\"index\" index=\"index\" item=\"item\">\n      <listitem\n        :id=\"item.id\"\n        :image=\"item.image\"\n        :content=\"item.content\"\n        :avatar=\"item.avatar\"\n        :createtime=\"item.create_time\"\n        :username=\"item.username\"\n        :likes=\"item.likes\">\n      </listitem>\n    </repeat>\n  </view>\n</template>\n\n<script>\n  import wepy from 'wepy'\n  import Panel from '@/components/panel' // alias example\n  import Counter from 'counter' // alias example\n  import List from '../components/list' // aliasFields example\n  import moduleA from 'module-a' // aliasFields ignore module example\n  import Group from '../components/group'\n  import Toast from 'wepy-com-toast'\n  import testMixin from '../mixins/test'\n\n  import ListItem from '@/components/index/listitem'\n\n  console.log('moduleA ignored: ', moduleA) // => moduleA ignored: {}\n\n  export default class Index extends wepy.page {\n    config = {\n      navigationBarTitleText: '圈子'\n    }\n    components = {\n      panel: Panel,\n      counter1: Counter,\n      counter2: Counter,\n      list: List,\n      group: Group,\n      toast: Toast,\n      listitem: ListItem\n    }\n\n    mixins = [testMixin]\n\n    data = {\n      dynamicList: [\n        {\n          id: 1,\n          username: '曦莫琅',\n          avatar: '/images/reading.png',\n          content: '这是动态',\n          image: '',\n          create_time: '2018-02-23 17:31',\n          likes: 12\n        },\n        {\n          id: 2,\n          username: '曦莫琅',\n          avatar: '/images/reading.png',\n          content: '这是动态',\n          image: '',\n          create_time: '2018-02-23 17:31',\n          likes: 12\n        },\n        {\n          id: 3,\n          username: '曦莫琅',\n          avatar: '/images/reading.png',\n          content: '这是动态',\n          image: '/images/reading.png',\n          create_time: '2018-02-23 17:31',\n          likes: 123\n        },\n        {\n          id: 4,\n          username: '曦莫琅',\n          avatar: '/images/reading.png',\n          content: '这是动态',\n          image: '',\n          create_time: '2018-02-23 17:31',\n          likes: 12\n        }\n      ],\n\n      mynum: 20,\n      userInfo: {\n        nickName: '加载中...'\n      },\n      normalTitle: '原始标题',\n      setTimeoutTitle: '标题三秒后会被修改',\n      count: 0,\n      netrst: '',\n      groupList: [\n        {\n          id: 1,\n          name: '点击改变',\n          list: [\n            {\n              childid: '1.1',\n              childname: '子项，点我改变'\n            }, {\n              childid: '1.2',\n              childname: '子项，点我改变'\n            }, {\n              childid: '1.3',\n              childname: '子项，点我改变'\n            }\n          ]\n        },\n        {\n          id: 2,\n          name: '点击改变',\n          list: [\n            {\n              childid: '2.1',\n              childname: '子项，点我改变'\n            }, {\n              childid: '2.2',\n              childname: '子项，点我改变'\n            }, {\n              childid: '2.3',\n              childname: '子项，点我改变'\n            }\n          ]\n        },\n        {\n          id: 3,\n          name: '点击改变',\n          list: [\n            {\n              childid: '3.1',\n              childname: '子项，点我改变'\n            }\n          ]\n        }\n      ]\n    }\n\n    computed = {\n      now () {\n        return +new Date()\n      }\n    }\n\n    methods = {\n      plus () {\n        this.mynum++\n      },\n      toast () {\n        let promise = this.$invoke('toast', 'show', {\n          title: '自定义标题',\n          img: 'https://raw.githubusercontent.com/kiinlam/wetoast/master/images/star.png'\n        })\n\n        promise.then((d) => {\n          console.log('toast done')\n        })\n      },\n      tap () {\n        console.log('do noting from ' + this.$name)\n      },\n      communicate () {\n        console.log(this.$name + ' tap')\n\n        this.$invoke('counter2', 'minus', 45, 6)\n        this.$invoke('counter1', 'plus', 45, 6)\n\n        this.$broadcast('index-broadcast', 1, 3, 4)\n      },\n      request () {\n        let self = this\n        let i = 10\n        let map = ['MA==', 'MQo=', 'Mg==', 'Mw==', 'NA==', 'NQ==', 'Ng==', 'Nw==', 'OA==', 'OQ==']\n        while (i--) {\n          wepy.request({\n            url: 'https://www.madcoder.cn/tests/sleep.php?time=1&t=css&c=' + map[i] + '&i=' + i,\n            success: function (d) {\n              self.netrst += d.data + '.'\n              self.$apply()\n            }\n          })\n        }\n      },\n      counterEmit (...args) {\n        let $event = args[args.length - 1]\n        console.log(`${this.$name} receive ${$event.name} from ${$event.source.$name}`)\n      }\n    }\n\n    events = {\n      'index-emit': (...args) => {\n        let $event = args[args.length - 1]\n        console.log(`${this.$name} receive ${$event.name} from ${$event.source.$name}`)\n      }\n    }\n\n    onLoad() {\n      let self = this\n      this.$parent.getUserInfo(function (userInfo) {\n        if (userInfo) {\n          self.userInfo = userInfo\n        }\n        self.normalTitle = '标题已被修改'\n\n        self.setTimeoutTitle = '标题三秒后会被修改'\n        setTimeout(() => {\n          self.setTimeoutTitle = '到三秒了'\n          self.$apply()\n        }, 3000)\n\n        self.$apply()\n      })\n    }\n  }\n</script>\n\n<style lang=\"less\">\n  .wrap{\n    background-color: #f8f8f8;\n  }\n  .userinfo {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n  }\n\n  .userinfo-avatar {\n    width: 80rpx;\n    height: 80rpx;\n    border-radius: 50%;\n  }\n\n  .userinfo-nickname {\n    color: #aaa;\n  }\n</style>\n"
  },
  {
    "path": "src/pages/me.wpy",
    "content": "<template>\n  <view class=\"wrap\">\n    <view class=\"toparea\">\n      <view class=\"left\">\n        <text>资产</text>\n        <text>{{ assets }} 币</text>\n      </view>\n      <view class=\"center\">\n        <image src=\"{{ userInfo.avatarUrl }}\"></image>\n        <text>{{ userInfo.nickName }}</text>\n        <text>{{ userInfo.country }}</text>\n      </view>\n      <view class=\"right\">\n        <text>计划</text>\n        <text>{{ hours }} h</text>\n      </view>\n    </view>\n\n    <!-- 菜单列表 -->\n    <view class=\"menulist\">\n      <view class=\"menuitem\">\n        <view class=\"icon iconfont icon-plan\"></view>\n        <text>计划统计</text>\n      </view>\n      <view class=\"menuitem\">\n        <view class=\"icon iconfont icon-bill\"></view>\n        <text>账本统计</text>\n      </view>\n      <view class=\"menuitem\">\n        <view class=\"icon iconfont icon-setting\"></view>\n        <text>设置</text>\n      </view>\n    </view>\n\n    <!-- 菜单列表 -->\n    <view class=\"menulist\">\n      <view class=\"menuitem\">\n        <view class=\"icon iconfont icon-menual\"></view>\n        <text>使用手册</text>\n      </view>\n      <view class=\"menuitem\">\n        <view class=\"icon iconfont icon-feed\"></view>\n        <text>意见反馈</text>\n      </view>\n      <view class=\"menuitem\">\n        <view class=\"icon iconfont icon-log\"></view>\n        <text>更新日志</text>\n      </view>\n      <view class=\"menuitem\">\n        <view class=\"icon iconfont icon-author\"></view>\n        <text>关于</text>\n      </view>\n    </view>\n  </view>\n</template>\n\n<script>\n  import wepy from 'wepy'\n  export default class Me extends wepy.page {\n    config = {\n      navigationBarTitleText: '我的'\n    }\n\n    data = {\n      userInfo: {},\n      assets: 12330,\n      hours: 120\n    }\n\n    onLoad() {\n      let self = this\n      this.$parent.getUserInfo(function (userInfo) {\n        if (userInfo) {\n          self.userInfo = userInfo\n        }\n        self.$apply()\n      })\n    }\n  }\n</script>\n\n<style lang=\"less\">\n  .toparea{\n    display: flex;\n    align-items: baseline;\n    text-align: center;\n    padding: 50rpx 0;\n    margin-bottom: 20rpx;\n    background-color: #138cff;\n    text{\n      display: block;\n      font-size: 26rpx;\n      color: #fff;\n    }\n  }\n  .left, .right{\n    width: 25%;\n    text:last-child{\n      margin-top: 10rpx;\n      font-size: 28rpx;\n      font-weight: bold;\n      color: #fff;\n    }\n  }\n  .center{\n    flex: 1;\n    image{\n      display: block;\n      width: 100rpx;\n      height: 100rpx;\n      margin: 0 auto 30rpx auto;\n      border-radius: 100%;\n      border: 1rpx solid #f8f8f8;\n    }\n    text:last-child{\n      margin-top: 10rpx;\n      font-size: 28rpx;\n      font-weight: bold;\n    }\n  }\n\n  .menulist{\n    margin-bottom: 20rpx;\n    background-color: #fff;\n    .menuitem{\n      display: flex;\n      padding: 30rpx;\n      transition: background-color 0.3s;\n      .icon{\n        margin-right: 20rpx;\n        width: 50rpx;\n        height: 50rpx;\n        text-align: center;\n      }\n      .icon::after{\n        font-family: \"iconfont\" !important;\n        font-size: 34rpx;\n        line-height: 50rpx;\n      }\n      text{\n        flex: 1;\n        display: block;\n        height: 50rpx;\n        line-height: 50rpx;\n        font-size: 26rpx;\n        color: #666;\n      }\n    }\n    .menuitem:active{\n      background-color: #f8f8f8;\n    }\n\n    .icon-plan::after{\n      content: \"\\e601\";\n      color: #138cff;\n    }\n    .icon-bill::after{\n      content: \"\\e61c\";\n      color: #138cff;\n    }\n    .icon-setting::after{\n      content: \"\\e62c\";\n      color: #138cff;\n    }\n    .icon-menual::after{\n      content: \"\\e647\";\n      color: #138cff;\n    }\n    .icon-feed::after{\n      content: \"\\e62f\";\n      color: #138cff;\n    }\n    .icon-log::after{\n      content: \"\\e696\";\n      color: #138cff;\n    }\n    .icon-author::after{\n      content: \"\\e614\";\n      color: #138cff;\n    }\n  }\n</style>\n"
  },
  {
    "path": "src/pages/plan/clock.wpy",
    "content": "<template>\n  <view class=\"wrap\">\n    <view class=\"plan-head\">\n      <text>计划 {{ planTitle }} {{ totalTime }} 分钟</text>\n    </view>\n\n    <!-- 时钟 -->\n    <view class=\"clock\" wx:if=\"{{ isStart }}\">\n      <text>计时中</text>\n      <text>{{ clock[0] }} : {{ clock[1] }} : {{ clock[2] }}</text>\n    </view>\n    <picker wx:else @change=\"bindPickerChange\" value=\"{{ index }}\" range=\"{{ minutesArray }}\">\n      <view class=\"clock\">\n        <text wx:if=\"{{ !hadSet }}\">点击设置时长 (分钟)</text>\n        <text wx:else>暂停中</text>\n        <text>{{ clock[0] }} : {{ clock[1] }} : {{ clock[2] }}</text>\n      </view>\n    </picker>\n\n    <!-- 底部控制按钮 -->\n    <view class=\"control-area\">\n      <view class=\"btn-pause\" @tap=\"bindStartOrPause\">\n        <text>{{ btnText }}</text>\n      </view>\n      <view class=\"btn-giveup\">\n        <text>放弃</text>\n      </view>\n      <view class=\"tips\">\n        <text>坚持就是胜利</text>\n        <text>放弃意味着放弃本次计划的执行</text>\n        <text>同样也意味着在计划执行过程中的一次“小失败”</text>\n      </view>\n    </view>\n  </view>\n</template>\n\n<script>\n  import wepy from 'wepy'\n  import { getTimeArr, isZero } from '@/utils/util'\n  \n  let timer = null\n\n  export default class Clock extends wepy.page {\n    config = {\n      navigationBarTitleText: '计时器'\n    }\n\n    data = {\n      planId: '',     // 计划ID\n      planTitle: '',  // 计划标题\n      totalTime: 0,    // 计划执行时间（秒）\n      restTime: 0,    // 计划执行剩余的事件（秒）\n      isStart: false, // 本次计划是否开始\n      hadSet: false,  // 记录是否设置过事件\n      btnText: '开始',  // 按钮的文字\n      clock: ['00', '00', '00'],   // 秒表\n      minutesArray: [1, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120]\n    }\n\n    computed = {}\n\n    methods = {\n      // 点击设置时间\n      bindPickerChange(e) {\n        let minutes = this.minutesArray[parseInt(e.detail.value)]\n        let _clock = getTimeArr(new Date().getTime() + minutes * 60 * 1000)\n        this.totalTime = minutes\n        this.restTime = minutes * 60    // 秒\n        this.clock = _clock\n        this.hadSet = true\n        this.$apply()\n      },\n      // 点击开始或暂停\n      bindStartOrPause() {\n        let _isStart = this.isStart\n        if (_isStart && !isZero(this.clock)) {\n          this.isStart = false\n          this.btnText = '继续'\n          // 停止倒计时\n          clearInterval(timer)\n        } else if (!_isStart && !isZero(this.clock)) {\n          this.isStart = true\n          this.btnText = '暂停'\n          // 开始\\继续倒计时\n          this.loop(this.restTime, (array) => {\n            let _rest = this.restTime\n            this.restTime = _rest - 1\n            this.clock = array\n            this.$apply()\n          })\n\n          timer = setInterval(() => {\n            this.loop(this.restTime, (array) => {\n              let _rest = this.restTime\n              this.restTime = _rest - 1\n              this.clock = array\n              this.$apply()\n            })\n          }, 1000)\n        } else {\n          this.isStart = false\n          this.btnText = '开始'\n          console.log('请先设置时长')\n        }\n        this.$apply()\n      }\n    }\n\n    // 自定义辅助函数\n    loop(time, cb) {\n      let arr = getTimeArr(new Date().getTime() + time * 1000)\n      cb && cb(arr)\n      if (isZero(arr)) {\n        // 倒计时完成，清除定时器\n        clearInterval(timer)\n        // 重置状态\n        this.isStart = false\n        this.hadSet = false\n        this.btnText = '开始'\n        this.$apply()\n        // 发送post请求发送数据\n      }\n    }\n\n    onLoad(params) {\n      // 没有传递计划ID，页面报错\n      if (!params.planId || !params.planTitle) return\n      this.planId = params.planId\n      this.planTitle = params.planTitle\n      this.$apply()\n    }\n\n    onUnload() {\n      console.log('页面隐藏，清除定时器')\n      // clearInterval(timer)\n    }\n  }\n</script>\n\n<style lang=\"less\">\n  .wrap {\n    display: flex;\n    justify-content: space-around;\n    align-items: center;\n    flex-direction: column;\n    height: 100%;\n    background-color: #fff;\n  }\n  .plan-head text{\n    font-size: 34rpx;\n  }\n  .clock{\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    flex-direction: column;\n    width: 400rpx;\n    height: 400rpx;\n    border-radius: 100%;\n    border: 1rpx solid rgba(19,140,255,.5);\n    text:first-child{\n      font-size: 26rpx;\n      color: #666;\n    }\n    text:last-child{\n      font-size: 50rpx;\n      color: #138cff;\n    }\n  }\n  .control-area{\n    text-align: center;\n    .btn-pause, .btn-giveup{\n      margin: 20rpx auto;\n      width: 140rpx;\n      height: 56rpx;\n      line-height: 56rpx;\n      color: #fff;\n      font-size: 28rpx;\n      border-radius: 4rpx;\n    }\n    .btn-pause{\n      background-color: #138cff;\n    }\n    .btn-giveup{\n      color: #757982;\n    }\n    .tips{\n      margin-top: 40rpx;\n    }\n    .tips text{\n      display: block;\n      font-size: 24rpx;\n      color: #ccc;\n    }\n  }\n</style>\n"
  },
  {
    "path": "src/pages/plan.wpy",
    "content": "<template>\n  <view class=\"wrap\">\n    <swiper class=\"swiper\">\n      <repeat for=\"{{ planList }}\" key=\"index\" index=\"index\" item=\"item\">\n        <swiper-item>\n          <listitem \n            :id=\"item.id\"\n            :image=\"item.image\"\n            :title=\"item.title\"\n            :remark=\"item.remark\"\n            :createtime=\"item.create_time\"\n            :hours=\"item.hours\"\n            :times=\"item.times\">\n          </listitem>\n        </swiper-item>\n      </repeat>\n    </swiper>\n  </view>\n</template>\n\n<script>\n  import wepy from 'wepy'\n  import ListItem from '@/components/plan/listitem'\n\n  export default class Plan extends wepy.page {\n    config = {\n      navigationBarTitleText: '计划'\n    }\n\n    data = {\n      planList: [\n        {\n          id: 1,\n          image: '/images/reading.png',\n          title: '阅读',\n          remark: '书籍并不是没有生命的东西，它包藏着一种生命的潜力，与作者同样地活跃。不仅如此，它还像一个宝瓶，把作者生机勃勃的智慧中最纯净的精华保存起来。',\n          create_time: '2018年2月24日',\n          times: 0,\n          hours: '5.22'\n        },\n        {\n          id: 2,\n          image: '/images/reading.png',\n          title: '运动',\n          remark: '一定要每天运动三十分钟',\n          create_time: '2018年2月24日',\n          times: 2,\n          hours: '2.22'\n        }\n      ]\n    }\n\n    components = {\n      listitem: ListItem\n    }\n  }\n</script>\n\n<style lang=\"less\">\n  .wrap {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    height: 100%;\n    .swiper {\n      width: 100%;\n      height: 100%;\n      text-align: center;\n      swiper-item {\n        display: flex;\n        justify-content: center;\n        align-items: center;\n        padding: 60rpx;\n        box-sizing: border-box;\n      }\n    }\n  }\n</style>\n"
  },
  {
    "path": "src/pages/ranking.wpy",
    "content": "<template>\n  <view class=\"wrap\">\n    <view class=\"typewrap\">\n      <view class=\"typebar\">\n        <view class=\"{{ rank.typeId === '1' ? 'active' : '' }}\" @tap=\"toggleType(1)\">\n          <text>资产排行</text>\n        </view>\n        <view class=\"{{ rank.typeId === '2' ? 'active' : '' }}\" @tap=\"toggleType(2)\">\n          <text>目标排行</text>\n        </view>\n      </view>\n    </view>\n\n    <!-- 排行榜滚动区域 -->\n    <view class=\"rankbox\">\n      <scroll-view>\n        <repeat for=\"{{ rankList }}\" key=\"index\" index=\"index\" item=\"item\">\n          <view class=\"item\" data-id=\"{{ item.id }}\">\n            <view class=\"number\">{{ index + 1 }}</view>\n            <image src=\"{{ item.image }}\"></image>\n            <text class=\"name\">{{ item.name }}</text>\n            <text class=\"val\">{{ item.val }}</text>\n          </view>\n        </repeat>\n      </scroll-view>\n    </view>\n  </view>\n</template>\n\n<script>\n  import wepy from 'wepy'\n  export default class Ranking extends wepy.page {\n    config = {\n      navigationBarTitleText: '榜单'\n    }\n\n    data = {\n      rankList: [\n        {\n          id: 1,\n          image: '/images/reading.png',\n          name: '曦莫琅',\n          val: '100币'\n        },\n        {\n          id: 2,\n          image: '/images/reading.png',\n          name: '曦莫琅',\n          val: '100币'\n        },\n        {\n          id: 3,\n          image: '/images/reading.png',\n          name: '曦莫琅',\n          val: '100币'\n        },\n        {\n          id: 4,\n          image: '/images/reading.png',\n          name: '曦莫琅',\n          val: '100币'\n        }\n      ],\n      rank: {\n        typeId: '1'\n      }\n    }\n\n    methods = {\n      toggleType(t) {\n        if (t === '1' && this.rank.typeId === '2') {\n          this.rank.typeId = t\n        } else if (t === '2' && this.rank.typeId === '1') {\n          this.rank.typeId = t\n        }\n      }\n    }\n  }\n</script>\n\n<style lang=\"less\">\n  .typewrap{\n    padding: 30rpx 0;\n  }\n  .typebar{\n    display: flex;\n    width: 50%;\n    margin: 0 auto;\n    height: 60rpx;\n    view{\n      width: 50%;\n      line-height: 60rpx;\n      text-align: center;\n      font-size: 28rpx;\n      background-color: #fff;\n      transition: background-color .3s;\n      box-sizing: border-box;\n      border: 2rpx solid #138cff;\n      text{\n        color: #138cff;\n      }\n    }\n    view:first-child{\n      border-top-left-radius: 6rpx;\n      border-bottom-left-radius: 6rpx;\n    }\n    view:last-child{\n      border-top-right-radius: 6rpx;\n      border-bottom-right-radius: 6rpx;\n    }\n    .active{\n      background-color: #138cff;\n      text{\n        color: #fff;\n      }\n    }\n  }\n\n  .rankbox{\n    padding: 0 30rpx;\n  }\n\n  .rankbox .item{\n    display: flex;\n    padding: 10rpx;\n    height: 60rpx;\n    border-bottom: 1rpx solid #f3f3f3;\n    text{\n      font-size: 28rpx;\n      line-height: 60rpx;\n    }\n    .number{\n      width: 100rpx;\n      text-align: center;\n    }\n    image{\n      display: block;\n      margin-right: 30rpx;\n      width: 60rpx;\n      height: 60rpx;\n    }\n    .name{\n      flex: 1;\n    }\n    .val{\n      padding: 0 20rpx;\n    }\n  }\n</style>\n"
  },
  {
    "path": "src/utils/config.js",
    "content": "// 账本支出类目\nexport const payCateList = [\n  {\n    type: 'pay',\n    cateId: 1,\n    cateName: '餐饮'\n  },\n  {\n    type: 'pay',\n    cateId: 2,\n    cateName: '购物'\n  },\n  {\n    type: 'pay',\n    cateId: 3,\n    cateName: '日用'\n  },\n  {\n    type: 'pay',\n    cateId: 4,\n    cateName: '交通'\n  },\n  {\n    type: 'pay',\n    cateId: 5,\n    cateName: '蔬菜'\n  },\n  {\n    type: 'pay',\n    cateId: 6,\n    cateName: '水果'\n  },\n  {\n    type: 'pay',\n    cateId: 7,\n    cateName: '零食'\n  },\n  {\n    type: 'pay',\n    cateId: 8,\n    cateName: '运动'\n  },\n  {\n    type: 'pay',\n    cateId: 9,\n    cateName: '娱乐'\n  },\n  {\n    type: 'pay',\n    cateId: 10,\n    cateName: '通讯'\n  },\n  {\n    type: 'pay',\n    cateId: 11,\n    cateName: '服饰'\n  },\n  {\n    type: 'pay',\n    cateId: 12,\n    cateName: '美容'\n  },\n  {\n    type: 'pay',\n    cateId: 13,\n    cateName: '住房'\n  },\n  {\n    type: 'pay',\n    cateId: 14,\n    cateName: '居家'\n  },\n  {\n    type: 'pay',\n    cateId: 15,\n    cateName: '孩子'\n  },\n  {\n    type: 'pay',\n    cateId: 16,\n    cateName: '长辈'\n  },\n  {\n    type: 'pay',\n    cateId: 17,\n    cateName: '社交'\n  },\n  {\n    type: 'pay',\n    cateId: 18,\n    cateName: '旅行'\n  },\n  {\n    type: 'pay',\n    cateId: 19,\n    cateName: '烟酒'\n  },\n  {\n    type: 'pay',\n    cateId: 20,\n    cateName: '数码'\n  },\n  {\n    type: 'pay',\n    cateId: 21,\n    cateName: '汽车'\n  },\n  {\n    type: 'pay',\n    cateId: 22,\n    cateName: '医疗'\n  },\n  {\n    type: 'pay',\n    cateId: 23,\n    cateName: '书籍'\n  },\n  {\n    type: 'pay',\n    cateId: 24,\n    cateName: '学习'\n  },\n  {\n    type: 'pay',\n    cateId: 25,\n    cateName: '宠物'\n  },\n  {\n    type: 'pay',\n    cateId: 26,\n    cateName: '礼金'\n  },\n  {\n    type: 'pay',\n    cateId: 27,\n    cateName: '礼物'\n  },\n  {\n    type: 'pay',\n    cateId: 28,\n    cateName: '办公'\n  },\n  {\n    type: 'pay',\n    cateId: 29,\n    cateName: '维修'\n  },\n  {\n    type: 'pay',\n    cateId: 30,\n    cateName: '捐赠'\n  },\n  {\n    type: 'pay',\n    cateId: 31,\n    cateName: '彩票'\n  },\n  {\n    type: 'pay',\n    cateId: 32,\n    cateName: '亲友'\n  },\n  {\n    type: 'pay',\n    cateId: 33,\n    cateName: '快递'\n  },\n  {\n    type: 'pay',\n    cateId: 34,\n    cateName: '其他'\n  }\n]\n\n// 账本收入类目\nexport const incomeCateList = [\n  {\n    type: 'income',\n    cateId: 1,\n    cateName: '工资'\n  },\n  {\n    type: 'income',\n    cateId: 2,\n    cateName: '兼职'\n  },\n  {\n    type: 'income',\n    cateId: 3,\n    cateName: '理财'\n  },\n  {\n    type: 'income',\n    cateId: 4,\n    cateName: '礼金'\n  },\n  {\n    type: 'income',\n    cateId: 5,\n    cateName: '红包'\n  },\n  {\n    type: 'income',\n    cateId: 6,\n    cateName: '其他'\n  }\n]"
  },
  {
    "path": "src/utils/util.js",
    "content": "// 辅助函数，log\nexport const log = console.log.bind(console)\n\n// 倒计时函数\n// 传入秒数，返回剩余的时，分，秒\n// endtime [Number]\n\nexport const getTimeArr = (endtime) => {\n  let now = new Date().getTime()\n  let resttime = (endtime - now) / 1000\n  let h, m, s\n  if (resttime > 0) {\n    h = Math.floor(resttime / 60 / 60 % 24)\n    m = Math.floor(resttime / 60 % 60)\n    s = Math.floor(resttime % 60)\n\n    h = h < 10 ? ('0' + h) : h\n    m = m < 10 ? ('0' + m) : m\n    s = s < 10 ? ('0' + s) : s\n  } else {\n    h = '00'\n    m = '00'\n    s = '00'\n  }\n\n  return [h, m, s]\n}\n\n// 判断三元素的数组是否都为‘00’\nexport const isZero = (arr) => {\n  if (arr.length !== 3) {\n    return 'error'\n  } else if (arr[0] === '00' && arr[1] === '00' && arr[2] === '00') {\n    return true\n  } else {\n    return false\n  }\n}\n\n// 获取设备系统信息\nexport const getSystem = () => {\n  let sys = {}\n  wx.getSystemInfo({\n    success: function (res) {\n      sys.pixelRatio = res.pixelRatio\n      sys.ww = res.windowWidth\n      sys.wh = res.windowHeight\n      sys.barh = res.statusBarHeight\n    }\n  })\n  return sys\n}\n\n// 本地存储相关\nexport const SetItem = (key, value) => {\n  wx.setStorageSync(key, value)\n}\n\nexport const GetItem = (key) => {\n  return wx.getStorageSync(key)\n}\n\n// 格式化日期\nexport const formatTime = (date) => {\n  var year = date.getFullYear()\n  var month = date.getMonth() + 1\n  var day = date.getDate()\n  var hour = date.getHours()\n  var minute = date.getMinutes()\n  var second = date.getSeconds()\n  return [year, month, day].map(formatNumber).concat([hour, minute, second].map(formatNumber))\n}\n\nfunction formatNumber(n) {\n  n = n.toString()\n  return n[1] ? n : '0' + n\n}"
  },
  {
    "path": "wepy.config.js",
    "content": "const path = require('path');\nvar prod = process.env.NODE_ENV === 'production';\n\nmodule.exports = {\n  wpyExt: '.wpy',\n  eslint: true,\n  cliLogs: !prod,\n  build: {\n    web: {\n      htmlTemplate: path.join('src', 'index.template.html'),\n      htmlOutput: path.join('web', 'index.html'),\n      jsOutput: path.join('web', 'index.js')\n    }\n  },\n  resolve: {\n    alias: {\n      counter: path.join(__dirname, 'src/components/counter'),\n      '@': path.join(__dirname, 'src')\n    },\n    aliasFields: ['wepy'],\n    modules: ['node_modules']\n  },\n  compilers: {\n    less: {\n      compress: prod\n    },\n    /*sass: {\n      outputStyle: 'compressed'\n    },*/\n    babel: {\n      sourceMap: !prod,\n      presets: [\n        'env'\n      ],\n      plugins: [\n        'transform-class-properties',\n        'transform-decorators-legacy',\n        'transform-object-rest-spread',\n        'transform-export-extensions',\n      ]\n    }\n  },\n  plugins: {\n  },\n  appConfig: {\n    noPromiseAPI: ['createSelectorQuery']\n  }\n}\n\nif (prod) {\n\n  // 压缩sass\n  // module.exports.compilers['sass'] = {outputStyle: 'compressed'}\n\n  // 压缩js\n  module.exports.plugins = {\n    uglifyjs: {\n      filter: /\\.js$/,\n      config: {\n      }\n    },\n    imagemin: {\n      filter: /\\.(jpg|png|jpeg)$/,\n      config: {\n        jpg: {\n          quality: 80\n        },\n        png: {\n          quality: 80\n        }\n      }\n    }\n  }\n}\n"
  }
]