From 283d69b46512f9e2cd693cf56e331142e8049660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Wed, 23 Jul 2025 18:52:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=B7=B2=E7=9F=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 6 +- .env.production | 10 +- src/api/shop/shopUserAddress/index.ts | 106 ++++++++++++++++++ src/api/shop/shopUserAddress/model/index.ts | 49 ++++++++ src/config/setting.ts | 4 +- .../cmsNavigation/components/design-edit.vue | 2 +- .../cms/cmsNavigation/components/extra.vue | 10 +- .../components/navigation-edit.vue | 103 ++++++++--------- .../cms/cmsNavigation/components/search.vue | 99 +++++++++++----- src/views/cms/cmsNavigation/index.vue | 82 +++++++++----- .../shopGoods/components/shopGoodsEdit.vue | 6 +- src/views/shop/shopGoods/index.vue | 22 +++- 12 files changed, 369 insertions(+), 130 deletions(-) create mode 100644 src/api/shop/shopUserAddress/index.ts create mode 100644 src/api/shop/shopUserAddress/model/index.ts diff --git a/.env.development b/.env.development index 1704208..845a178 100644 --- a/.env.development +++ b/.env.development @@ -1,7 +1,7 @@ VITE_APP_NAME=后台管理系统 -VITE_SOCKET_URL=wss://server.gxwebsoft.com -VITE_SERVER_URL=https://server.gxwebsoft.com/api - VITE_API_URL=https://cms-api.websoft.top/api +VITE_SOCKET_URL=wss://server.websoft.top +VITE_SERVER_URL=https://server.websoft.top/api +VITE_API_URL=https://cms.websoft.top/api #VITE_SOCKET_URL=ws://127.0.0.1:9191 diff --git a/.env.production b/.env.production index 58c9db9..dd3fb6e 100644 --- a/.env.production +++ b/.env.production @@ -1,8 +1,4 @@ VITE_APP_NAME=后台管理系统 -#VITE_SOCKET_URL=wss://server.gxwebsoft.com -#VITE_SERVER_URL=https://server.gxwebsoft.com/api -#VITE_API_URL=https://cms-api.websoft.top/api - -VITE_SOCKET_URL=wss://server.gxwebsoft.com -VITE_SERVER_URL=https://server.gxwebsoft.com/api -VITE_API_URL=https://cms-api.websoft.top/api +VITE_SOCKET_URL=wss://server.websoft.top +VITE_SERVER_URL=https://server.websoft.top/api +VITE_API_URL=https://cms.websoft.top/api diff --git a/src/api/shop/shopUserAddress/index.ts b/src/api/shop/shopUserAddress/index.ts new file mode 100644 index 0000000..2a0d186 --- /dev/null +++ b/src/api/shop/shopUserAddress/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopUserAddress, ShopUserAddressParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询收货地址 + */ +export async function pageShopUserAddress(params: ShopUserAddressParam) { + const res = await request.get>>( + MODULES_API_URL + '/shop/shop-user-address/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询收货地址列表 + */ +export async function listShopUserAddress(params?: ShopUserAddressParam) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-user-address', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加收货地址 + */ +export async function addShopUserAddress(data: ShopUserAddress) { + const res = await request.post>( + MODULES_API_URL + '/shop/shop-user-address', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改收货地址 + */ +export async function updateShopUserAddress(data: ShopUserAddress) { + const res = await request.put>( + MODULES_API_URL + '/shop/shop-user-address', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除收货地址 + */ +export async function removeShopUserAddress(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-user-address/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除收货地址 + */ +export async function removeBatchShopUserAddress(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-user-address/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询收货地址 + */ +export async function getShopUserAddress(id: number) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-user-address/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopUserAddress/model/index.ts b/src/api/shop/shopUserAddress/model/index.ts new file mode 100644 index 0000000..4f45d0f --- /dev/null +++ b/src/api/shop/shopUserAddress/model/index.ts @@ -0,0 +1,49 @@ +import type { PageParam } from '@/api'; + +/** + * 收货地址 + */ +export interface ShopUserAddress { + // 主键ID + id?: number; + // 姓名 + name?: string; + // 手机号码 + phone?: string; + // 所在国家 + country?: string; + // 所在省份 + province?: string; + // 所在城市 + city?: string; + // 所在辖区 + region?: string; + // 收货地址 + address?: string; + // 收货地址 + fullAddress?: string; + // + lat?: string; + // + lng?: string; + // 1先生 2女士 + gender?: number; + // 家、公司、学校 + type?: string; + // 默认收货地址 + isDefault?: string; + // 用户ID + userId?: number; + // 租户id + tenantId?: number; + // 注册时间 + createTime?: string; +} + +/** + * 收货地址搜索条件 + */ +export interface ShopUserAddressParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/config/setting.ts b/src/config/setting.ts index b8c4c9f..32880fe 100644 --- a/src/config/setting.ts +++ b/src/config/setting.ts @@ -7,7 +7,7 @@ export const APP_SECRET = 'ffd6eee985af45e4a75098422d1decbb'; export const domain = 'https://websoft.top'; // 基础模块 -export const COMMON_API_URL = 'https://server.gxwebsoft.com/api'; +export const COMMON_API_URL = 'https://server.websoft.top/api'; // 主节点 export const SERVER_API_URL = import.meta.env.VITE_SERVER_URL; // 模块节点 @@ -15,8 +15,6 @@ export const MODULES_API_URL = import.meta.env.VITE_API_URL; export const THINK_API_URL = import.meta.env.VITE_THINK_URL; // 文件服务器地址 export const FILE_SERVER = 'https://file.wsdns.cn'; -// 图片前缀 -export const IMG_URL = 'https://gxtyzx.gxsportscenter.com/uploads/images/'; /** * 以下配置一般不需要修改 diff --git a/src/views/cms/cmsNavigation/components/design-edit.vue b/src/views/cms/cmsNavigation/components/design-edit.vue index e530e21..9d86ce0 100644 --- a/src/views/cms/cmsNavigation/components/design-edit.vue +++ b/src/views/cms/cmsNavigation/components/design-edit.vue @@ -6,7 +6,7 @@ :maskClosable="false" :maxable="true" title="页面内容" - placement="left" + placement="right" :confirm-loading="loading" :body-style="{ paddingBottom: '28px' }" @update:visible="updateVisible" diff --git a/src/views/cms/cmsNavigation/components/extra.vue b/src/views/cms/cmsNavigation/components/extra.vue index a0e40dd..939e784 100644 --- a/src/views/cms/cmsNavigation/components/extra.vue +++ b/src/views/cms/cmsNavigation/components/extra.vue @@ -1,11 +1,11 @@ diff --git a/src/views/cms/cmsNavigation/components/navigation-edit.vue b/src/views/cms/cmsNavigation/components/navigation-edit.vue index f94b478..2186258 100644 --- a/src/views/cms/cmsNavigation/components/navigation-edit.vue +++ b/src/views/cms/cmsNavigation/components/navigation-edit.vue @@ -41,6 +41,17 @@ @pressEnter="save" /> + + + + {{ item.label }} + + + - - - - - - - - - - - - - {{ item.label }} - - - + + + + + + + + + - - - - - - - - + + + + + + + + 顶部 @@ -178,7 +178,8 @@ v-model:value="password" /> - + >({ trigger: 'blur' } ], - // model: [ - // { - // required: true, - // message: '请选择模型', - // type: 'string', - // trigger: 'blur' - // } - // ], + model: [ + { + required: true, + message: '请选择模型', + type: 'string', + trigger: 'blur' + } + ], // component: [ // { // required: true, @@ -399,10 +400,10 @@ const chooseModel = (item: CmsModel) => { form.component = `${item.component}`; form.itemId = undefined; - if(item.model == 'links'){ + if (item.model == 'links') { pathPlaceholder.value = 'https://'; } - if(item.model == 'product'){ + if (item.model == 'product') { pathPlaceholder.value = '/iphone-15-pro'; } }; @@ -447,15 +448,15 @@ const save = () => { if (password.value) { form.password = password.value; } - if(form.model == 'detail' && form.itemId == 0){ + if (form.model == 'detail' && form.itemId == 0) { message.error('请输入文章ID'); return false; } - if(form.model == 'item' && form.itemId == 0){ + if (form.model == 'item' && form.itemId == 0) { message.error('请输入产品ID'); return false; } - if(form.path == '/'){ + if (form.path == '/') { form.model = 'index'; form.sortNumber = 0; } @@ -501,13 +502,13 @@ const getModels = () => { } // 简体中文栏目 -if(lang.value != 'zh_CN'){ +if (lang.value != 'zh_CN') { listCmsNavigation({ lang: 'zh_CN' }).then(list => { zhCmsNavigationList.value = toTreeData({ data: list.map((d) => { - return { ...d, key: d.navigationId, value: d.navigationId }; + return {...d, key: d.navigationId, value: d.navigationId}; }), idField: 'navigationId', parentIdField: 'parentId' @@ -527,11 +528,11 @@ watch( if (props.parentId) { form.parentId = props.parentId; } - if(props.model){ + if (props.model) { form.model = props.model; form.path = `/${props.model}`; form.component = `/pages/${props.model}/index.vue`; - if(props.model == 'page'){ + if (props.model == 'page') { form.component = `/pages/[${props.model}]/index.vue`; } } @@ -547,10 +548,10 @@ watch( status: 'done' }); } - if(form.lang == ''){ + if (form.lang == '') { form.lang = locale.value; } - if(props.data.parentPosition){ + if (props.data.parentPosition) { form.position = props.data.parentPosition; } // if (props.data.type == 2) { diff --git a/src/views/cms/cmsNavigation/components/search.vue b/src/views/cms/cmsNavigation/components/search.vue index 82fea9d..173a7f6 100644 --- a/src/views/cms/cmsNavigation/components/search.vue +++ b/src/views/cms/cmsNavigation/components/search.vue @@ -1,42 +1,87 @@ diff --git a/src/views/cms/cmsNavigation/index.vue b/src/views/cms/cmsNavigation/index.vue index 985dc5f..ade9c88 100644 --- a/src/views/cms/cmsNavigation/index.vue +++ b/src/views/cms/cmsNavigation/index.vue @@ -41,6 +41,17 @@ 不限 + + 不限 + +