修改报错问题
parent
d4c3f6c739
commit
221995e78e
|
|
@ -2,7 +2,7 @@
|
|||
<view class="pr" :style="style_container">
|
||||
<swiper circular="true" :autoplay="form.is_roll == '1'" :interval="form.interval_time * 1000" :display-multiple-items="slides_per_group" :duration="500" :style="{ height: new_style.height * 2 + 'rpx' }" :previous-margin="previousMargin" :next-margin="nextMargin" @change="slideChange">
|
||||
<block v-if="form.carousel_type == 'card'">
|
||||
<swiper-item v-for="(item, index) in new_list" :key="index" class="flex-row align-c" @tap="url_open(item.carousel_link)">
|
||||
<swiper-item v-for="(item, index) in new_list" :key="index" class="flex-row align-c" :data-value="item.carousel_link.page" @tap="url_open">
|
||||
<view class="swiper-item" :style="img_style" :class="['scale-defalt', { 'scale-1': animationData === index }]">
|
||||
<image-empty :image-src="item.carousel_img[0]" class="img" :style="img_style" :img_fit="img_fit" error-style="width: 100rpx;height: 100rpx;"></image-empty>
|
||||
</view>
|
||||
|
|
@ -244,9 +244,7 @@
|
|||
this.$refs.popup.close();
|
||||
},
|
||||
url_open(link) {
|
||||
if (!isEmpty(link)) {
|
||||
app.globalData.url_open(link.page);
|
||||
}
|
||||
app.globalData.url_event(link);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -78,9 +78,7 @@
|
|||
});
|
||||
},
|
||||
url_open(link) {
|
||||
if (!isEmpty(link)) {
|
||||
app.globalData.url_open(link);
|
||||
}
|
||||
app.globalData.url_event(link);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<view class="pr" :style="diy_content_style">
|
||||
<view v-for="(item, index) in tabs_data" :key="index">
|
||||
<componentDiyTabs v-if="item.key == 'tabs'" :value="item.com_data" :key="key" @tabs-click="tabs_click_event"></componentDiyTabs>
|
||||
<componentDiyTabsCarousel v-else-if="item.key == 'tabs-carousel'" :value="item.com_data" :key="key + 'tabs-carousel'" @tabs-click="tabs_click_event"></componentDiyTabsCarousel>
|
||||
<componentDiyTabsCarousel v-else-if="item.key == 'tabs-carousel'" :value="item.com_data" :key="key" @tabs-click="tabs_click_event"></componentDiyTabsCarousel>
|
||||
</view>
|
||||
<view v-if="is_tabs_type" class="diy-content">
|
||||
<template v-if="diy_data.length > 0">
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<view class="oh" :style="style_container">
|
||||
<view :class="outer_class" :style="onter_style">
|
||||
<block v-if="!['5'].includes(theme)">
|
||||
<view v-for="(item, index) in list" :key="index" class="pr" :class="layout_type" :style="layout_style">
|
||||
<view v-for="(item, index) in list" :key="index" class="pr" :class="layout_type" :style="layout_style" :data-value="item.goods_url" @tap="url_event">
|
||||
<block v-if="theme == '6'">
|
||||
<view :class="['flex-row align-c jc-sb ptb-15 mlr-10 gap-20', { 'br-b-e': index != list.length - 1 }]">
|
||||
<view v-if="is_show('title')" :class="text_line" :style="title_style">{{ item.title }}</view>
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
<span v-if="is_show('price_unit')" class="identifying">{{ item.show_price_unit }}</span>
|
||||
</view>
|
||||
<view v-if="show_content && is_show('original_price') && !isEmpty(item.min_original_price)" class="text-size-xss flex-row">
|
||||
<img class="original-price-left" :src="form.static_img[0].url" />
|
||||
<img v-if="form.static_img.length > 0" class="original-price-left" :src="form.static_img[0].url" />
|
||||
<span :class="['original-price text-line-1', { 'flex-1': form.is_price_solo == '1' }]"
|
||||
>{{ item.show_original_price_symbol }}{{ item.min_original_price }}
|
||||
<block v-if="is_show('original_price_unit')">
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
<span v-if="is_show('price_unit')" class="identifying">{{ item.show_price_unit }}</span>
|
||||
</view>
|
||||
<view v-if="show_content && is_show('original_price') && !isEmpty(item.min_original_price)" class="text-size-xss flex-row">
|
||||
<image class="original-price-left" :src="form.static_img[0].url" />
|
||||
<img v-if="form.static_img.length > 0" class="original-price-left" :src="form.static_img[0].url" />
|
||||
<span :class="['original-price text-line-1', { 'flex-1': form.is_price_solo == '1' }]"
|
||||
>{{ item.show_original_price_symbol }}{{ item.min_original_price }}
|
||||
<block v-if="is_show('original_price_unit')">
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
</span>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="form.is_shop_show == '1'">
|
||||
<view v-if="form.is_shop_show == '1'" :data-index="index" @tap.stop="goods_button_event">
|
||||
<block v-if="form.shop_type == 'text'">
|
||||
<view class="plr-11 ptb-3 round" :style="button_style + ('color:' + new_style.shop_button_text_color)">{{ form.shop_button_text }}</view>
|
||||
</block>
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
<block v-else>
|
||||
<swiper circular="true" :autoplay="new_style.is_roll == '1'" :interval="new_style.interval_time * 1000" :duration="500" :style="{ width: '100%', height: new_style.content_outer_height * 2 + 'rpx' }">
|
||||
<swiper-item v-for="(item1, index1) in shop_content_list" :key="index1" class="flex-row" :style="onter_style">
|
||||
<view v-for="(item, index) in item1.split_list" :key="index" class="pr" :class="layout_type" :style="layout_style">
|
||||
<view v-for="(item, index) in item1.split_list" :key="index" class="pr" :class="layout_type" :style="layout_style" :data-value="item.goods_url" @tap="url_event">
|
||||
<block v-if="!isEmpty(item)">
|
||||
<block v-if="!isEmpty(item.new_cover)">
|
||||
<image-empty :image-src="item.new_cover[0]" :class="'flex-img' + theme" :style="content_img_radius" error-style="width: 100rpx;height: 100rpx;"></image-empty>
|
||||
|
|
@ -121,7 +121,7 @@
|
|||
<span v-if="is_show('price_unit')" class="identifying">{{ item.show_price_unit }}</span>
|
||||
</view>
|
||||
<view v-if="show_content && is_show('original_price') && !isEmpty(item.min_original_price)" class="text-size-xss flex">
|
||||
<image class="original-price-left" :src="form.static_img[0].url" />
|
||||
<img v-if="form.static_img.length > 0" class="original-price-left" :src="form.static_img[0].url" />
|
||||
<span :class="['original-price text-line-1', { 'flex-1': form.is_price_solo == '1' }]"
|
||||
>{{ item.show_original_price_symbol }}{{ item.min_original_price }}
|
||||
<block v-if="is_show('original_price_unit')">
|
||||
|
|
@ -130,7 +130,7 @@
|
|||
</span>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="form.is_shop_show == '1'">
|
||||
<view v-if="form.is_shop_show == '1'" :data-index="index1" :data-split-index="index" @tap.stop="goods_button_event">
|
||||
<block v-if="form.shop_type == 'text'">
|
||||
<view class="plr-11 ptb-3 round" :style="button_style + ('color:' + new_style.shop_button_text_color)">{{ form.shop_button_text }}</view>
|
||||
</block>
|
||||
|
|
@ -145,6 +145,11 @@
|
|||
</swiper>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 商品购买 -->
|
||||
<component-goods-buy v-if="is_show_cart" ref="goods_buy" v-on:CartSuccessEvent="goods_cart_back_event"></component-goods-buy>
|
||||
|
||||
<!-- 购物车抛物线 -->
|
||||
<component-cart-para-curve v-if="is_show_cart" ref="cart_para_curve"></component-cart-para-curve>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -152,9 +157,13 @@
|
|||
const app = getApp();
|
||||
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 componentGoodsBuy from '@/components/goods-buy/goods-buy';
|
||||
import componentCartParaCurve from '@/components/cart-para-curve/cart-para-curve';
|
||||
export default {
|
||||
components: {
|
||||
imageEmpty,
|
||||
componentGoodsBuy,
|
||||
componentCartParaCurve
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
|
|
@ -172,6 +181,8 @@
|
|||
return {
|
||||
form: {},
|
||||
new_style: {},
|
||||
is_show_cart: false,
|
||||
propIsCartParaCurve: true,
|
||||
default_list: {
|
||||
title: '测试商品标题',
|
||||
min_original_price: '41.2',
|
||||
|
|
@ -414,10 +425,88 @@
|
|||
}
|
||||
return style;
|
||||
},
|
||||
url_open_event(link) {
|
||||
if (!isEmpty(link)) {
|
||||
app.globalData.url_open(link.page);
|
||||
url_event(link) {
|
||||
app.globalData.url_event(link);
|
||||
},
|
||||
goods_button_event(e) {
|
||||
let index = e.currentTarget.dataset.index || 0;
|
||||
let goods = this.list[index];
|
||||
if (this.theme == '5') {
|
||||
index = e.currentTarget.dataset.index || 0;
|
||||
split_index = e.currentTarget.dataset.split_index || 0;
|
||||
goods = this.shop_content_list[index][split_index];
|
||||
}
|
||||
if (this.form.shop_button_effect == '0') {
|
||||
app.globalData.url_event(goods.goods_url);
|
||||
} else {
|
||||
this.goods_cart_event(goods);
|
||||
}
|
||||
},
|
||||
// 加入购物车
|
||||
goods_cart_event(e) {
|
||||
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,
|
||||
pos: e,
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
// 加入购物车成功回调
|
||||
goods_cart_back_event(e) {
|
||||
// 增加数量
|
||||
var back = e.back_data;
|
||||
var new_data = this.data;
|
||||
var goods = new_data['goods_list'][back.index];
|
||||
goods['user_cart_count'] = parseInt(goods['user_cart_count'] || 0) + parseInt(e.stock);
|
||||
if (goods['user_cart_count'] > 99) {
|
||||
goods['user_cart_count'] = '99+';
|
||||
}
|
||||
new_data['goods_list'][back.index] = goods;
|
||||
this.setData({
|
||||
data: new_data,
|
||||
});
|
||||
|
||||
// 抛物线
|
||||
if (this.propIsCartParaCurve && (this.$refs.cart_para_curve || null) != null) {
|
||||
this.$refs.cart_para_curve.init(null, back.pos, goods.images);
|
||||
}
|
||||
|
||||
// 导航购物车处理
|
||||
if (this.propIsCartNumberTabBarBadgeSync) {
|
||||
var cart_total = e.cart_number || 0;
|
||||
if (cart_total <= 0) {
|
||||
app.globalData.set_tab_bar_badge(2, 0);
|
||||
} else {
|
||||
app.globalData.set_tab_bar_badge(2, 1, cart_total);
|
||||
}
|
||||
}
|
||||
|
||||
// 当前页面
|
||||
var page = app.globalData.current_page().split('?');
|
||||
switch (page[0]) {
|
||||
// 商品详情页面
|
||||
case 'pages/goods-detail/goods-detail':
|
||||
// 商品搜索
|
||||
case 'pages/goods-search/goods-search':
|
||||
var res = app.globalData.get_page_object(page[0]);
|
||||
if (res.length > 0) {
|
||||
for (var i in res) {
|
||||
res[i].$vm.goods_cart_count_handle(cart_total);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.$emit('CartSuccessEvent', { ...e, ...{ goods_list: new_data.goods_list, goods: goods } });
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<swiper circular="true" :autoplay="value.data_style.is_roll == '1'" :interval="value.data_style.interval_time * 1000" :duration="500" :vertical="value.data_style.rotation_direction == 'vertical'" class="swiper" style="height: 100%" @change="carousel_change">
|
||||
<swiper-item v-for="(item1, index1) in value.data_content.list" :key="index1">
|
||||
<template v-if="type === 'img'">
|
||||
<view @tap="url_event(item1.carousel_link.page)">
|
||||
<view :data-value="item1.carousel_link.page" @tap="url_event">
|
||||
<image-empty :image-src="item1.carousel_img[0]" :style="contentImgRadius" error-style="width: 80rpx;height: 80rpx;"></image-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -47,9 +47,7 @@
|
|||
},
|
||||
// 跳转链接
|
||||
url_event(link) {
|
||||
if (!isEmpty(link)) {
|
||||
app.globalData.url_open(link);
|
||||
}
|
||||
app.globalData.url_event(link);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<view v-if="outerflex == 'row'" class="wh-auto ht-auto">
|
||||
<view class="flex-row gap-10 align-c wh-auto ht-auto">
|
||||
<template v-if="flex === 'row'">
|
||||
<view v-for="(item, index) in value" :key="index" class="flex-row gap-10 half-width ht-auto" @tap="url_event(item.goods_url)">
|
||||
<view v-for="(item, index) in value" :key="index" class="flex-row gap-10 half-width ht-auto" :data-value="item.goods_url" @tap="url_event">
|
||||
<template v-if="!isEmpty(item.new_cover)">
|
||||
<image-empty :image-src="item.new_cover[0]" class="wh-auto ht-auto" :style="contentImgRadius" error-style="width: 80rpx;height: 80rpx;"></image-empty>
|
||||
</template>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
</view>
|
||||
</template>
|
||||
<template v-else-if="actived != 7 || num !== 1">
|
||||
<view v-for="(item, index) in value" :key="index" :class="['flex-col gap-10 ht-auto', { 'half-width': num !== 1, 'wh-auto': num == 1 }]" @tap="url_event(item.goods_url)">
|
||||
<view v-for="(item, index) in value" :key="index" :class="['flex-col gap-10 ht-auto', { 'half-width': num !== 1, 'wh-auto': num == 1 }]" :data-value="item.goods_url" @tap="url_event">
|
||||
<view class="wh-auto ht-auto pr">
|
||||
<template v-if="!isEmpty(item.new_cover)">
|
||||
<image-empty :image-src="item.new_cover[0]" class="wh-auto ht-auto" :style="contentImgRadius" error-style="width: 80rpx;height: 80rpx;"></image-empty>
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view v-for="(item, index) in value" :key="index" class="flex-col wh-auto ht-auto" @tap="url_event(item.goods_url)">
|
||||
<view v-for="(item, index) in value" :key="index" class="flex-col wh-auto ht-auto" :data-value="item.goods_url" @tap="url_event">
|
||||
<template v-if="!isEmpty(item.new_cover)">
|
||||
<image-empty :image-src="item.new_cover[0]" class="wh-auto ht-auto" :style="contentImgRadius" error-style="width: 80rpx;height: 80rpx;"></image-empty>
|
||||
</template>
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
<view v-else class="wh-auto ht-auto">
|
||||
<view class="flex-col gap-20 align-c wh-auto ht-auto">
|
||||
<template v-if="flex === 'row'">
|
||||
<view v-for="(item, index) in value" :key="index" class="flex-row gap-10 align-c wh-auto ht-auto shop-max-height" @tap="url_event(item.goods_url)">
|
||||
<view v-for="(item, index) in value" :key="index" class="flex-row gap-10 align-c wh-auto ht-auto shop-max-height" :data-value="item.goods_url" @tap="url_event">
|
||||
<template v-if="!isEmpty(item.new_cover)">
|
||||
<image-empty :image-src="item.new_cover[0]" class="wh-auto ht-auto" :style="contentImgRadius" error-style="width: 80rpx;height: 80rpx;"></image-empty>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<template>
|
||||
<view :style="style_container">
|
||||
<swiper circular="true" :autoplay="new_style.is_roll == '1'" :interval="new_style.interval_time * 1000" :duration="500" :style="{ height: newHeight }" @change="slideChange">
|
||||
<swiper-item v-for="(item, index) in nav_content_list" :key="index" class="flex-row align-c" @tap="url_open(item.carousel_link)">
|
||||
<swiper-item v-for="(item, index) in nav_content_list" :key="index" class="flex-row align-c">
|
||||
<view class="bannerImg flex-row flex-wrap wh-auto gap-x-10">
|
||||
<view v-for="(item1, index1) in item.split_list" :key="index1" class="flex-col gap-10 align-c" :style="{ width: group_width }" @tap="url_open_event(item1.link)">
|
||||
<view v-for="(item1, index1) in item.split_list" :key="index1" class="flex-col gap-10 align-c" :style="{ width: group_width }" :data-value="item1.link.page" @tap="url_open_event">
|
||||
<view v-if="['image_with_text', 'image'].includes(nav_style)" class="top-img flex-row align-c jc-c">
|
||||
<image-empty :image-src="item1.img[0]" :style="img_style" error-style="width: 60rpx;height: 60rpx;"></image-empty>
|
||||
</view>
|
||||
|
|
@ -144,9 +144,7 @@
|
|||
});
|
||||
},
|
||||
url_open_event(link) {
|
||||
if (!isEmpty(link)) {
|
||||
app.globalData.url_open(link.page);
|
||||
}
|
||||
app.globalData.url_event(link);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<view v-if="intervalId != undefined" class="flex-row align-c gap-4">
|
||||
<span class="text-size-xss" :style="{ color: new_style.end_text_color }">{{ seckill_time.time_first_text }}</span>
|
||||
<view class="flex-row gap-3 jc-c align-c" :style="[form.theme == '4' ? time_bg + 'padding: 6rpx 8rpx;border-radius: 22rpx;' : '']">
|
||||
<image v-if="form.theme == '4'" class="seckill-head-icon radius-xs" :src="form.theme_4_static_img[0].url" />
|
||||
<image v-if="form.theme == '4' && form.theme_4_static_img.length > 0" class="seckill-head-icon radius-xs" :src="form.theme_4_static_img[0].url" />
|
||||
<view v-for="(item, index) in time_config" :key="item.key" class="flex-row gap-3 jc-c align-c">
|
||||
<template v-if="form.theme == '4'">
|
||||
<view class="text-size-xs" :style="{ color: new_style.countdown_color }">{{ item.value }}</view>
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
<span class="text-size-xss" :style="{ color: new_style.end_text_color }">已结束</span>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="form.button_status == '1'" class="flex-row align-c" :style="{ color: new_style.head_button_color }" @tap="url_event('/pages/plugins/seckill/index/index')">
|
||||
<view v-if="form.button_status == '1'" class="flex-row align-c" :style="{ color: new_style.head_button_color }" :data-value="'/pages/plugins/seckill/index/index'" @tap="url_event">
|
||||
<span :style="{ 'font-size': new_style.head_button_size * 2 + 'rpx' }">{{ form.button_text }}</span>
|
||||
<iconfont name="icon-arrow-right" :color="new_style.head_button_color"></iconfont>
|
||||
</view>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
<template v-if="form.shop_style_type != '3'">
|
||||
<view class="flex-row flex-wrap wh-auto" :style="{ gap: content_outer_spacing * 2 + 'rpx' }">
|
||||
<view v-for="(item1, index1) in list" :key="index1" class="flex-row wh-auto">
|
||||
<view v-for="(item, index) in item1.split_list" :key="index" :class="layout_type" :style="layout_type_style + content_radius + (form.shop_style_type == '1' ? content_padding : '')" @tap="url_event(item.goods_url)">
|
||||
<view v-for="(item, index) in item1.split_list" :key="index" :class="layout_type" :style="layout_type_style + content_radius + (form.shop_style_type == '1' ? content_padding : '')" :data-value="item.goods_url" @tap="url_event">
|
||||
<template v-if="!isEmpty(item)">
|
||||
<view class="oh pr" :class="'flex-img' + form.shop_style_type">
|
||||
<template v-if="!isEmpty(item.new_cover)">
|
||||
|
|
@ -99,7 +99,7 @@
|
|||
<template v-else>
|
||||
<swiper circular="false" :autoplay="new_style.is_roll == '1'" :next-margin="new_style.rolling_fashion == 'translation' ? '-' + content_outer_spacing_magin : '0rpx'" :interval="new_style.interval_time * 1000" :duration="500" :display-multiple-items="slides_per_group" :style="{ height: new_style.content_outer_height * 2 + 'rpx' }">
|
||||
<swiper-item v-for="(item1, index1) in list" :key="index1" :class="{ 'flex-row': new_style.rolling_fashion != 'translation' }" :style="new_style.rolling_fashion != 'translation' ? 'gap:' + content_outer_spacing_magin : ''">
|
||||
<view v-for="(item, index) in item1.split_list" :key="index" :class="layout_type" :style="content_radius + (form.shop_style_type == '1' ? content_padding : '') + (new_style.rolling_fashion != 'translation' ? layout_type_style : 'margin-right:' + content_outer_spacing_magin + ';height: 100%;whith: 100%')" @tap="url_event(item.goods_url)">
|
||||
<view v-for="(item, index) in item1.split_list" :key="index" :class="layout_type" :style="content_radius + (form.shop_style_type == '1' ? content_padding : '') + (new_style.rolling_fashion != 'translation' ? layout_type_style : 'margin-right:' + content_outer_spacing_magin + ';height: 100%;whith: 100%')" :data-value="item.goods_url" @tap="url_event">
|
||||
<template v-if="!isEmpty(item)">
|
||||
<view class="oh pr wh-auto ht-auto">
|
||||
<template v-if="!isEmpty(item.new_cover)">
|
||||
|
|
@ -485,9 +485,7 @@
|
|||
},
|
||||
// 跳转链接
|
||||
url_event(link) {
|
||||
if (!isEmpty(link)) {
|
||||
app.globalData.url_open(link);
|
||||
}
|
||||
app.globalData.url_event(link);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue