Skip to content

Commit

Permalink
升级taro3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
wizard-a committed Jan 23, 2021
0 parents commit 47c1f17
Show file tree
Hide file tree
Showing 175 changed files with 26,831 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'extends': ['taro/react']
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist/
deploy_versions/
.temp/
.rn_temp/
node_modules/
.DS_Store
116 changes: 116 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
小程序
------------
Taro_Mall是一款多端开源在线商城应用程序,后台是基于litemall基础上进行开发,前端采用Taro框架编写,现已全部完成微信小程序,头条小程序,和h5移动端,后续会对APP,淘宝,百度小程序进行适配。Taro_Mall已经完成了 litemall 前端的所有功能


扫码体验
------------
感谢 @程哥提供的认证的小程序平台,微信登录和支付现在已经可以用。(请先不要支付,暂不支持退款,如果想要测试,请选择1分钱的商品)

小程序正式版

<img src='./public/code.jpg' width='150' height='150' style="margin-right: 50px"/>

小程序(体验版,可以体验最新的功能)

<img src='./public/xiaochengxu.jpg' width='150' height='150' style="margin-right: 50px"/>

h5

<img src='./public/mobile.png' width='150' height='150'/>


后台系统地址

https://shop.xinmeitop.com/boss



框架功能列表
----------

- [x] 支持自定义底部导航


快速启动
------------

#### 微信小程序
* `git clone https://github.com/jiechud/taro-mall.git`
* `npm install || yarn install`
* `yarn dev:weapp` 启动服务
* 用微信开发者工具打开dist目录

#### 头条小程序
* `yarn dev:tt`
* 头条小程序开发工具打开dist目录

#### h5
* `yarn dev:h5` 启动服务
* 打开浏览器

系列文章
--------
* [01 Taro_Mall 开源多端小程序框架设计](https://www.cnblogs.com/qiaojie/p/12431670.html)

功能
------------
* 首页
* 专题列表、专题详情
* 分类列表、分类详情
* 品牌列表、品牌详情
* 新品首发、人气推荐
* 优惠券列表、优惠券选择
* 商品搜索
* 商品详情
* 购物车
* 购物下单
* 订单列表、订单详情
* 地址、收藏、足迹、意见反馈


项目截图
------------------
<img src='./public/images/1-1.jpeg' width='320px' height='568px' style="margin-right: 15px"><img src='./public/images/1-2.jpeg' width='320px' height='568px' style='margin-left: 10px'><br>

<img src='./public/images/2-1.jpeg' width='320px' height='568px' style="margin-right: 15px"><img src='./public/images/2-2.jpeg' width='320px' height='568px' style='margin-left: 10px'><br>

<img src='./public/images/3-1.jpeg' width='320px' height='568px' style="margin-right: 15px"><img src='./public/images/3-2.jpeg' width='320px' height='568px' style='margin-left: 10px'><br>


项目架构
------------
项目用Taro做跨端开发框架,Taro基本采用React的写法,项目集成了 redux dva 控制单向数据流,用immer来提供不可变数据,提升整体的性能,减少渲染。

技术栈
| 技术 | 说明 | 官网 |
| ---- | ---- | ---- |
| Taro | 多端统一开发解决方 | https://taro.aotu.io/ |
| TaroUI | 一套基于 Taro 框架开发的多端 UI 组件库 | https://taro-ui.jd.com/ |
| redux| 单项数据流 | https://redux.js.org/ |
| dva | 基于 redux 和 redux-saga 的数据流方案 | https://dvajs.com/ |
| immer | 创建不可变数据 | https://immerjs.github.io/immer/docs/introduction |


FAQ
-----------
1. 账号登录的用户名密码是什么?

account: user123 password: user123

联系我
--------------
建立了一个微信交流群,如需加入,请添加微信,备注小程序


微信: <img src='./public/my.png' width='150' height='150'/>

赞赏
-----------
因服务器是由个人维护,如果这个项目对您有帮助,您可以扫描下面二维码进行捐赠,谢谢。

<img src='./public/wx-pay.png' width='150' height='150'/><img src='./public/ali-pay.png' width='150' height='150'/>

License
------------
MIT License Copyright (c) 2020 jiechud
10 changes: 10 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// babel-preset-taro 更多选项和默认值:
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
module.exports = {
presets: [
['taro', {
framework: 'react',
ts: false
}]
]
}
9 changes: 9 additions & 0 deletions config/dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
env: {
NODE_ENV: '"development"'
},
defineConstants: {
},
mini: {},
h5: {}
}
72 changes: 72 additions & 0 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
const config = {
projectName: 'taro-app',
date: '2020-2-22',
designWidth: 750,
deviceRatio: {
640: 2.34 / 2,
750: 1,
828: 1.81 / 2
},
sourceRoot: 'src',
outputRoot: 'dist',
defineConstants: {
},
copy: {
patterns: [
],
options: {
}
},
framework: 'react',
mini: {
webpackChain (chain) {
chain.optimization.sideEffects(false)
},
postcss: {
pxtransform: {
enable: true,
config: {

}
},
url: {
enable: true,
config: {
limit: 1024 // 设定转换尺寸上限
}
},
cssModules: {
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]'
}
}
}
},
h5: {
publicPath: '/',
staticDirectory: 'static',
postcss: {
autoprefixer: {
enable: true,
config: {
}
},
cssModules: {
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]'
}
}
}
}
}

