From 806eae80dc0a0fa98089c8454926dd1252809bcf Mon Sep 17 00:00:00 2001 From: zpc Date: Mon, 21 Apr 2025 16:38:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/common.js | 5 +++++ common/config.js | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/common/common.js b/common/common.js index a7e9c07..e940acd 100644 --- a/common/common.js +++ b/common/common.js @@ -51,6 +51,11 @@ export default { * @returns */ removeTrailingZeros(numStr) { + // 判断传入参数是否为字符串,如果不是则转为字符串 + if (typeof numStr !== 'string') { + numStr = String(numStr); + } + if (numStr.includes('.')) { numStr = numStr.replace(/0+$/, ''); // 移除末尾的零 if (numStr.endsWith('.')) { diff --git a/common/config.js b/common/config.js index bee9d11..51fc8de 100644 --- a/common/config.js +++ b/common/config.js @@ -8,7 +8,7 @@ import RequestManager from '@/common/request.js' let configData = null; let isLoading = false; let loadPromise = null; -const wx_version = "103"; +const wx_version = "104"; const defaultConfig = { "good_type": [{ "value": 0, "sort_order": 0, "is_show": 1, "name": "全部", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 1, "sort_order": 1, "is_show": 0, "name": "一番赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 2, "sort_order": 2, "is_show": 1, "name": "无限赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 3, "sort_order": 3, "is_show": 0, "name": "擂台赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 5, "sort_order": 4, "is_show": 0, "name": "积分赏", "pay_wechat": 0, "pay_balance": 0, "pay_currency": 0, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 0 }, { "value": 6, "sort_order": 5, "is_show": 1, "name": "限时活动", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 8, "sort_order": 6, "is_show": 1, "name": "领主赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 9, "sort_order": 7, "is_show": 0, "name": "连击赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 10, "sort_order": 8, "is_show": 0, "name": "商城赏", "pay_wechat": 1, "pay_balance": 0, "pay_currency": 0, "pay_currency2": 1, "pay_coupon": 0, "is_deduction": 0 }, { "value": 11, "sort_order": 9, "is_show": 0, "name": "自制赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 15, "sort_order": 15, "is_show": 0, "name": "福利屋", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 0, "pay_currency2": 0, "pay_coupon": 0, "is_deduction": 0 }, { "value": 16, "sort_order": 16, "is_show": 1, "name": "翻倍赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 17, "sort_order": 17, "is_show": 0, "name": "外卖盒子", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 0, "pay_currency2": 0, "pay_coupon": 0, "is_deduction": 0 }], "app_setting": { @@ -147,8 +147,17 @@ class ConfigManager { static getGoodType() { let goodType = this.get('good_type'); if (goodType != null) { - // goodType数组过滤,只保留is_show=1的项目 + if (this.GetVersion()) { + return goodType.filter(item => item.is_show === 1 && (item.value === 2||item.value === 0)).map(item => { + return { + id: item.value, + title: item.name + } + }); + } return goodType.filter(item => item.is_show === 1).map(item => { + console.log(item); + return { id: item.value, title: item.name