修复:用户资料及认证提交页面,需求定制页面

This commit is contained in:
2025-02-15 18:38:21 +08:00
parent ca3b5a296e
commit 9081e41188
29 changed files with 925 additions and 284 deletions

View File

@@ -3,6 +3,7 @@ import type { ApiResult } from '@/api';
import type { User } from '@/api/system/user/model';
import type { UpdatePasswordParam } from './model';
import type {CmsWebsite, CmsWebsiteParam} from "~/api/cms/cmsWebsite/model";
import {COMMON_API_URL} from "~/config";
/**
* 获取网站信息
@@ -27,7 +28,7 @@ export async function getUserInfo(): Promise<User> {
const config = useRuntimeConfig();
const res = await request.get<ApiResult<User>>(config.public.apiServer + '/auth/user',{
headers: {
TenantId: `${localStorage.getItem('TID_ADMIN')}`
TenantId: `${localStorage.getItem('ServerTenantId')}`
}
});
if (res.code === 0 && res.data) {
@@ -36,6 +37,18 @@ export async function getUserInfo(): Promise<User> {
return Promise.reject(new Error(res.message));
}
export async function updateUser(data: User){
const res = await request.put<ApiResult<unknown>>(
COMMON_API_URL + '/auth/user',
data
);
if (res.code === 0) {
return res.message ?? '修改成功';
}
return Promise.reject(new Error(res.message));
}
/**
* 获取服务器时间(实时)
* @return

106
api/shop/shopCart/index.ts Normal file
View File

@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type {ApiResult, PageResult} from '@/api';
import type {ShopCart, ShopCartParam} from './model';
import {SERVER_API_URL} from "~/config";
/**
* 分页查询购物车
*/
export async function pageShopCart(params: ShopCartParam) {
const res = await request.get<ApiResult<PageResult<ShopCart>>>(
SERVER_API_URL + '/shop/shop-cart/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询购物车列表
*/
export async function listShopCart(params?: ShopCartParam) {
const res = await request.get<ApiResult<ShopCart[]>>(
SERVER_API_URL + '/shop/shop-cart',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加购物车
*/
export async function addShopCart(data: ShopCart) {
const res = await request.post<ApiResult<unknown>>(
SERVER_API_URL + '/shop/shop-cart',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改购物车
*/
export async function updateShopCart(data: ShopCart) {
const res = await request.put<ApiResult<unknown>>(
SERVER_API_URL + '/shop/shop-cart',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除购物车
*/
export async function removeShopCart(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
SERVER_API_URL + '/shop/shop-cart/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除购物车
*/
export async function removeBatchShopCart(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
SERVER_API_URL + '/shop/shop-cart/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询购物车
*/
export async function getShopCart(id: number) {
const res = await request.get<ApiResult<ShopCart>>(
SERVER_API_URL + '/shop/shop-cart/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -0,0 +1,72 @@
import type { PageParam } from '@/api';
import type {ShopOrderInfo} from "~/api/shop/shopOrderInfo/model";
import type {Company} from "~/api/system/company/model";
/**
* 购物车
*/
export interface ShopCart {
// 购物车表ID
id?: string;
// 类型 0商城 1外卖
type?: number;
// 唯一标识
code?: string;
// 商品ID
productId?: string;
// 商品规格
spec?: string;
// 商品价格
price?: string;
// 商品数量
cartNum?: number;
// 单商品合计
totalPrice?: string;
// 0 = 未购买 1 = 已购买
isPay?: string;
// 是否为立即购买
isNew?: string;
// 拼团id
combinationId?: number;
// 秒杀产品ID
seckillId?: number;
// 砍价id
bargainId?: number;
// 是否选中
selected?: string;
// 商户ID
merchantId?: string;
// 用户ID
userId?: string;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
// 商品封面图
image?: string;
}
/**
* 购物车搜索条件
*/
export interface ShopCartParam extends PageParam {
id?: number;
keywords?: string;
}
export interface MyCart {
appName?: string,
domain?: string,
adminUrl?: string;
menuId?: number;
num?: number,
type?: number;
payType?: number,
payPrice?: number,
month?: number,
comments?: string,
list?: Company[],
totalPrice?: number
}

View File

@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopMerchant, ShopMerchantParam } from './model';
import { MODULES_API_URL } from '@/config';
/**
* 分页查询商户
*/
export async function pageShopMerchant(params: ShopMerchantParam) {
const res = await request.get<ApiResult<PageResult<ShopMerchant>>>(
MODULES_API_URL + '/shop/shop-merchant/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询商户列表
*/
export async function listShopMerchant(params?: ShopMerchantParam) {
const res = await request.get<ApiResult<ShopMerchant[]>>(
MODULES_API_URL + '/shop/shop-merchant',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加商户
*/
export async function addShopMerchant(data: ShopMerchant) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-merchant',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改商户
*/
export async function updateShopMerchant(data: ShopMerchant) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-merchant',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除商户
*/
export async function removeShopMerchant(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-merchant/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除商户
*/
export async function removeBatchShopMerchant(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-merchant/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询商户
*/
export async function getShopMerchant(id: number) {
const res = await request.get<ApiResult<ShopMerchant>>(
MODULES_API_URL + '/shop/shop-merchant/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -0,0 +1,89 @@
import type { PageParam } from '@/api';
/**
* 商户
*/
export interface ShopMerchant {
// ID
merchantId?: number;
// 商户名称
merchantName?: string;
// 商户编号
merchantCode?: string;
// 商户类型
type?: number;
// 商户图标
image?: string;
// 商户手机号
phone?: string;
// 商户姓名
realName?: string;
// 店铺类型
shopType?: string;
// 项目分类
itemType?: string;
// 商户分类
category?: string;
// 行业父级分类
parentId?: string;
// 商户经营分类
merchantCategoryId?: number;
// 商户分类
merchantCategoryTitle?: string;
// 经纬度
lngAndLat?: string;
//
lng?: string;
//
lat?: string;
// 所在省份
province?: string;
// 所在城市
city?: string;
// 所在辖区
region?: string;
// 详细地址
address?: string;
// 手续费
commission?: string;
// 关键字
keywords?: string;
// 资质图片
files?: string;
// 营业时间
businessTime?: string;
// 文章内容
content?: string;
// 每小时价格
price?: string;
// 是否自营
ownStore?: number;
// 是否推荐
recommend?: number;
// 是否需要审核
goodsReview?: number;
// 管理入口
adminUrl?: string;
// 备注
comments?: string;
// 所有人
userId?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 状态
status?: number;
// 排序号
sortNumber?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
* 商户搜索条件
*/
export interface ShopMerchantParam extends PageParam {
merchantId?: number;
keywords?: string;
}

View File

@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopMerchantApply, ShopMerchantApplyParam } from './model';
import { MODULES_API_URL } from '@/config';
/**
* 分页查询商户入驻申请
*/
export async function pageShopMerchantApply(params: ShopMerchantApplyParam) {
const res = await request.get<ApiResult<PageResult<ShopMerchantApply>>>(
MODULES_API_URL + '/shop/shop-merchant-apply/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询商户入驻申请列表
*/
export async function listShopMerchantApply(params?: ShopMerchantApplyParam) {
const res = await request.get<ApiResult<ShopMerchantApply[]>>(
MODULES_API_URL + '/shop/shop-merchant-apply',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加商户入驻申请
*/
export async function addShopMerchantApply(data: ShopMerchantApply) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-merchant-apply',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改商户入驻申请
*/
export async function updateShopMerchantApply(data: ShopMerchantApply) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-merchant-apply',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除商户入驻申请
*/
export async function removeShopMerchantApply(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-merchant-apply/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除商户入驻申请
*/
export async function removeBatchShopMerchantApply(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-merchant-apply/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询商户入驻申请
*/
export async function getShopMerchantApply(id: number) {
const res = await request.get<ApiResult<ShopMerchantApply>>(
MODULES_API_URL + '/shop/shop-merchant-apply/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -0,0 +1,74 @@
import type { PageParam } from '@/api';
/**
* 商户入驻申请
*/
export interface ShopMerchantApply {
// ID
applyId?: number;
// 认证类型
type?: number;
// 商户名称
merchantName?: string;
// 社会信用代码
merchantCode?: string;
// 商户图标
image?: string;
// 商户手机号
phone?: string;
// 商户姓名
realName?: string;
// 身份证号码
idCard?: string;
sfz1?: string;
sfz2?: string;
yyzz?: string;
// 店铺类型
shopType?: string;
// 行业父级分类
parentId?: number;
// 所属分类
categoryId?: number;
// 商户分类
category?: string;
// 手续费
commission?: string;
// 关键字
keywords?: string;
// 资质图片
files?: string;
// 所有人
userId?: number;
// 是否自营
ownStore?: number;
// 是否推荐
recommend?: number;
// 是否需要审核
goodsReview?: number;
// 审核完成时间
completedTime?: string
// 工作负责人
name2?: string;
// 驳回原因
reason?: string;
// 审核状态
checkStatus?: boolean;
// 备注
comments?: string;
// 状态
status?: number;
// 排序号
sortNumber?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
* 商户入驻申请搜索条件
*/
export interface ShopMerchantApplyParam extends PageParam {
applyId?: number;
keywords?: string;
}

View File

@@ -1,7 +1,7 @@
import request from '~/utils/request';
import type {ApiResult, PageResult} from '@/api';
import type {User, UserParam} from './model';
import { SERVER_API_URL } from '@/config';
import {COMMON_API_URL, SERVER_API_URL} from '@/config';
/**
* 分页查询用户
@@ -155,7 +155,7 @@ export async function updateUserStatus(userId?: number, status?: number) {
/**
* 修改推荐状态
*/
export async function updateUserRecommend(form) {
export async function updateUserRecommend(form: any) {
const res = await request.put<ApiResult<unknown>>(
SERVER_API_URL + '/system/user/recommend',
form

View File

@@ -25,7 +25,7 @@
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="user"><nuxt-link to="/user">用户中心</nuxt-link></el-dropdown-item>
<el-dropdown-item command="password"><nuxt-link to="/user/password">修改密码</nuxt-link></el-dropdown-item>
<!-- <el-dropdown-item command="password"><nuxt-link to="/user/password">修改密码</nuxt-link></el-dropdown-item>-->
<el-dropdown-item command="auth"><nuxt-link to="/user/auth">实名认证</nuxt-link></el-dropdown-item>
<el-dropdown-item divided command="order"><nuxt-link to="/user/order">我的订单</nuxt-link></el-dropdown-item>
<el-dropdown-item divided command="logOut"><nuxt-link to="/user/logout">退出登录</nuxt-link>

View File

@@ -1,8 +1,8 @@
<template>
<nuxt-link to="/" class="flex items-center gap-sm mr-7" v-if="logo">
<nuxt-link to="/" class="flex items-center cursor-pointer gap-sm mr-7" v-if="logo">
<!-- <el-image src="https://oss.wsdns.cn/20250211/eedb87d7b95b41e3bc9eca1247c85fa4.png" class="h-[30px]" size="small" shape="square" />-->
<!-- <h4 class="text-gray-700 text-xl font-bold">WEBSOFT</h4>-->
<el-image :src="logo?.value" class=" rounded-sm rounded-sm h-[24px]"/>
<el-image :src="logo?.value" class=" rounded-sm rounded-sm w-[107px] h-[24px]"/>
<!-- <div class="text-sm text-gray-700 text-xl font-bold" :style="`${logo?.style}`">{{ website?.websiteName }}</div>-->
</nuxt-link>
</template>

View File

@@ -1,5 +1,39 @@
<template>
<div class="lg:w-screen-lg sm:flex xl:p-0 p-4 mb-10 m-auto relative">
<div class="xl:w-screen-xl m-auto py-4">
<div v-if="title" class="text-center flex flex-col items-center z-100 relative">
<h2 class="text-4xl font-bold tracking-tight text-gray-500 dark:text-white">
{{ title }}
</h2>
<div class="sub-title">
<p class="text-gray-500 dark:text-gray-400 py-3">
{{ comments }}
</p>
</div>
</div>
<el-row :gutter="24" id="container" class="clearfix">
<el-col v-for="(item,index) in list" :key="index" :span="6" class="left mb-8">
<el-card shadow="hover" :body-style="{ padding: '0px' }" class=" hover:bg-gray-50 cursor-pointer" @click="navigateTo(`/market/${item.websiteId}.html`)">
<div class="flex-1 px-4 py-5 sm:p-4 !p-4">
<div class="text-gray-700 dark:text-white text-base font-semibold flex gap-1.5">
<el-avatar
:src="item.websiteLogo" shape="square" :size="55" style="background-color: white;"/>
<div class="flex-1 text-lg cursor-pointer flex flex-col">
{{ item.websiteName }}
<div class="flex justify-between items-center">
<sapn class="text-xs text-gray-400 font-normal line-clamp-1">{{ item.comments || '暂无描述' }}</sapn>
<el-button size="small" round>获取</el-button>
</div>
</div>
</div>
<div class="item-image pt-3">
<el-image v-if="item.files" :src="`${JSON.parse(item.files)[0].url}`" class="w-full h-1/2 max-h-[220px]" />
<el-image v-else class="w-full h-[220px]" />
</div>
</div>
</el-card>
</el-col>
</el-row>
</div>
<el-row :gutter="24" class="flex w-full">
<el-col v-for="(item,index) in list" :key="index" :span="6" :xs="24" class="mb-6">
<nuxt-link :to="item.path">
@@ -16,7 +50,6 @@
</nuxt-link>
</el-col>
</el-row>
</div>
<div v-if="disabled" class="px-1 text-center text-gray-500 min-h-xs">
没有更多了
</div>
@@ -31,6 +64,9 @@ import {pageCompanyAll} from "~/api/system/company";
import {listCmsNavigation} from "~/api/cms/cmsNavigation";
import type {CmsNavigation} from "~/api/cms/cmsNavigation/model";
import {navigateTo} from "#imports";
import type {CmsWebsite} from "~/api/cms/cmsWebsite/model";
import {listWebsite} from "~/api/system/website";
import {listCmsWebsite, pageCmsWebsiteAll} from "~/api/cms/cmsWebsite";
const props = withDefaults(
defineProps<{
@@ -49,14 +85,13 @@ const emit = defineEmits<{
(e: 'done'): void;
}>();
const list = ref<CmsNavigation[]>([]);
const list = ref<CmsWebsite[]>([]);
// 请求数据
const reload = async () => {
listCmsNavigation({
parentId: 2828
pageCmsWebsiteAll({
}).then(data => {
list.value = data;
list.value = data?.list || [];
})
}
reload();

View File

@@ -8,7 +8,7 @@ export const domain = 'https://websoft.top';
export const SERVER_API_URL = import.meta.env.VITE_SERVER_URL || 'https://server.gxwebsoft.com/api';
// 模块节点
export const MODULES_API_URL = import.meta.env.VITE_API_URL || 'https://server.gxwebsoft.com/api';
export const THINK_API_URL = import.meta.env.VITE_THINK_URL || 'https://gxtyzx-api.gxwebsoft.com/api';
export const COMMON_API_URL = import.meta.env.VITE_THINK_URL || 'https://common-api.websoft.top/api';
// 文件服务器地址
export const FILE_SERVER = 'https://file.wsdns.cn';
// 图片前缀

View File

@@ -9,7 +9,6 @@ export default defineNuxtRouteMiddleware((to, from) => {
if(import.meta.client){
let token = useToken()
if(!token.value){
console.log('ekekekekeke')
return navigateTo({
path: '/passport/login',
query: {
@@ -27,7 +26,7 @@ export default defineNuxtRouteMiddleware((to, from) => {
if (isMobile) {
mobile.value = true;
if (to.path.indexOf('/m') < 0) {
return window.location.href = `/m`
// return window.location.href = `/m`
}
}
}

View File

@@ -7,7 +7,7 @@
<span class="font-600 mr-3"> 文章详情 </span>
</template>
<el-card shadow="hover" class=" my-5 px-2">
<el-card shadow="hover" class=" my-10 px-2">
<!-- 新闻详细 -->
<div class=" bg-white">

View File

@@ -3,7 +3,7 @@
<Flash/>
<CompanyList :param="{official: true,recommend: true,limit: 4}" :fit="`cover`" />
<CompanyList title="产品服务" :param="{official: true,recommend: true,limit: 4}" :fit="`cover`" />
</template>
<script setup lang="ts">

View File

@@ -205,7 +205,7 @@ const reload = async () => {
page.value = {
image: data.websiteLogo,
title: data.websiteName,
categoryName: '应用市场',
categoryName: '插件市场',
...data,
}

View File

@@ -154,11 +154,11 @@ await getSiteInfo({
lang: i18n.locale.value
}).then(data => {
website.value = data
topNavs.value = data.topNavs?.filter(d => d.title === '产品系列' || d.title === 'Product')
if(topNavs.value[0].children){
cpCategory.value = topNavs.value[0].children;
}
caseCategory.value = data.topNavs?.filter(d => d.title === '项目展示' || d.title === 'Case')[0].children
// topNavs.value = data.topNavs?.filter(d => d.title === '产品系列' || d.title === 'Product')
// if(topNavs.value[0].children){
// cpCategory.value = topNavs.value[0].children;
// }
// caseCategory.value = data.topNavs?.filter(d => d.title === '项目展示' || d.title === 'Case')[0].children
})
const reload = async () => {

View File

@@ -207,7 +207,7 @@ const reload = async () => {
page.value = {
image: data.websiteLogo,
title: data.websiteName,
categoryName: '应用市场',
categoryName: '插件市场',
...data,
}

View File

@@ -9,7 +9,7 @@
<div class="item text-center flex flex-col items-center">
<div class="text-gray-400">插件ID</div>
<el-icon size="24" class="py-1"><Cpu /></el-icon>
<span class="text-gray-500">{{ form.websiteCode }}</span>
<span class="text-gray-500">{{ form.websiteId }}</span>
</div>
<el-divider class="opacity-40" style="height: 40px" direction="vertical" />
<nuxt-link class="item text-center flex flex-col items-center">

View File

@@ -4,7 +4,7 @@
<div class="xl:w-screen-xl m-auto py-4 mt-20">
<el-page-header :icon="ArrowLeft" @back="goBack">
<template #content>
<span class="text-large font-600 mr-3"> 应用市场 </span>
<span class="text-large font-600 mr-3"> 插件市场 </span>
</template>
<template #extra>
<el-space class="flex items-center">
@@ -16,7 +16,7 @@
<!-- :value="item.value"-->
<!-- />-->
<!-- </el-select>-->
<el-input v-model="where.keywords" style="width: 400px" :placeholder="`应用搜索`" :suffix-icon="Search" @change="reload"/>
<el-input v-model="where.keywords" style="width: 400px" :placeholder="`插件ID | 插件名称 | 域名`" :suffix-icon="Search" @change="reload"/>
<el-button-group v-model:value="where" @tab-click="handleClick" @change="reload">
<el-button>综合</el-button>
<el-button>最新</el-button>
@@ -61,7 +61,7 @@ import { ArrowLeft,View,Search } from '@element-plus/icons-vue'
import { ElNotification as notify } from 'element-plus'
import { useLayout, usePage} from "~/composables/configState";
import type {CmsNavigation} from "~/api/cms/cmsNavigation/model";
import type {CmsArticle, CmsArticleParam} from "~/api/cms/cmsArticle/model";
import type {CmsArticleParam} from "~/api/cms/cmsArticle/model";
import type { ComponentSize } from 'element-plus'
import { ElNotification } from 'element-plus'
import type { TabsPaneContext } from 'element-plus'

View File

@@ -4,7 +4,7 @@
<div class="xl:w-screen-xl m-auto py-4 mt-20">
<el-page-header :icon="ArrowLeft" @back="goBack">
<template #content>
<span class="text-large font-600 mr-3"> 应用市场 </span>
<span class="text-large font-600 mr-3"> 插件市场 </span>
</template>
<template #extra>
<el-space class="flex items-center">

View File

@@ -2,30 +2,40 @@
<!-- Banner -->
<Banner :layout="layout"/>
<!-- 主体部分 -->
<div class="xl:w-screen-xl m-auto bg-white">
<el-row :gutter="50" id="container" class="clearfix">
<el-col :span="5" class="left">
<!-- 内页左侧组件 -->
<Left :category="category" />
</el-col>
<el-col :span="19" class="right">
<div class="sitemp h-[32px] flex justify-between pt-5">
<h2>{{ page.title }}</h2>
<Breadcrumb :data="page" />
</div>
<div class="form-box p-5">
<div class="xl:w-screen-xl m-auto py-4 mt-20">
<el-page-header :icon="ArrowLeft" @back="goBack">
<template #content>
<span class="text-large font-600 mr-3"> {{ page.title }} </span>
</template>
<template #extra>
</template>
<el-card shadow="hover" class="my-10 px-2">
<el-row :gutter="30" justify="space-between">
<el-col :span="13">
<el-alert title="填写您的需求,为您量身定制." type="warning" />
<el-form
ref="formRef"
:model="form"
:rules="rules"
label-width="120"
label-position="left"
class="mt-5"
status-icon
>
<el-form-item :label="$t('order.title')" prop="title" class="hover:bg-gray-50 p-2">
<el-input v-model="form.title" :placeholder="$t('order.title')"/>
<el-select
v-model="form.title"
filterable
placeholder="选择咨询的产品"
>
<el-option
v-for="item in siteList"
:key="item.websiteId"
:label="item.websiteName"
:value="`${item.websiteId}`"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('order.content')" prop="content" class="hover:bg-gray-50 p-2">
<el-input type="textarea" :rows="5" cols="80" v-model="form.content" :placeholder="$t('order.content')"/>
@@ -39,9 +49,9 @@
<el-form-item :label="$t('order.email')" prop="email" class="hover:bg-gray-50 p-2">
<el-input v-model="form.email" :placeholder="$t('order.email')"/>
</el-form-item>
<el-form-item :label="$t('order.address')" prop="address" class="hover:bg-gray-50 p-2">
<el-input v-model="form.address" :placeholder="$t('order.address')"/>
</el-form-item>
<!-- <el-form-item :label="$t('order.address')" prop="address" class="hover:bg-gray-50 p-2">-->
<!-- <el-input v-model="form.address" :placeholder="$t('order.address')"/>-->
<!-- </el-form-item>-->
<el-form-item :label="$t('order.code')" prop="code" class="hover:bg-gray-50 p-2">
<el-space class="flex">
<el-input size="large" :placeholder="$t('order.imgCode')" maxlength="5" v-model="form.code"/>
@@ -56,10 +66,15 @@
</div>
</el-form-item>
</el-form>
</div>
</el-col>
<el-col :span="10">
<el-image class="py-2" v-if="page.icon" :src="page.icon" />
</el-col>
</el-row>
</el-card>
</el-page-header>
</div>
<el-dialog v-model="dialogVisible">
<div class="flex justify-center">
<el-image w-full :src="dialogImageUrl" alt="查看证件"/>
@@ -67,23 +82,26 @@
</el-dialog>
</template>
<script setup lang="ts">
import {useLayout, usePage} from "~/composables/configState";
import type {CmsNavigation} from "~/api/cms/cmsNavigation/model";
import {ArrowLeft, View, Search} from '@element-plus/icons-vue'
import {useLayout, usePage, useUser} from "~/composables/configState";
import {getNavIdByParamsId} from "~/utils/common";
import type {FormInstance, FormRules} from 'element-plus'
import type {CmsOrder} from "~/api/cms/cmsOrder/model";
import useFormData from "~/utils/use-form-data";
import Left from "~/components/Left.vue";
import {addCmsOrder} from "~/api/cms/cmsOrder";
import {getCaptcha} from "~/api/passport/login";
import {getCmsNavigation, listCmsNavigation} from "~/api/cms/cmsNavigation";
import {listCmsWebsite, pageCmsWebsiteAll} from "~/api/cms/cmsWebsite";
import type {CmsWebsite} from "~/api/cms/cmsWebsite/model";
// 引入状态管理
const route = useRoute();
const router = useRouter();
const navId = ref();
const layout = useLayout();
const user = useUser();
const page = usePage();
const category = ref<CmsNavigation[]>([]);
const siteList = ref<CmsWebsite[]>([]);
const dialogVisible = ref(false)
const formRef = ref<FormInstance>()
const dialogImageUrl = ref('')
@@ -177,11 +195,16 @@ const reload = async () => {
page.value = data
layout.value.banner = data.banner;
// 二级栏目分类
listCmsNavigation({
parentId: data.parentId == 0 ? data.navigationId : data.parentId
}).then(categoryData => {
category.value = categoryData;
pageCmsWebsiteAll({
}).then(res => {
siteList.value = res?.list || [];
})
// 用户信息
if(user.value){
form.realName = user.value.realName;
form.phone = user.value.phone;
form.email = user.value.email;
}
// seo
useSeoMeta({
description: data.comments || data.title,
@@ -214,6 +237,10 @@ const submitForm = (formEl: FormInstance | undefined) => {
})
}
const goBack = () => {
router.back();
}
watch(
() => route.params.id,
(id) => {

View File

@@ -5,7 +5,7 @@
<div class="xl:w-screen-xl m-auto py-4 mt-2">
<el-page-header :icon="ArrowLeft" @back="goBack">
<template #content>
<span class="text-large font-600 mr-3"> {{ page.title }} </span>
<span class="text-large font-600 mr-3"> {{ page.title || '页面标题' }} </span>
</template>
<el-card shadow="hover" class=" my-5">

View File

@@ -338,7 +338,7 @@ const doLogin = async (data: any) => {
user.value.balance = data.user.balance;
localStorage.setItem('UserId',data.user.userId);
localStorage.setItem('Avatar',data.user.avatar);
localStorage.setItem('TID_ADMIN',data.user.tenantId);
localStorage.setItem('ServerTenantId',data.user.tenantId);
// localStorage.setItem('TenantId',data.user.tenantId);
}
setTimeout(() => {

View File

@@ -7,7 +7,7 @@
<div class="login-layout m-auto mt-10 sm:w-screen-xl w-full">
<div class="m-auto flex sm:flex-row flex-col sm:px-0 px-3 ">
<!-- 用户菜单 -->
<UserMenu :activeIndex="activeIndex" @done="reload"/>
<!-- <UserMenu :activeIndex="activeIndex" @done="reload"/>-->
<div class="flash bg-white rounded-lg w-full">
<div class="sm:w-screen-md w-full sm:px-4 sm:py-2">
<Auth @done="reload"/>
@@ -27,6 +27,7 @@ import type {ApiResult} from "~/api";
import UserMenu from "./components/UserMenu.vue";
import Auth from './components/Auth.vue';
import type {ShopMerchantApply} from "~/api/shop/shopMerchantApply/model";
import {COMMON_API_URL} from "~/config";
// 配置信息
const runtimeConfig = useRuntimeConfig();
@@ -44,7 +45,7 @@ const reload = async () => {
navigateTo('/passport/login');
return false;
}
const {data: response} = await useServerRequest<ApiResult<ShopMerchantApply>>('/shop/shop-merchant-apply/getByUserId', {baseURL: runtimeConfig.public.apiServer})
const {data: response} = await useServerRequest<ApiResult<ShopMerchantApply>>(COMMON_API_URL + '/shop/shop-merchant-apply/getByUserId', {baseURL: runtimeConfig.public.apiServer})
if (response.value?.data) {
merchantApply.value = response.value.data;
}

View File

@@ -10,8 +10,8 @@
status-icon
>
<el-tabs v-model="form.type" class="flash bg-white ml-0">
<el-tab-pane :name="0" label="个人认证"/>
<el-tab-pane :name="1" label="企业认证"/>
<!-- <el-tab-pane :name="0" label="个人认证"/>-->
<el-tab-pane :name="1" label="实名认证"/>
</el-tabs>
<!-- 已完成认证 -->
<template v-if="form.status === 1">
@@ -205,9 +205,10 @@ import type {ApiResult} from "~/api";
import {useServerRequest} from "~/composables/useServerRequest";
import type {ShopMerchant} from "~/api/shop/shopMerchant/model";
import useFormData from "~/utils/use-form-data";
import {COMMON_API_URL} from "~/config";
const token = useToken();
const tenantId = localStorage.getItem('TID_ADMIN')
const tenantId = localStorage.getItem('ServerTenantId')
const formRef = ref<FormInstance>()
const yyzzFile = ref<UploadUserFile[]>([])
const sfzFile = ref<UploadUserFile[]>([])
@@ -393,7 +394,7 @@ const resetForm = (formEl: FormInstance | undefined) => {
}
const reload = async () => {
const {data: response} = await useServerRequest<ApiResult<ShopMerchant>>('/shop/shop-merchant-apply/getByUserId')
const {data: response} = await useServerRequest<ApiResult<ShopMerchant>>(COMMON_API_URL + '/shop/shop-merchant-apply/getByUserId')
if (response.value?.data) {
isUpdate.value = true;
assignFields(response.value.data)

View File

@@ -39,6 +39,15 @@ withDefaults(
}>(),
{}
);
const emit = defineEmits<{
(e: 'done', where: any): void
}>()
const onSubmit = () => {
emit('done')
}
</script>
<style scoped lang="less">

View File

@@ -29,11 +29,11 @@ const activities = [
name: '账号信息',
path: '/user'
},
{
icon: Lock,
name: '密码修改',
path: '/user/password'
},
// {
// icon: Lock,
// name: '密码修改',
// path: '/user/password'
// },
{
icon: Postcard,
name: '实名认证',

View File

@@ -7,11 +7,23 @@
<div class="login-layout mt-10 sm:w-screen-xl w-full">
<div class="m-auto flex sm:flex-row flex-col sm:px-0 px-3">
<!-- 用户菜单 -->
<UserMenu :activeIndex="activeIndex" @done="onDone" class="sm:flex hidden"/>
<!-- <UserMenu :activeIndex="activeIndex" @done="onDone" class="sm:flex hidden"/>-->
<div class="flash bg-white rounded-lg w-full">
<div class="title text-xl text-gray-700 md:px-8 p-4 md:mt-3 font-500">账号信息</div>
<div class="sm:w-screen-md w-full sm:px-4 sm:py-2">
<Base :form="form"/>
<div class="lg:w-screen-lg w-full sm:px-4 sm:py-4 mb-10">
<el-descriptions class="px-4" :column="2" border>
<el-descriptions-item label="用户ID">{{user?.userId}}</el-descriptions-item>
<el-descriptions-item label="手机号码">{{user?.mobile}}</el-descriptions-item>
<el-descriptions-item label="昵称">{{user?.nickname}}</el-descriptions-item>
<el-descriptions-item label="性别">{{user?.sexName}}</el-descriptions-item>
<el-descriptions-item label="邮箱">{{user?.email}}</el-descriptions-item>
<el-descriptions-item label="生日">{{user?.birthday}}</el-descriptions-item>
<el-descriptions-item label="所在省份">{{user?.province}}</el-descriptions-item>
<el-descriptions-item label="所在城市">{{user?.city}}</el-descriptions-item>
<el-descriptions-item label="可用余额">{{user?.balance}}</el-descriptions-item>
<el-descriptions-item label="可用积分">{{user?.points}}</el-descriptions-item>
<el-descriptions-item label="个人简介">{{user?.introduction}}</el-descriptions-item>
</el-descriptions>
</div>
</div>
</div>
@@ -25,20 +37,19 @@ import {useWebsite} from "~/composables/configState";
import useFormData from '@/utils/use-form-data';
import type {User} from '@/api/system/user/model';
import {ref} from 'vue'
import {useServerRequest} from "~/composables/useServerRequest";
import type {ApiResult} from "~/api";
import UserMenu from "./components/UserMenu.vue";
import Base from './components/Base.vue';
import {updateUser} from "~/api/layout";
import {openUrl} from "~/utils/common";
// 配置信息
const runtimeConfig = useRuntimeConfig();
const route = useRoute();
const router = useRouter();
const website = useWebsite()
const userInfo = ref<User>();
const user = useUser();
const activeIndex = ref('');
// 配置信息
const {form, assignFields} = useFormData<User>({
userId: undefined,
@@ -67,17 +78,6 @@ const onDone = (index: string) => {
activeIndex.value = index;
}
const onSubmit = async () => {
const {data: modify} = await useServerRequest<ApiResult<User>>('/auth/user', {
baseURL: runtimeConfig.public.apiServer,
method: 'put',
body: form
})
if (modify.value?.code == 0) {
ElMessage.success('修改成功')
}
}
const reload = async () => {
// 未登录状态(是否强制登录)
const token = localStorage.getItem('token');
@@ -85,10 +85,14 @@ const reload = async () => {
navigateTo('/passport/login');
return false;
}
const {data: response} = await useServerRequest<ApiResult<User>>('/auth/user', {baseURL: runtimeConfig.public.apiServer})
if (response.value?.data) {
userInfo.value = response.value?.data;
assignFields(response.value?.data);
if(user.value){
form.userId = user.value.userId;
form.nickname = user.value.nickname;
form.realName = user.value.realName;
form.mobile = user.value.mobile;
form.email = user.value.email;
form.sex = user.value.sex;
form.comments = user.value.comments;
}
}
@@ -100,7 +104,6 @@ watch(
() => route.path,
(path) => {
activeIndex.value = path;
console.log(path, '=>Path')
reload();
},
{immediate: true}