Browse Source

修复:已知问题

dev
科技小王子 1 month ago
parent
commit
283d69b465
  1. 6
      .env.development
  2. 10
      .env.production
  3. 106
      src/api/shop/shopUserAddress/index.ts
  4. 49
      src/api/shop/shopUserAddress/model/index.ts
  5. 4
      src/config/setting.ts
  6. 2
      src/views/cms/cmsNavigation/components/design-edit.vue
  7. 10
      src/views/cms/cmsNavigation/components/extra.vue
  8. 41
      src/views/cms/cmsNavigation/components/navigation-edit.vue
  9. 53
      src/views/cms/cmsNavigation/components/search.vue
  10. 82
      src/views/cms/cmsNavigation/index.vue
  11. 6
      src/views/shop/shopGoods/components/shopGoodsEdit.vue
  12. 22
      src/views/shop/shopGoods/index.vue

6
.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

10
.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

106
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<ApiResult<PageResult<ShopUserAddress>>>(
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<ApiResult<ShopUserAddress[]>>(
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<ApiResult<unknown>>(
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<ApiResult<unknown>>(
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<ApiResult<unknown>>(
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<ApiResult<unknown>>(
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<ApiResult<ShopUserAddress>>(
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));
}

49
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;
}

4
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/';
/**
*

2
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"

10
src/views/cms/cmsNavigation/components/extra.vue

@ -1,11 +1,11 @@
<!-- 搜索表单 -->
<template>
<a-space style="flex-wrap: wrap" v-if="hasRole('superAdmin') || hasRole('admin') || hasRole('foundation')">
<a-button
type="text"
@click="openUrl('/mp-pages')"
>小程序端
</a-button>
<!-- <a-button-->
<!-- type="text"-->
<!-- @click="openUrl('/mp-pages')"-->
<!-- >小程序端-->
<!-- </a-button>-->
</a-space>
</template>

41
src/views/cms/cmsNavigation/components/navigation-edit.vue

@ -41,6 +41,17 @@
@pressEnter="save"
/>
</a-form-item>
<a-form-item label="模型" name="model">
<a-select v-model:value="form.model">
<a-select-option
v-for="item in models"
:key="item.value"
:value="item.value"
>
{{ item.label }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
:label="`详情页ID`"
name="itemId"
@ -63,17 +74,6 @@
<!-- @pressEnter="save"-->
<!-- />-->
<!-- </a-form-item>-->
<a-form-item label="模型" name="model">
<a-select v-model:value="form.model">
<a-select-option
v-for="item in models"
:key="item.value"
:value="item.value"
>
{{ item.label }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
:label="form.model == 'links' ? '链接地址' : '路由地址'"
name="path"
@ -178,7 +178,8 @@
v-model:value="password"
/>
</a-form-item>
<a-form-item label="关联栏目" name="style" v-if="lang && lang != 'zh_CN'" extra="选择对应中文栏目,用于同步保存翻译内容">
<a-form-item label="关联栏目" name="style" v-if="lang && lang != 'zh_CN'"
extra="选择对应中文栏目,用于同步保存翻译内容">
<a-tree-select
allow-clear
:tree-data="zhCmsNavigationList"
@ -315,14 +316,14 @@ const rules = reactive<Record<string, Rule[]>>({
trigger: 'blur'
}
],
// model: [
// {
// required: true,
// message: '',
// type: 'string',
// trigger: 'blur'
// }
// ],
model: [
{
required: true,
message: '请选择模型',
type: 'string',
trigger: 'blur'
}
],
// component: [
// {
// required: true,

53
src/views/cms/cmsNavigation/components/search.vue

@ -1,11 +1,54 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<a-button type="primary" class="ele-btn-icon" :disabled="!websiteId" @click="openEdit()">
<template #icon>
<PlusOutlined />
<plus-outlined/>
</template>
<span>添加</span>
<span>新建</span>
</a-button>
<a-button type="dashed" class="ele-btn-icon" @click="expandAll">
展开
</a-button>
<a-button type="dashed" class="ele-btn-icon" @click="foldAll">
折叠
</a-button>
<a-divider type="vertical"/>
<a-radio-group v-model:value="position" @change="reload">
<a-radio-button :value="1">顶部</a-radio-button>
<a-radio-button :value="2">底部</a-radio-button>
<a-radio-button :value="0">不限</a-radio-button>
</a-radio-group>
<a-divider type="vertical"/>
<a-select
v-model:value="where.model"
style="width: 150px"
placeholder="选择模型"
@change="reload"
>
<a-select-option value="">全部</a-select-option>
<a-select-option :value="1">文章</a-select-option>
<a-select-option :value="2">单页</a-select-option>
<a-select-option :value="3">链接</a-select-option>
<a-select-option :value="4">帮助</a-select-option>
<a-select-option :value="5">关于</a-select-option>
</a-select>
<!-- 搜索表单 -->
<a-input-search
allow-clear
v-model:value="searchText"
placeholder="请输入搜索关键词"
@search="reload"
@pressEnter="reload"
/>
<a-button
type="text"
@click="openUrl('/website/model')"
>模型管理
</a-button
>
<a-button type="text" class="ele-btn-icon" @click="clearSiteInfoCache">
清除缓存
</a-button>
</a-space>
</template>
@ -14,6 +57,7 @@
import {PlusOutlined} from '@ant-design/icons-vue';
import type {GradeParam} from '@/api/user/grade/model';
import {watch} from 'vue';
import {openUrl} from "@/utils/common";
const props = withDefaults(
defineProps<{
@ -37,6 +81,7 @@
watch(
() => props.selection,
() => {}
() => {
}
);
</script>

82
src/views/cms/cmsNavigation/index.vue

@ -41,6 +41,17 @@
<a-radio-button :value="0">不限</a-radio-button>
</a-radio-group>
<a-divider type="vertical"/>
<a-select
v-model:value="modelName"
style="width: 150px"
placeholder="选择模型"
@change="reload"
>
<a-select-option :value="undefined">不限</a-select-option>
<template v-for="(item,index) in modelList" :key="index">
<a-select-option :value="item.model" :index="index">{{ item.name }}</a-select-option>
</template>
</a-select>
<!-- 搜索表单 -->
<a-input-search
allow-clear
@ -61,6 +72,20 @@
</a-space>
</template>
<template #bodyCell="{ column, record, index }">
<template v-if="column.key === 'title'">
<a-space>
<a-avatar v-if="record.icon" :size="22" :src="record.icon"/>
<a @click="openUrl(`/website/article?id=${record.navigationId}`)">{{ record.title }}</a>
</a-space>
<template v-if="record.model == 'page'">
<a-divider type="vertical"/>
<a-tooltip v-if="record.model == 'page'" :title="`编辑页面内容及SEO信息`">
<a @click="openDesign(record)">
<FileWordOutlined/>
</a>
</a-tooltip>
</template>
</template>
<template v-if="column.key === 'path'">
<div @mouseover="saveNavigationIcon(record.navigationId)" @mouseleave="removeNavigationIcon">
<span class="text-gray-400">{{ record.path }}</span>
@ -91,17 +116,6 @@
<span v-else-if="isDirectory(record)"></span>
<a-tag v-else>{{ record.modelName }}</a-tag>
</template>
<template v-else-if="column.key === 'title'">
<a-space>
<a-avatar v-if="record.icon" :size="22" :src="record.icon"/>
<!-- <span class="cursor-pointer" v-if="isDirectory(record)">{{-->
<!-- record.title-->
<!-- }}</span>-->
<a class="cursor-pointer text-black" :href="navTo(record,'',true)" target="_blank">{{
record.title
}}</a>
</a-space>
</template>
<template v-if="column.key === 'banner'">
<a-image v-if="record.banner" :src="record.banner" :width="100"/>
</template>
@ -128,13 +142,13 @@
</template>
<template v-else-if="column.key === 'action'">
<template v-if="record.path != '/'">
<!-- <a-tooltip v-if="record.model == 'page'" :title="`配置SEO及页面内容`">-->
<!-- <a @click="openDesign(record)">单页</a>-->
<!-- <a-divider type="vertical"/>-->
<!-- </a-tooltip>-->
<a-tooltip :title="`添加子分类`">
<a @click="openEdit(null, record.navigationId,record.model)">添加</a>
</a-tooltip>
<a-tooltip v-if="record.model == 'page'" :title="`配置SEO及页面内容`">
<a-divider type="vertical"/>
<a @click="openDesign(record)">单页</a>
</a-tooltip>
<!-- <a-divider type="vertical" />-->
<!-- <a-tooltip :title="`自定义组件`">-->
<!-- <a @click="openDesign(record)">组件</a>-->
@ -204,7 +218,7 @@
<script lang="ts" setup>
import {ref} from 'vue';
import {message} from 'ant-design-vue/es';
import {PlusOutlined, CopyOutlined} from '@ant-design/icons-vue';
import {PlusOutlined, CopyOutlined, FileWordOutlined} from '@ant-design/icons-vue';
import type {
DatasourceFunction,
ColumnItem,
@ -235,13 +249,17 @@ import {CmsDesign} from '@/api/cms/cmsDesign/model';
import {getSiteDomain} from '@/utils/domain';
import {removeSiteInfoCache} from '@/api/cms/cmsWebsite';
import Extra from "./components/extra.vue";
import {listCmsModel} from "@/api/cms/cmsModel";
import {CmsModel} from "@/api/cms/cmsModel/model";
//
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
//
const domain = ref(getSiteDomain());
const modelList = ref<CmsModel[]>([])
const websiteId = localStorage.getItem('WebsiteId')
const currentId = ref<number>();
const modelName = ref<string>();
//
const {locale} = useI18n();
@ -269,7 +287,13 @@ const columns = ref<ColumnItem[]>([
ellipsis: true
},
{
title: '访问路径',
title: '模型',
dataIndex: 'model',
key: 'model',
align: 'center'
},
{
title: '路径',
dataIndex: 'path',
key: 'path'
},
@ -287,19 +311,12 @@ const columns = ref<ColumnItem[]>([
width: 120,
hideInTable: true
},
// {
// title: '',
// dataIndex: 'model',
// key: 'model',
// align: 'center',
// width: 150
// },
{
title: '位置',
dataIndex: 'position',
key: 'position',
align: 'center',
width: 150
width: 120
},
{
title: '状态',
@ -329,6 +346,7 @@ const columns = ref<ColumnItem[]>([
{
title: '操作',
key: 'action',
align: 'center',
width: 220,
fixed: 'right'
}
@ -388,6 +406,7 @@ const datasource: DatasourceFunction = ({where}) => {
if (locale.value) {
where.lang = locale.value || undefined;
}
where.model = modelName.value;
return listCmsNavigation({...where});
};
@ -409,6 +428,7 @@ const onDone: EleProTableDone<CmsNavigation> = ({data}) => {
/* 刷新表格 */
const reload = (where?: CmsNavigationParam) => {
console.log(where, 'w')
tableRef?.value?.reload({where});
};
@ -465,11 +485,9 @@ const openDesign = (row?: CmsNavigation) => {
// }
};
const openLayout = (row?: CmsNavigation) => {
current.value = row ?? null;
categoryId.value = row?.navigationId;
showDesignRecordEdit.value = true;
};
const onModel = () => {
reload()
}
const saveNavigationIcon = (index: number) => {
currentId.value = index;
@ -534,6 +552,10 @@ const isDirectory = (d: CmsNavigation) => {
return !!d.children?.length;
};
listCmsModel().then((data) => {
modelList.value = data;
});
/* 自定义行属性 */
const customRow = (record: CmsNavigation) => {
return {

6
src/views/shop/shopGoods/components/shopGoodsEdit.vue

@ -50,6 +50,7 @@
<a-textarea
:rows="1"
:maxlength="100"
style="width: 558px"
show-count
placeholder="此款商品美观大方 性价比较高 不容错过"
v-model:value="form.comments"
@ -90,7 +91,10 @@
/>
</a-form-item>
<a-form-item label="运费模板" v-if="!merchantId">
<a-select v-model:value="form.expressTemplateId">
<a-select
v-model:value="form.expressTemplateId"
style="width: 240px"
>
<a-select-option
v-for="(item, index) in expressTemplateList"
:key="index"

22
src/views/shop/shopGoods/index.vue

@ -30,6 +30,14 @@
<span class="text-gray-700 font-bold">{{ record.name }}</span>
</a-space>
</template>
<template v-if="column.key === 'recommend'">
<a-space @click="onRecommend(record)">
<span v-if="record.recommend === 1" class="ele-text-success"
><CheckOutlined
/></span>
<span v-else class="ele-text-placeholder"><CloseOutlined/></span>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">出售中</a-tag>
<a-tag v-if="record.status === 1" color="orange">待上架</a-tag>
@ -60,7 +68,7 @@
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import {ExclamationCircleOutlined, CheckOutlined, CloseOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import {toTreeData} from 'ele-admin-pro';
import {toDateString} from 'ele-admin-pro';
@ -74,7 +82,7 @@ import Extra from '@/views/shop/shopGoods/components/extra.vue';
import {
pageShopGoods,
removeShopGoods,
removeBatchShopGoods
removeBatchShopGoods, updateShopGoods
} from '@/api/shop/shopGoods';
import type {ShopGoods, ShopGoodsParam} from '@/api/shop/shopGoods/model';
import {getPageTitle} from '@/utils/common';
@ -276,6 +284,16 @@ const query = () => {
}
};
const onRecommend = (row: ShopGoods) => {
updateShopGoods({
...row,
recommend: row.recommend == 1 ? 0 : 1
}).then((msg) => {
message.success(msg);
reload();
});
};
/* 自定义行属性 */
const customRow = (record: ShopGoods) => {
return {

Loading…
Cancel
Save