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们准备好了吗? 庞大的企业级市场 ...
随机推荐
- 2021年Web开发的7大趋势
技术发展日新月异,所以 Web 开发人员也需要及时了解行业最新的发展趋势. 全球有超过 17.4 亿个网站.在每一个细分领域都有无数企业争夺搜索引擎的排名前列位置.开发人员应该了解和发现更多创新的 W ...
- 关闭(隐藏)VS2019控制台上文件路径的显示
昨天有个朋友问我,怎么关闭在运行程序后,控制台上显示的文件路径啊?啥??我突然不知道他说的说什么,然后我就自己随便打了几行运行了一下,才知道原来他说的是这个: 一开始我也没在意,我就告诉他,这个无所谓 ...
- (25)Vim 1
1.安装Vim CentOS 系统中,使用如下命令即可安装 Vim: yum install vim 需要注意的是,此命令运行时,有时需要手动确认 [y/n] 遇到此情况,选择 "y&quo ...
- P1046 陶陶摘苹果 Python实现
题目描述 陶陶家的院子里有一棵苹果树,每到秋天树上就会结出1010个苹果.苹果成熟的时候,陶陶就会跑去摘苹果.陶陶有个3030厘米高的板凳,当她不能直接用手摘到苹果的时候,就会踩到板凳上再试试. 现在 ...
- C#委托的进一步学习
一.委托的说明 namespace LearningCsharp { class Program { //定义一个委托,使用delegate加上方法签名 //将委托理解为存储方法的"数组&q ...
- SQL中字符串截取函数(SUBSTRING)
1.left(name,4)截取左边的4个字符 列: SELECT LEFT(201809,4) 年 结果:2018 2.right(name,2)截取右边的2个字符 SELECT RIGHT(201 ...
- AtCoder Beginner Contest 176
比赛链接:https://atcoder.jp/contests/abc176 A - Takoyaki #include <bits/stdc++.h> using namespace ...
- 【noi 2.6_2421】Exchange Rates(DP)
题意:起始有1000元美元,给出N天美元与加拿大元的汇率.问N天内可以不停的兑换,每次兑换需要收取3%的手续费,问可以得到的最大的美元数. 解法:直接用2个变量存第 i 天时手中是美元和加拿大元的最大 ...
- Java——方法及构造方法、intellij IDEA中的一些快捷键
intellij IDEA中的一些快捷键: 一.方法基础 给你一个两个int类型的数相加的例子: 这个例子说明了 public static void main(String[] args) {}相当 ...
- CF1474-A. Puzzle From the Future
CF1474-A. Puzzle From the Future 题意: 有两个由\(0,1\)组成的.长度相等字符串\(a, b\),两个字符串按位相加得到一个新的字符串\(s\),对\(s\)取\ ...