wxml
<view class="mul-yb {{courseChapters.state==1?'mianfke':''}}" bindtap="getVideo"
data-title="{{courseChapters.name}}"
data-currentPoster="{{courseChapters.thumbnail}}"
data-state="{{courseChapters.state}}"
data-videoId="{{courseChapters.courseVideoAddress}}"
>
js
getVideo(e) {
this.setData({
options: {
title: e.currentTarget.dataset.title, // 视频标题
currentPoster: 'images/2020/06/04/15912626515967143.jpg', // 封面图
state: e.currentTarget.dataset.title, // 1收费 2免费
videoId: '2fcc42331de5412cbccb6691394de337' // 视频id
}
})
}
data-currentPoster 和 data-videoId 这两个数据得值如何赋值到js里面