Commit f28bc688 by chenwq

详情,视频互斥;开通门店样式

1 parent 046d2d45
...@@ -13,6 +13,9 @@ Component({ ...@@ -13,6 +13,9 @@ Component({
value: -1, value: -1,
observer(n) { observer(n) {
this.getInfo() this.getInfo()
if (n == 3) {
this.setVideoCtx()
}
} }
}, },
// 选中的产品 // 选中的产品
...@@ -69,6 +72,16 @@ Component({ ...@@ -69,6 +72,16 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
setVideoCtx() {
this.setData({
videoCtx: wx.createVideoContext('video', this),
crowdVideoCtx: wx.createVideoContext('crowd-video', this)
})
},
handleVideoPlay(e) {
let { attr } = e.currentTarget.dataset
this.data[attr] && this.data[attr].pause()
},
getInfo() { getInfo() {
let { activeNavIdx, actNum } = this.data let { activeNavIdx, actNum } = this.data
// console.log(actNum, 'actNum---') // console.log(actNum, 'actNum---')
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="view-prod custom-class"> <view class="view-prod custom-class">
<view class="pro-head"> <view class="pro-head">
<!-- 有视频 --> <!-- 有视频 -->
<video class="frame" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" /> <video class="frame" id="video" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" bindplay="handleVideoPlay" data-attr="crowdVideoCtx"/>
<image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" /> <image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" />
<view class="title-wrap"> <view class="title-wrap">
<view class="title">{{prodItemVideo.name}}</view> <view class="title">{{prodItemVideo.name}}</view>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<image webp wx:if="{{ index >= 3 && !showLeftFlag}}" mode="widthFix" webp class="img-item {{item.className?item.className:''}}" src="{{item.url?item.url:item}}?v={{img_version}}"> <image webp wx:if="{{ index >= 3 && !showLeftFlag}}" mode="widthFix" webp class="img-item {{item.className?item.className:''}}" src="{{item.url?item.url:item}}?v={{img_version}}">
<!-- 众筹-视频 --> <!-- 众筹-视频 -->
<block wx:if="{{ index == 3 && actNum == 3 }}"> <block wx:if="{{ index == 3 && actNum == 3 }}">
<video class="crowd-video" src="{{videoBaseUrl}}video/crowd-detail.mp4" /> <video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{videoBaseUrl}}video/crowd-detail.mp4" />
</block> </block>
</image> </image>
</block> </block>
......
...@@ -29,7 +29,6 @@ page { ...@@ -29,7 +29,6 @@ page {
} }
.top { .top {
margin-bottom: 32rpx; margin-bottom: 32rpx;
display: flex;
align-items: center; align-items: center;
.line { .line {
width: 6rpx; width: 6rpx;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!