From aa11230116e2c5b3d18b0293829f828e6840d545 Mon Sep 17 00:00:00 2001 From: zpc Date: Fri, 27 Feb 2026 20:37:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=89=8D=E7=AB=AFUI=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=92=8C=E5=90=8E=E5=8F=B0=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 前端优化: - 修复分享图片配置,使用API返回的share_image - 新增设置页面,包含用户协议、隐私政策、退出登录、注销账号 - 调整用户中心菜单,将协议相关功能移至设置页面 - 隐藏首页和详情页的参与次数显示 - 商城页面价格显示改为哈尼券(价格x100) 后台管理修复: - 修复用户列表货币字段映射错误(Diamond字段) - 修复资金变动对话框,动态加载货币名称 - 修复ChangeDiamondAsync方法使用正确的Money2字段 --- .kiro/settings/mcp.json | 8 +- honey_box/common/config.js | 16 +- honey_box/common/env.js | 4 +- honey_box/common/platform/BasePlatform.js | 145 ++++++------- honey_box/package/index/lian-ji.vue | 3 +- honey_box/pages.json | 10 +- honey_box/pages/mall/index.vue | 4 +- honey_box/pages/shouye/detail_wuxian.vue | 3 +- honey_box/pages/shouye/index.vue | 9 +- honey_box/pages/user/settings.vue | 202 ++++++++++++++++++ honey_box/static/settings.png | Bin 0 -> 3579 bytes .../Models/User/UserModels.cs | 6 +- .../Services/UserBusinessService.cs | 18 +- .../user/components/MoneyChangeDialog.vue | 35 ++- 14 files changed, 346 insertions(+), 117 deletions(-) create mode 100644 honey_box/pages/user/settings.vue create mode 100644 honey_box/static/settings.png diff --git a/.kiro/settings/mcp.json b/.kiro/settings/mcp.json index b68250e0..fa363e2e 100644 --- a/.kiro/settings/mcp.json +++ b/.kiro/settings/mcp.json @@ -45,8 +45,8 @@ }, "mysql": { "command": "node", - "args": [ - "D:/CodeManage/HaniBlindBox/server/scripts/mssql-mcp-server/index.js" + "args": [ + "D:/outsource/HaniBlindBox/server/scripts/mssql-mcp-server/index.js" ], "env": { "MYSQL_HOST": "192.168.195.16", @@ -62,7 +62,7 @@ "sqlserver": { "command": "node", "args": [ - "D:/CodeManage/HaniBlindBox/server/scripts/mssql-mcp-server/index.js" + "D:/outsource/HaniBlindBox/server/scripts/mssql-mcp-server/index.js" ], "env": { "MSSQL_SERVER": "1.13.21.84", @@ -78,7 +78,7 @@ "admin-sqlserver": { "command": "node", "args": [ - "D:/CodeManage/HaniBlindBox/server/scripts/mssql-mcp-server/index.js" + "D:/outsource/HaniBlindBox/server/scripts/mssql-mcp-server/index.js" ], "env": { "MSSQL_SERVER": "1.13.21.84", diff --git a/honey_box/common/config.js b/honey_box/common/config.js index a7c2e8b8..c53efe09 100644 --- a/honey_box/common/config.js +++ b/honey_box/common/config.js @@ -221,7 +221,21 @@ const defaultConfig = { // 配置类 class ConfigManager { static getShareImageUrl() { - return "https://image.zfunbox.cn/icon/fenxiang.jpg"; //this.getAppSetting('share_image_url'); + // 从 base_config 中获取 share_image + const shareImage = this.getBaseConfigKey('share_image'); + // 如果没有配置,返回默认图片 + return shareImage || "https://image.zfunbox.cn/icon/fenxiang.jpg"; + } + + /** + * 获取分享标题 + * @returns {String} 分享标题 + */ + static getShareTitle() { + // 从 base_config 中获取 share_title + const shareTitle = this.getBaseConfigKey('share_title'); + // 如果没有配置,返回默认标题 + return shareTitle || (this.getAppSetting("app_name") + ",正版潮玩手办一番赏"); } /** * 初始化并加载配置 diff --git a/honey_box/common/env.js b/honey_box/common/env.js index d004875c..7a0e3b61 100644 --- a/honey_box/common/env.js +++ b/honey_box/common/env.js @@ -12,9 +12,9 @@ // 测试环境配置 - .NET 10 后端 const testing = { // baseUrl: 'https://app.zpc-xy.com/honey/api', - baseUrl: 'https://api.hanimanghe.top', + // baseUrl: 'https://api.hanimanghe.top', // baseUrl: 'http://192.168.1.24:5238', - // baseUrl: 'http://192.168.195.15:2822', + baseUrl: 'http://192.168.195.15:2822', imageUrl: 'https://youdas-1308826010.cos.ap-shanghai.myqcloud.com', loginPage: '', wxAppId: '' diff --git a/honey_box/common/platform/BasePlatform.js b/honey_box/common/platform/BasePlatform.js index 4d3cac0f..202e60f7 100644 --- a/honey_box/common/platform/BasePlatform.js +++ b/honey_box/common/platform/BasePlatform.js @@ -126,94 +126,69 @@ class BasePlatform { * @returns {Array} 菜单项数组,每项包含id, show, title, icon, path和handler */ getUserMenuList() { - let m = [{ - id: 1, - show: true, - title: '消费记录', - icon: 'my/s1.png', - path: '/pages/other/order_list', - handler: this.navigateToPath.bind(this) - }, - { - id: 3, - show: true, - title: '我的收藏', - icon: 'my/s3.png', - path: '/package/mine/collect', - handler: this.navigateToPath.bind(this) - }, - { - id: 4, - show: true, - title: '优惠券', - icon: 'my/s4.png', - path: '/pages/user/coupon', - handler: this.navigateToPath.bind(this) - }, - { - id: 5, - show: true, - title: '邀请好友', - icon: 'my/s5.png', - path: '/pages/user/tui-guang', - handler: this.navigateToPath.bind(this) - }, - { - id: 6, - show: true, - title: '加入福利群', - icon: 'my/s6.png', - path: '', - handler: this.handleJoinGroup.bind(this) - }, - { - id: 7, - show: true, - title: '用户协议', - icon: 'my/s7.png', - // path: '/pages/guize/guize?type=4', - handler: this.getUserAgreement.bind(this) - }, - { - id: 9, - show: true, - title: '隐私协议', - icon: 'my/s7.png', - handler: this.getPrivacyAgreement.bind(this) - } - - ]; - - if (uni.getStorageSync('token') != null && uni.getStorageSync('token') != "") { - m.push({ - id: 8, + let m = [{ + id: 1, show: true, - title: '注销账号', - icon: 'my/s10.png', - path: '/pages/user/cancel-account-page', + title: '消费记录', + icon: 'my/s1.png', + path: '/pages/other/order_list', handler: this.navigateToPath.bind(this) - }), - m.push({ - id: 8, - show: true, - title: '退出登录', - icon: 'my/exit.png', - path: '', - handler: this.handleLogout.bind(this) - }) + }, + { + id: 3, + show: true, + title: '我的收藏', + icon: 'my/s3.png', + path: '/package/mine/collect', + handler: this.navigateToPath.bind(this) + }, + { + id: 4, + show: true, + title: '优惠券', + icon: 'my/s4.png', + path: '/pages/user/coupon', + handler: this.navigateToPath.bind(this) + }, + { + id: 5, + show: true, + title: '邀请好友', + icon: 'my/s5.png', + path: '/pages/user/tui-guang', + handler: this.navigateToPath.bind(this) + }, + { + id: 6, + show: true, + title: '加入福利群', + icon: 'my/s6.png', + path: '', + handler: this.handleJoinGroup.bind(this) + }, + { + id: 11, + show: true, + title: '设置', + icon: 'my/settings.png', + path: '/pages/user/settings', + handler: this.navigateToPath.bind(this) + } + ]; + + // "关于"菜单:如需显示可将 show 改为 true + const customServiceMenu = { + id: 10, + show: false, + title: '关于', + icon: 'my/about.png', + path: '/pages/other/about', + handler: this.navigateToPath.bind(this) + }; + m.push(customServiceMenu); + return m; } - // “关于”菜单:如需显示可将 show 改为 true - const customServiceMenu = { - id: 10, - show: false, - title: '关于', - icon: 'my/about.png', - path: '/pages/other/about', - handler: this.navigateToPath.bind(this) - }; - m.push(customServiceMenu); - return m; - } + /** * 导航到指定页面 diff --git a/honey_box/package/index/lian-ji.vue b/honey_box/package/index/lian-ji.vue index b32acac1..48becd0c 100644 --- a/honey_box/package/index/lian-ji.vue +++ b/honey_box/package/index/lian-ji.vue @@ -27,7 +27,8 @@ - {{ pageData.goods.join_count }}次参与 + + diff --git a/honey_box/pages.json b/honey_box/pages.json index 7ece498b..e74f9591 100644 --- a/honey_box/pages.json +++ b/honey_box/pages.json @@ -201,7 +201,15 @@ { "path": "pages/user/coupon", "style": { - "navigationBarTitleText": "", + "navigationBarTitleText": "优惠券", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + }, + { + "path": "pages/user/settings", + "style": { + "navigationBarTitleText": "设置", "enablePullDownRefresh": false, "navigationStyle": "custom" } diff --git a/honey_box/pages/mall/index.vue b/honey_box/pages/mall/index.vue index 2eaa697b..ef367c11 100644 --- a/honey_box/pages/mall/index.vue +++ b/honey_box/pages/mall/index.vue @@ -21,7 +21,7 @@ - {{ item.price }} + {{ item.price * 100 }}{{ $config.getAppSetting('currency2_name') }} @@ -54,7 +54,7 @@ 类型:明信片 ×{{ orderData.goods.prize_num }} - ¥{{ orderData.goods.price }} + {{ orderData.goods.price * 100 }}{{ $config.getAppSetting('currency2_name') }} diff --git a/honey_box/pages/shouye/detail_wuxian.vue b/honey_box/pages/shouye/detail_wuxian.vue index a9d56a1c..54de92d3 100644 --- a/honey_box/pages/shouye/detail_wuxian.vue +++ b/honey_box/pages/shouye/detail_wuxian.vue @@ -31,7 +31,8 @@ --> - 已有{{ pageData.goods.join_count }}次参与 + + diff --git a/honey_box/pages/shouye/index.vue b/honey_box/pages/shouye/index.vue index a458efa8..fc57e4ee 100644 --- a/honey_box/pages/shouye/index.vue +++ b/honey_box/pages/shouye/index.vue @@ -88,13 +88,11 @@ - + {{ item.join_count }}次参与 - + --> @@ -279,6 +277,7 @@ onShareAppMessage() { let imageUrl = this.$config.getShareImageUrl(); + console.log('imageUrlimageUrlimageUrl:', imageUrl); // 使用小写 id,兼容新版 .NET API const userinfo = uni.getStorageSync("userinfo") || {}; const pid = userinfo.id || userinfo.ID || ''; diff --git a/honey_box/pages/user/settings.vue b/honey_box/pages/user/settings.vue new file mode 100644 index 00000000..fc910f9c --- /dev/null +++ b/honey_box/pages/user/settings.vue @@ -0,0 +1,202 @@ + + + + + diff --git a/honey_box/static/settings.png b/honey_box/static/settings.png new file mode 100644 index 0000000000000000000000000000000000000000..c432011825afc3df8b4f6b4093695502414db14c GIT binary patch literal 3579 zcmVk(pdb(eVu1{X@Cu|LBCj@LaTtX%>U4(E)&dm@GIZMEQEb6dshy%# ziwZKG0V;MBN=YkKQ{@%HBMA*PNXY~2XbglrA+O#3{yV#Iv%BAZyChp@Dw%uc`@Vb6 zJ@@?YIrrRi?u%L>Dsrf?=5wlKYxBWgAZ+LYT5{pLe|{{-rwW7 zi2CG~mX<^m?*}!b{OXvPn9Ie*#f_&=pKkIbc&c&jXL+{3n*?vnVpCs5Kyg2H%q25 z=w}SJ2KR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/src/HoneyBox.Admin.Business/Models/User/UserModels.cs b/server/HoneyBox/src/HoneyBox.Admin.Business/Models/User/UserModels.cs index 0e5389a4..7b8b1475 100644 --- a/server/HoneyBox/src/HoneyBox.Admin.Business/Models/User/UserModels.cs +++ b/server/HoneyBox/src/HoneyBox.Admin.Business/Models/User/UserModels.cs @@ -77,17 +77,17 @@ public class UserListResponse public string? Mobile { get; set; } /// - /// 余额 + /// 余额/钻石 (对应 balance_name) /// public decimal Balance { get; set; } /// - /// 积分 + /// 积分/HH币 (对应 currency1_name) /// public decimal Integral { get; set; } /// - /// 钻石/评分 + /// 哈尼券 (对应 currency2_name) /// public decimal Diamond { get; set; } diff --git a/server/HoneyBox/src/HoneyBox.Admin.Business/Services/UserBusinessService.cs b/server/HoneyBox/src/HoneyBox.Admin.Business/Services/UserBusinessService.cs index 9f8ce93f..5fb9107a 100644 --- a/server/HoneyBox/src/HoneyBox.Admin.Business/Services/UserBusinessService.cs +++ b/server/HoneyBox/src/HoneyBox.Admin.Business/Services/UserBusinessService.cs @@ -221,17 +221,17 @@ public class UserBusinessService : IUserBusinessService private async Task ChangeDiamondAsync(User user, decimal changeAmount, string remark, int operatorId) { - var newDiamond = user.Score + changeAmount; + var newDiamond = (user.Money2 ?? 0) + changeAmount; if (newDiamond < 0) { - throw new BusinessException(BusinessErrorCodes.ValidationFailed, "钻石不足"); + throw new BusinessException(BusinessErrorCodes.ValidationFailed, "哈尼券不足"); } - user.Score = newDiamond; + user.Money2 = newDiamond; user.UpdatedAt = DateTime.Now; - // 记录变动日志 - var profitScore = new ProfitScore + // 记录变动日志到 ProfitMoney2 表 + var profitMoney2 = new ProfitMoney2 { UserId = user.Id, ChangeMoney = changeAmount, @@ -241,7 +241,7 @@ public class UserBusinessService : IUserBusinessService ShareUid = operatorId, CreatedAt = DateTime.Now }; - _dbContext.ProfitScores.Add(profitScore); + _dbContext.ProfitMoney2s.Add(profitMoney2); } #endregion @@ -1289,9 +1289,9 @@ public class UserBusinessService : IUserBusinessService Nickname = user.Nickname, Avatar = user.HeadImg, Mobile = user.Mobile, - Balance = user.Money, - Integral = user.Integral, - Diamond = user.Score, + Balance = user.Money, // 钻石 (balance_name) + Integral = user.Integral, // HH币 (currency1_name) + Diamond = user.Money2 ?? 0, // 哈尼券 (currency2_name) EquityLevel = user.Vip, CreatedAt = user.CreatedAt, LastLoginIp = loginIps.GetValueOrDefault(user.Id), diff --git a/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/user/components/MoneyChangeDialog.vue b/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/user/components/MoneyChangeDialog.vue index 04b4ecdc..dade9547 100644 --- a/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/user/components/MoneyChangeDialog.vue +++ b/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/user/components/MoneyChangeDialog.vue @@ -65,9 +65,10 @@