liyongli hai 1 ano
pai
achega
7a53fa6571

+ 13 - 9
src/pages/home/index.tsx

@@ -78,15 +78,19 @@ class Home extends React.Component<any, any> {
 
         <InputBox>
           <View className="mian">
-            <Video
-              src={this.state.data.baseVideoUrl || ""}
-              controls={false}
-              style={`width: ${w}px;height: ${h}px;`}
-              autoplay={true}
-              loop
-              muted
-              id="video"
-            />
+            {h && this.state.data.baseVideoUrl && (
+              <Video
+                src={this.state.data.baseVideoUrl || ""}
+                controls={false}
+                style={`width: ${w}px;height: ${h}px;`}
+                autoplay={true}
+                loop
+                muted
+                show-fullscreen-btn={true} show-play-btn={true}
+                id="video"
+              />
+            )}
+
             {this.state.data?.textList?.map((item: any) => (
               <View className="body">
                 <View className="btn">{item.title}</View>

+ 4 - 3
src/pages/previous_editions/index.scss

@@ -4,12 +4,13 @@
   width: 100%;
   box-sizing: border-box;
 
-  .video {
+  .zuopin {
+    width: 650px;
+    height: 300px;
+    background-color: #000;
     display: block;
     position: relative;
     margin: 0 auto 62px auto;
-    width: 82%;
-    height: 20%;
   }
 
   .line {

+ 29 - 18
src/pages/previous_editions/index.tsx

@@ -15,6 +15,11 @@ class PreviousEditions extends React.Component<any, any> {
     this.state = {
       height: 0,
       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"
+        }
+      ]
     };
   }
 
@@ -32,34 +37,40 @@ class PreviousEditions extends React.Component<any, any> {
     });
   };
 
+  showImage = (url: string) => {
+    Taro.previewImage({
+      urls: [url],
+    });
+  }
+
   render() {
     // const {  } = this.props;
     const w = this.#systemInfo.screenWidth - 60;
-    const h = (w / 16) * 9;
     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>
-          <Video
-            src=""
-            controls={true}
-            style={`width: ${w}px;height: ${h}px;`}
-            loop
-            muted
-            className="video"
-          />
-          <Image
-            src={line}
-            onLoad={this.getImageSizeLine}
-            className="line"
-            style={`width: ${w}px;height: ${this.state.heightLine}px;`}
-          />
+          {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>)
+          })}
         </InputBox>
       </View>
     );