diff --git a/components/diy/carousel.vue b/components/diy/carousel.vue index 73d79945..8e9595b9 100644 --- a/components/diy/carousel.vue +++ b/components/diy/carousel.vue @@ -6,7 +6,7 @@ - + @@ -24,7 +24,7 @@ - + @@ -49,12 +49,6 @@ - - - - - - @@ -100,7 +94,6 @@ img_fit: '', dot_style: '', video_style: '', - video_src: '', popup_width: '0rpx', popup_height: '0rpx', // 样式二的处理 @@ -250,23 +243,12 @@ style += gradient_computer(data) + padding_computer(video_padding) + `color: ${video_title_color};`; return style; }, - video_play(list) { - this.setData({ - video_src: list[0].url, - }); - this.$refs.popup.open(); - const videoContext = uni.createVideoContext('carousel_video'); - if (!isEmpty(videoContext)) { - videoContext.play(); + video_play(e) { + const list = e.currentTarget.dataset.value; + if (!isEmpty(list)) { + this.$emit('video_play', list[0].url, this.popup_width, this.popup_height); } }, - video_close() { - const videoContext = uni.createVideoContext('carousel_video'); - if (!isEmpty(videoContext)) { - videoContext.pause(); - } - this.$refs.popup.close(); - }, url_open(link) { app.globalData.url_event(link); }, diff --git a/components/diy/custom.vue b/components/diy/custom.vue index 759d58b4..723d7b06 100644 --- a/components/diy/custom.vue +++ b/components/diy/custom.vue @@ -3,16 +3,16 @@ diff --git a/components/diy/diy.vue b/components/diy/diy.vue index c100a2d9..38c0bcb8 100644 --- a/components/diy/diy.vue +++ b/components/diy/diy.vue @@ -15,16 +15,16 @@ + + + + + + + + + + + @@ -74,6 +85,7 @@ diff --git a/components/diy/goods-list.vue b/components/diy/goods-list.vue index 9bedddda..60b80d1b 100644 --- a/components/diy/goods-list.vue +++ b/components/diy/goods-list.vue @@ -103,7 +103,7 @@ - + @@ -154,11 +154,6 @@ - - - - - @@ -167,14 +162,10 @@ import { isEmpty, common_styles_computer, get_math, gradient_handle, padding_computer, radius_computer } from '@/common/js/common/common.js'; import imageEmpty from '@/components/diy/modules/image-empty.vue'; import componentBadge from '@/components/badge/badge'; - import componentGoodsBuy from '@/components/goods-buy/goods-buy'; - import componentCartParaCurve from '@/components/cart-para-curve/cart-para-curve'; export default { components: { imageEmpty, componentBadge, - componentGoodsBuy, - componentCartParaCurve, }, props: { propValue: { @@ -190,7 +181,11 @@ propkey: { type: String, default: '', - } + }, + propIndex: { + type: Number, + default: 0, + }, }, data() { return { @@ -231,23 +226,19 @@ }, watch: { propkey(val) { - this.setData({ - form: this.propValue.content, - new_style: this.propValue.style, - }); this.init(); } }, created() { - this.setData({ - form: this.propValue.content, - new_style: this.propValue.style, - }); this.init(); }, methods: { isEmpty, init() { + this.setData({ + form: this.propValue.content, + new_style: this.propValue.style, + }); let new_list = []; // 指定商品并且指定商品数组不为空 if (!isEmpty(this.form.data_list) && this.form.data_type == '0') { @@ -438,25 +429,26 @@ goods = this.shop_content_list[index][split_index]; } if (this.form.shop_button_effect == '0') { + app.globalData.goods_data_cache_handle(goods.id, goods); + app.globalData.url_open(goods.goods_url); } else { - if ((this.$refs.goods_buy || null) != null) { - // 开启购物车抛物线效果则展示提示操作 - let is_success_tips = this.propIsCartParaCurve ? 0 : 1; - this.$refs.goods_buy.init( - goods, - { - buy_event_type: 'cart', - is_direct_cart: 1, - is_success_tips: is_success_tips, - }, - { - index: index, - split_index: split_index, - pos: e, - } - ); - } + // 开启购物车抛物线效果则展示提示操作 + let is_success_tips = this.propIsCartParaCurve ? 0 : 1; + this.$emit('goods_buy_event', + this.propIndex, + goods, + { + buy_event_type: 'cart', + is_direct_cart: 1, + is_success_tips: is_success_tips, + }, + { + index: index, + split_index: split_index, + pos: e, + } + ); } }, // 加入购物车成功回调 diff --git a/components/diy/goods-tabs.vue b/components/diy/goods-tabs.vue index fccffb67..28cfe445 100644 --- a/components/diy/goods-tabs.vue +++ b/components/diy/goods-tabs.vue @@ -2,7 +2,7 @@ - + @@ -49,6 +49,10 @@ type: String, default: '', }, + propIndex: { + type: Number, + default: 0, + }, }, data() { return { @@ -170,6 +174,14 @@ }) .exec(); }, + goods_buy_event(index, goods = {}, params = {}, back_data = null) { + this.$emit('goods_buy_event', index, goods, params, back_data); + }, + goods_cart_back_event(e) { + if ((this.$refs.diy_goods_list || null) != null) { + this.$refs.diy_goods_list.goods_cart_back_event(e); + } + } }, }; diff --git a/components/diy/header.vue b/components/diy/header.vue index 98be946a..b352764b 100644 --- a/components/diy/header.vue +++ b/components/diy/header.vue @@ -1,6 +1,9 @@