Browse Source
- 重构医生申请页面,移除旧的表单字段,添加微信昵称和头像获取功能 - 实现微信头像上传功能,支持临时显示和服务器上传 - 添加手机号获取功能,通过微信授权获取用户手机号 -优化表单验证逻辑,增加昵称和头像的必填验证 - 移除旧的用户类型选择和证书上传功能 - 更新页面标题从"AddApply"改为"AddDoctor"-修复邀请关系处理逻辑,确保邀请人ID正确传递- 优化页面加载逻辑,依赖用户ID变化重新加载数据 - 移除错误显示逻辑,简化页面结构 - 更新商品列表组件,优化瀑布流布局和样式 -优化商品详情页面,调整底部按钮样式和咨询按钮大小 - 移除页面中的邀请提示弹窗,改为控制台输出 - 更新分类页面逻辑,根据首页导航获取商品分类 - 移除配置加载时的冗余代码,优化加载逻辑 - 更新API接口,移除旧的文章模型和接口定义 - 添加导航和网站字段模型的新属性支持master
15 changed files with 442 additions and 568 deletions
@ -1,218 +0,0 @@ |
|||||
import request from '@/utils/request'; |
|
||||
import type {ApiResult, PageResult} from '@/api'; |
|
||||
import type {CmsArticle, CmsArticleParam} from './model'; |
|
||||
|
|
||||
/** |
|
||||
* 分页查询文章 |
|
||||
*/ |
|
||||
export async function pageCmsArticle(params: CmsArticleParam) { |
|
||||
const res = await request.get<ApiResult<PageResult<CmsArticle>>>( |
|
||||
'/cms/cms-article/page', |
|
||||
params |
|
||||
); |
|
||||
if (res.code === 0) { |
|
||||
return res.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 查询文章列表 |
|
||||
*/ |
|
||||
export async function listCmsArticle(params?: CmsArticleParam) { |
|
||||
const res = await request.get<ApiResult<CmsArticle[]>>( |
|
||||
'/cms/cms-article', |
|
||||
params |
|
||||
); |
|
||||
if (res.code === 0 && res.data) { |
|
||||
return res.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 添加文章 |
|
||||
*/ |
|
||||
export async function addCmsArticle(data: CmsArticle) { |
|
||||
const res = await request.post<ApiResult<unknown>>( |
|
||||
'/cms/cms-article', |
|
||||
data |
|
||||
); |
|
||||
if (res.code === 0) { |
|
||||
return res.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 修改文章 |
|
||||
*/ |
|
||||
export async function updateCmsArticle(data: CmsArticle) { |
|
||||
const res = await request.put<ApiResult<unknown>>( |
|
||||
'/cms/cms-article', |
|
||||
data |
|
||||
); |
|
||||
if (res.code === 0) { |
|
||||
return res.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 删除文章 |
|
||||
*/ |
|
||||
export async function removeCmsArticle(id?: number) { |
|
||||
const res = await request.del<ApiResult<unknown>>( |
|
||||
'/cms/cms-article/' + id |
|
||||
); |
|
||||
if (res.code === 0) { |
|
||||
return res.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 批量删除文章 |
|
||||
*/ |
|
||||
export async function removeBatchCmsArticle(data: (number | undefined)[]) { |
|
||||
const res = await request.del<ApiResult<unknown>>( |
|
||||
'/cms/cms-article/batch', |
|
||||
{ |
|
||||
data |
|
||||
} |
|
||||
); |
|
||||
if (res.code === 0) { |
|
||||
return res.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 根据id查询文章 |
|
||||
*/ |
|
||||
export async function getCmsArticle(id: number) { |
|
||||
const res = await request.get<ApiResult<CmsArticle>>( |
|
||||
'/cms/cms-article/' + id |
|
||||
); |
|
||||
if (res.code === 0 && res.data) { |
|
||||
return res.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
export async function getCount(params?: CmsArticleParam) { |
|
||||
const res = await request.get<ApiResult<unknown>>('/cms/cms-article/data', { |
|
||||
params |
|
||||
}); |
|
||||
if (res.code === 0) { |
|
||||
return res.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 上一篇 |
|
||||
* @param params |
|
||||
*/ |
|
||||
export async function getPrevious(params?: CmsArticleParam) { |
|
||||
const res = await request.get<ApiResult<CmsArticle>>( |
|
||||
'/cms/cms-article/getPrevious/' + params?.articleId, |
|
||||
{ |
|
||||
params |
|
||||
} |
|
||||
); |
|
||||
if (res.code === 0) { |
|
||||
return res.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 下一篇 |
|
||||
* @param params |
|
||||
*/ |
|
||||
export async function getNext(params?: CmsArticleParam) { |
|
||||
const res = await request.get<ApiResult<CmsArticle>>( |
|
||||
'/cms/cms-article/getNext/' + params?.articleId, |
|
||||
{ |
|
||||
params |
|
||||
} |
|
||||
); |
|
||||
if (res.code === 0) { |
|
||||
return res.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 验证文章密码 |
|
||||
* @param params |
|
||||
*/ |
|
||||
export async function checkArticlePassword(params?: CmsArticleParam) { |
|
||||
const res = await request.get<ApiResult<unknown>>( |
|
||||
'/cms/cms-article/checkArticlePassword', |
|
||||
{ |
|
||||
params |
|
||||
} |
|
||||
); |
|
||||
if (res.code === 0) { |
|
||||
return res.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
export async function findTags(params?: CmsArticleParam) { |
|
||||
const res = await request.get<ApiResult<CmsArticle[]>>( |
|
||||
'/cms/cms-article/findTags', |
|
||||
{ |
|
||||
params |
|
||||
} |
|
||||
); |
|
||||
if (res.code === 0) { |
|
||||
return res.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
export async function pageTags(params?: CmsArticleParam) { |
|
||||
const res = await request.get<ApiResult<CmsArticle[]>>( |
|
||||
'/cms/cms-article/pageTags', |
|
||||
{ |
|
||||
params |
|
||||
} |
|
||||
); |
|
||||
if (res.code === 0) { |
|
||||
return res.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 按IDS查询文章 |
|
||||
* @param params |
|
||||
*/ |
|
||||
export async function getByIds(params?: CmsArticleParam) { |
|
||||
const res = await request.get<ApiResult<CmsArticle[]>>( |
|
||||
'/cms/cms-article/getByIds', |
|
||||
{ |
|
||||
params |
|
||||
} |
|
||||
); |
|
||||
if (res.code === 0) { |
|
||||
return res.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 根据code查询文章 |
|
||||
*/ |
|
||||
export async function getByCode(code: string) { |
|
||||
const res = await request.get<ApiResult<CmsArticle>>( |
|
||||
'/cms/cms-article/getByCode/' + code |
|
||||
); |
|
||||
if (res.code === 0 && res.data) { |
|
||||
return res.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.message)); |
|
||||
} |
|
@ -1,132 +0,0 @@ |
|||||
import type { PageParam } from '@/api/index'; |
|
||||
|
|
||||
/** |
|
||||
* 文章 |
|
||||
*/ |
|
||||
export interface CmsArticle { |
|
||||
// 文章ID
|
|
||||
articleId?: number; |
|
||||
// 文章标题
|
|
||||
title?: string; |
|
||||
// 文章类型 0常规 1视频
|
|
||||
type?: number; |
|
||||
// 文章模型
|
|
||||
model?: string; |
|
||||
// 文章详情页模板
|
|
||||
detail?: string; |
|
||||
// banner图片
|
|
||||
banner?: string; |
|
||||
// 列表显示方式(10小图展示 20大图展示)
|
|
||||
showType?: number; |
|
||||
// 话题
|
|
||||
topic?: string; |
|
||||
// 标签
|
|
||||
tags?: any; |
|
||||
// 栏目ID
|
|
||||
categoryId?: number; |
|
||||
// 栏目名称
|
|
||||
categoryName?: string; |
|
||||
// 封面图
|
|
||||
image?: string; |
|
||||
// 价格
|
|
||||
price?: number; |
|
||||
startTime?: any; |
|
||||
endTime?: any; |
|
||||
// 缩列图
|
|
||||
thumbnail?: string; |
|
||||
// 来源
|
|
||||
source?: string; |
|
||||
// 产品概述
|
|
||||
overview?: string; |
|
||||
// 虚拟阅读量(仅用作展示)
|
|
||||
virtualViews?: number; |
|
||||
// 实际阅读量
|
|
||||
actualViews?: number; |
|
||||
// 购买人数
|
|
||||
bmUsers?: number; |
|
||||
// 浏览权限(0公开 1会员 2密码)
|
|
||||
permission?: number; |
|
||||
// 访问密码
|
|
||||
password?: string; |
|
||||
// 确认密码
|
|
||||
password2?: string; |
|
||||
// 发布来源客户端 (APP、H5、小程序等)
|
|
||||
platform?: string; |
|
||||
// 文章附件
|
|
||||
files?: string; |
|
||||
// 视频地址
|
|
||||
video?: string; |
|
||||
// 接受的文件类型
|
|
||||
accept?: string; |
|
||||
// 经度
|
|
||||
longitude?: string; |
|
||||
// 纬度
|
|
||||
latitude?: string; |
|
||||
// 所在省份
|
|
||||
province?: string; |
|
||||
// 所在城市
|
|
||||
city?: string; |
|
||||
// 所在辖区
|
|
||||
region?: string; |
|
||||
// 街道地址
|
|
||||
address?: string; |
|
||||
// 点赞数
|
|
||||
likes?: number; |
|
||||
// pdf地址
|
|
||||
pdfUrl?: string; |
|
||||
// 评论数
|
|
||||
commentNumbers?: number; |
|
||||
// 提醒谁看
|
|
||||
toUsers?: string; |
|
||||
// 文章内容
|
|
||||
content?: string; |
|
||||
// 是否推荐
|
|
||||
recommend?: number; |
|
||||
// 用户ID
|
|
||||
userId?: number; |
|
||||
// 排序(数字越小越靠前)
|
|
||||
sortNumber?: number; |
|
||||
// 备注
|
|
||||
comments?: string; |
|
||||
// 状态, 0已发布, 1待审核 2已驳回 3违规内容
|
|
||||
status?: number; |
|
||||
// 是否删除, 0否, 1是
|
|
||||
deleted?: number; |
|
||||
// 租户id
|
|
||||
tenantId?: number; |
|
||||
// 创建时间
|
|
||||
createTime?: string; |
|
||||
// 修改时间
|
|
||||
updateTime?: string; |
|
||||
// 父级id
|
|
||||
parentId?: number; |
|
||||
nickname?: string; |
|
||||
username?: string; |
|
||||
author?: string; |
|
||||
shopId?: number; |
|
||||
tenantName?: string; |
|
||||
logo?: string; |
|
||||
fileList?: any; |
|
||||
// 编辑器类型
|
|
||||
editor?: number; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 文章搜索条件 |
|
||||
*/ |
|
||||
export interface CmsArticleParam extends PageParam { |
|
||||
articleId?: number; |
|
||||
articleIds?: string; |
|
||||
categoryId?: number; |
|
||||
parentId?: number; |
|
||||
status?: number; |
|
||||
// 是否推荐
|
|
||||
recommend?: number; |
|
||||
keywords?: string; |
|
||||
// 验证密码
|
|
||||
password?: string; |
|
||||
password2?: string; |
|
||||
tags?: string; |
|
||||
detail?: string; |
|
||||
sceneType?: string; |
|
||||
} |
|
@ -1,50 +1,59 @@ |
|||||
import {Image} from '@nutui/nutui-react-taro' |
import {Image} from '@nutui/nutui-react-taro' |
||||
import {Share} from '@nutui/icons-react-taro' |
|
||||
|
import {View, Text} from '@tarojs/components' |
||||
import Taro from '@tarojs/taro' |
import Taro from '@tarojs/taro' |
||||
|
import {ShopGoods} from "@/api/shop/shopGoods/model" |
||||
|
import {CmsNavigation} from "@/api/cms/cmsNavigation/model" |
||||
import './GoodsList.scss' |
import './GoodsList.scss' |
||||
|
|
||||
|
interface GoodsListProps { |
||||
|
data: ShopGoods[] |
||||
|
nav?: CmsNavigation |
||||
|
} |
||||
|
|
||||
const GoodsList = (props: any) => { |
|
||||
|
const GoodsList = (props: GoodsListProps) => { |
||||
|
|
||||
return ( |
return ( |
||||
<> |
<> |
||||
<div className={'py-3'}> |
|
||||
<div className={'flex flex-col justify-between items-center rounded-lg px-2'}> |
|
||||
|
<View className={'py-3'} style={{paddingTop: '0'}}> |
||||
|
<View className={'bg-gray-50'}> |
||||
|
<View className={'grid grid-cols-2 gap-2 pb-2 p-2'}> |
||||
{props.data?.map((item, index) => { |
{props.data?.map((item, index) => { |
||||
return ( |
return ( |
||||
<div key={index} className={'flex flex-col rounded-lg bg-white shadow-sm w-full mb-5'}> |
|
||||
<Image src={item.image} mode={'aspectFit'} lazyLoad={false} |
|
||||
radius="10px 10px 0 0" height="180" |
|
||||
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}/> |
|
||||
<div className={'flex flex-col p-2 rounded-lg'}> |
|
||||
<div> |
|
||||
<div className={'car-no text-sm'}>{item.name}</div> |
|
||||
<div className={'flex justify-between text-xs py-1'}> |
|
||||
<span className={'text-orange-500'}>{item.comments}</span> |
|
||||
<span className={'text-gray-400'}>已售 {item.sales}</span> |
|
||||
</div> |
|
||||
<div className={'flex justify-between items-center py-2'}> |
|
||||
<div className={'flex text-red-500 text-xl items-baseline'}> |
|
||||
<span className={'text-xs'}>¥</span> |
|
||||
<span className={'font-bold text-2xl'}>{item.price}</span> |
|
||||
</div> |
|
||||
<div className={'buy-btn'}> |
|
||||
<div className={'cart-icon'}> |
|
||||
<Share size={20} className={'mx-4 mt-2'} |
|
||||
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}/> |
|
||||
</div> |
|
||||
<div className={'text-white pl-4 pr-5'} |
|
||||
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}>购买 |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
<View key={index} className={'goods-waterfall-item bg-white'} style={{ |
||||
|
borderRadius: '0 0 6px 6px' |
||||
|
}}> |
||||
|
<View className={'goods-card'}> |
||||
|
<Image |
||||
|
src={item.image} |
||||
|
lazyLoad={false} |
||||
|
style={{ |
||||
|
borderRadius: '6px 6px 0 0', |
||||
|
height: '180px' |
||||
|
}} |
||||
|
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})} |
||||
|
/> |
||||
|
<View className={'goods-info p-2 flex flex-col'}> |
||||
|
<View className={'goods-title text-sm font-bold'}>{item.name}</View> |
||||
|
<View className={'goods-meta'}> |
||||
|
<Text className={'goods-comments text-gray-400 text-xs'}>{item.comments}</Text> |
||||
|
</View> |
||||
|
<View className={'goods-price-section flex justify-between'}> |
||||
|
<View className={'goods-price'}> |
||||
|
<Text className={'price-unit text-orange-600 font-bold text-lg'}>¥</Text> |
||||
|
<Text className={'price-number text-orange-600 font-bold text-lg'}>{item.price}</Text> |
||||
|
</View> |
||||
|
<View className={'goods-actions'}> |
||||
|
<Text className={'goods-sales text-gray-400 text-xs'}>已售 {item.sales}</Text> |
||||
|
</View> |
||||
|
</View> |
||||
|
</View> |
||||
|
</View> |
||||
|
</View> |
||||
) |
) |
||||
})} |
})} |
||||
</div> |
|
||||
</div> |
|
||||
|
</View> |
||||
|
</View> |
||||
|
</View> |
||||
</> |
</> |
||||
) |
) |
||||
} |
} |
||||
|
Loading…
Reference in new issue