Repository: seymoe/mp-jishengji Branch: master Commit: f3d70636ef57 Files: 34 Total size: 60.4 KB Directory structure: gitextract_7vk5hfap/ ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .prettierrc ├── .wepycache ├── .wepyignore ├── LICENSE ├── README.md ├── package.json ├── src/ │ ├── app.wpy │ ├── components/ │ │ ├── bill/ │ │ │ ├── cateslide.wpy │ │ │ ├── listitem.wpy │ │ │ └── listsection.wpy │ │ ├── counter.wpy │ │ ├── group.wpy │ │ ├── groupitem.wpy │ │ ├── index/ │ │ │ └── listitem.wpy │ │ ├── list.wpy │ │ ├── panel.wpy │ │ ├── plan/ │ │ │ └── listitem.wpy │ │ └── wepy-list.wpy │ ├── index.template.html │ ├── mixins/ │ │ └── test.js │ ├── pages/ │ │ ├── bill/ │ │ │ └── addone.wpy │ │ ├── bill.wpy │ │ ├── index.wpy │ │ ├── me.wpy │ │ ├── plan/ │ │ │ └── clock.wpy │ │ ├── plan.wpy │ │ └── ranking.wpy │ └── utils/ │ ├── config.js │ └── util.js └── wepy.config.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .editorconfig ================================================ root = true [*] charset = utf-8 indent_style = space indent_size = 2 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true ================================================ FILE: .eslintignore ================================================ dist/* ================================================ FILE: .eslintrc.js ================================================ module.exports = { root: true, parser: 'babel-eslint', parserOptions: { sourceType: 'module' }, env: { browser: true }, // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style extends: 'standard', // required to lint *.wpy files plugins: [ 'html' ], settings: { 'html/html-extensions': ['.html', '.wpy'] }, // add your custom rules here 'rules': { // allow paren-less arrow functions 'arrow-parens': 0, // allow async-await 'generator-star-spacing': 0, // allow debugger during development 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, 'space-before-function-paren': 0 } } ================================================ FILE: .gitignore ================================================ node_modules dist .DB_store ================================================ FILE: .prettierrc ================================================ { "singleQuote": true } ================================================ FILE: .wepycache ================================================ {"/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} ================================================ FILE: .wepyignore ================================================ node_modules dist .DB_store *.wpy___jb_tmp___ ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2018 Molang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # 记生计 [小程序] 一款日常生活记录类的工具小程序,通过wepyjs构建,包含计划、账本、圈子、榜单和个人中心等模块。 状态:未完成 ## 玩耍: 1. Fork 或 `git clone https://github.com/seymoe/mp-jishengji.git` 或 download 2. `cd mp-jishengji && npm install` 3. `wepy build --watch` (如果未安装wepy-cli,请先安装,见[WePY](https://tencent.github.io/wepy/index.html)) 4. 微信开发者工具目录选择dist --- + 计划 + 账本 + 我的 ## 想法: 本项目本来是作为私有仓库开发,但感觉独乐乐不如众乐乐,本小程序经过本人调研两天时间,结合个人开发者类目许可要求以及目前上线的众小程序来看,综合而来的想法,我相信做出这个小程序,无论如何都能获得一部分用户,或多或少。个人开发者完全可以尝试,特别是想利用wepy构建小程序练手的前端er来说。顺便求fork、star。 ## 计划: + 完善圈子、榜单等相关页面开发 + 构建后端API,实现发圈、完成计划,记账等功能的数据存储支持 + 增加数据统计与图标分析 + 完善功能,优化细节 ## License MIT ================================================ FILE: package.json ================================================ { "name": "jishengji-miniapp", "version": "0.0.1", "description": "A WePY project", "main": "dist/app.js", "scripts": { "dev": "wepy build --watch", "build": "cross-env NODE_ENV=production wepy build --no-cache", "dev:web": "wepy build --output web", "clean": "find ./dist -maxdepth 1 -not -name 'project.config.json' -not -name 'dist' | xargs rm -rf", "test": "echo \"Error: no test specified\" && exit 1" }, "wepy": { "module-a": false, "./src/components/list": "./src/components/wepy-list.wpy" }, "author": "ximolang", "license": "MIT", "dependencies": { "wepy": "^1.6.0", "wepy-async-function": "^1.4.4", "wepy-com-toast": "^1.0.2" }, "devDependencies": { "babel-eslint": "^7.2.1", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-export-extensions": "^6.22.0", "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-preset-env": "^1.6.1", "cross-env": "^5.1.3", "eslint": "^3.18.0", "eslint-config-standard": "^7.1.0", "eslint-friendly-formatter": "^2.0.7", "eslint-plugin-html": "^2.0.1", "eslint-plugin-promise": "^3.5.0", "eslint-plugin-standard": "^2.0.1", "wepy-eslint": "^1.5.3", "wepy-compiler-babel": "^1.5.1", "wepy-compiler-less": "^1.3.10" } } ================================================ FILE: src/app.wpy ================================================ ================================================ FILE: src/components/bill/cateslide.wpy ================================================ ================================================ FILE: src/components/bill/listitem.wpy ================================================ ================================================ FILE: src/components/bill/listsection.wpy ================================================ ================================================ FILE: src/components/counter.wpy ================================================ ================================================ FILE: src/components/group.wpy ================================================ ================================================ FILE: src/components/groupitem.wpy ================================================ ================================================ FILE: src/components/index/listitem.wpy ================================================ ================================================ FILE: src/components/list.wpy ================================================ ================================================ FILE: src/components/panel.wpy ================================================ ================================================ FILE: src/components/plan/listitem.wpy ================================================ ================================================ FILE: src/components/wepy-list.wpy ================================================ ================================================ FILE: src/index.template.html ================================================ 转 WEB DEMO
================================================ FILE: src/mixins/test.js ================================================ import wepy from 'wepy' export default class testMixin extends wepy.mixin { data = { mixin: 'This is mixin data.' } methods = { tap () { this.mixin = 'mixin data was changed' console.log('mixin method tap') } } onShow() { console.log('mixin onShow') } onLoad() { console.log('mixin onLoad') } } ================================================ FILE: src/pages/bill/addone.wpy ================================================ ================================================ FILE: src/pages/bill.wpy ================================================ ================================================ FILE: src/pages/index.wpy ================================================ ================================================ FILE: src/pages/me.wpy ================================================ ================================================ FILE: src/pages/plan/clock.wpy ================================================ ================================================ FILE: src/pages/plan.wpy ================================================ ================================================ FILE: src/pages/ranking.wpy ================================================ ================================================ FILE: src/utils/config.js ================================================ // 账本支出类目 export const payCateList = [ { type: 'pay', cateId: 1, cateName: '餐饮' }, { type: 'pay', cateId: 2, cateName: '购物' }, { type: 'pay', cateId: 3, cateName: '日用' }, { type: 'pay', cateId: 4, cateName: '交通' }, { type: 'pay', cateId: 5, cateName: '蔬菜' }, { type: 'pay', cateId: 6, cateName: '水果' }, { type: 'pay', cateId: 7, cateName: '零食' }, { type: 'pay', cateId: 8, cateName: '运动' }, { type: 'pay', cateId: 9, cateName: '娱乐' }, { type: 'pay', cateId: 10, cateName: '通讯' }, { type: 'pay', cateId: 11, cateName: '服饰' }, { type: 'pay', cateId: 12, cateName: '美容' }, { type: 'pay', cateId: 13, cateName: '住房' }, { type: 'pay', cateId: 14, cateName: '居家' }, { type: 'pay', cateId: 15, cateName: '孩子' }, { type: 'pay', cateId: 16, cateName: '长辈' }, { type: 'pay', cateId: 17, cateName: '社交' }, { type: 'pay', cateId: 18, cateName: '旅行' }, { type: 'pay', cateId: 19, cateName: '烟酒' }, { type: 'pay', cateId: 20, cateName: '数码' }, { type: 'pay', cateId: 21, cateName: '汽车' }, { type: 'pay', cateId: 22, cateName: '医疗' }, { type: 'pay', cateId: 23, cateName: '书籍' }, { type: 'pay', cateId: 24, cateName: '学习' }, { type: 'pay', cateId: 25, cateName: '宠物' }, { type: 'pay', cateId: 26, cateName: '礼金' }, { type: 'pay', cateId: 27, cateName: '礼物' }, { type: 'pay', cateId: 28, cateName: '办公' }, { type: 'pay', cateId: 29, cateName: '维修' }, { type: 'pay', cateId: 30, cateName: '捐赠' }, { type: 'pay', cateId: 31, cateName: '彩票' }, { type: 'pay', cateId: 32, cateName: '亲友' }, { type: 'pay', cateId: 33, cateName: '快递' }, { type: 'pay', cateId: 34, cateName: '其他' } ] // 账本收入类目 export const incomeCateList = [ { type: 'income', cateId: 1, cateName: '工资' }, { type: 'income', cateId: 2, cateName: '兼职' }, { type: 'income', cateId: 3, cateName: '理财' }, { type: 'income', cateId: 4, cateName: '礼金' }, { type: 'income', cateId: 5, cateName: '红包' }, { type: 'income', cateId: 6, cateName: '其他' } ] ================================================ FILE: src/utils/util.js ================================================ // 辅助函数,log export const log = console.log.bind(console) // 倒计时函数 // 传入秒数,返回剩余的时,分,秒 // endtime [Number] export const getTimeArr = (endtime) => { let now = new Date().getTime() let resttime = (endtime - now) / 1000 let h, m, s if (resttime > 0) { h = Math.floor(resttime / 60 / 60 % 24) m = Math.floor(resttime / 60 % 60) s = Math.floor(resttime % 60) h = h < 10 ? ('0' + h) : h m = m < 10 ? ('0' + m) : m s = s < 10 ? ('0' + s) : s } else { h = '00' m = '00' s = '00' } return [h, m, s] } // 判断三元素的数组是否都为‘00’ export const isZero = (arr) => { if (arr.length !== 3) { return 'error' } else if (arr[0] === '00' && arr[1] === '00' && arr[2] === '00') { return true } else { return false } } // 获取设备系统信息 export const getSystem = () => { let sys = {} wx.getSystemInfo({ success: function (res) { sys.pixelRatio = res.pixelRatio sys.ww = res.windowWidth sys.wh = res.windowHeight sys.barh = res.statusBarHeight } }) return sys } // 本地存储相关 export const SetItem = (key, value) => { wx.setStorageSync(key, value) } export const GetItem = (key) => { return wx.getStorageSync(key) } // 格式化日期 export const formatTime = (date) => { var year = date.getFullYear() var month = date.getMonth() + 1 var day = date.getDate() var hour = date.getHours() var minute = date.getMinutes() var second = date.getSeconds() return [year, month, day].map(formatNumber).concat([hour, minute, second].map(formatNumber)) } function formatNumber(n) { n = n.toString() return n[1] ? n : '0' + n } ================================================ FILE: wepy.config.js ================================================ const path = require('path'); var prod = process.env.NODE_ENV === 'production'; module.exports = { wpyExt: '.wpy', eslint: true, cliLogs: !prod, build: { web: { htmlTemplate: path.join('src', 'index.template.html'), htmlOutput: path.join('web', 'index.html'), jsOutput: path.join('web', 'index.js') } }, resolve: { alias: { counter: path.join(__dirname, 'src/components/counter'), '@': path.join(__dirname, 'src') }, aliasFields: ['wepy'], modules: ['node_modules'] }, compilers: { less: { compress: prod }, /*sass: { outputStyle: 'compressed' },*/ babel: { sourceMap: !prod, presets: [ 'env' ], plugins: [ 'transform-class-properties', 'transform-decorators-legacy', 'transform-object-rest-spread', 'transform-export-extensions', ] } }, plugins: { }, appConfig: { noPromiseAPI: ['createSelectorQuery'] } } if (prod) { // 压缩sass // module.exports.compilers['sass'] = {outputStyle: 'compressed'} // 压缩js module.exports.plugins = { uglifyjs: { filter: /\.js$/, config: { } }, imagemin: { filter: /\.(jpg|png|jpeg)$/, config: { jpg: { quality: 80 }, png: { quality: 80 } } } } }