From 99fcfdbc5bc24b95ee8bf52679c7a35fd650d223 Mon Sep 17 00:00:00 2001
From: Gaoxs <704041637@qq.com>
Date: Thu, 17 Sep 2020 10:22:51 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A8=A1=E5=9D=97=E5=90=8D?=
=?UTF-8?q?=E7=A7=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/colorui/components/cu-custom.vue | 132 ++++++++++----------
pages/home/components/Banner.vue | 58 ++++-----
pages/home/index.vue | 91 +++++++-------
3 files changed, 148 insertions(+), 133 deletions(-)
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 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
- {{ 'YSHOP商城' }}
-
-
-
+
+
+
+ {{ 'YSHOP商城' }}
+
+
+
-
+
@@ -112,7 +111,7 @@
Live
},
props: {},
- data: function () {
+ data: function() {
return {
CustomBar: this.CustomBar,
StatusBar: this.StatusBar,
@@ -215,7 +214,7 @@
},
},
- onShow: function () {
+ onShow: function() {
this.getLocation()
let that = this;
uni.showLoading({
@@ -243,14 +242,14 @@
},
methods: {
...mapActions(["getLocation"]),
- onShareTimeline: function () {
+ onShareTimeline: function() {
return {
title: this.miniHomeRemark,
imageUrl: this.miniHomeImg,
path: "pages/home/index?spread=" + uni.getStorageSync("uid")
}
},
- onShareAppMessage: function () {
+ onShareAppMessage: function() {
return {
title: this.miniHomeRemark,
imageUrl: this.miniHomeImg,
@@ -288,7 +287,7 @@
goGoodsPromotion() {
this.$yrouter.push('/pages/shop/GoodsPromotion/index');
},
- setOpenShare: function () {
+ setOpenShare: function() {
if (this.$deviceType == 'weixin') {
getShare().then(res => {
var data = res.data.data;
@@ -302,7 +301,7 @@
})
}
},
- startQr: function () {
+ startQr: function() {
uni.scanCode({
success: (res) => {
let option = handleUrlParam(res.result)
@@ -351,7 +350,7 @@
this.bgcolor = e;
},
},
- created: async function () {
+ created: async function() {
// await this.doColorThief();
},
};
@@ -389,22 +388,22 @@
}
}
- .head_box {
- width: 750rpx;
- // background: #fff;
- transition: all linear 0.3s;
+ .head_box {
+ width: 750rpx;
+ // background: #fff;
+ transition: all linear 0.3s;
- /deep/.cuIcon-back {
- display: none;
- }
+ /deep/.cuIcon-back {
+ display: none;
+ }
- .nav-title {
- font-size: 38rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #fff;
- }
- }
+ .nav-title {
+ font-size: 38rpx;
+ font-family: PingFang SC;
+ font-weight: 500;
+ color: #fff;
+ }
+ }
.cu-bar.fixed {
position: fixed;
@@ -447,4 +446,12 @@
.home_content_box {
margin-top: -10rpx;
}
-
+
+ .head_box {
+ }
+
+ .nav-title {
+ margin-left: 20rpx;
+ line-height: 40px;
+ }
+