Commit d9bc3e5b by 宋冰琦

修改首页banner视频

parent 1ea7ca4b
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
<swiper :current="current" class="swiper" @change="swiperChange"> <swiper :current="current" class="swiper" @change="swiperChange">
<swiper-item> <swiper-item>
<view class="list"> <view class="list">
图片演示 <image mode="widthFix" src="https://hooloo-mp.oss-cn-shanghai.aliyuncs.com/resources/mp_order_dtl_rvpic.png" class="imageShow"/>
</view> </view>
</swiper-item> </swiper-item>
<swiper-item> <swiper-item>
<view class="list"> <view class="list">
视频演示 <video @loadedmetadata="videometa" :style="{'height':height+'px','width':width+'px'}" src="https://hooloo-mp.oss-cn-shanghai.aliyuncs.com/resources/mp_order_dtl_rvvid.mp4" class="videoShow"></video>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
...@@ -43,7 +43,9 @@ export default { ...@@ -43,7 +43,9 @@ export default {
nouserList:[], nouserList:[],
current: 0, current: 0,
actionIndx:0, actionIndx:0,
Utils Utils,
height:0,
width:0
}; };
}, },
mounted(){ mounted(){
...@@ -54,6 +56,28 @@ export default { ...@@ -54,6 +56,28 @@ export default {
}, },
}, },
methods: { methods: {
videometa(e) {
var that = this;
//获取系统信息
wx.getSystemInfo({
success (res) {
//视频的高
var height = e.detail.height;
//视频的宽
var width = e.detail.width;
//算出视频的比例
var proportion = height / width;
//res.windowWidth为手机屏幕的宽。
var windowWidth = res.windowWidth;
//算出当前宽度下高度的数值
that.height = proportion * windowWidth;
that.width = windowWidth
}
})
},
changeTab(current) { changeTab(current) {
this.current = current; this.current = current;
}, },
...@@ -66,6 +90,18 @@ export default { ...@@ -66,6 +90,18 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.bigBox { .bigBox {
.imageShow {
// margin-top: 40rpx;
// margin-bottom: 40rpx;
}
.videoShow {
width: 100%;
height: 100vh;
// margin-top: 40rpx;
// margin-bottom: 40rpx;
}
.topBar{ .topBar{
position: fixed; position: fixed;
width: 100%; width: 100%;
...@@ -93,7 +129,7 @@ export default { ...@@ -93,7 +129,7 @@ export default {
height: calc(100vh - 64rpx); height: calc(100vh - 64rpx);
.list{ .list{
height: 100%; height: 100%;
padding: 0rpx 32rpx; // padding: 0rpx 32rpx;
overflow-y: scroll; overflow-y: scroll;
} }
} }
......
...@@ -197,7 +197,7 @@ export default { ...@@ -197,7 +197,7 @@ export default {
created() { created() {
let platform = uni.getSystemInfoSync().platform; let platform = uni.getSystemInfoSync().platform;
uni.downloadFile({ uni.downloadFile({
url: "https://hooloo-dev-api.gdatac.com/resources/menu.mp4", //仅为示例,并非真实的资源 url: "https://hooloo-mp.oss-cn-shanghai.aliyuncs.com/resources/menu.mp4", //仅为示例,并非真实的资源
success: (res) => { success: (res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
console.log(res); console.log(res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment