From 01eaea0cdc50726d93b1c8705facfd0103a14222 Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Tue, 30 Jul 2024 11:49:24 +0800 Subject: [PATCH 1/3] =?UTF-8?q?Fix(=E5=85=A5=E9=A9=BB):[#2105]=E7=BB=8F?= =?UTF-8?q?=E7=BA=AC=E5=BA=A6=E8=A6=81=E6=B1=82=E4=BF=9D=E7=95=996?= =?UTF-8?q?=E4=BD=8D=E5=B0=8F=E6=95=B0=EF=BC=8C=E5=AE=9E=E9=99=85=E5=8F=AA?= =?UTF-8?q?=E6=9C=89=E5=89=8D=E4=B8=A4=E4=BD=8D=E5=B0=8F=E6=95=B0=E4=BF=9D?= =?UTF-8?q?=E7=95=99=EF=BC=8C=E5=90=8E=E5=9B=9B=E4=BD=8D=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E8=A2=AB=E7=BD=AE=E4=B8=BA0=E5=AF=BC=E8=87=B4=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D=E6=9C=89=E5=81=8F=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 36 +++++++++++++++++++----------------- pagesInn/inn/innHome.vue | 4 ++-- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/main.js b/main.js index 6fa3b48..e024e72 100644 --- a/main.js +++ b/main.js @@ -46,31 +46,33 @@ Vue.prototype.$validator = function (rule) { // cookie.clearAll(); // cookie.set(CACHE_KEY, 1); // } -//强制转为几位小数,不足的补0 -var forceToDecimal = function changeToDecimal(x, len, ignore = false) { - var f_x = parseFloat(x); +// 强制转为几位小数,不足的补0 +const forceToDecimal = function changeToDecimal(value, len = 1) { + const f_x = parseFloat(value) if (isNaN(f_x)) { - return 0; + return 0 } - var f = Math.round(f_x * 100) / 100; - if (ignore) { - f = Math.floor(f_x * 100) / 100; - } - var s = f.toString(); - var rs = s.indexOf('.'); + let s = f_x.toString() + let rs = s.indexOf('.') if (rs < 0) { - rs = s.length; - s += '.'; + rs = s.length + s += '.' } while (s.length <= rs + len) { - s += '0'; + s += '0' } - return s; + const tempArr = s.split('.') + const decimalArr = tempArr[1].split('') + let res = tempArr[0] + '.' + for (let i = 0; i < len; i++) { + res += decimalArr[i] + } + return res } -//强制转为2位小数,不足的补0 -var force2Decimal = function change2Decimal(x, ignore = false) { - return forceToDecimal(x, 2, false); +// 强制转为2位小数,不足的补0 +const force2Decimal = function change2Decimal(value) { + return forceToDecimal(value, 2) } Vue.prototype.$force2Decimal = force2Decimal diff --git a/pagesInn/inn/innHome.vue b/pagesInn/inn/innHome.vue index e2a988e..0be6575 100644 --- a/pagesInn/inn/innHome.vue +++ b/pagesInn/inn/innHome.vue @@ -757,8 +757,8 @@ export default { _this.isLike = data.zanVo !== null _this.isFavorite = data.hasFavorite _this.favoriteCount = data.favoriteCount - _this.inn.latitude = _this.inn.latitude ? parseFloat(_this.inn.latitude) : 24.993587 - _this.inn.longitude = _this.inn.longitude ? parseFloat(_this.inn.longitude) : 102.779656 + _this.inn.latitude = _this.inn.latitude > 0 ? _this.inn.latitude : 24.993587 + _this.inn.longitude = _this.inn.longitude > 0 ? _this.inn.longitude : 102.779656 // fix bug#1107 if (!_this.isLoad) { // 该店铺无商品则不显示“精选商品” From 8056e74d43d19be71065eead9b87efd7c9528746 Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Tue, 30 Jul 2024 14:16:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?Fix(=E4=B8=8A=E4=BC=A0):[#2109]=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E8=B6=85=E5=87=BA=E5=A4=A7=E5=B0=8F=E9=99=90=E5=88=B6?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/tm-upload/tm-upload.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/tm-upload/tm-upload.vue b/components/tm-upload/tm-upload.vue index 3a54c34..9c26e5f 100644 --- a/components/tm-upload/tm-upload.vue +++ b/components/tm-upload/tm-upload.vue @@ -225,7 +225,7 @@ export default { this.upload_exceeded_list.push(i === 0 ? 1 : i + 1); uni.showModal({ title: '提示', - content: `第${[...new Set(this.upload_exceeded_list)].join(',')}张图片超出限制${this.upload_max}MB,已过滤`, + content: `图片超出限制${this.upload_max}MB,已过滤`, showCancel: false, confirmText: '确认', success(res) { From b264e04e8fa8c0b97f9b6f7006ac9fc41bc3f802 Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Tue, 30 Jul 2024 14:16:54 +0800 Subject: [PATCH 3/3] =?UTF-8?q?Chore:=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg_product/views/scenicSpot.vue | 1 + pkg_product/views/sharpList.vue | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg_product/views/scenicSpot.vue b/pkg_product/views/scenicSpot.vue index 822e11e..a8020c3 100644 --- a/pkg_product/views/scenicSpot.vue +++ b/pkg_product/views/scenicSpot.vue @@ -27,6 +27,7 @@