|
@@ -24,7 +24,7 @@ export interface IPhotoSliderProps extends IPhotoProviderBase {
|
|
onIndexChange?: Function;
|
|
onIndexChange?: Function;
|
|
}
|
|
}
|
|
|
|
|
|
-type PhotoSliderState = {
|
|
|
|
|
|
+type PhotoSliderState = {
|
|
// 偏移量
|
|
// 偏移量
|
|
translateX: number;
|
|
translateX: number;
|
|
// 图片当前的 index
|
|
// 图片当前的 index
|
|
@@ -275,7 +275,7 @@ export default class PhotoSlider extends React.Component<
|
|
className={maskClassName}
|
|
className={maskClassName}
|
|
style={{ background: `rgba(0, 0, 0, ${backdropOpacity})` }}
|
|
style={{ background: `rgba(0, 0, 0, ${backdropOpacity})` }}
|
|
/>
|
|
/>
|
|
- {bannerVisible ? (
|
|
|
|
|
|
+ {bannerVisible && (
|
|
<BannerWrap style={overlayStyle}>
|
|
<BannerWrap style={overlayStyle}>
|
|
<Counter>{photoIndex + 1} / {imageLength}</Counter>
|
|
<Counter>{photoIndex + 1} / {imageLength}</Counter>
|
|
<BannerRight>
|
|
<BannerRight>
|
|
@@ -285,7 +285,7 @@ export default class PhotoSlider extends React.Component<
|
|
/>
|
|
/>
|
|
</BannerRight>
|
|
</BannerRight>
|
|
</BannerWrap>
|
|
</BannerWrap>
|
|
- ) : undefined}
|
|
|
|
|
|
+ )}
|
|
{images
|
|
{images
|
|
.slice( // 加载相邻三张
|
|
.slice( // 加载相邻三张
|
|
Math.max(photoIndex - 1, 0),
|
|
Math.max(photoIndex - 1, 0),
|