From b62f2ccd21cd0be7f3c6923d9f95dd44f2d35ba5 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 27 Apr 2025 21:47:39 +0800 Subject: [PATCH] =?UTF-8?q?sync=EF=BC=9A=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20https://gitee.com/sheepjs/shopro-uniapp/commit/42c7?= =?UTF-8?q?5bb61a94290ed692b5915e41ebc60d4dc521?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sheep/components/s-goods-column/s-goods-column.vue | 7 ------- sheep/url/index.js | 13 +++++++------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/sheep/components/s-goods-column/s-goods-column.vue b/sheep/components/s-goods-column/s-goods-column.vue index 6fcd9f04..0811b1d1 100644 --- a/sheep/components/s-goods-column/s-goods-column.vue +++ b/sheep/components/s-goods-column/s-goods-column.vue @@ -505,7 +505,6 @@ import { PromotionActivityTypeEnum } from '@/sheep/util/const'; // 数据 - const state = reactive({}); let defaultImgWidth = ref(0); // 接收参数 @@ -605,10 +604,6 @@ type: Boolean, default: false, }, - imgHeight: { - type: String, - default: '', - }, }); // 优惠文案 @@ -692,10 +687,8 @@ totalHeight = (goodsPriceCard.width / props.data.image_wh.w) * props.data.image_wh.h + goodsPriceCard.height; - console.log(totalHeight, 'totalHeight'); } else { totalHeight = goodsPriceCard.width + goodsPriceCard.height; - console.log(totalHeight, 'totalHeight2'); } emits('getHeight', totalHeight); }); diff --git a/sheep/url/index.js b/sheep/url/index.js index d216f83f..a7b82e4f 100644 --- a/sheep/url/index.js +++ b/sheep/url/index.js @@ -71,7 +71,8 @@ function append_thumbnail_params(url, params) { if (!gravity && gravity != 'center') { // 指定了裁剪区域 mode = 'mfit'; - crop_str = '/crop,g_' + gravityFormatMap('aliyun', gravity) + ',w_' + width + ',h_' + height; + crop_str = + '/crop,g_' + gravityFormatter('aliyun', gravity) + ',w_' + width + ',h_' + height; } // 质量压缩 @@ -91,7 +92,7 @@ function append_thumbnail_params(url, params) { // 指定了裁剪区域 mode_str = 'crop'; mode = 'fill'; - crop_str = '/gravity/' + gravityFormatMap('qcloud', gravity); + crop_str = '/gravity/' + gravityFormatter('qcloud', gravity); } // 质量压缩 @@ -121,7 +122,7 @@ function append_thumbnail_params(url, params) { if (mode == 'fill' || (!gravity && gravity != 'center')) { // 指定了裁剪区域,全部转为 mfit mode = 'mfit'; - crop_str = '/gravity/' + gravityFormatMap('qiniu', gravity) + '/crop/' + size; + crop_str = '/gravity/' + gravityFormatter('qiniu', gravity) + '/crop/' + size; } // 质量压缩 if (quality > 0 && quality < 100) { @@ -158,8 +159,8 @@ function append_thumbnail_params(url, params) { * * @return string */ -function gravityFormatMap(type, gravity) { - let gravityFormat = { +function gravityFormatter(type, gravity) { + let gravityFormatMap = { aliyun: { north_west: 'nw', // 左上 north: 'north', // 中上 @@ -195,5 +196,5 @@ function gravityFormatMap(type, gravity) { }, }; - return gravityFormat[type][gravity]; + return gravityFormatMap[type][gravity]; }