diff --git a/components/colorui/components/cu-custom.vue b/components/colorui/components/cu-custom.vue index b09f70d..5d1f2ae 100644 --- a/components/colorui/components/cu-custom.vue +++ b/components/colorui/components/cu-custom.vue @@ -1,65 +1,71 @@ - - - - - diff --git a/pages/home/components/Banner.vue b/pages/home/components/Banner.vue index 90a3731..ad407a7 100644 --- a/pages/home/components/Banner.vue +++ b/pages/home/components/Banner.vue @@ -43,34 +43,36 @@ let bgcolor = item.bgcolor; // 颜色不存在 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 - ); - }); - } - }); - } + // 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); diff --git a/pages/home/index.vue b/pages/home/index.vue index bd77321..0d94ee2 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -1,26 +1,26 @@