diff --git a/components/magic-list/magic-list.vue b/components/magic-list/magic-list.vue index 6b8ef718..63c9d8eb 100644 --- a/components/magic-list/magic-list.vue +++ b/components/magic-list/magic-list.vue @@ -45,6 +45,12 @@ const app = getApp(); export default { name: 'recommend-hot', + data() { + return { + theme_view: app.globalData.get_theme_value_view(), + data_goods_list: [], + }; + }, props: { propCurrencySymbol: { type: String, @@ -65,11 +71,12 @@ default: 1000, }, }, - data() { - return { - theme_view: app.globalData.get_theme_value_view(), - data_goods_list: [], - }; + // 属性值改变监听 + watch: { + // 数据 + propData(value, old_value) { + this.set_data(value); + } }, mounted() { this.set_data(this.propData); diff --git a/pages/index/index.vue b/pages/index/index.vue index 7c21f7ae..78712cbe 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -162,7 +162,7 @@ - + @@ -328,6 +328,8 @@ cart_total: 0, message_total: 0, right_icon_list: [], + // 增加随机数,避免无法监听数据列表内部数据更新 + random_value: 0, // 基础配置 common_shop_notice: null, home_index_floor_data_type: 0, @@ -524,6 +526,7 @@ cart_total: data.cart_total.buy_number || 0, message_total: parseInt(data.message_total || 0), right_icon_list: data.right_icon_list || [], + random_value: Math.random(), data_list_loding_status: data.data_list.length == 0 ? 0 : 3, plugins_sort_list: data.plugins_sort_list || [], plugins_seckill_data: data.plugins_seckill_data || null,