前言
技术栈
React + Taro + Dva
项目运行
git clone git@github.com:EasyTuan/taro-msparis.git # 国内镜像加速节点:git@gitee.com:easytuan/taro-msparis.git cd taro-msparis npm install # 开发时时监听编译小程序 npm run dev:weapp # 开发时时监听编译H5 npm run dev:h5 # pages模版快速生成 npm run tep `文件名` 项目说明
git分支说明:
init:框架整体结构,不涉及任何业务逻辑
master:项目的稳定版本
feature:项目开发分支
目标功能
- [x] 美衣列表 -- 完成
- [x] 美衣详情 -- 完成
- [x] 登录、注册 -- 完成
- [x] 个人中心 -- 完成
- [x] 优惠券 -- 完成
- [x] 衣袋(购物车) -- 完成
业务介绍
目录结构
├── .temp // H5编译结果目录 ├── .rn_temp // RN编译结果目录 ├── dist // 小程序编译结果目录 ├── config // Taro配置目录 │ ├── dev.js // 开发时配置 │ ├── index.js // 默认配置 │ └── prod.js // 打包时配置 ├── screenshots // 项目截图,和项目开发无关 ├── site // H5静态文件(打包文件) ├── src // 源码目录 │ ├── components // 组件 │ ├── config // 项目开发配置 │ ├── images // 图片文件 │ ├── models // redux models │ ├── pages // 页面文件目录 │ │ └── home │ │ ├── index.js // 页面逻辑 │ │ ├── index.scss // 页面样式 │ │ ├── model.js // 页面models │ │ └── service.js // 页面api │ ├── styles // 样式文件 │ ├── utils // 常用工具类 │ ├── app.js // 入口文件 │ └── index.html ├── package.json └── template.js // pages模版快速生成脚本,执行命令 npm run tep `文件名`部分截图展示
首页 && 商品详情

衣袋 && 我的

登录 && 优惠券

taro的安装及使用
安装 Taro 开发工具 @tarojs/cli
使用 npm 或者 yarn 全局安装,或者直接使用npx
$ npm install -g @tarojs/cli $ yarn global add @tarojs/cli使用命令创建模板项目
$ taro init myApp进入项目目录开始开发,可以选择小程序预览模式,或者 h5 预览模式,若使用微信小程序预览模式,则需要自行下载并打开微信开发者工具,选择预览项目根目录。
微信小程序编译预览模式
# npm script $ npm run dev:weapp # 仅限全局安装 $ taro build --type weapp --watch # npx 用户也可以使用 $ npx taro build --type weapp --watch

