diff --git a/admin/src/views/Config.vue b/admin/src/views/Config.vue index e102c42..60f94b6 100644 --- a/admin/src/views/Config.vue +++ b/admin/src/views/Config.vue @@ -106,6 +106,35 @@ + + + + + + + + 选择图片 + +
+ 移除 +
+
+ + 保存全部顶图 + +
+
@@ -126,6 +155,24 @@ const commissionRules = ref([]) const configs = reactive({ qrcode: '', agreement: '', privacy: '', withdrawal_guide: '' }) const freezeDays = ref(1) +// 页面顶图配置 +const pageBannerList = [ + { key: 'page_banner_pickup', label: '代取' }, + { key: 'page_banner_delivery', label: '代送' }, + { key: 'page_banner_help', label: '万能帮' }, + { key: 'page_banner_purchase', label: '代购' }, + { key: 'page_banner_food', label: '美食街' }, + { key: 'page_banner_order-hall', label: '接单页' } +] +const pageBanners = reactive({ + page_banner_pickup: '', + page_banner_delivery: '', + page_banner_help: '', + page_banner_purchase: '', + page_banner_food: '', + 'page_banner_order-hall': '' +}) + function addRule() { commissionRules.value.push({ minAmount: 0, maxAmount: 0, rateType: 0, rate: 0 }) } @@ -148,7 +195,7 @@ async function saveCommissionRules() { async function fetchConfig(key) { try { - const res = await request.get(`/config/${key}`) + const res = await request.get(`/admin/config/${key}`) configs[key] = res.value || '' } catch { /* 忽略 */ } } @@ -180,6 +227,27 @@ async function saveFreezeDays() { } } +async function fetchPageBanners() { + for (const item of pageBannerList) { + try { + const res = await request.get(`/admin/config/${item.key}`) + pageBanners[item.key] = res.value || '' + } catch { /* 忽略 */ } + } +} + +async function savePageBanners() { + saving.value = true + try { + for (const item of pageBannerList) { + await request.put(`/admin/config/${item.key}`, { value: pageBanners[item.key] }) + } + ElMessage.success('页面顶图保存成功') + } finally { + saving.value = false + } +} + onMounted(async () => { await fetchCommissionRules() await Promise.all([ @@ -187,7 +255,8 @@ onMounted(async () => { fetchConfig('agreement'), fetchConfig('privacy'), fetchConfig('withdrawal_guide'), - fetchFreezeDays() + fetchFreezeDays(), + fetchPageBanners() ]) }) diff --git a/miniapp/manifest.json b/miniapp/manifest.json index f819adb..1cd36dc 100644 --- a/miniapp/manifest.json +++ b/miniapp/manifest.json @@ -50,7 +50,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "", + "appid" : "wx626fd4a47944e3ea", "setting" : { "urlCheck" : false }, diff --git a/miniapp/pages.json b/miniapp/pages.json index c52e987..cbad301 100644 --- a/miniapp/pages.json +++ b/miniapp/pages.json @@ -9,157 +9,183 @@ { "path": "pages/login/login", "style": { - "navigationBarTitleText": "登录" + "navigationBarTitleText": "登录", + "navigationStyle": "custom" } }, { "path": "pages/order-hall/order-hall", "style": { - "navigationBarTitleText": "订单大厅" + "navigationBarTitleText": "接单", + "navigationStyle": "custom" } }, { "path": "pages/message/message", "style": { - "navigationBarTitleText": "消息" + "navigationBarTitleText": "消息", + "navigationStyle": "custom" } }, { "path": "pages/mine/mine", "style": { - "navigationBarTitleText": "我的" + "navigationBarTitleText": "我的", + "navigationStyle": "custom" } }, { "path": "pages/pickup/pickup", "style": { - "navigationBarTitleText": "代取" + "navigationBarTitleText": "代取", + "navigationStyle": "custom" } }, { "path": "pages/delivery/delivery", "style": { - "navigationBarTitleText": "代送" + "navigationBarTitleText": "代送", + "navigationStyle": "custom" } }, { "path": "pages/help/help", "style": { - "navigationBarTitleText": "万能帮" + "navigationBarTitleText": "万能帮", + "navigationStyle": "custom" } }, { "path": "pages/purchase/purchase", "style": { - "navigationBarTitleText": "代购" + "navigationBarTitleText": "代购", + "navigationStyle": "custom" } }, { "path": "pages/food/food", "style": { - "navigationBarTitleText": "美食街" + "navigationBarTitleText": "美食街", + "navigationStyle": "custom" } }, { "path": "pages/food/shop-detail", "style": { - "navigationBarTitleText": "门店详情" + "navigationBarTitleText": "门店详情", + "navigationStyle": "custom" } }, { "path": "pages/food/food-order", "style": { - "navigationBarTitleText": "美食街订单" + "navigationBarTitleText": "美食街订单", + "navigationStyle": "custom" } }, { "path": "pages/food/food-order-detail", "style": { - "navigationBarTitleText": "美食街订单详情" + "navigationBarTitleText": "美食街订单详情", + "navigationStyle": "custom" } }, { "path": "pages/order/order-detail", "style": { - "navigationBarTitleText": "订单详情" + "navigationBarTitleText": "订单详情", + "navigationStyle": "custom" } }, { "path": "pages/order/my-orders", "style": { - "navigationBarTitleText": "我的订单" + "navigationBarTitleText": "我的订单", + "navigationStyle": "custom" } }, { "path": "pages/order/my-taken", "style": { - "navigationBarTitleText": "我的接单" + "navigationBarTitleText": "我的接单", + "navigationStyle": "custom" } }, { "path": "pages/order/complete-order", "style": { - "navigationBarTitleText": "完成订单确认" + "navigationBarTitleText": "完成订单确认", + "navigationStyle": "custom" } }, { "path": "pages/message/system-msg", "style": { - "navigationBarTitleText": "系统消息" + "navigationBarTitleText": "系统消息", + "navigationStyle": "custom" } }, { "path": "pages/message/order-notify", "style": { - "navigationBarTitleText": "订单通知" + "navigationBarTitleText": "订单通知", + "navigationStyle": "custom" } }, { "path": "pages/message/chat", "style": { - "navigationBarTitleText": "聊天" + "navigationBarTitleText": "聊天", + "navigationStyle": "custom" } }, { "path": "pages/mine/earnings", "style": { - "navigationBarTitleText": "我的收益" + "navigationBarTitleText": "我的收益", + "navigationStyle": "custom" } }, { "path": "pages/mine/earnings-record", "style": { - "navigationBarTitleText": "收益记录" + "navigationBarTitleText": "收益记录", + "navigationStyle": "custom" } }, { "path": "pages/runner/certification", "style": { - "navigationBarTitleText": "跑腿认证" + "navigationBarTitleText": "跑腿认证", + "navigationStyle": "custom" } }, { "path": "pages/config/agreement", "style": { - "navigationBarTitleText": "用户协议" + "navigationBarTitleText": "用户协议", + "navigationStyle": "custom" } }, { "path": "pages/config/privacy", "style": { - "navigationBarTitleText": "隐私政策" + "navigationBarTitleText": "隐私政策", + "navigationStyle": "custom" } }, { "path": "pages/config/qrcode", "style": { - "navigationBarTitleText": "客服二维码" + "navigationBarTitleText": "客服二维码", + "navigationStyle": "custom" } }, { "path": "pages/webview/webview", "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "", + "navigationStyle": "custom" } } ], diff --git a/miniapp/pages/config/agreement.vue b/miniapp/pages/config/agreement.vue index 80d08b3..45dc575 100644 --- a/miniapp/pages/config/agreement.vue +++ b/miniapp/pages/config/agreement.vue @@ -1,5 +1,16 @@