Taro 物料市场

taro component demo

https://taro-ext.jd.com/

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 物料市场的更多相关文章

  1. Web前端开发工程师常用技术网站整理

    1.常用工具相关 有道云笔记 http://note.youdao.com/signIn/index.html 36镇-最好用的共享收藏夹 http://www.36zhen.com/ 浏览器同步测试 ...

  2. Uniapp And Taro一些小测评

    前情 最近公司准备新开发一个小程序项目,对于使用哪一款小程序框架有一些犹豫,我有过2年左右的uniapp项目开发经验,Taro在刚刚出来的时候有尝试过,经常莫名报错需要重启,在内心是有些偏向uniap ...

  3. uni-app开发小程序入门到崩溃

    最近一段时间公司要做一个小程序项目,还要支持,微信小程序,头条小程序,百度小程序.一套代码,实现三个平台.当时接到这个任务,就不知道怎么去下手,一套代码,分别要发布三个平台,赶紧就去上网了解这些东西, ...

  4. 向安富利(Avnet)学什么?

    这个只做电子元器件分销的企业,居然能数次进入<财富>排行榜.看来,这是一个在供应链上创造价值的高手.在企业竞争已经集中到供应链竞争的今天,安富利的成功之道,无疑具有特别的意义. 2000年 ...

  5. 小程序多端框架全面测评:chameleon、Taro、uni-app、mpvue、WePY

    摘要: 微信小程序开发技巧. 作者:coldsnap 原文:小程序多端框架全面测评 Fundebug经授权转载,版权归原作者所有. 最近前端届多端框架频出,相信很多有代码多端运行需求的开发者都会产生一 ...

  6. SAP ML 物料分类账详解(含取消激活物料帐方法)

    一.业务背景: 中国会计准则规定,对存货的核算必须采用历史成本法(即实际成本法).如果企业采用计划成本法或者定额成本法进行日常核算的,应当按期结转其成本差异,将计划成本或者定额成本调整为实际成本. “ ...

  7. 小程序开发:用原生还是选框架(wepy/mpvue/uni-app/taro)?

    小程序开发:用原生还是选框架(wepy/mpvue/uni-app/taro)? 自 2017-1-9微信小程序诞生以来,历经2年多的迭代升级,已有数百万小程序上线,成为继Web.iOS.Androi ...

  8. Taro 和 uni-app选型对比

    一.Taro和uni-app的介绍 1.taro的介绍 taro是多端统一开发框架,支持用 React 的开发方式编写一次代码,生成能运行在微信/百度/支付宝/字节跳动小程序.H5.React Nat ...

  9. BAT“搅局”B2B市场,CIO们准备好了吗?

    "CIO必须灵活构建其所在企业的IT系统,深入业务,以应对日新月异的数字化业务环境."   BAT军团"搅局"B2B市场,CIO们准备好了吗? 庞大的企业级市场 ...

随机推荐

  1. loj2587铁人两项

    无向图,图中选出定点三元组(a,b,c),a->b->c的路径没有重复边.问方案有多少? -------------------------------------------- 首先求出 ...

  2. 【Python爬虫】:使用高性能异步多进程爬虫获取豆瓣电影Top250

    在本篇博文当中,将会教会大家如何使用高性能爬虫,快速爬取并解析页面当中的信息.一般情况下,如果我们请求网页的次数太多,每次都要发出一次请求,进行串行执行的话,那么请求将会占用我们大量的时间,这样得不偿 ...

  3. Spring Filter过滤表单中的非法字符

    使用Spring Filter过滤表单中的非法字符 1 package test.filter; 2 3 import java.io.IOException; 4 import java.util. ...

  4. Flutter环境搭建遇坑小结(二)

    在上一节中,已经对Flutter运行中始终卡在Running Gradle task 'assembleDebug'...,做出了解决方案,继续往下运行,但是新的问题又出现了: Failed to i ...

  5. toggle() 隐藏和收缩

    <!DOCTYPE html><html><head><script src="/jquery/jquery-1.11.1.min.js" ...

  6. 飞塔创建IPSec

    5.2和5.4版本飞塔建立IPSec VPN时,必须在两端添加完策略.路由后IPSec才会起来.

  7. Educational Codeforces Round 95 (Rated for Div. 2) C. Mortal Kombat Tower (DP)

    题意:你和基友两人从左往右轮流打怪兽,强怪用\(1\)表示,垃圾用\(0\)表示,但基友比较弱,打不过强怪,碰到强怪需要用一次魔法,而你很强,无论什么怪都能乱杀,基友先打,每人每次至少杀一个怪兽,最多 ...

  8. C# 网络加密与解密

    数据在网络传输过程中的保密性是网络安全中重点要考虑的问题之一.由于通过网络传递数据是在不安全的信道上进行传输的,因此通信双方要想确保任何可能正在侦听的人无法理解通信的内容,而且希望确保接收方接收的信息 ...

  9. 【POJ 1148】Utopia Divided

    Utopia Divided 题目链接:POJ 1148 题目大意 在一个坐标系中,一个点一开始在原点,然后被要求每次走到一个规定的象限内. 你有一些互不相同的数,每次你可以选每选过的两个,正负性可以 ...

  10. MySQL数据库系列(四)- InnoDB下的共享表空间和独立表空间详解

    一.概念 共享表空间: Innodb的所有数据保存在一个单独的表空间里面,而这个表空间可以由很多个文件组成,一个表可以跨多个文件存在,所以其大小限制不再是文件大小的限制,而是其自身的限制.从Innod ...