Taro 物料市场
Taro 物料市场
taro component demo
https://taro-ext.jd.com/plugin/view/5caab6c68c36ac0048ace8df
https://taro-ext.jd.com/plugin/view/5e6a0a1acbca8f0850956daa
https://github.com/haomo-studio/hm-taro-information-card/blob/master/index.jsx
css in js
flex & Taro.pxTransform & boxSizing: 'border-box',
import Taro from '@tarojs/taro';
export default {
hmInformationCard: {
display: 'flex',
alignItems: 'center',
flexDirection: 'row',
justifyContent: 'center',
width: Taro.pxTransform(750),
height: Taro.pxTransform(596)
},
box: {
display: 'flex',
alignItems: 'flex-start',
flexDirection: 'column',
justifyContent: 'center',
borderRadius: Taro.pxTransform(39),
boxShadow: '0px 10px 30px rgba(209, 213, 223, 0.50)',
backgroundColor: '#ffffff',
width: Taro.pxTransform(721),
height: Taro.pxTransform(518)
},
hd: {
boxSizing: 'border-box',
display: 'flex',
alignItems: 'center',
flexDirection: 'row',
justifyContent: 'space-between',
paddingRight: Taro.pxTransform(62),
paddingLeft: Taro.pxTransform(58),
width: Taro.pxTransform(721),
height: Taro.pxTransform(80)
},
container: { display: 'flex', flexDirection: 'row' },
tagWrap: {
boxSizing: 'border-box',
display: 'flex',
alignItems: 'center',
flexDirection: 'row',
borderRadius: Taro.pxTransform(39),
backgroundColor: '#fec4b0',
paddingRight: Taro.pxTransform(18),
paddingLeft: Taro.pxTransform(16),
height: Taro.pxTransform(80)
},
tag: {
opacity: 1,
textAlign: 'center',
lineHeight: Taro.pxTransform(35),
whiteSpace: 'nowrap',
color: '#f64000',
fontSize: Taro.pxTransform(23),
fontWeight: 400
},
nameClass: {
display: 'flex',
alignItems: 'flex-start',
flexDirection: 'column',
marginLeft: Taro.pxTransform(29),
height: Taro.pxTransform(80)
},
wrap: { display: 'flex', flexDirection: 'row', marginTop: Taro.pxTransform(2) },
alexander: {
opacity: 1,
width: Taro.pxTransform(109),
height: Taro.pxTransform(41),
lineHeight: Taro.pxTransform(41),
whiteSpace: 'nowrap',
color: '#141821',
fontSize: Taro.pxTransform(27),
fontWeight: 400
},
dataClass: { display: 'flex', flexDirection: 'row' },
data: {
opacity: 1,
width: Taro.pxTransform(187),
height: Taro.pxTransform(35),
lineHeight: Taro.pxTransform(35),
whiteSpace: 'nowrap',
color: '#858997',
fontSize: Taro.pxTransform(23),
fontWeight: 400
},
titleImg: { width: Taro.pxTransform(35), height: Taro.pxTransform(8) },
summaryClass: {
display: 'flex',
position: 'relative',
flexDirection: 'row',
justifyContent: 'center',
marginTop: Taro.pxTransform(49),
width: Taro.pxTransform(719),
height: Taro.pxTransform(94)
},
summary: {
position: 'relative',
opacity: 1,
width: Taro.pxTransform(592),
height: Taro.pxTransform(94),
overflow: 'hidden',
textOverflow: 'ellipsis',
lineHeight: Taro.pxTransform(47),
color: '#141821',
fontSize: Taro.pxTransform(31),
fontWeight: 400
},
word: {
position: 'absolute',
top: Taro.pxTransform(47),
left: Taro.pxTransform(526),
opacity: 1,
lineHeight: Taro.pxTransform(47),
whiteSpace: 'nowrap',
color: '#141821',
fontFamily: 'Helvetica',
fontSize: Taro.pxTransform(31),
fontWeight: 'normal'
},
ft: {
display: 'flex',
alignItems: 'center',
flexDirection: 'row',
marginTop: Taro.pxTransform(132),
height: Taro.pxTransform(47)
},
shoucang: { marginLeft: Taro.pxTransform(64), width: Taro.pxTransform(35), height: Taro.pxTransform(29) },
num: {
opacity: 1,
marginLeft: Taro.pxTransform(16),
width: Taro.pxTransform(53),
height: Taro.pxTransform(47),
lineHeight: Taro.pxTransform(47),
whiteSpace: 'nowrap',
color: '#141821',
fontFamily: 'Helvetica',
fontSize: Taro.pxTransform(31),
fontWeight: 'normal'
},
like: {
opacity: 1,
width: Taro.pxTransform(62),
height: Taro.pxTransform(47),
lineHeight: Taro.pxTransform(47),
whiteSpace: 'nowrap',
color: '#141821',
fontSize: Taro.pxTransform(31),
fontWeight: 400
}
};
网易严选
https://github.com/qit-team/taro-yanxuan/blob/master/config/index.js
https://github.com/qit-team/taro-yanxuan/blob/master/src/components/popup/index.js
https://github.com/qit-team/taro-yanxuan/blob/master/src/components/popup/index.scss
this.props.children
ScrollView & style height
import Taro, { Component } from '@tarojs/taro'
import { View, ScrollView, Image } from '@tarojs/components'
import classNames from 'classnames'
import closeIcon from './assets/close.png'
import './index.scss'
export default class Popup extends Component {
static defaultProps = {
visible: false,
compStyle: '',
onClose: () => {}
}
constructor (props) {
super(props)
this.state = {
isShow: props.visible
}
}
componentWillReceiveProps (nextProps) {
const { visible } = nextProps
const { isShow } = this.state
if (visible !== isShow) {
this.setState({
isShow: visible
})
}
}
handleClose = () => {
this.props.onClose()
}
handleTouchMove = e => {
e.stopPropagation()
}
render () {
const { onClose, compStyle } = this.props
const { isShow } = this.state
return (
<View
className={classNames('comp-popup', isShow && 'comp-popup--visible')}
onTouchMove={this.handleTouchMove}
style={compStyle}
>
<View className='comp-popup__mask' onClick={onClose} />
<View className='comp-popup__wrapper'>
<ScrollView
scrollY
className='comp-popup__content'
style={{ height: Taro.pxTransform(750) }}
>
{this.props.children}
</ScrollView>
<View className='comp-popup__close' onClick={onClose}>
<Image className='comp-popup__close-img' src={closeIcon} />
</View>
</View>
</View>
)
}
}
scss & flex
@import '@styles/theme.scss';
.comp-popup {
position: absolute;
width: 100%;
height: 0;
top: 0;
left: 0;
z-index: 9;
display: flex;
flex-direction: column;
overflow: hidden;
// NOTE RN 没有 display: none,暂时用 height 实现同等效果
&--visible {
height: 100%;
}
}
.comp-popup__mask {
flex: 1;
width: 100%;
background: rgba(0, 0, 0, 0.25);
}
.comp-popup__wrapper {
position: absolute;
bottom: 0;
width: 100%;
background: #ffffff;
}
.comp-popup__content {
}
.comp-popup__close {
position: absolute;
top: 22px;
right: 22px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 48px;
height: 48px;
&-img {
width: 24px;
height: 24px;
}
}

