12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <template>
- <view :class="'video-box ' + (isMine ? 'my-video' : '')" @click="playerHander">
- <image :src="message.payload.thumbUrl" mode="aspectFill" class="poster"></image>
- <image :src="`${assetsUrl}talk-playing.png`" mode="aspectFit" class="video-icon"></image>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- isPlay: false,
- assetsUrl:this.$util.assetsUrl,
- };
- },
- components: {},
- props: {
- message: {
- type: Object,
- default: () => {}
- },
- isMine: {
- type: Boolean,
- default: true
- }
- },
- watch: {
- message: {
- handler: function(newVal) {
- this.message=newVal;
- // this.setData({
- // message: newVal
- // });
- },
- immediate: true,
- deep: true
- }
- },
- onLoad() {
- console.log(this.message)
- },
- methods: {
- playerHander() {
- uni.$emit('videoPlayerHandler', {
- isPlay: true,
- message: this.message
- });
- },
- stopHander() {
- this.isPlay = false;
- }
- }
- };
- </script>
- <style>
- @import './index.css';
- </style>
|