12 | To get started, edit index.js
and save to reload.
13 |
Date: ${module()}
` 10 | ].join('') 11 | -------------------------------------------------------------------------------- /boilerplate/lib/src/example/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #ccc; 3 | } 4 | -------------------------------------------------------------------------------- /boilerplate/miniprogram/.gitignore.keep: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | *.log 4 | *yarn* 5 | *.lock -------------------------------------------------------------------------------- /boilerplate/miniprogram/README.md: -------------------------------------------------------------------------------- 1 | # 小程序 2 | 3 | ### 目录结构 4 | 5 | root 6 | |----components/常用组件 7 | |----deps/ 常用依赖包引入 8 | |----assets/ 图片等资源文件,不过建议之后添加的图片放入子包目录 9 | |----model/ 数据模型文件 10 | |----utils 常用方法文件 11 | |----pages/ 主包页面文件 12 | |----packageA/ 子包文件 13 | |----packageB/ 子包文件 14 | |----packageC/ 子包文件 15 | 16 | 17 | 18 | ### 开发说明 19 | 20 | #### 统一请求出口 21 | 22 | * `model/fetchAPI.js`定义了统一的数据请求接口,reqwest(普通数据请求)、uploadFile(文件上传) 23 | * 开发过程中把数据源定为测试环境、提交审核之前记得将数据源改为线上; 24 | 25 | #### 常用方法 26 | 27 | * `utils/format.js` 封装时间格式化方法 28 | * `utils/utils.js` 封装常用的方法,第三方登录,formId上报等; 29 | * `utils/wxAPI.js` 微信提供的常用api Promise化封装方法 30 | 31 | ### 注意事项 32 | 33 | * pages放主入口相关页面,packageA,packageB,packageC放次要加载页面 34 | * 页面参数不需要encode,否则解析不出来 35 | 36 | -------------------------------------------------------------------------------- /boilerplate/miniprogram/app.js: -------------------------------------------------------------------------------- 1 | import DATracker from './utils/DATracker' 2 | import fundebug from './deps/fundebug.1.0.0.min.js' 3 | 4 | App({ 5 | onLaunch: function () { 6 | // 请填入哈勃的appKey 7 | // DATracker.init('key') 8 | // 用于错误检测,apikey会过期 9 | // fundebug.init({ 10 | // apikey : '5bbf66eaa6cd39ec26714e1d2ee619f452a804438c4d029b673db8b3eca150a8' 11 | // }) 12 | wx.getSystemInfo({ 13 | success: (res) => { 14 | this.globalData.systemInfo = res; 15 | console.log(res) 16 | } 17 | }) 18 | }, 19 | globalData: { 20 | userInfo: null 21 | } 22 | }) -------------------------------------------------------------------------------- /boilerplate/miniprogram/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages":[ 3 | "pages/index/index" 4 | ], 5 | "window":{ 6 | "backgroundTextStyle":"light", 7 | "navigationBarBackgroundColor": "#fff", 8 | "navigationBarTitleText": "WeChat", 9 | "navigationBarTextStyle":"black" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /boilerplate/miniprogram/app.wxss: -------------------------------------------------------------------------------- 1 | /**app.wxss**/ 2 | .container { 3 | height: 100%; 4 | display: flex; 5 | flex-direction: column; 6 | align-items: center; 7 | justify-content: space-between; 8 | padding: 200rpx 0; 9 | box-sizing: border-box; 10 | } 11 | -------------------------------------------------------------------------------- /boilerplate/miniprogram/deps/uuid.js: -------------------------------------------------------------------------------- 1 | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.uuidv1=e()}}(function(){return function e(n,r,o){function t(u,f){if(!r[u]){if(!n[u]){var s="function"==typeof require&&require;if(!f&&s)return s(u,!0);if(i)return i(u,!0);var d=new Error("Cannot find module '"+u+"'");throw d.code="MODULE_NOT_FOUND",d}var a=r[u]={exports:{}};n[u][0].call(a.exports,function(e){var r=n[u][1][e];return t(r?r:e)},a,a.exports,e,n,r,o)}return r[u].exports}for(var i="function"==typeof require&&require,u=0;u
13 | To get started, edit App.js
and save to reload.
14 |