Taro.pxTransform
css in js
https://nervjs.github.io/taro/docs/size.html#api

Taro 物料市场的更多相关文章
- Web前端开发工程师常用技术网站整理
1.常用工具相关 有道云笔记 http://note.youdao.com/signIn/index.html 36镇-最好用的共享收藏夹 http://www.36zhen.com/ 浏览器同步测试 ...
- Uniapp And Taro一些小测评
前情 最近公司准备新开发一个小程序项目,对于使用哪一款小程序框架有一些犹豫,我有过2年左右的uniapp项目开发经验,Taro在刚刚出来的时候有尝试过,经常莫名报错需要重启,在内心是有些偏向uniap ...
- uni-app开发小程序入门到崩溃
最近一段时间公司要做一个小程序项目,还要支持,微信小程序,头条小程序,百度小程序.一套代码,实现三个平台.当时接到这个任务,就不知道怎么去下手,一套代码,分别要发布三个平台,赶紧就去上网了解这些东西, ...
- 向安富利(Avnet)学什么?
这个只做电子元器件分销的企业,居然能数次进入<财富>排行榜.看来,这是一个在供应链上创造价值的高手.在企业竞争已经集中到供应链竞争的今天,安富利的成功之道,无疑具有特别的意义. 2000年 ...
- 小程序多端框架全面测评:chameleon、Taro、uni-app、mpvue、WePY
摘要: 微信小程序开发技巧. 作者:coldsnap 原文:小程序多端框架全面测评 Fundebug经授权转载,版权归原作者所有. 最近前端届多端框架频出,相信很多有代码多端运行需求的开发者都会产生一 ...
- SAP ML 物料分类账详解(含取消激活物料帐方法)
一.业务背景: 中国会计准则规定,对存货的核算必须采用历史成本法(即实际成本法).如果企业采用计划成本法或者定额成本法进行日常核算的,应当按期结转其成本差异,将计划成本或者定额成本调整为实际成本. “ ...
- 小程序开发:用原生还是选框架(wepy/mpvue/uni-app/taro)?
小程序开发:用原生还是选框架(wepy/mpvue/uni-app/taro)? 自 2017-1-9微信小程序诞生以来,历经2年多的迭代升级,已有数百万小程序上线,成为继Web.iOS.Androi ...
- Taro 和 uni-app选型对比
一.Taro和uni-app的介绍 1.taro的介绍 taro是多端统一开发框架,支持用 React 的开发方式编写一次代码,生成能运行在微信/百度/支付宝/字节跳动小程序.H5.React Nat ...
- BAT“搅局”B2B市场,CIO们准备好了吗?
"CIO必须灵活构建其所在企业的IT系统,深入业务,以应对日新月异的数字化业务环境." BAT军团"搅局"B2B市场,CIO们准备好了吗? 庞大的企业级市场 ...
随机推荐
- 两个list<Map<String,String>>放入一个list中
// public static void main(String[] args) {// List<Map<String, String>> list2 = new Arra ...
- collections,random
collections模块 在内置数据类型(dict.list.set.tuple)的基础上,collections模块还提供了几个额外的数据类型:Counter.deque.defaultdict. ...
- SpringMVC听课笔记(六:视图和试图解析器)
1.spring mvc解析视图 2. 视图和视图解析器 3. 视图 4.常用的视图类 5.视图解析器 1) 2) 3) 4)JSTL 需要注意的是,配置了mvc:view-controller,为 ...
- Office系列---将Office文件(Word、PPT、Excel)转换为PDF文件,提取Office文件(Word、PPT)中的所有图片
将Office文件转换为PDF文件,提取Office文件中的所有图片 1.Office系列---将Office文件(Word.PPT.Excel)转换为PDF文件 1.1 基于Office实现的解决方 ...
- Australia Trip Memory (>~<)
近日,掠过空中星尘,喜于"水雾","牛马",晨曦中不情愿地睁开双眼,到达 Australia 这个"人间天堂"那天的场景还似黄粱一梦却已经是 ...
- 敏捷史话(五):敏捷已逝 —— Dave Thomas
" 敏捷已逝,但敏捷精神长存.因为所谓的敏捷专家卖给你的是方法论,而不是价值."当多数人都在从"敏捷"身上榨取利益时, Dave Thomas 成为了一位逆行者 ...
- Watering Grass(贪心算法)
给定一条草坪.草坪上有n个喷水装置.草坪长l米宽w米..n个装置都有每个装置的位置和喷水半径..要求出最少需要几个喷水装置才能喷满草坪..喷水装置都是装在草坪中间一条水平线上的. n sprinkle ...
- hdu4507吉哥系列故事——恨7不成妻 (数位dp)
Problem Description 单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: ...
- Codeforces Round #635 C. Linova and Kingdom
传送门:C. Linova and Kingdom 题意:给你一棵树,要求对k个结点涂色,然后统计每个未涂色结点到根结点的路径上未涂色结点的和,求和最大能为多少 题解:对着样例画几遍,然后贪心发现,最 ...
- typedef struct xxx xxx与struct xxx区别 && “->”和“.”访问结构体变量
1. struct //是C中的结构体的关键词.如: stuct node{ int a;.....} a; node 相当于结构体的类型,关键是其实在C中stuct node 才相当于一个数据类型, ...