Authored by 陈林

Merge branch 'V6.9.1' into 'master'

V6.9.1



See merge request !30
/**
* bundle.js
*@author dennis
*@createtime 3/26/19
*@description
*/
'use strict'
const exec = require('child_process').exec
const spawn = require('child_process').spawn
const execSync = require('child_process').execSync
const readline = require('readline')
const path = require('path')
const fs = require('fs-extra')
const args = process.argv;
const platform = args.length > 2 ? args[2]: 'ios'
fs.ensureDirSync('./build/ios_output/')
fs.ensureDirSync('./build/android_output/')
const ouputDir = `./build/${platform}_output`
console.log('remove old bundle files')
execSync(`rm -rf ${ouputDir}/*`)
console.log('remove complete')
let exeStr = `node node_modules/rocket-bundler/src/cli.js bundle --dev false --platform ${platform} --entry-file index.${platform}.js --bundle-output ${ouputDir}/yoho-bussiness.jsbundle --base-file base.js --base-output ${ouputDir}/yoho-base.jsbundle --assets-dest ${ouputDir} -- reset cache `
console.log(exeStr)
let build = exec(exeStr)
build.stdout.on('data', data => console.log('======: ', data))
build.stdout.on('close', zipPackage)
function zipPackage(e) {
if (e) {
console.log(e)
}
console.log('bundle complete')
console.log('start zip')
let zipexec = exec(`zip -r main.zip *`,{cwd:ouputDir})
zipexec.stdout.on('data', data => console.log('======: ', data))
zipexec.stdout.on('close', md5)
}
function md5(e) {
if (e) {
console.log(e)
}
console.log('zip complete')
console.log(' start compute md5')
let type = ''
if (platform == 'ios') {
type = 'rn'
}
let md5exec = exec(`python md5.py ${ouputDir}/main.zip ${type}`)
md5exec.stdout.on('data', data => console.log('======: ', data))
md5exec.stdout.on('close', function (e) {
if (e) {
console.log(e)
}
console.log(' complete compute md5')
})
}
function checkHtmlDiff(dirOld, dirNew) {
return new Promise((resolve, reject) => {
exec(`git diff --no-index ${dirOld} ${dirNew}`, {cwd: __dirname}, function (error, stdout, stderr) {
if (!stdout) {
console.log('nothing changed for html files')
resolve(false)
} else {
let diffDir = dirNew.replace('./build/new/','./build/diff/')
console.log(`copying htmls from ${dirNew}, to ${diffDir}`)
fs.copySync(dirNew,diffDir)
console.log('copying done')
resolve(true)
}
})
})
}
function checkAssetsDiff(dirOld, dirNew, callback) {
const cspr = spawn('git', ['diff', '--no-index', dirOld, dirNew], {cwd: __dirname});
const rl = readline.createInterface({ input: cspr.stdout });
let differlist = []
rl.on('line', line => {
// console.log('line====>\n',line)
let regexStart = RegExp('Binary*')
if (regexStart.test(line)) { //查询含有差异文件的行
let regexContent = /and\s.*\s/g
let found = line.match(regexContent)
let foundText = found[0].replace('and', '').replace(/\s/g, '').replace('b/', './')
if (foundText !=='/dev/null') {
differlist.push(foundText)
}
}
})
.on('close', () => {
if (differlist.length > 0) {
console.log('differ file list\n', differlist)
console.log('copying differ files')
differlist.forEach(item => {
console.log(`copy from ${item}, to ./build/diff/assets/img/${path.basename(item)}`)
fs.copySync(item, './build/diff/assets/img/' + path.basename(item))
})
console.log('copying differ done')
}
callback && callback(differlist.length)
})
}
... ...
... ... @@ -65,6 +65,8 @@ class RankItem extends PureComponent {
}
}
let { width } = Dimensions.get('window');
const styles = StyleSheet.create({
itemContainer: {
height: 70 * DEVICE_WIDTH_RATIO,
... ... @@ -80,7 +82,7 @@ const styles = StyleSheet.create({
rank: {
fontSize: 18,
color: '#444444',
width: 23,
width: 23,
marginLeft: 18 * DEVICE_WIDTH_RATIO,
},
avatar: {
... ... @@ -93,8 +95,8 @@ const styles = StyleSheet.create({
name: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
marginLeft: 20,
marginLeft: 10 * DEVICE_WIDTH_RATIO,
maxWidth: width - 230 * DEVICE_WIDTH_RATIO,
},
rightContainer: {
flex: 1,
... ... @@ -105,7 +107,7 @@ const styles = StyleSheet.create({
amount: {
fontSize: 16,
color: '#444444',
fontWeight: 'bold',
fontWeight: 'bold',
},
amountName: {
fontFamily: 'PingFangSC-Regular',
... ...
... ... @@ -59,6 +59,7 @@ export default function native(platform) {
<GroupPurchaseDetailContainer
FP_NAME={this.props.FP_NAME}
FP_PARAM={this.props.FP_PARAM}
popShare={this.props.popShare}
/>
</Provider>
);
... ...
'use strict';
import React, {Component} from 'react';
import ReactNative, {InteractionManager, StyleSheet, View, Dimensions, NativeAppEventEmitter} from 'react-native'
import ReactNative, {InteractionManager, StyleSheet, View, Dimensions, NativeAppEventEmitter, Platform} from 'react-native'
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
... ... @@ -67,6 +67,10 @@ class GroupPurchaseDetailContainer extends Component {
this.props.actions.getProductList();
this.props.actions.fetchActivityGroupDetail(this.props.FP_NAME, this.props.FP_PARAM);
this.props.actions.fetchResourceInfo();
if(Platform.OS === 'android' && this.props.popShare == "1"){
this.props.actions.showShareView(true);
}
}
componentWillUnmount() {
... ...
... ... @@ -233,6 +233,7 @@ export default class MessageList extends Component {
}}
onPressListItem={(itemData) =>{
this.setState({showToolTips: false});
this.props.onPressListItem && this.props.onPressListItem(itemData, rowID)
}
}
selectListItem={(itemData) =>{
... ...
#!/usr/bin/python
#encoding=utf-8
import os
import io
import sys
import hashlib
import string
import subprocess
def printUsage():
print ('''Usage: [python] md5.py <filename> <module>''')
print (''' module has two optional value: jp,rn''')
print (''' default is jp''')
def write2Clipboard(output):
process = subprocess.Popen(
'pbcopy', env={'LANG': 'en_US.UTF-8'}, stdin=subprocess.PIPE)
process.communicate(output.encode('utf-8'))
def calMd5(filename, module="jp"):
print("🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅🍅")
if not os.path.isfile(filename):
print("👿 file doesn't exist\t" + filename)
return
m0 = hashlib.md5()
file = io.FileIO(filename,'r')
bytes = file.read(8096)
while(bytes != b''):
m0.update(bytes)
bytes = file.read(8096)
file.close()
md5value = m0.hexdigest()
print("😇 file\t\t\t" + filename)
print("😌 file md5 value\t" + md5value)
suffixes = "yohopatch2016"
if module == 'rn':
suffixes = "yohorn2016"
m1 = hashlib.md5()
source = md5value + suffixes
m1.update(source.encode("utf8"))
sourceMd5value = m1.hexdigest()
print("😏 string\t\t" + source)
print("😋 string md5 value\t" + sourceMd5value)
write2Clipboard(sourceMd5value)
print("😀 the value already write to your clipboard\t")
print("🚀 🚁 ✈️ now you can use command + v to paste it!!!\t")
print("🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊🍊")
def main():
if(sys.argv.__len__() == 2):
calMd5(sys.argv[1])
elif(sys.argv.__len__() == 3):
calMd5(sys.argv[1], sys.argv[2])
else:
printUsage()
main()
... ...
... ... @@ -652,7 +652,6 @@
"resolved": "http://registry.npm.taobao.org/align-text/download/align-text-0.1.4.tgz",
"integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
"dev": true,
"optional": true,
"requires": {
"kind-of": "^3.0.2",
"longest": "^1.0.1",
... ... @@ -664,7 +663,6 @@
"resolved": "http://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz",
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
"dev": true,
"optional": true,
"requires": {
"is-buffer": "^1.1.5"
}
... ... @@ -3166,13 +3164,14 @@
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
},
"fs-extra": {
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/fs-extra/download/fs-extra-1.0.0.tgz",
"integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=",
"version": "7.0.1",
"resolved": "http://npm.yohops.com/fs-extra/-/fs-extra-7.0.1.tgz",
"integrity": "sha1-TxicRKoSO4lfcigE9V6iPq3DSOk=",
"dev": true,
"requires": {
"graceful-fs": "^4.1.2",
"jsonfile": "^2.1.0",
"klaw": "^1.0.0"
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
},
"fs.realpath": {
... ... @@ -5663,9 +5662,10 @@
"integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE="
},
"jsonfile": {
"version": "2.4.0",
"resolved": "http://registry.npm.taobao.org/jsonfile/download/jsonfile-2.4.0.tgz",
"integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
"version": "4.0.0",
"resolved": "http://npm.yohops.com/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"dev": true,
"requires": {
"graceful-fs": "^4.1.6"
}
... ... @@ -5698,7 +5698,7 @@
},
"klaw": {
"version": "1.3.1",
"resolved": "http://registry.npm.taobao.org/klaw/download/klaw-1.3.1.tgz",
"resolved": "http://npm.yohops.com/klaw/-/klaw-1.3.1.tgz",
"integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=",
"requires": {
"graceful-fs": "^4.1.9"
... ... @@ -5708,8 +5708,7 @@
"version": "1.0.4",
"resolved": "http://registry.npm.taobao.org/lazy-cache/download/lazy-cache-1.0.4.tgz",
"integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=",
"dev": true,
"optional": true
"dev": true
},
"lcid": {
"version": "1.0.0",
... ... @@ -5810,8 +5809,7 @@
"version": "1.0.1",
"resolved": "http://registry.npm.taobao.org/longest/download/longest-1.0.1.tgz",
"integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
"dev": true,
"optional": true
"dev": true
},
"loose-envify": {
"version": "1.3.1",
... ... @@ -5977,11 +5975,29 @@
"resolved": "http://registry.npm.taobao.org/core-js/download/core-js-2.5.6.tgz",
"integrity": "sha1-D+bUW/PKw6w2Sp1y3nV29OsiG50="
},
"fs-extra": {
"version": "1.0.0",
"resolved": "http://npm.yohops.com/fs-extra/-/fs-extra-1.0.0.tgz",
"integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=",
"requires": {
"graceful-fs": "^4.1.2",
"jsonfile": "^2.1.0",
"klaw": "^1.0.0"
}
},
"json5": {
"version": "0.4.0",
"resolved": "http://registry.npm.taobao.org/json5/download/json5-0.4.0.tgz",
"integrity": "sha1-BUNS5MTIDIbAkjh31EneF2pzLI0="
},
"jsonfile": {
"version": "2.4.0",
"resolved": "http://npm.yohops.com/jsonfile/-/jsonfile-2.4.0.tgz",
"integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
"requires": {
"graceful-fs": "^4.1.6"
}
},
"mime-db": {
"version": "1.23.0",
"resolved": "http://registry.npm.taobao.org/mime-db/download/mime-db-1.23.0.tgz",
... ... @@ -6971,6 +6987,24 @@
"yargs": "^9.0.0"
},
"dependencies": {
"fs-extra": {
"version": "1.0.0",
"resolved": "http://npm.yohops.com/fs-extra/-/fs-extra-1.0.0.tgz",
"integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=",
"requires": {
"graceful-fs": "^4.1.2",
"jsonfile": "^2.1.0",
"klaw": "^1.0.0"
}
},
"jsonfile": {
"version": "2.4.0",
"resolved": "http://npm.yohops.com/jsonfile/-/jsonfile-2.4.0.tgz",
"integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
"requires": {
"graceful-fs": "^4.1.6"
}
},
"whatwg-fetch": {
"version": "1.1.1",
"resolved": "http://registry.npm.taobao.org/whatwg-fetch/download/whatwg-fetch-1.1.1.tgz",
... ... @@ -9238,6 +9272,12 @@
}
}
},
"universalify": {
"version": "0.1.2",
"resolved": "http://npm.yohops.com/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=",
"dev": true
},
"unpipe": {
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz",
... ...
... ... @@ -7,7 +7,8 @@
"ios": "node node_modules/react-native/local-cli/cli.js start",
"android": "sh replace-custom-components-file-android.sh && node node_modules/react-native/local-cli/cli.js start",
"build:ios": "react-native bundle --entry-file index.ios.js --platform ios --dev false --reset-cache --bundle-output ../bundle/main.jsbundle --assets-dest ../bundle",
"build:android": "react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output index.android.bundle --assets-dest bundle/"
"build:android": "react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output index.android.bundle --assets-dest bundle/",
"bundle": "sh replace-custom-components-file.sh && node bundle.js"
},
"peerDependencies": {
"react": "^16.3.2"
... ... @@ -54,6 +55,7 @@
"devDependencies": {
"babel-jest": "22.4.3",
"babel-preset-react-native": "4.0.0",
"fs-extra": "^7.0.1",
"jest": "22.4.3",
"react-test-renderer": "16.3.1",
"rocket-bundler": "^0.14.2"
... ...