@@ -301,6 +323,8 @@ import {
setRealNameBanner,
getButlerQrcode,
setButlerQrcode,
+ getDisplayPageImage,
+ setDisplayPageImage,
getMemberIcons,
setMemberIcons,
getMemberEntryImage,
@@ -321,6 +345,7 @@ const configForm = ref({
searchBanner: '',
realNameBanner: '',
butlerQrcode: '',
+ displayPageImage: '',
unlimitedMemberIcon: '',
sincereMemberIcon: '',
familyMemberIcon: '',
@@ -352,14 +377,15 @@ const getFullUrl = (url) => {
const loadConfig = async () => {
try {
- const [avatarRes, bannerRes, realNameBannerRes, qrcodeRes, memberIconsRes, memberEntryRes, realNamePriceRes] = await Promise.all([
+ const [avatarRes, bannerRes, realNameBannerRes, qrcodeRes, memberIconsRes, memberEntryRes, realNamePriceRes, displayPageRes] = await Promise.all([
getDefaultAvatar(),
getSearchBanner(),
getRealNameBanner(),
getButlerQrcode(),
getMemberIcons(),
getMemberEntryImage(),
- getRealNamePrice()
+ getRealNamePrice(),
+ getDisplayPageImage()
])
if (avatarRes) {
configForm.value.defaultAvatar = avatarRes.avatarUrl || ''
@@ -385,6 +411,9 @@ const loadConfig = async () => {
if (realNamePriceRes) {
configForm.value.realNamePrice = realNamePriceRes.price || 88
}
+ if (displayPageRes) {
+ configForm.value.displayPageImage = displayPageRes.imageUrl || ''
+ }
} catch (error) {
console.error('加载配置失败:', error)
}
@@ -445,6 +474,15 @@ const handleQrcodeSuccess = (response) => {
}
}
+const handleDisplayPageImageSuccess = (response) => {
+ if (response.code === 0 && response.data) {
+ configForm.value.displayPageImage = response.data.url
+ ElMessage.success('上传成功')
+ } else {
+ ElMessage.error(response.message || '上传失败')
+ }
+}
+
const handleUnlimitedMemberIconSuccess = (response) => {
if (response.code === 0 && response.data) {
configForm.value.unlimitedMemberIcon = response.data.url
@@ -521,6 +559,9 @@ const saveBasicConfig = async () => {
if (configForm.value.butlerQrcode) {
promises.push(setButlerQrcode(configForm.value.butlerQrcode))
}
+ if (configForm.value.displayPageImage) {
+ promises.push(setDisplayPageImage(configForm.value.displayPageImage))
+ }
if (configForm.value.memberEntryImage) {
promises.push(setMemberEntryImage(configForm.value.memberEntryImage))
}
diff --git a/miniapp/pages.json b/miniapp/pages.json
index 9b64fcc..f763388 100644
--- a/miniapp/pages.json
+++ b/miniapp/pages.json
@@ -152,6 +152,13 @@
"navigationBarTitleText": "联系我们"
}
},
+ {
+ "path": "pages/display/index",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": "详情"
+ }
+ },
{
"path": "pages/webview/index",
"style": {
diff --git a/miniapp/pages/display/index.vue b/miniapp/pages/display/index.vue
new file mode 100644
index 0000000..c4c29ff
--- /dev/null
+++ b/miniapp/pages/display/index.vue
@@ -0,0 +1,188 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ‹
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂无内容
+
+
+
+
+
+
+
+
+
+
diff --git a/miniapp/store/config.js b/miniapp/store/config.js
index 9627f8d..12d57c2 100644
--- a/miniapp/store/config.js
+++ b/miniapp/store/config.js
@@ -41,6 +41,7 @@ export const useConfigStore = defineStore('config', {
searchBanner: '',
realNameBanner: '',
butlerQrcode: '', // 管家指导二维码
+ displayPageImage: '', // 展示页长图
memberEntryImage: '', // 会员入口图
// 会员图标配置
@@ -133,6 +134,7 @@ export const useConfigStore = defineStore('config', {
this.searchBanner = config.searchBanner || ''
this.realNameBanner = config.realNameBanner || ''
this.butlerQrcode = config.butlerQrcode || ''
+ this.displayPageImage = config.displayPageImage || ''
this.memberEntryImage = config.memberEntryImage || ''
// 会员图标配置
diff --git a/server/src/XiangYi.AdminApi/Controllers/AdminConfigController.cs b/server/src/XiangYi.AdminApi/Controllers/AdminConfigController.cs
index 3ce6037..a65085e 100644
--- a/server/src/XiangYi.AdminApi/Controllers/AdminConfigController.cs
+++ b/server/src/XiangYi.AdminApi/Controllers/AdminConfigController.cs
@@ -231,6 +231,34 @@ public class AdminConfigController : ControllerBase
return result ? ApiResponse.Success("设置成功") : ApiResponse.Error(40001, "设置失败");
}
+ ///
+ /// 获取展示页长图
+ ///
+ [HttpGet("displayPageImage")]
+ public async Task
> GetDisplayPageImage()
+ {
+ var imageUrl = await _configService.GetDisplayPageImageAsync();
+ return ApiResponse.Success(new DisplayPageImageResponse
+ {
+ ImageUrl = imageUrl
+ });
+ }
+
+ ///
+ /// 设置展示页长图
+ ///
+ [HttpPost("displayPageImage")]
+ public async Task SetDisplayPageImage([FromBody] SetDisplayPageImageRequest request)
+ {
+ if (string.IsNullOrWhiteSpace(request.ImageUrl))
+ {
+ return ApiResponse.Error(40001, "图片URL不能为空");
+ }
+
+ var result = await _configService.SetDisplayPageImageAsync(request.ImageUrl);
+ return result ? ApiResponse.Success("设置成功") : ApiResponse.Error(40001, "设置失败");
+ }
+
///
/// 获取会员图标
///
@@ -533,3 +561,25 @@ public class SetRealNamePriceRequest
///
public decimal Price { get; set; }
}
+
+///
+/// 展示页长图响应
+///
+public class DisplayPageImageResponse
+{
+ ///
+ /// 图片URL
+ ///
+ public string? ImageUrl { get; set; }
+}
+
+///
+/// 设置展示页长图请求
+///
+public class SetDisplayPageImageRequest
+{
+ ///
+ /// 图片URL
+ ///
+ public string ImageUrl { get; set; } = string.Empty;
+}
diff --git a/server/src/XiangYi.Application/Interfaces/IConfigService.cs b/server/src/XiangYi.Application/Interfaces/IConfigService.cs
index 731623e..fc8628c 100644
--- a/server/src/XiangYi.Application/Interfaces/IConfigService.cs
+++ b/server/src/XiangYi.Application/Interfaces/IConfigService.cs
@@ -101,6 +101,11 @@ public class AppConfigResponse
///
public string? ButlerQrcode { get; set; }
+ ///
+ /// 展示页长图URL
+ ///
+ public string? DisplayPageImage { get; set; }
+
///
/// 会员图标配置
///
diff --git a/server/src/XiangYi.Application/Interfaces/ISystemConfigService.cs b/server/src/XiangYi.Application/Interfaces/ISystemConfigService.cs
index 7ad4d12..39bf38b 100644
--- a/server/src/XiangYi.Application/Interfaces/ISystemConfigService.cs
+++ b/server/src/XiangYi.Application/Interfaces/ISystemConfigService.cs
@@ -92,6 +92,16 @@ public interface ISystemConfigService
///
Task SetButlerQrcodeAsync(string imageUrl);
+ ///
+ /// 获取展示页长图URL
+ ///
+ Task GetDisplayPageImageAsync();
+
+ ///
+ /// 设置展示页长图URL
+ ///
+ Task SetDisplayPageImageAsync(string imageUrl);
+
///
/// 获取会员图标URL(已废弃,请使用GetMemberIconsAsync)
///
diff --git a/server/src/XiangYi.Application/Services/ConfigService.cs b/server/src/XiangYi.Application/Services/ConfigService.cs
index 51a4f15..4bccee0 100644
--- a/server/src/XiangYi.Application/Services/ConfigService.cs
+++ b/server/src/XiangYi.Application/Services/ConfigService.cs
@@ -49,6 +49,7 @@ public class ConfigService : IConfigService
var searchBanner = await _systemConfigService.GetSearchBannerAsync();
var realNameBanner = await _systemConfigService.GetRealNameBannerAsync();
var butlerQrcode = await _systemConfigService.GetButlerQrcodeAsync();
+ var displayPageImage = await _systemConfigService.GetDisplayPageImageAsync();
var memberIcons = await _systemConfigService.GetMemberIconsAsync();
var dailyPopup = await GetPopupConfigAsync(1); // 每日弹窗
var serviceAccountPopup = await GetPopupConfigAsync(2); // 服务号关注弹窗
@@ -65,6 +66,7 @@ public class ConfigService : IConfigService
SearchBanner = searchBanner,
RealNameBanner = realNameBanner,
ButlerQrcode = butlerQrcode,
+ DisplayPageImage = displayPageImage,
MemberIcons = memberIcons,
DailyPopup = dailyPopup,
ServiceAccountPopup = serviceAccountPopup,
diff --git a/server/src/XiangYi.Application/Services/SystemConfigService.cs b/server/src/XiangYi.Application/Services/SystemConfigService.cs
index 4e1da99..27ad45a 100644
--- a/server/src/XiangYi.Application/Services/SystemConfigService.cs
+++ b/server/src/XiangYi.Application/Services/SystemConfigService.cs
@@ -48,6 +48,11 @@ public class SystemConfigService : ISystemConfigService
///
public const string ButlerQrcodeKey = "butler_qrcode";
+ ///
+ /// 展示页长图配置键
+ ///
+ public const string DisplayPageImageKey = "display_page_image";
+
///
/// 会员图标配置键
///
@@ -240,6 +245,18 @@ public class SystemConfigService : ISystemConfigService
return await SetConfigValueAsync(ButlerQrcodeKey, imageUrl, "管家指导二维码URL");
}
+ ///
+ public async Task GetDisplayPageImageAsync()
+ {
+ return await GetConfigValueAsync(DisplayPageImageKey);
+ }
+
+ ///
+ public async Task SetDisplayPageImageAsync(string imageUrl)
+ {
+ return await SetConfigValueAsync(DisplayPageImageKey, imageUrl, "展示页长图URL");
+ }
+
///
public async Task GetMemberIconAsync()
{