38 changed files with 689 additions and 416 deletions
@ -0,0 +1,106 @@ |
|||
import request from '@/utils/request'; |
|||
import type { ApiResult, PageResult } from '@/api'; |
|||
import type { OrderGoods, OrderGoodsParam } from './model'; |
|||
import {SERVER_API_URL} from '@/config/setting'; |
|||
|
|||
/** |
|||
* 分页查询订单商品 |
|||
*/ |
|||
export async function pageOrderGoods(params: OrderGoodsParam) { |
|||
const res = await request.get<ApiResult<PageResult<OrderGoods>>>( |
|||
SERVER_API_URL + '/system/order-goods/page', |
|||
{ |
|||
params |
|||
} |
|||
); |
|||
if (res.data.code === 0) { |
|||
return res.data.data; |
|||
} |
|||
return Promise.reject(new Error(res.data.message)); |
|||
} |
|||
|
|||
/** |
|||
* 查询订单商品列表 |
|||
*/ |
|||
export async function listOrderGoods(params?: OrderGoodsParam) { |
|||
const res = await request.get<ApiResult<OrderGoods[]>>( |
|||
SERVER_API_URL + '/system/order-goods', |
|||
{ |
|||
params |
|||
} |
|||
); |
|||
if (res.data.code === 0 && res.data.data) { |
|||
return res.data.data; |
|||
} |
|||
return Promise.reject(new Error(res.data.message)); |
|||
} |
|||
|
|||
/** |
|||
* 添加订单商品 |
|||
*/ |
|||
export async function addOrderGoods(data: OrderGoods) { |
|||
const res = await request.post<ApiResult<unknown>>( |
|||
SERVER_API_URL + '/system/order-goods', |
|||
data |
|||
); |
|||
if (res.data.code === 0) { |
|||
return res.data.message; |
|||
} |
|||
return Promise.reject(new Error(res.data.message)); |
|||
} |
|||
|
|||
/** |
|||
* 修改订单商品 |
|||
*/ |
|||
export async function updateOrderGoods(data: OrderGoods) { |
|||
const res = await request.put<ApiResult<unknown>>( |
|||
SERVER_API_URL + '/system/order-goods', |
|||
data |
|||
); |
|||
if (res.data.code === 0) { |
|||
return res.data.message; |
|||
} |
|||
return Promise.reject(new Error(res.data.message)); |
|||
} |
|||
|
|||
/** |
|||
* 删除订单商品 |
|||
*/ |
|||
export async function removeOrderGoods(id?: number) { |
|||
const res = await request.delete<ApiResult<unknown>>( |
|||
SERVER_API_URL + '/system/order-goods/' + id |
|||
); |
|||
if (res.data.code === 0) { |
|||
return res.data.message; |
|||
} |
|||
return Promise.reject(new Error(res.data.message)); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除订单商品 |
|||
*/ |
|||
export async function removeBatchOrderGoods(data: (number | undefined)[]) { |
|||
const res = await request.delete<ApiResult<unknown>>( |
|||
SERVER_API_URL + '/system/order-goods/batch', |
|||
{ |
|||
data |
|||
} |
|||
); |
|||
if (res.data.code === 0) { |
|||
return res.data.message; |
|||
} |
|||
return Promise.reject(new Error(res.data.message)); |
|||
} |
|||
|
|||
/** |
|||
* 根据id查询订单商品 |
|||
*/ |
|||
export async function getOrderGoods(id: number) { |
|||
const res = await request.get<ApiResult<OrderGoods>>( |
|||
SERVER_API_URL + '/system/order-goods/' + id |
|||
); |
|||
if (res.data.code === 0 && res.data.data) { |
|||
return res.data.data; |
|||
} |
|||
return Promise.reject(new Error(res.data.message)); |
|||
} |
@ -0,0 +1,55 @@ |
|||
import type { PageParam } from '@/api'; |
|||
|
|||
/** |
|||
* 订单商品 |
|||
*/ |
|||
export interface OrderGoods { |
|||
// 订单号
|
|||
id?: number; |
|||
// 订单类型,0商城 1应用插件
|
|||
type?: number; |
|||
// 订单ID
|
|||
orderId?: number; |
|||
// 项目ID
|
|||
itemId?: number; |
|||
// 实际付款
|
|||
payPrice?: string; |
|||
// 购买数量
|
|||
totalNum?: number; |
|||
// 0未付款,1已付款
|
|||
payStatus?: string; |
|||
// 0未完成,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款
|
|||
orderStatus?: number; |
|||
// 预约详情开始时间数组
|
|||
startTime?: string; |
|||
// 是否已开具发票:0未开发票,1已开发票,2不能开具发票
|
|||
isInvoice?: string; |
|||
// 发票流水号
|
|||
invoiceNo?: string; |
|||
// 支付时间
|
|||
payTime?: string; |
|||
// 过期时间
|
|||
expirationTime?: string; |
|||
// 用户id
|
|||
userId?: number; |
|||
// 备注
|
|||
comments?: string; |
|||
// 排序号
|
|||
sortNumber?: number; |
|||
// 是否删除, 0否, 1是
|
|||
deleted?: number; |
|||
// 租户id
|
|||
tenantId?: number; |
|||
// 修改时间
|
|||
updateTime?: string; |
|||
// 创建时间
|
|||
createTime?: string; |
|||
} |
|||
|
|||
/** |
|||
* 订单商品搜索条件 |
|||
*/ |
|||
export interface OrderGoodsParam extends PageParam { |
|||
id?: number; |
|||
keywords?: string; |
|||
} |
@ -0,0 +1,86 @@ |
|||
<template> |
|||
<div class="xl:w-screen-xl sm:flex xl:p-0 p-4 m-auto relative"> |
|||
<el-row :gutter="24" class="flex"> |
|||
<template v-for="(item,index) in data?.list" :key="index"> |
|||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" class="mb-5 min-w-xs"> |
|||
<el-card shadow="hover" :body-style="{ padding: '0px' }" class="hover:bg-gray-50 cursor-pointer" @click="openSpmUrl(`/item`, item,item.companyId,true)"> |
|||
<el-image |
|||
:src="item.image" |
|||
:fit="fit" :lazy="true" class="w-full md:h-[150px] h-[199px] cursor-pointer bg-gray-50"/> |
|||
<div class="flex-1 px-4 py-5 sm:p-6 !p-4"> |
|||
<div class="text-gray-700 dark:text-white text-base font-semibold flex flex-col gap-1.5"> |
|||
<div class="flex-1 text-xl cursor-pointer flex items-center"> |
|||
{{ item.shortName }} |
|||
<el-tag v-if="item.chargingMethod === 0" size="small" type="success" class="text-white ml-2" effect="dark">免费</el-tag> |
|||
</div> |
|||
</div> |
|||
<div class="flex items-center gap-1.5 py-2 text-gray-500 justify-between"> |
|||
<div class="text-gray-500 line-clamp-2">{{ item.comments }}</div> |
|||
</div> |
|||
<div class="button-group flex justify-between items-center mt-3"> |
|||
<el-space class="flex items-end"> |
|||
<el-avatar size="small" :src="item.companyLogo" /> |
|||
<span class="text-gray-400 line-clamp-1 pr-2">{{ item.companyName }}</span> |
|||
</el-space> |
|||
<!-- <el-button @click.stop="loginDeveloperCenterByToken(item)">控制台</el-button>--> |
|||
<!-- 已购买 --> |
|||
<!-- <template v-if="item.isBuy">--> |
|||
<!-- <el-button v-if="item.isBuy && item.installed" type="success" @click.stop="openSpmUrl(`https://${item.domain}`,item,item.companyId,true)">进入控制台</el-button>--> |
|||
<!-- <el-button v-if="item.isBuy && !item.installed" type="primary" @click.stop="openSpmUrl(`/product/create`,item,item.companyId,true)">立即开通</el-button>--> |
|||
<!-- </template>--> |
|||
<!-- 未够买 --> |
|||
<!-- <template v-if="!item.isBuy">--> |
|||
<!-- <div class="flex items-center cursor-pointer" v-if="!item.isBuy" @click.stop="openSpmUrl(`/product/create`,item,item.companyId,true)">--> |
|||
<!-- <div class="flex items-center text-red-600">--> |
|||
<!-- <span>¥{{ item.price }}</span>--> |
|||
<!-- <span v-if="item.chargingMethod == 2">/年</span>--> |
|||
<!-- <span v-if="item.chargingMethod == 3">/月</span>--> |
|||
<!-- <span v-if="item.chargingMethod == 4">/天</span>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<!-- </template>--> |
|||
</div> |
|||
</div> |
|||
</el-card> |
|||
</el-col> |
|||
</template> |
|||
</el-row> |
|||
</div> |
|||
<div class="flex justify-center py-3"> |
|||
<el-pagination background layout="prev, pager, next" :total="data?.count" @change="onPage" /> |
|||
</div> |
|||
<!-- <div v-if="disabled" class="px-1 text-center text-gray-500">--> |
|||
<!-- 没有更多了--> |
|||
<!-- </div>--> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import {openSpmUrl} from "~/utils/common"; |
|||
import type {Company} from "~/api/system/company/model"; |
|||
import type {PageResult} from "~/api"; |
|||
|
|||
const props = withDefaults( |
|||
defineProps<{ |
|||
data?: PageResult<Company>; |
|||
disabled?: boolean; |
|||
fit?: any; |
|||
}>(), |
|||
{ |
|||
fit: 'cover' |
|||
} |
|||
); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'done', index: number): void; |
|||
}>(); |
|||
|
|||
// const load = () => { |
|||
// if(!props.disabled){ |
|||
// emit('done') |
|||
// } |
|||
// } |
|||
|
|||
const onPage = (index: number) => { |
|||
emit('done',index) |
|||
} |
|||
</script> |
@ -0,0 +1,75 @@ |
|||
<template> |
|||
<PageBanner :layout="layout" :title="`${form?.categoryName}`" :desc="`${form?.comments}`" /> |
|||
<CardList :param="{type: 0,official: true}" :data="data" :disabled="disabled" @done="onSearch" /> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import type {ApiResult, PageResult} from "~/api"; |
|||
import {useServerRequest} from "~/composables/useServerRequest"; |
|||
import {useWebsite} from "~/composables/configState"; |
|||
import type {Navigation} from "~/api/cms/navigation/model"; |
|||
import type {Company, CompanyParam} from "~/api/system/company/model"; |
|||
import CardList from './components/CardList.vue'; |
|||
import {getIdBySpm} from "~/utils/common"; |
|||
|
|||
const route = useRoute(); |
|||
|
|||
// 页面信息 |
|||
const runtimeConfig = useRuntimeConfig(); |
|||
const data = ref<PageResult<Company>>(); |
|||
const page = ref<number>(0); |
|||
const resultText = ref(''); |
|||
const layout = ref<any>(); |
|||
const disabled = ref<boolean>(false); |
|||
|
|||
// 获取状态 |
|||
const form = ref<Navigation>(); |
|||
|
|||
// 搜索表单 |
|||
const where = reactive<CompanyParam>({ |
|||
keywords: '' |
|||
}); |
|||
|
|||
const onSearch = (index: number) => { |
|||
page.value = index; |
|||
reload(); |
|||
} |
|||
|
|||
// 请求数据 |
|||
const reload = async () => { |
|||
const {data: response} = await useServerRequest<ApiResult<PageResult<Company>>>('/system/company/page',{baseURL: runtimeConfig.public.apiServer, params: { |
|||
page: page.value, |
|||
limit: 12, |
|||
categoryId: getIdBySpm(5), |
|||
keywords: where.keywords |
|||
}}) |
|||
if(response.value?.data){ |
|||
data.value = response.value?.data; |
|||
} |
|||
} |
|||
|
|||
const { data: nav } = await useServerRequest<ApiResult<Navigation>>(`/cms/cms-navigation/${getIdBySpm(5)}`) |
|||
if(nav.value?.data){ |
|||
form.value = nav.value?.data; |
|||
useHead({ |
|||
title: `${form.value.title} - WEBSOFT`, |
|||
bodyAttrs: { |
|||
class: "page-container", |
|||
} |
|||
}); |
|||
} |
|||
// 页面布局 |
|||
if(form.value?.layout){ |
|||
layout.value = JSON.parse(form.value?.layout) |
|||
} |
|||
|
|||
|
|||
|
|||
watch( |
|||
() => getIdBySpm(5), |
|||
(id) => { |
|||
console.log(id,'id = .>>>>') |
|||
reload(); |
|||
}, |
|||
{ immediate: true } |
|||
); |
|||
</script> |
@ -1,105 +0,0 @@ |
|||
<template> |
|||
<!-- Banner --> |
|||
<Banner :layout="layout" /> |
|||
333 |
|||
<div class="container md:w-screen-xl m-auto"> |
|||
<div class="flex flex-col" v-if="app"> |
|||
<Breadcrumb :data="form" :title="`应用详情`" /> |
|||
<div class="page-main w-full bg-white rounded-lg"> |
|||
<div class="p-4 leading-7"> |
|||
<div class="goods-info flex"> |
|||
<el-avatar :src="app.appIcon" class="mr-2" size="large" /> |
|||
<div class="flex flex-col ml-2"> |
|||
<div class="text-lg">{{ app.appName }}</div> |
|||
<div class="text-gray-400 w-screen-lg">{{ app.comments }}</div> |
|||
<div>应用ID: <span class="text-blue-500">{{ app.appId }}</span></div> |
|||
<div>后台演示: <span class="text-blue-500">{{ app.adminUrl }}</span></div> |
|||
<div>前端演示: <span class="text-blue-500">{{ app.appUrl }}</span></div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 空白页 --> |
|||
<div class="mt-[60px]" v-if="!app"> |
|||
<el-empty description="404 页面不存在"></el-empty> |
|||
</div> |
|||
|
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { Search } from '@element-plus/icons-vue' |
|||
import type {ApiResult, PageResult} from "~/api"; |
|||
import {useServerRequest} from "~/composables/useServerRequest"; |
|||
import {useWebsite} from "~/composables/configState"; |
|||
import type {Navigation} from "~/api/cms/navigation/model"; |
|||
import {getIdByParam, getPath} from "~/utils/common"; |
|||
import type {Company, CompanyParam} from "~/api/system/company/model"; |
|||
import {navigateTo} from "#imports"; |
|||
import Breadcrumb from "~/components/Breadcrumb.vue"; |
|||
import type {App} from "~/api/oa/app/model"; |
|||
|
|||
const route = useRoute(); |
|||
|
|||
// 页面信息 |
|||
const runtimeConfig = useRuntimeConfig(); |
|||
const resultText = ref(''); |
|||
const layout = ref<any>(); |
|||
|
|||
// 获取状态 |
|||
const form = ref<Navigation>(); |
|||
const website = useWebsite(); |
|||
const app = ref<App>() |
|||
|
|||
// 搜索表单 |
|||
const where = reactive<CompanyParam>({ |
|||
keywords: '' |
|||
}); |
|||
|
|||
const navTo = (item: Company) => { |
|||
navigateTo(`/market/${item.companyId}`) |
|||
} |
|||
|
|||
// 请求数据 |
|||
const reload = async () => { |
|||
|
|||
const { data: nav } = await useServerRequest<ApiResult<Navigation>>('/cms/cms-navigation/getNavigationByPath',{query: {path: getPath()}}) |
|||
if(nav.value?.data){ |
|||
form.value = nav.value?.data; |
|||
} |
|||
// 页面布局 |
|||
if(form.value?.layout){ |
|||
layout.value = JSON.parse(form.value?.layout) |
|||
} |
|||
useHead({ |
|||
title: `搜索结果 - ${website.value.websiteName}`, |
|||
bodyAttrs: { |
|||
class: "page-container", |
|||
} |
|||
}); |
|||
await handleClick() |
|||
} |
|||
|
|||
// 搜索结果 |
|||
const handleClick = async () => { |
|||
const {data: response} = await useServerRequest<ApiResult<App>>(`/oa/oa-app/${getIdByParam()}`,{baseURL: runtimeConfig.public.apiServer}) |
|||
if(response.value?.data){ |
|||
if (response.value.data) { |
|||
app.value = response.value.data |
|||
} |
|||
if(!response.value){ |
|||
resultText.value = '暂无相关结果' |
|||
} |
|||
} |
|||
} |
|||
|
|||
watch( |
|||
() => route, |
|||
() => { |
|||
reload(); |
|||
}, |
|||
{ immediate: true } |
|||
); |
|||
|
|||
</script> |
@ -1,77 +0,0 @@ |
|||
<template> |
|||
<!-- Banner --> |
|||
<Banner :layout="layout" /> |
|||
|
|||
<!-- 简单模式 --> |
|||
<PageContainer :form="form" :layout="layout" /> |
|||
|
|||
<!-- 高级模式 --> |
|||
<div class="flex flex-col" v-if="layout?.showLayout"> |
|||
{{ layout }} |
|||
</div> |
|||
|
|||
</template> |
|||
<script setup lang="ts"> |
|||
import type {ApiResult} from "~/api"; |
|||
import {useServerRequest} from "~/composables/useServerRequest"; |
|||
import {useConfigInfo, useForm, useToken, useWebsite} from "~/composables/configState"; |
|||
import Breadcrumb from "~/components/Breadcrumb.vue"; |
|||
import type {BreadcrumbItem} from "~/types/global"; |
|||
import type {Navigation} from "~/api/cms/navigation/model"; |
|||
import {getIdBySpm} from "~/utils/common"; |
|||
import PageContainer from "~/components/PageContainer.vue"; |
|||
|
|||
// 引入状态管理 |
|||
const route = useRoute(); |
|||
const website = useWebsite(); |
|||
const config = useConfigInfo(); |
|||
const token = useToken(); |
|||
const form = useForm(); |
|||
const breadcrumb = ref<BreadcrumbItem>(); |
|||
const layout = ref<any>(); |
|||
|
|||
// 请求数据 |
|||
const reload = async () => { |
|||
|
|||
// 存在spm(优先级高) |
|||
const { data: nav } = await useServerRequest<ApiResult<Navigation>>('/cms/cms-navigation/' + getIdBySpm(5)) |
|||
if (nav.value?.data) { |
|||
form.value = nav.value.data |
|||
}else{ |
|||
const { data: nav } = await useServerRequest<ApiResult<Navigation>>('/cms/cms-navigation/getNavigationByPath',{query: {path: route.path}}) |
|||
if(nav.value?.data){ |
|||
form.value = nav.value?.data; |
|||
} |
|||
} |
|||
// 页面布局 |
|||
if(form.value?.layout){ |
|||
layout.value = JSON.parse(form.value?.layout) |
|||
} |
|||
|
|||
// seo |
|||
useHead({ |
|||
title: `${form.value.title} - ${website.value.websiteName}`, |
|||
meta: [{ name: form.value.design?.keywords, content: form.value.design?.description }], |
|||
bodyAttrs: { |
|||
class: "page-container", |
|||
}, |
|||
script: [ |
|||
{ |
|||
children: `console.log(${JSON.stringify(form.value)})`, |
|||
}, |
|||
], |
|||
}); |
|||
// 面包屑 |
|||
breadcrumb.value = form.value |
|||
} |
|||
|
|||
watch( |
|||
() => route.path, |
|||
(path) => { |
|||
console.log(path,'=>Path') |
|||
|
|||
reload(); |
|||
}, |
|||
{ immediate: true } |
|||
); |
|||
</script> |
Loading…
Reference in new issue