diff --git a/common/config.js b/common/config.js index 405003d..9cc4952 100644 --- a/common/config.js +++ b/common/config.js @@ -10,7 +10,8 @@ let isLoading = false; let loadPromise = null; 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": 1, "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 }], - "app_setting": { "key": "app_setting", "app_name": "友达赏", "purchase_popup": "1", "exchange_times": "2", "balance_name": "钻石", "balance_icon": "https://mh.shhuanmeng.com/app/icons/20250322/3d823aaa01e96aeeafc39cbb2d579612.jpg", "currency1_name": "货币", "currency1_icon": "https://mh.shhuanmeng.com/app/icons/20250322/8188634352e7f9edf5a2a42329b7c2c9.jpg", "currency2_name": "积分1", "currency2_icon": "", "win_audio": "https://mh.shhuanmeng.com/static/web/static/mp3/open.mp3", "update_time": 1742716262 } + "app_setting": { "key": "app_setting", "app_name": "友达赏", "purchase_popup": "1", "exchange_times": "2", "balance_name": "钻石", "balance_icon": "https://mh.shhuanmeng.com/app/icons/20250322/3d823aaa01e96aeeafc39cbb2d579612.jpg", "file": "", "currency1_name": "UU币", "currency1_icon": "https://mh.shhuanmeng.com/app/icons/20250322/8188634352e7f9edf5a2a42329b7c2c9.jpg", "currency2_name": "达达卷", "currency2_icon": "", "win_audio": "https://mh.shhuanmeng.com/static/web/static/mp3/open.mp3", "applet_version": "v1.0.0", "sign_in_spend_limit": "0", "update_time": 1743438198 } + }; // 配置类 @@ -40,7 +41,31 @@ class ConfigManager { if (res.status === 1 && res.data) { configData = res.data; console.log('全局配置数据加载成功'); + let _configData = uni.getStorageSync("configData"); uni.setStorageSync('configData', configData); + if (_configData != null && _configData != '') { + if (_configData.app_setting.applet_version != configData.app_setting.applet_version) { + console.log('版本号不一致,需要更新'); + const updateManager = uni.getUpdateManager(); + uni.showModal({ + title: "更新提示", + content: "新版本已经准备好,是否重启应用?", + showCancel: false, + success(res) { + if (res.confirm) { + console.log('开始重启'); + wx.restartMiniProgram({path:"/pages/shouye/index"}); + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + //updateManager.applyUpdate(); + + //#ifdef MP-WEIXIN + + //#endif + } + }, + }); + } + } resolve(configData); } else { console.error('加载配置数据失败:', res.msg || '未知错误'); diff --git a/manifest.json b/manifest.json index afb3253..2aebbfa 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "一番赏", - "appid" : "__UNI__2E6CB39", + "appid" : "__UNI__0BC0425", "description" : "", "versionName" : "1.0.1", "versionCode" : 101, diff --git a/pages/mall/index.vue b/pages/mall/index.vue index f3ad644..22c681d 100644 --- a/pages/mall/index.vue +++ b/pages/mall/index.vue @@ -335,12 +335,11 @@ pay(type) { - //orderData.price - //{{ orderData.goods.price*100 }} (剩余:{{ orderData.use_integral }}) + var pri = this.orderData.goods.price * 100; if (this.orderData.use_integral < pri) { uni.showToast({ - title: '吧唧币不足', + title: this.$config.getAppSetting("currency2_name")+'不足', icon: 'none', }); return;