From 9c7ea6ff0b942b63d15a60e19b2ef9830d555ce3 Mon Sep 17 00:00:00 2001 From: yuhawu <15545526+yuhawu@user.noreply.gitee.com> Date: Wed, 13 Aug 2025 10:03:12 +0800 Subject: [PATCH] newadmin --- src/api/index.js | 3 +- src/api/modules/district.js | 82 +---- src/layout/Sidebar.vue | 9 + src/router/index.js | 12 + src/views/Task/List.vue | 64 +++- src/views/redirectUrl/index.vue | 521 ++++++++++++++++++++++++-------- 6 files changed, 493 insertions(+), 198 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index a23a371..40e08eb 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -11,4 +11,5 @@ export { adminApi } from './modules/admin' export { invitationApi } from './modules/invitation' export { depotApi } from './modules/depot' export { userApi } from './modules/user' -export { userLoginApi } from './modules/userLogin' \ No newline at end of file +export { userLoginApi } from './modules/userLogin' +export { priceTemplateApi } from './modules/priceTemplate' \ No newline at end of file diff --git a/src/api/modules/district.js b/src/api/modules/district.js index 5abf902..b42fe47 100644 --- a/src/api/modules/district.js +++ b/src/api/modules/district.js @@ -1,73 +1,23 @@ -import request from '@/utils/axios' +import instance from '../../utils/axios.js' /** - * 获取所有省级数据 + * 地区管理相关接口 */ -export function getProvinces() { - return request({ - url: '/district/provinces', - method: 'get' - }) -} -/** - * 根据省份ID获取城市列表 - */ -export function getCitiesByProvinceId(provinceId) { - return request({ - url: `/district/cities/${provinceId}`, - method: 'get' - }) -} +// 获取省份列表 +export const getProvinces = () => { + return instance.get('/district/provinces'); +}; -/** - * 根据城市ID获取区县列表 - */ -export function getDistrictsByCityId(cityId) { - return request({ - url: `/district/districts/${cityId}`, - method: 'get' - }) -} +// 获取运费信息 +export const getFreInfo = (templateId) => { + return instance.get(`/district/freInfo/${templateId}`); +}; -/** - * 获取省级市级树形结构 - */ -export function getDistrictTree() { - return request({ - url: '/district/getDistrictTree', - method: 'get' - }) -} +// 为了向后兼容,也导出整个对象 +export const districtApi = { + getProvinces, + getFreInfo +}; -/** - * 新增物流模板 - */ -export function createTemplate(data) { - return request({ - url: '/logistics/logistics', - method: 'post', - data: data - }) -} - -/** - * 获取运费信息 - */ -export function getFreInfo(id) { - return request({ - url: '/logistics/logistics/' + id, - method: 'get' - }) -} - -/** - * 更新物流模板 - */ -export function UpdateTemplate(data) { - return request({ - url: '/logistics/logistics', - method: 'put', - data: data - }) -} +export default districtApi; \ No newline at end of file diff --git a/src/layout/Sidebar.vue b/src/layout/Sidebar.vue index 6471567..312709e 100644 --- a/src/layout/Sidebar.vue +++ b/src/layout/Sidebar.vue @@ -75,6 +75,10 @@ const menuData = shallowRef([ title: '店铺列表', path: '/shop/list', permission: 'shop:list:view' + }, + { + title: '价格模板', + path: '/shop/priceTemplate' } ] }, @@ -87,6 +91,11 @@ const menuData = shallowRef([ title: '选品中心', path: '/book/selection/center', permission: 'book:selection:view' + }, + { + title: '自营书品', + path: '/book/shopGoods', + // permission: 'book:shopGoods:view' } ] }, diff --git a/src/router/index.js b/src/router/index.js index 6717821..ec83542 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -113,6 +113,18 @@ const routes = [{ // meta: { title: '物流模板', permission: 'logistics:view' } meta: { title: '物流模板' } + }, + { + path: '/shop/priceTemplate', + component: () => import('@/views/PriceTemplate/index.vue'), + // meta: { title: '价格模板', permission: 'priceTemplate:list:view' } + meta: { title: '价格模板' } + }, + { + path: '/book/shopGoods', + component: () => import('@/views/shopGoods/index.vue'), + // meta: { title: '自营书品', permission: 'book:shopGoods:view' } + meta: { title: '自营书品'} } ] diff --git a/src/views/Task/List.vue b/src/views/Task/List.vue index a252c84..42fe939 100644 --- a/src/views/Task/List.vue +++ b/src/views/Task/List.vue @@ -15,7 +15,7 @@ - 搜索 + 搜索 重置 @@ -119,12 +119,30 @@ - - - - {{ item.label }} - - + + + + + 孔夫子店铺: + + + {{ item.label }} + + + + + + + 拼多多店铺: + + + {{ item.label }} + + + + @@ -420,11 +438,31 @@ const getShopListData = async () => { const data = response.data; if (data && Array.isArray(data) && data.length > 0) { - // 将店铺数据转换为复选框需要的格式 - shopList.value = data.map(shop => ({ - value: shop.id, - label: shop.shopName || shop.name - })); + // 根据 shop_type 分类店铺数据 + const kfzShops = []; // 孔夫子店铺 (shop_type = 2) + const pddShops = []; // 拼多多店铺 (shop_type = 1) + + data.forEach(shop => { + const shopItem = { + value: shop.id, + label: shop.shopName || shop.name, + shopType: shop.shopType + }; + + // 注意:API返回的shopType是字符串类型 + if (shop.shopType === '2') { + kfzShops.push(shopItem); + } else if (shop.shopType === '1') { + pddShops.push(shopItem); + } + }); + + // 设置分类后的店铺数据 + shopList.value = { + kfzShops, + pddShops + }; + console.log('设置后的 shopList:', shopList.value); } } catch (error) { @@ -568,7 +606,7 @@ const handleAdd = async () => { } // 加载店铺数据 - if (shopList.value.length === 0) { + if (!shopList.value.kfzShops && !shopList.value.pddShops) { await getShopListData(); } diff --git a/src/views/redirectUrl/index.vue b/src/views/redirectUrl/index.vue index 955d926..0121cbe 100644 --- a/src/views/redirectUrl/index.vue +++ b/src/views/redirectUrl/index.vue @@ -1,100 +1,107 @@ - - - - - 与书同行 - + + + + + 未注册用户请在下方注册 + + + + 与书同行 + - - - - - - + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + + + + - - + - - - - 注册 - - - + + + + 注册 + + + + + + + + + + 已注册用户请到浏览器打开后台管理系统 + + + + 后台管理系统地址: + + https://erp.buzhiyushu.cn/ + + 复制链接 + + + + + + 操作流程图 + + + 点击查看大图 + + + + + + + + + + + 操作流程图 + × + + + + @@ -408,6 +415,39 @@ const showSuccessDialog = () => { }) } +// 复制登录链接 +const copyLoginUrl = async () => { + const loginUrl = 'https://erp.buzhiyushu.cn/' + try { + await navigator.clipboard.writeText(loginUrl) + ElMessage.success('链接已复制到剪贴板!') + } catch (err) { + // 如果复制失败,使用备用方法 + try { + const textArea = document.createElement('textarea') + textArea.value = loginUrl + document.body.appendChild(textArea) + textArea.select() + document.execCommand('copy') + document.body.removeChild(textArea) + ElMessage.success('链接已复制到剪贴板!') + } catch (fallbackErr) { + ElMessage.error('复制失败,请手动复制链接') + } + } +} + +// 显示流程图大图 +const showImageViewer = ref(false) + +const showFlowChart = () => { + showImageViewer.value = true +} + +const closeImageViewer = () => { + showImageViewer.value = false +} + // 页面加载时获取URL参数和验证码 onMounted(() => { getUrlParams() @@ -425,11 +465,33 @@ onMounted(() => { padding: 20px; } -.register-container { +.page-container { + display: flex; width: 100%; + max-width: 1200px; + gap: 40px; + align-items: flex-start; +} + +/* 左侧注册区域 */ +.left-section { + flex: 0 0 400px; max-width: 400px; } +.section-title { + text-align: center; + margin-bottom: 30px; +} + +.section-title h1 { + color: white; + font-size: 24px; + font-weight: 500; + margin: 0; + text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); +} + .register-form { background: white; border-radius: 12px; @@ -439,7 +501,7 @@ onMounted(() => { .form-header { display: flex; - justify-content: space-between; + justify-content: center; align-items: center; margin-bottom: 30px; } @@ -451,23 +513,107 @@ onMounted(() => { font-weight: 500; } -.language-switch { - width: 32px; - height: 32px; - background: #f0f0f0; - border-radius: 6px; +/* 右侧已注册用户区域 */ +.right-section { + flex: 1; + max-width: 600px; +} + +.login-info { + background: white; + border-radius: 12px; + padding: 40px 30px; + box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); +} + +.login-url { + margin-bottom: 30px; +} + +.url-label { + font-size: 16px; + color: #333; + margin-bottom: 15px; + font-weight: 500; +} + +.url-box { display: flex; align-items: center; - justify-content: center; - cursor: pointer; + gap: 10px; + padding: 15px; + background: #f8f9fa; + border-radius: 8px; + border: 1px solid #e9ecef; } -.language-switch span { +.url-text { + flex: 1; + color: #495057; font-size: 14px; - color: #666; - font-weight: bold; + word-break: break-all; } +.copy-btn { + flex-shrink: 0; +} + +.flow-chart { + text-align: center; +} + +.flow-chart h3 { + font-size: 18px; + color: #333; + margin-bottom: 20px; + font-weight: 500; +} + +.chart-container { + position: relative; + border-radius: 8px; + overflow: hidden; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + cursor: pointer; + transition: all 0.3s ease; +} + +.chart-container:hover { + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); + transform: translateY(-2px); +} + +.flow-image { + width: 100%; + height: auto; + display: block; + max-width: 100%; + transition: transform 0.3s ease; +} + +.chart-container:hover .flow-image { + transform: scale(1.02); +} + +.click-tip { + position: absolute; + bottom: 0; + left: 0; + right: 0; + background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent); + color: white; + text-align: center; + padding: 15px 10px 10px; + font-size: 14px; + opacity: 0; + transition: opacity 0.3s ease; +} + +.chart-container:hover .click-tip { + opacity: 1; +} + +/* 表单样式 */ .el-form-item { margin-bottom: 20px; } @@ -490,8 +636,6 @@ onMounted(() => { box-shadow: 0 0 0 1px #409eff; } - - .captcha-row { display: flex; gap: 10px; @@ -531,30 +675,171 @@ onMounted(() => { background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%); } -.login-link { - text-align: center; - margin-top: 20px; -} - -.login-link span { - color: #666; - font-size: 14px; - cursor: pointer; -} - -.login-link span:hover { - color: #409eff; -} - /* 移动端适配 */ -@media (max-width: 480px) { - .register-form { +@media (max-width: 768px) { + .page-container { + flex-direction: column; + gap: 30px; + } + + .left-section, + .right-section { + max-width: 100%; + } + + .register-form, + .login-info { padding: 30px 20px; - margin: 10px; + } + + .section-title h1 { + font-size: 20px; } .form-header h2 { font-size: 20px; } + + .url-box { + flex-direction: column; + align-items: stretch; + gap: 10px; + } + + .copy-btn { + align-self: center; + } +} + +@media (max-width: 480px) { + .register-page { + padding: 10px; + } + + .page-container { + gap: 20px; + } + + .section-title h1 { + font-size: 18px; + } + + .register-form, + .login-info { + padding: 25px 15px; + } +} + +/* 全屏图片查看器样式 */ +.image-viewer-overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.9); + z-index: 9999; + display: flex; + justify-content: center; + align-items: center; + padding: 20px; +} + +.image-viewer-container { + background: white; + border-radius: 12px; + max-width: 95vw; + max-height: 95vh; + display: flex; + flex-direction: column; + box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); +} + +.image-viewer-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 20px 30px; + border-bottom: 1px solid #eee; + flex-shrink: 0; +} + +.image-viewer-header h3 { + margin: 0; + font-size: 20px; + color: #333; + font-weight: 500; +} + +.close-btn { + background: none; + border: none; + font-size: 28px; + color: #999; + cursor: pointer; + padding: 0; + width: 32px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; + transition: all 0.3s ease; +} + +.close-btn:hover { + background: #f5f5f5; + color: #333; +} + +.image-viewer-content { + padding: 20px; + overflow: auto; + flex: 1; + display: flex; + justify-content: center; + align-items: center; +} + +.full-image { + max-width: none; + max-height: none; + width: auto; + height: auto; + border-radius: 8px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + /* 确保图片以原始尺寸显示,但不超过容器 */ + max-width: calc(95vw - 40px); + max-height: calc(95vh - 120px); +} + +/* 移动端图片查看器适配 */ +@media (max-width: 768px) { + .image-viewer-overlay { + padding: 10px; + } + + .image-viewer-container { + max-width: 100vw; + max-height: 100vh; + border-radius: 8px; + } + + .image-viewer-header { + padding: 15px 20px; + } + + .image-viewer-header h3 { + font-size: 18px; + } + + .image-viewer-content { + padding: 15px; + } + + .full-image { + max-width: calc(100vw - 30px); + max-height: calc(100vh - 100px); + } } \ No newline at end of file
后台管理系统地址: