From 813a54060c014f4e09a715b370086e0ffb3541d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Tue, 8 Oct 2024 14:29:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9uniapp=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy/diy.vue | 60 +++++++++++++++++++++-------------- components/diy/goods-list.vue | 13 ++++++++ components/diy/goods-tabs.vue | 9 ++++++ pages/index/index.vue | 19 ++++------- 4 files changed, 65 insertions(+), 36 deletions(-) diff --git a/components/diy/diy.vue b/components/diy/diy.vue index e674dfcd..3dfb1a1e 100644 --- a/components/diy/diy.vue +++ b/components/diy/diy.vue @@ -13,30 +13,30 @@ @@ -116,6 +116,10 @@ type: [String, Number], default: '', }, + propkey: { + type: String, + default: '', + } }, components: { componentDiyHeader, @@ -208,9 +212,19 @@ hack_reset: false, // 底部导航高度 footer_height_value: 0, + diy_key: '', }; }, - created() { + watch: { + propkey(val) { + this.setData({ + diy_key: val + }) + // 初始化 + this.init(); + } + }, + created() { // 初始化配置 this.init_config(); diff --git a/components/diy/goods-list.vue b/components/diy/goods-list.vue index 892805af..720817bc 100644 --- a/components/diy/goods-list.vue +++ b/components/diy/goods-list.vue @@ -187,6 +187,10 @@ type: Boolean, default: true, }, + propkey: { + type: String, + default: '', + } }, data() { return { @@ -225,6 +229,15 @@ return gradient_handle(this.new_style.shop_button_color, '180deg'); }, }, + watch: { + propkey(val) { + this.setData({ + form: this.propValue.content, + new_style: this.propValue.style, + }); + this.init(); + } + }, created() { this.setData({ form: this.propValue.content, diff --git a/components/diy/goods-tabs.vue b/components/diy/goods-tabs.vue index aa92c1a3..1cd6a318 100644 --- a/components/diy/goods-tabs.vue +++ b/components/diy/goods-tabs.vue @@ -45,6 +45,10 @@ type: Boolean, default: false, }, + propkey: { + type: String, + default: '', + } }, data() { return { @@ -79,6 +83,11 @@ } }, }, + watch: { + propkey(val) { + this.init(); + } + }, created() { this.init(); }, diff --git a/pages/index/index.vue b/pages/index/index.vue index 371594c7..20e9b30f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,8 +3,8 @@ - - + +