Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature raxui #149

Merged
merged 30 commits into from Mar 8, 2017
Merged

Feature raxui #149

merged 30 commits into from Mar 8, 2017

Conversation

yacheng
Copy link
Collaborator

@yacheng yacheng commented Mar 3, 2017

Before submitting a pull request, please make sure the following is done...

  1. Fork the repo and create your branch from master.
  2. If you've added code that should be tested, add tests!
  3. If you've changed APIs, update the documentation.
  4. Ensure the test suite passes (npm test).
  5. Make sure your code lints (npm run lint) - we've done our best to make sure these rules match our internal linting guidelines.

"rax-text": "^0.2.2",
"rax-scrollview": "^0.2.2",
"rax-touchable": "^0.2.2",
"moment": "~2.13.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

统一使用 moment ^2.13.0


import Day from './Day';

import moment from 'moment/min/moment.min';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

依赖改为 import moment from 'moment';

@@ -0,0 +1,91 @@
import {createElement, Component, PropTypes} from 'rax';
import View from '@ali/rax-view';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

去掉 @ali

@@ -0,0 +1,2 @@
import Index from './Calendar';
export default Index;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把 Calendar 文件命名为 index

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除当前文件

width: DEVICE_WIDTH,
},
monthHeading: {
padding: '10rem',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

所有单位用 number 格式,比如:padding: '10rem' 改为 padding: 10

null
}
<Text style={timeStyle}>
{'' + displayFirstNum}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{'' + displayFirstNum} 可以简化为 {displayFirstNum}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处有一个本周发现的 weex 上渲染问题,数字类型 0 会重复渲染出一层 text 标签,我这边在定位

formatFunc: PropTypes.func,
onTick: PropTypes.func,
onComplete: PropTypes.func,
tpl: PropTypes.string, // 倒计时展示模板
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

中文注释改为英文

let scroll;

if (!isWeex) {
var raf = window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(c) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有用到 raf ?

bottom = props.bottom || 125;

if (isWeex) {
bottom += 'rem';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rem 可以省略

};

GoTop.defaultProps = {
name: '顶部',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用英文


GoTop.defaultProps = {
name: '顶部',
icon: 'https://gw.alicdn.com/tps/TB1UhIvLXXXXXaRXpXXXXXXXXXX-60-66.png',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认图片使用 base64 图片

@@ -0,0 +1,44 @@
import {Component, createElement} from 'rax';

let defaultWidth = window.screen.width;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weex 下 window.screen.width 是屏幕真实像素宽度,是不是用错了这里

<div {...this.props} style={style} />
);
} else {
// 如果仅有一个 child 则返回 child 标签
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用英文注释

const styles = {
initial: {
'flex': 1,
'width': '1%',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

% 单位 weex 不支持

colStyle: {},
gridStyle: {},
list: [],
temp: function() {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

重新命名 temp

},

iconContainer: {
// 'display':'flex',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

移除注释

import Text from 'rax-text';
import Image from 'rax-image';

class Icon extends Component {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rax-icon 的实现有些问题,每次都需要重复传fontFamily与source,导致使用起来变扭

};

return (
<div {...this.props} style={style} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

依赖 View 是不是更好?

Copy link
Collaborator

@yuanyan yuanyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed

@yuanyan yuanyan merged commit f6d48d4 into master Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants