From e7dccf157295384ec21f237621b7f236095c44a1 Mon Sep 17 00:00:00 2001 From: Gao xiaosong <704041637@qq.com> Date: Fri, 30 Oct 2020 01:11:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=AE=E6=92=AD=E5=9B=BE?= =?UTF-8?q?=E5=8D=A1=E9=A1=BF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- pages/home/components/Banner.vue | 36 ++------------------------------ 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/manifest.json b/manifest.json index 5d0a1cc..43136fe 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name" : "yshopmall", "appid" : "__UNI__C7A519E", "description" : "", - "versionName" : "1.0.0", + "versionName" : "1.0.1", "versionCode" : 1, "transformPx" : false, /* 5+App特有相关 */ diff --git a/pages/home/components/Banner.vue b/pages/home/components/Banner.vue index d699be3..5a1da6b 100644 --- a/pages/home/components/Banner.vue +++ b/pages/home/components/Banner.vue @@ -41,46 +41,14 @@ let item = this.detail[this.swiperCurrent]; // 获取轮播图颜色 let bgcolor = item.bgcolor; - // #ifdef APP-PLUS - that.$set(item, 'bgcolor', '#c40414'); - that.$emit('getbgcolor', '#c40414'); - // #endif - // #ifndef APP-PLUS // 颜色不存在 if (bgcolor === '') { - let ctx = uni.createCanvasContext('colorThief', that); - if (0 === that.webviewId || ctx.webviewId === that.webviewId) { - that.webviewId = ctx.webviewId; - uni.getImageInfo({ - src: item.pic, - success: function (image) { - ctx.drawImage(image.path, 0, 0, image.width, image.height); - ctx.draw(true, function (e) { - uni.canvasGetImageData({ - canvasId: 'colorThief', - x: 0, - y: 0, - width: parseInt(image.width), - height: parseInt(image.height), - success(res) { - let bgcolor = colorThief(res.data) - .color() - .getHex(); - that.$set(item, 'bgcolor', bgcolor); - that.$emit('getbgcolor', bgcolor); - } - }, - that - ); - }); - } - }); - } + that.$set(item, 'bgcolor', '#c40414'); + that.$emit('getbgcolor', '#c40414'); } else { that.$set(item, 'bgcolor', bgcolor); that.$emit('getbgcolor', bgcolor); } - // #endif }, swiperChange(e) {