Commit 87fd8829 authored by 张九刚's avatar 张九刚

fix: 优化产品页面和品牌页面的按钮显示逻辑,调整视频组件的样式和尺寸

parent a911cbc5
No preview for this file type
......@@ -2,12 +2,18 @@
<view class="container">
<image :key="index" v-for="(item, index) in imgList" mode="widthFix" class="productimg" :src="item.imgUrl">
</image>
<view class="btnbox">
<image v-if="productId&&skuId" @tap="buyHandler" class="btnbuy" :src="$baseUrl + 'brandpage/btnbuy.png'"></image>
<view class="btnbox" v-if="productId && skuId">
<image @tap="buyHandler" class="btnbuy" :src="$baseUrl + 'brandpage/btnbuy.png'"></image>
<button class="btnshare" open-type="share" style="background: none; border: none; padding: 0;">
<image class="btnshare" :src="$baseUrl + 'brandpage/btnshare.png'"></image>
</button>
</view>
<view class="btnbox" v-else>
<button class="btnshare2" open-type="share" style="background: none; border: none; padding: 0;">
<image class="btnshare2" :src="$baseUrl + 'brandpage/btnsharebig.png'"></image>
</button>
</view>
</view>
</template>
......@@ -37,9 +43,9 @@ export default {
this.contentImg = contentImg;
this.contentImgLen = contentImgLen;
this.shareTitle = shareTitle;
this.shareImg = this.$baseUrl + shareImg;
this.shareImg = this.$baseUrl + shareImg;
// this.shareImg = "https://yun.duiba.com//fh/"+shareImg;
console.log("this.shareImg:", this.shareImg);
......@@ -112,6 +118,14 @@ export default {
width: 350rpx;
height: 75rpx;
}
button.btnshare2::after {
border: none !important;
}
.btnshare2 {
width: 718rpx;
height: 75rpx;
}
}
}
</style>
......@@ -121,7 +121,13 @@
</uni-popup>
</view>
<view v-if="showVideo" class="video-popup">
<video :src="currentVideoUrl" controls autoplay style="width: 100vw; height: 56vw;"></video>
<video
:src="currentVideoUrl"
controls
autoplay
:style="{ width: videoWidth + 'px', height: videoHeight + 'px' }"
@loadedmetadata="onVideoLoadedMeta"
></video>
<view class="close-btn-bottom" @tap="closeVideo">×</view>
</view>
</view>
......@@ -155,9 +161,9 @@ export default {
popupIndex: 0,
showVideo: false,
testVideoUrl: '',
channel: {}
channel: {},
videoWidth: 375,
videoHeight: 210
}
},
mounted() {
......@@ -293,6 +299,13 @@ export default {
current: url // 当前显示的图片
});
},
onVideoLoadedMeta(e) {
const { width, height } = e.detail;
const pageWidth = uni.upx2px(750);
const ratio = height / width;
this.videoWidth = pageWidth;
this.videoHeight =pageWidth;// pageWidth * ratio;
}
}
}
</script>
......@@ -438,6 +451,7 @@ export default {
text-align: center;
height: 100rpx;
white-space: pre-wrap;
}
}
......@@ -619,6 +633,7 @@ export default {
font-size: 24rpx;
color: black;
margin-top: 10rpx;
padding-right: 40rpx;
}
}
}
......
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