未验证 提交 e63c22de 编写于 作者: X xiaoyatong 提交者: GitHub

feat: 适配jd小程序。 (#278)

上级 0f08f7df
......@@ -62,6 +62,7 @@
"checked:taro": "npm run generate:file:taro && tsc --project ./tsconfig.taro.json",
"generate:file:taro:pages": "node scripts/taro/generate-taro-pages.js",
"dev:taro:weapp": "npm run checked:taro && npm run generate:file:taro:pages && cd ./src/sites/mobile-taro && npm run dev:weapp",
"dev:taro:jd": "npm run checked:taro && npm run generate:file:taro:pages && cd ./src/sites/mobile-taro && npm run dev:jd",
"replace:taro:types": "node scripts/taro/replace-taro-types-alias.js",
"build:taro:types": "tsc && npm run replace:taro:types",
"build:taro:es": "npx rollup -c rollup.config.taro.es.js",
......@@ -152,7 +153,7 @@
"shelljs": "^0.8.4",
"ts-jest": "^27.1.4",
"ts-node": "^10.7.0",
"typescript": "^4.1.2",
"typescript": "4.5.5",
"unist-util-visit": "^4.1.0",
"vinyl-fs": "^3.0.3",
"vite": "^2.1.5",
......
......@@ -827,7 +827,7 @@
"desc": "用于实时展示倒计时数值,支持毫秒精度。",
"sort": 17,
"show": true,
"taro": false,
"taro": true,
"author": "songsong"
},
{
......
......@@ -38,6 +38,7 @@ export const ActionSheet: FunctionComponent<
Partial<ActionSheetProps> & React.HTMLAttributes<HTMLDivElement>
> = (props) => {
const {
children,
cancelTxt,
optionTag,
optionSubTag,
......@@ -105,7 +106,9 @@ export const ActionSheet: FunctionComponent<
)
})}
</div>
) : null}
) : (
children
)}
{cancelTxt && (
<div className={b('cancel')} onClick={() => cancelActionSheet()}>
{cancelTxt}
......
import React from 'react'
import Taro from '@tarojs/taro'
import { Divider } from '@/packages/nutui.react.taro'
import { useTranslate } from '@/sites/assets/locale/taro'
......@@ -61,19 +62,23 @@ const DividerDemo = () => {
<div style={{ fontSize: '14px', marginLeft: '27px', color: '#909ca4' }}>
{translated.text}
<Divider direction="vertical" />
<a
href="#/Divider"
<span
onClick={() => {
Taro.navigateTo({ url: '/pages/index/index' })
}}
style={{ color: '#1989fa', display: 'inline-block' }}
>
{translated.link}
</a>
</span>
<Divider direction="vertical" />
<a
href="#/Divider"
<span
onClick={() => {
Taro.navigateTo({ url: '/pages/index/index' })
}}
style={{ color: '#1989fa', display: 'inline-block' }}
>
{translated.link}
</a>
</span>
</div>
</div>
</>
......
......@@ -75,16 +75,6 @@ export const FixedNav: FunctionComponent<
onChange(value)
}
// const [classNames, setClassNames] = useState('')
// const classes = () => {
// return `${fixednavClass} ${type} ${visible ? 'active' : ''}`
// }
// useEffect(() => {
// setClassNames(classes())
// }, [visible])
return (
<div className={classes} style={position} {...rest}>
{overlay && (
......
......@@ -97,7 +97,7 @@ const NoticeBarDemo = () => {
direction="vertical"
list={horseLamp2}
speed={10}
standTime={1000}
standTime={2000}
complexAm
/>
</div>
......
......@@ -79,7 +79,6 @@ export const NoticeBar: FunctionComponent<
const wrap = useRef<HTMLDivElement>(null)
const content = useRef<HTMLDivElement>(null)
// const [scrollList,SetScrollList] = useState([])
const [showNoticeBar, SetShowNoticeBar] = useState(true)
const scrollList: any = useRef([])
const [wrapWidth, SetWrapWidth] = useState(0)
......@@ -92,8 +91,6 @@ export const NoticeBar: FunctionComponent<
const [timer, SetTimer] = useState(0)
const [isCanScroll, SetIsCanScroll] = useState<null | boolean>(null)
const [index, setIndex] = useState<number>(0)
useEffect(() => {
if (direction === 'vertical') {
if (children) {
......@@ -188,7 +185,7 @@ export const NoticeBar: FunctionComponent<
*/
const startRollEasy = () => {
showhorseLamp()
const timerCurr = window.setInterval(
const timerCurr = setInterval(
showhorseLamp,
~~(height / speed / 4) * 1000 + Number(standTime)
)
......@@ -259,7 +256,6 @@ export const NoticeBar: FunctionComponent<
}
const contentStyle = {
// paddingLeft: firstRound ? 0 : `${wrapWidth}px`,
animationDelay: `${firstRound ? delay : 0}s`,
animationDuration: `${duration}s`,
transform: `translateX(${firstRound ? 0 : `${wrapWidth}px`})`,
......@@ -306,7 +302,7 @@ export const NoticeBar: FunctionComponent<
<div
ref={content}
className={`content ${animationClass} ${
isEllipsis() && 'nut-ellipsis'
isEllipsis() ? 'nut-ellipsis' : ''
}`}
style={contentStyle}
onAnimationEnd={onAnimationEnd}
......
......@@ -79,7 +79,6 @@ export const NoticeBar: FunctionComponent<
const wrap = useRef<HTMLDivElement>(null)
const content = useRef<HTMLDivElement>(null)
// const [scrollList,SetScrollList] = useState([])
const [showNoticeBar, SetShowNoticeBar] = useState(true)
const scrollList: any = useRef([])
const [wrapWidth, SetWrapWidth] = useState(0)
......@@ -92,8 +91,6 @@ export const NoticeBar: FunctionComponent<
const [timer, SetTimer] = useState(0)
const [isCanScroll, SetIsCanScroll] = useState<null | boolean>(null)
const [index, setIndex] = useState<number>(0)
useEffect(() => {
if (direction === 'vertical') {
if (children) {
......@@ -186,7 +183,7 @@ export const NoticeBar: FunctionComponent<
*/
const startRollEasy = () => {
showhorseLamp()
const timerCurr = window.setInterval(
const timerCurr = setInterval(
showhorseLamp,
~~(height / speed / 4) * 1000 + Number(standTime)
)
......@@ -257,7 +254,6 @@ export const NoticeBar: FunctionComponent<
}
const contentStyle = {
// paddingLeft: firstRound ? 0 : `${wrapWidth}px`,
animationDelay: `${firstRound ? delay : 0}s`,
animationDuration: `${duration}s`,
transform: `translateX(${firstRound ? 0 : `${wrapWidth}px`})`,
......
......@@ -63,6 +63,7 @@ const subPackages = [
'pages/tag/index',
'pages/popover/index',
'pages/skeleton/index',
'pages/countdown/index',
'pages/collapse/index',
'pages/empty/index',
'pages/progress/index',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册