Skip to content

Commit

Permalink
Feat: bump version to 2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Miaonster committed Dec 13, 2019
1 parent 9995f19 commit 928a525
Show file tree
Hide file tree
Showing 4 changed files with 4,187 additions and 240 deletions.
35 changes: 19 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taro-code",
"version": "2.0.2",
"version": "2.0.3",
"description": "Taro.js barcode & qrcode",
"scripts": {
"build": "export TARO_BUILD_TYPE=ui && taro build --ui",
Expand All @@ -15,7 +15,8 @@
"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:rn": "npm run build:rn -- --watch",
"update:project": "taro update project"
},
"author": "Miaonster <[email protected]>",
"license": "MIT",
Expand All @@ -25,23 +26,24 @@
"main": "dist/index.js",
"homepage": "https://github.com/Miaonster/taro-code",
"dependencies": {
"@tarojs/components": "1.3.28",
"@tarojs/router": "1.3.28",
"@tarojs/taro": "1.3.28",
"@tarojs/taro-alipay": "1.3.28",
"@tarojs/taro-h5": "1.3.28",
"@tarojs/taro-swan": "1.3.28",
"@tarojs/taro-tt": "1.3.28",
"@tarojs/taro-weapp": "1.3.28",
"@tarojs/components": "1.3.29",
"@tarojs/router": "1.3.29",
"@tarojs/taro": "1.3.29",
"@tarojs/taro-alipay": "1.3.29",
"@tarojs/taro-h5": "1.3.29",
"@tarojs/taro-swan": "1.3.29",
"@tarojs/taro-tt": "1.3.29",
"@tarojs/taro-weapp": "1.3.29",
"nerv-devtools": "^1.5.6",
"nervjs": "^1.5.6",
"wx-base64-qrcode": "^1.0.4"
},
"devDependencies": {
"@tarojs/plugin-babel": "1.3.28",
"@tarojs/plugin-csso": "1.3.28",
"@tarojs/plugin-uglifyjs": "1.3.28",
"@tarojs/webpack-runner": "1.3.28",
"@tarojs/cli": "1.3.29",
"@tarojs/plugin-babel": "1.3.29",
"@tarojs/plugin-csso": "1.3.29",
"@tarojs/plugin-uglifyjs": "1.3.29",
"@tarojs/webpack-runner": "1.3.29",
"@types/react": "^16.4.6",
"@types/webpack-env": "^1.13.6",
"babel-eslint": "^8.2.3",
Expand All @@ -51,9 +53,10 @@
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"eslint": "^4.19.1",
"eslint-config-taro": "1.3.28",
"eslint-config-taro": "1.3.29",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-taro": "1.3.28"
"eslint-plugin-react-hooks": "^2.3.0",
"eslint-plugin-taro": "1.3.29"
}
}
25 changes: 6 additions & 19 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,25 @@ import './app.css'

// 如果需要在 h5 环境中开启 React Devtools
// 取消以下注释:
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5') {
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5') {
// require('nerv-devtools')
// }

class App extends Component {

config = {
pages: [
'pages/index/index'
],
pages: ['pages/index/index'],
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#fff',
navigationBarTitleText: 'WeChat',
navigationBarTextStyle: 'black'
}
navigationBarTextStyle: 'black',
},
}

componentDidMount () {}

componentDidShow () {}

componentDidHide () {}

componentDidCatchError () {}

// 在 App 类中的 render() 函数没有实际作用
// 请勿修改此函数
render () {
return (
<Index />
)
render() {
return <Index />
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/utils/barcode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ function btoa(string) {

function getBuffer({ pieces, width, extraBytes, scale = 1 }) {
return pieces
.flatMap((piece) => Array(scale).fill(piece))
.flatMap((piece, index) => {
.map((piece) => Array(scale).fill(piece))
.reduce((acc, x) => acc.concat(x), [])
.map((piece, index) => {
const code = parseInt(piece) ? 0 : 255
const colors = [code, code, code]
if (!((index % width) - 1) && extraBytes) {
Expand All @@ -57,6 +58,7 @@ function getBuffer({ pieces, width, extraBytes, scale = 1 }) {
return colors
}
})
.reduce((acc, x) => acc.concat(x), [])
.map((x) => String.fromCharCode(x))
.join('')
}
Expand Down
Loading

0 comments on commit 928a525

Please sign in to comment.