|
@@ -17,9 +17,15 @@ class PreviousEditions extends React.Component<any, any> {
|
|
|
heightLine: 0,
|
|
|
list: [
|
|
|
{
|
|
|
- url: "https://cxzx.smcic.net/topic/tool/img/%E5%B0%91%E5%84%BF%E4%B9%A6%E7%94%BB%E5%A4%A7%E8%B5%9B/R-C.jfif"
|
|
|
- }
|
|
|
- ]
|
|
|
+ url: "https://cxzx.smcic.net/topic/tool/img/%E5%B0%91%E5%84%BF%E4%B9%A6%E7%94%BB%E5%A4%A7%E8%B5%9B/R-C.jfif",
|
|
|
+ type: "Image",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "Article",
|
|
|
+ title: "公众号文章",
|
|
|
+ url: "https://mp.weixin.qq.com/mp/appmsgalbum?__biz=Mzg5MTg4NjU5NA==&action=getalbum&album_id=2833231067116797954#wechat_redirect",
|
|
|
+ },
|
|
|
+ ],
|
|
|
};
|
|
|
}
|
|
|
|
|
@@ -41,7 +47,32 @@ class PreviousEditions extends React.Component<any, any> {
|
|
|
Taro.previewImage({
|
|
|
urls: [url],
|
|
|
});
|
|
|
- }
|
|
|
+ };
|
|
|
+
|
|
|
+ ele_image = (v: any) => {
|
|
|
+ return (
|
|
|
+ <Image
|
|
|
+ src={v.url}
|
|
|
+ className="zuopin"
|
|
|
+ mode="aspectFit"
|
|
|
+ onClick={() => this.showImage(v.url)}
|
|
|
+ />
|
|
|
+ );
|
|
|
+ };
|
|
|
+
|
|
|
+ showWebview = (url: string) => {
|
|
|
+ Taro.navigateTo({
|
|
|
+ url: "/pages/webview/index?url=" + url,
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ ele_article = (v: any) => {
|
|
|
+ return (
|
|
|
+ <View className="article" onClick={() => this.showWebview(v.url)}>
|
|
|
+ {v.title}
|
|
|
+ </View>
|
|
|
+ );
|
|
|
+ };
|
|
|
|
|
|
render() {
|
|
|
// const { } = this.props;
|
|
@@ -49,27 +80,26 @@ class PreviousEditions extends React.Component<any, any> {
|
|
|
return (
|
|
|
<View className="PreviousEditions">
|
|
|
<Image
|
|
|
- style={`width: ${this.#systemInfo.screenWidth}px;height: ${this.state.height
|
|
|
- }px;`}
|
|
|
+ style={`width: ${this.#systemInfo.screenWidth}px;height: ${
|
|
|
+ this.state.height
|
|
|
+ }px;`}
|
|
|
src="https://cxzx.smcic.net/topic/tool/img/%E5%B0%91%E5%84%BF%E4%B9%A6%E7%94%BB%E5%A4%A7%E8%B5%9B/banner-2.png"
|
|
|
onLoad={this.getImageSize}
|
|
|
/>
|
|
|
<InputBox>
|
|
|
- {this.state.list.map(v => {
|
|
|
- return (<View>
|
|
|
- <Image
|
|
|
- src={v.url}
|
|
|
- className="zuopin"
|
|
|
- mode="aspectFit"
|
|
|
- onClick={() => this.showImage(v.url)}
|
|
|
- />
|
|
|
- <Image
|
|
|
- src={line}
|
|
|
- onLoad={this.getImageSizeLine}
|
|
|
- className="line"
|
|
|
- style={`width: ${w}px;height: ${this.state.heightLine}px;`}
|
|
|
- />
|
|
|
- </View>)
|
|
|
+ {this.state.list.map((v) => {
|
|
|
+ return (
|
|
|
+ <View>
|
|
|
+ {v.type === "Image" && this.ele_image(v)}
|
|
|
+ {v.type === "Article" && this.ele_article(v)}
|
|
|
+ <Image
|
|
|
+ src={line}
|
|
|
+ onLoad={this.getImageSizeLine}
|
|
|
+ className="line"
|
|
|
+ style={`width: ${w}px;height: ${this.state.heightLine}px;`}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ );
|
|
|
})}
|
|
|
</InputBox>
|
|
|
</View>
|