Prechádzať zdrojové kódy

Merge branch 'master' of http://git.cc-lotus.info/article-system/article-mobile

guhongwei 4 rokov pred
rodič
commit
d5ba07b2fc

+ 7 - 1
src/views/adminCenter/topic/edit.vue

@@ -22,7 +22,13 @@
             </van-field>
             <van-field name="uploader" label="视频" v-if="form.type === '1'">
               <template #input>
-                <van-uploader :fileList="form.fileUrl" :after-read="file => toUpload(file, 'fileUrl')" accept=".mp4,.flv,.avi,.rmvb,.wmv" max-size="11534336" />
+                <van-uploader
+                  :fileList="form.fileUrl"
+                  :max-count="1"
+                  :after-read="file => toUpload(file, 'fileUrl')"
+                  accept=".mp4,.flv,.avi,.rmvb,.wmv"
+                  max-size="11534336"
+                />
               </template>
             </van-field>
             <van-field v-model="form.website" name="website" label="网址" placeholder="请输入网址" />

+ 10 - 1
src/views/adminCenter/topic/item.vue

@@ -21,7 +21,9 @@
           </template>
         </el-col>
       </el-col>
-      <el-col :span="24" v-if="data.type === '1'"> </el-col>
+      <el-col :span="24" v-if="data.type === '1'" style="text-align:center">
+        <video :src="data.fileUrl[0].url" :width="videopx" :height="videohpx" controls></video>
+      </el-col>
     </el-row>
   </div>
 </template>
@@ -63,6 +65,13 @@ export default {
     imghpx() {
       return this.imgpx * 0.8;
     },
+    videopx() {
+      console.log(document.body.clientHeight);
+      return document.body.clientWidth * 0.8;
+    },
+    videohpx() {
+      return document.body.clientHeight * (2 / 10);
+    },
   },
   metaInfo() {
     return { title: this.$route.meta.title };