module.exports = function (merge) {
if (process.env.NODE_ENV === 'development') {
return merge({}, config, require('./dev'))
}
return merge({}, config, require('./prod'))
}
18 changes: 18 additions & 0 deletions config/prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
env: {
NODE_ENV: '"production"'
},
defineConstants: {
},
mini: {},
h5: {
/**
* 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。
* 参考代码如下:
* webpackChain (chain) {
* chain.plugin('analyzer')
* .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
* }
*/
}
}
68 changes: 68 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"name": "myApp",
"version": "1.0.0",
"private": true,
"description": "demo",
"templateInfo": {
"name": "redux",
"typescript": false,
"css": "less"
},
"scripts": {
"build:weapp": "taro build --type weapp",
"build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt",
"build:h5": "taro build --type h5",
"build:rn": "taro build --type rn",
"build:qq": "taro build --type qq",
"build:jd": "taro build --type jd",
"build:quickapp": "taro build --type quickapp",
"dev:weapp": "npm run build:weapp -- --watch",
"dev:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch",
"dev:h5": "npm run build:h5 -- --watch",
"dev:rn": "npm run build:rn -- --watch",
"dev:qq": "npm run build:qq -- --watch",
"dev:jd": "npm run build:jd -- --watch",
"dev:quickapp": "npm run build:quickapp -- --watch"
},
"browserslist": [
"last 3 versions",
"Android >= 4.1",
"ios >= 8"
],
"author": "",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.7.7",
"@tarojs/components": "3.0.25",
"@tarojs/react": "3.0.25",
"@tarojs/runtime": "3.0.25",
"@tarojs/taro": "3.0.25",
"dva-core": "^2.0.4",
"dva-immer": "^0.5.2",
"react": "^16.10.0",
"react-dom": "^16.10.0",
"react-redux": "^7.2.0",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"taro-ui": "3.0.0-alpha.9"
},
"devDependencies": {
"@babel/core": "^7.8.0",
"@tarojs/mini-runner": "3.0.25",
"@tarojs/webpack-runner": "3.0.25",
"@types/react": "^16.0.0",
"@types/webpack-env": "^1.13.6",
"babel-preset-taro": "3.0.25",
"eslint": "^6.8.0",
"eslint-config-taro": "3.0.25",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-react-hooks": "^1.6.1",
"stylelint": "9.3.0"
}
}
13 changes: 13 additions & 0 deletions project.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"miniprogramRoot": "./dist",
"projectname": "myApp",
"description": "demo",
"appid": "touristappid",
"setting": {
"urlCheck": true,
"es6": false,
"postcss": false,
"minified": false
},
"compileType": "miniprogram"
}
Loading

0 comments on commit 47c1f17

Please sign in to comment.