feat(doctor): 重构医生申请页面并优化用户体验
- 重构医生申请页面,移除旧的表单字段,添加微信昵称和头像获取功能 - 实现微信头像上传功能,支持临时显示和服务器上传 - 添加手机号获取功能,通过微信授权获取用户手机号 -优化表单验证逻辑,增加昵称和头像的必填验证 - 移除旧的用户类型选择和证书上传功能 - 更新页面标题从"AddApply"改为"AddDoctor"-修复邀请关系处理逻辑,确保邀请人ID正确传递- 优化页面加载逻辑,依赖用户ID变化重新加载数据 - 移除错误显示逻辑,简化页面结构 - 更新商品列表组件,优化瀑布流布局和样式 -优化商品详情页面,调整底部按钮样式和咨询按钮大小 - 移除页面中的邀请提示弹窗,改为控制台输出 - 更新分类页面逻辑,根据首页导航获取商品分类 - 移除配置加载时的冗余代码,优化加载逻辑 - 更新API接口,移除旧的文章模型和接口定义 - 添加导航和网站字段模型的新属性支持
This commit is contained in:
@@ -8,5 +8,3 @@ export const BaseUrl = API_BASE_URL;
|
|||||||
export const Version = 'v3.0.8';
|
export const Version = 'v3.0.8';
|
||||||
// 版权信息
|
// 版权信息
|
||||||
export const Copyright = 'WebSoft Inc.';
|
export const Copyright = 'WebSoft Inc.';
|
||||||
|
|
||||||
// java -jar CertificateDownloader.jar -k 0kF5OlPr482EZwtn9zGufUcqa7ovgxRL -m 1723321338 -f ./apiclient_key.pem -s 2B933F7C35014A1C363642623E4A62364B34C4EB -o ./
|
|
||||||
|
|||||||
@@ -216,3 +216,16 @@ export async function getCmsArticleByCode(code: string) {
|
|||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.message));
|
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,6 +1,7 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
import type { CmsNavigation, CmsNavigationParam } from './model';
|
import type { CmsNavigation, CmsNavigationParam } from './model';
|
||||||
|
import type {CmsArticle} from "@/api/cms/cmsArticle/model";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询网站导航记录表
|
* 分页查询网站导航记录表
|
||||||
@@ -122,4 +123,15 @@ export async function getNavigationByPath(params: CmsNavigationParam) {
|
|||||||
return Promise.reject(new Error(res.message));
|
return Promise.reject(new Error(res.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据code查询导航
|
||||||
|
*/
|
||||||
|
export async function getByCode(code: string) {
|
||||||
|
const res = await request.get<ApiResult<CmsArticle>>(
|
||||||
|
'/cms/cms-navigation/getByCode/' + code
|
||||||
|
);
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.message));
|
||||||
|
}
|
||||||
|
|||||||
@@ -113,5 +113,7 @@ export interface CmsNavigationParam extends PageParam {
|
|||||||
parentId?: number;
|
parentId?: number;
|
||||||
hide?: number;
|
hide?: number;
|
||||||
model?: string;
|
model?: string;
|
||||||
|
home?: number;
|
||||||
|
position?: number;
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ export interface Config {
|
|||||||
siteName?: string;
|
siteName?: string;
|
||||||
siteLogo?: string;
|
siteLogo?: string;
|
||||||
domain?: string;
|
domain?: string;
|
||||||
apiUrl?: string;
|
|
||||||
icpNo?: string;
|
icpNo?: string;
|
||||||
copyright?: string;
|
copyright?: string;
|
||||||
loginBgImg?: string;
|
loginBgImg?: string;
|
||||||
@@ -58,4 +57,7 @@ export interface Config {
|
|||||||
sysLogo?: string;
|
sysLogo?: string;
|
||||||
vipText?: string;
|
vipText?: string;
|
||||||
vipComments?: string;
|
vipComments?: string;
|
||||||
|
deliveryText?: string;
|
||||||
|
guaranteeText?: string;
|
||||||
|
openComments?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -78,11 +78,7 @@ function App(props: { children: any; }) {
|
|||||||
|
|
||||||
// 显示邀请提示
|
// 显示邀请提示
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Taro.showToast({
|
console.log(`检测到邀请信息 ID:${inviteParams.inviter}`)
|
||||||
title: `检测到邀请信息 ID:${inviteParams.inviter}`,
|
|
||||||
icon: 'success',
|
|
||||||
duration: 3000
|
|
||||||
})
|
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,69 +1,208 @@
|
|||||||
import {useEffect, useState, useRef} from "react";
|
import {useEffect, useState, useRef} from "react";
|
||||||
import {Loading, CellGroup, Input, Form, Radio, InputNumber, TextArea, ConfigProvider} from '@nutui/nutui-react-taro'
|
import {Loading, CellGroup, Input, Form, Avatar, Button, Space} from '@nutui/nutui-react-taro'
|
||||||
import {Edit} from '@nutui/icons-react-taro'
|
import {Edit} from '@nutui/icons-react-taro'
|
||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
import {Image} from '@tarojs/components';
|
import {View} from '@tarojs/components'
|
||||||
import FixedButton from "@/components/FixedButton";
|
import FixedButton from "@/components/FixedButton";
|
||||||
import {DictData} from "@/api/system/dict-data/model";
|
|
||||||
import {listDictData} from "@/api/system/dict-data";
|
|
||||||
import {addShopUser, getShopUser} from "@/api/shop/shopUser";
|
|
||||||
import {ShopUser} from "@/api/shop/shopUser/model";
|
|
||||||
import {uploadFile} from "@/api/system/file";
|
|
||||||
import {useUser} from "@/hooks/useUser";
|
import {useUser} from "@/hooks/useUser";
|
||||||
|
import {TenantId} from "@/config/app";
|
||||||
|
import {updateUser} from "@/api/system/user";
|
||||||
|
import {User} from "@/api/system/user/model";
|
||||||
|
import {getStoredInviteParams, handleInviteRelation} from "@/utils/invite";
|
||||||
|
import {addShopDealerUser} from "@/api/shop/shopDealerUser";
|
||||||
|
import {listUserRole, updateUserRole} from "@/api/system/userRole";
|
||||||
|
|
||||||
const customTheme = {
|
// 类型定义
|
||||||
nutuiInputnumberButtonWidth: '30px',
|
interface ChooseAvatarEvent {
|
||||||
nutuiInputnumberButtonHeight: '30px',
|
detail: {
|
||||||
nutuiInputnumberButtonBorderRadius: '2px',
|
avatarUrl: string;
|
||||||
nutuiInputnumberButtonBackgroundColor: `#f4f4f4`,
|
};
|
||||||
nutuiInputnumberInputHeight: '30px',
|
|
||||||
nutuiInputnumberInputMargin: '0 2px',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const AddApply = () => {
|
interface InputEvent {
|
||||||
const {user} = useUser()
|
detail: {
|
||||||
|
value: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const AddDoctor = () => {
|
||||||
|
const {user, loginUser} = useUser()
|
||||||
const [loading, setLoading] = useState<boolean>(true)
|
const [loading, setLoading] = useState<boolean>(true)
|
||||||
const [FormData, setFormData] = useState<ShopUser>()
|
const [FormData, setFormData] = useState<User>()
|
||||||
const [userType, setUserType] = useState<DictData[]>()
|
|
||||||
const formRef = useRef<any>(null)
|
const formRef = useRef<any>(null)
|
||||||
|
|
||||||
const reload = async () => {
|
const reload = async () => {
|
||||||
const userId = Taro.getStorageSync('UserId')
|
const inviteParams = getStoredInviteParams()
|
||||||
if(!userId || userId == '') return
|
if (inviteParams?.inviter) {
|
||||||
const shopUser = await getShopUser(Number(Taro.getStorageSync('UserId')))
|
|
||||||
if(shopUser){
|
|
||||||
console.log(shopUser.type,'shopUsershopUsershopUsershopUsershopUsershopUsershopUser')
|
|
||||||
setFormData({
|
setFormData({
|
||||||
...shopUser,
|
...user,
|
||||||
type : Number(shopUser.type)
|
refereeId: Number(inviteParams.inviter),
|
||||||
|
// 清空昵称,强制用户手动输入
|
||||||
|
nickname: '',
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 如果没有邀请参数,也要确保昵称为空
|
||||||
|
setFormData({
|
||||||
|
...user,
|
||||||
|
nickname: '',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const userType = await listDictData({dictCode: 'UserType'})
|
|
||||||
if(userType){
|
|
||||||
setUserType(userType)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const uploadAvatar = ({detail}: ChooseAvatarEvent) => {
|
||||||
|
// 先更新本地显示的头像(临时显示)
|
||||||
|
const tempFormData = {
|
||||||
|
...FormData,
|
||||||
|
avatar: `${detail.avatarUrl}`,
|
||||||
|
}
|
||||||
|
setFormData(tempFormData)
|
||||||
|
|
||||||
|
Taro.uploadFile({
|
||||||
|
url: 'https://server.websoft.top/api/oss/upload',
|
||||||
|
filePath: detail.avatarUrl,
|
||||||
|
name: 'file',
|
||||||
|
header: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
TenantId
|
||||||
|
},
|
||||||
|
success: async (res) => {
|
||||||
|
const data = JSON.parse(res.data);
|
||||||
|
if (data.code === 0) {
|
||||||
|
const finalAvatarUrl = `${data.data.thumbnail}`
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 使用 useUser hook 的 updateUser 方法更新头像
|
||||||
|
await updateUser({
|
||||||
|
avatar: finalAvatarUrl
|
||||||
|
})
|
||||||
|
|
||||||
|
Taro.showToast({
|
||||||
|
title: '头像上传成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 1500
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.error('更新用户头像失败:', error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 无论用户信息更新是否成功,都要更新本地FormData
|
||||||
|
const finalFormData = {
|
||||||
|
...tempFormData,
|
||||||
|
avatar: finalAvatarUrl
|
||||||
|
}
|
||||||
|
setFormData(finalFormData)
|
||||||
|
|
||||||
|
// 同步更新表单字段
|
||||||
|
if (formRef.current) {
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
avatar: finalAvatarUrl
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 上传失败,恢复原来的头像
|
||||||
|
setFormData({
|
||||||
|
...FormData,
|
||||||
|
avatar: user?.avatar || ''
|
||||||
|
})
|
||||||
|
Taro.showToast({
|
||||||
|
title: '上传失败',
|
||||||
|
icon: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('上传头像失败:', error)
|
||||||
|
Taro.showToast({
|
||||||
|
title: '上传失败',
|
||||||
|
icon: 'error'
|
||||||
|
})
|
||||||
|
// 恢复原来的头像
|
||||||
|
setFormData({
|
||||||
|
...FormData,
|
||||||
|
avatar: user?.avatar || ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提交表单
|
// 提交表单
|
||||||
const submitSucceed = async (values: any) => {
|
const submitSucceed = async (values: any) => {
|
||||||
if (!FormData?.age || FormData?.age == 0) {
|
try {
|
||||||
|
// 验证必填字段
|
||||||
|
if (!values.phone && !FormData?.phone) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: `请填写年龄`,
|
title: '请先获取手机号',
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
|
// 验证昵称:必须填写且不能是默认的微信昵称
|
||||||
|
const nickname = values.realName || FormData?.nickname || '';
|
||||||
|
if (!nickname || nickname.trim() === '') {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写昵称',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否为默认的微信昵称(常见的默认昵称)
|
||||||
|
const defaultNicknames = ['微信用户', 'WeChat User', '微信昵称'];
|
||||||
|
if (defaultNicknames.includes(nickname.trim())) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请填写真实昵称,不能使用默认昵称',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证昵称长度
|
||||||
|
if (nickname.trim().length < 2) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '昵称至少需要2个字符',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!values.avatar && !FormData?.avatar) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请上传头像',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log(values,FormData)
|
||||||
|
|
||||||
|
const roles = await listUserRole({userId: user?.userId})
|
||||||
|
console.log(roles, 'roles...')
|
||||||
|
|
||||||
// 准备提交的数据
|
// 准备提交的数据
|
||||||
await addShopUser({
|
await updateUser({
|
||||||
userId: Taro.getStorageSync('UserId'),
|
userId: user?.userId,
|
||||||
type: values.type,
|
nickname: values.realName || FormData?.nickname,
|
||||||
username: user?.username,
|
phone: values.phone || FormData?.phone,
|
||||||
nickname: user?.nickname,
|
avatar: values.avatar || FormData?.avatar,
|
||||||
|
refereeId: values.refereeId || FormData?.refereeId
|
||||||
|
});
|
||||||
|
|
||||||
|
await addShopDealerUser({
|
||||||
|
userId: user?.userId,
|
||||||
realName: values.realName || FormData?.nickname,
|
realName: values.realName || FormData?.nickname,
|
||||||
phone: values.phone || FormData?.phone
|
mobile: values.phone || FormData?.phone,
|
||||||
|
refereeId: values.refereeId || FormData?.refereeId
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (roles.length > 0) {
|
||||||
|
await updateUserRole({
|
||||||
|
...roles[0],
|
||||||
|
roleId: 1848
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: `注册成功`,
|
title: `注册成功`,
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
@@ -78,6 +217,127 @@ const AddApply = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取微信昵称
|
||||||
|
const getWxNickname = (nickname: string) => {
|
||||||
|
// 更新表单数据
|
||||||
|
const updatedFormData = {
|
||||||
|
...FormData,
|
||||||
|
nickname: nickname
|
||||||
|
}
|
||||||
|
setFormData(updatedFormData);
|
||||||
|
|
||||||
|
// 同步更新表单字段
|
||||||
|
if (formRef.current) {
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
realName: nickname
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 获取用户手机号 */
|
||||||
|
const handleGetPhoneNumber = ({detail}: { detail: { code?: string, encryptedData?: string, iv?: string } }) => {
|
||||||
|
const {code, encryptedData, iv} = detail
|
||||||
|
Taro.login({
|
||||||
|
success: (loginRes) => {
|
||||||
|
if (code) {
|
||||||
|
Taro.request({
|
||||||
|
url: 'https://server.websoft.top/api/wx-login/loginByMpWxPhone',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
authCode: loginRes.code,
|
||||||
|
code,
|
||||||
|
encryptedData,
|
||||||
|
iv,
|
||||||
|
notVerifyPhone: true,
|
||||||
|
refereeId: 0,
|
||||||
|
sceneType: 'save_referee',
|
||||||
|
tenantId: TenantId
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
TenantId
|
||||||
|
},
|
||||||
|
success: async function (res) {
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: res.data.message,
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 登录成功
|
||||||
|
const token = res.data.data.access_token;
|
||||||
|
const userData = res.data.data.user;
|
||||||
|
console.log(userData, 'userData...')
|
||||||
|
// 使用useUser Hook的loginUser方法更新状态
|
||||||
|
loginUser(token, userData);
|
||||||
|
|
||||||
|
if (userData.phone) {
|
||||||
|
console.log('手机号已获取', userData.phone)
|
||||||
|
const updatedFormData = {
|
||||||
|
...FormData,
|
||||||
|
phone: userData.phone,
|
||||||
|
// 不自动填充微信昵称,保持用户已输入的昵称
|
||||||
|
nickname: FormData?.nickname || '',
|
||||||
|
// 只在没有头像时才使用微信头像
|
||||||
|
avatar: FormData?.avatar || userData.avatar
|
||||||
|
}
|
||||||
|
setFormData(updatedFormData)
|
||||||
|
|
||||||
|
// 更新表单字段值
|
||||||
|
if (formRef.current) {
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
phone: userData.phone,
|
||||||
|
// 不覆盖用户已输入的昵称
|
||||||
|
realName: FormData?.nickname || '',
|
||||||
|
avatar: FormData?.avatar || userData.avatar
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Taro.showToast({
|
||||||
|
title: '手机号获取成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 1500
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 处理邀请关系
|
||||||
|
if (userData?.userId) {
|
||||||
|
try {
|
||||||
|
const inviteSuccess = await handleInviteRelation(userData.userId)
|
||||||
|
if (inviteSuccess) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '邀请关系建立成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('处理邀请关系失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示登录成功提示
|
||||||
|
// Taro.showToast({
|
||||||
|
// title: '注册成功',
|
||||||
|
// icon: 'success',
|
||||||
|
// duration: 1500
|
||||||
|
// })
|
||||||
|
|
||||||
|
// 不需要重新启动小程序,状态已经通过useUser更新
|
||||||
|
// 可以选择性地刷新当前页面数据
|
||||||
|
// await reload();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('登录失败!')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 处理固定按钮点击事件
|
// 处理固定按钮点击事件
|
||||||
const handleFixedButtonClick = () => {
|
const handleFixedButtonClick = () => {
|
||||||
// 触发表单提交
|
// 触发表单提交
|
||||||
@@ -88,25 +348,17 @@ const AddApply = () => {
|
|||||||
console.log(error, 'err...')
|
console.log(error, 'err...')
|
||||||
}
|
}
|
||||||
|
|
||||||
const uploadImg1 = () => {
|
|
||||||
uploadFile().then(data => {
|
|
||||||
setFormData({
|
|
||||||
...FormData,
|
|
||||||
uploadImg1: data.url
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
reload().then(() => {
|
reload().then(() => {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
})
|
})
|
||||||
}, []); // 依赖用户ID,当用户变化时重新加载
|
}, [user?.userId]); // 依赖用户ID,当用户变化时重新加载
|
||||||
|
|
||||||
// 当FormData变化时,同步更新表单字段值
|
// 当FormData变化时,同步更新表单字段值
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (formRef.current && FormData) {
|
if (formRef.current && FormData) {
|
||||||
formRef.current.setFieldsValue({
|
formRef.current.setFieldsValue({
|
||||||
|
refereeId: FormData.refereeId,
|
||||||
phone: FormData.phone,
|
phone: FormData.phone,
|
||||||
avatar: FormData.avatar,
|
avatar: FormData.avatar,
|
||||||
realName: FormData.nickname
|
realName: FormData.nickname
|
||||||
@@ -128,106 +380,42 @@ const AddApply = () => {
|
|||||||
onFinish={(values) => submitSucceed(values)}
|
onFinish={(values) => submitSucceed(values)}
|
||||||
onFinishFailed={(errors) => submitFailed(errors)}
|
onFinishFailed={(errors) => submitFailed(errors)}
|
||||||
>
|
>
|
||||||
|
<View className={'bg-gray-100 h-3'}></View>
|
||||||
<CellGroup style={{padding: '4px 0'}}>
|
<CellGroup style={{padding: '4px 0'}}>
|
||||||
{JSON.stringify(FormData)}
|
<Form.Item name="refereeId" label="邀请人ID" initialValue={FormData?.refereeId} required>
|
||||||
<Form.Item label="用户类型" name="type" initialValue={FormData?.type} required>
|
<Input placeholder="邀请人ID" disabled={true}/>
|
||||||
<Radio.Group
|
|
||||||
defaultValue="0"
|
|
||||||
direction="horizontal"
|
|
||||||
value={FormData?.type}
|
|
||||||
onChange={(value: any) => {
|
|
||||||
setFormData({
|
|
||||||
...FormData,
|
|
||||||
type: value
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{userType?.map((item) => (
|
|
||||||
<Radio key={item.value} value={item.value}>
|
|
||||||
{item.label}
|
|
||||||
</Radio>
|
|
||||||
))}
|
|
||||||
</Radio.Group>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="姓名" name="realName" required>
|
<Form.Item name="phone" label="手机号" initialValue={FormData?.phone} required>
|
||||||
|
<View className="flex items-center justify-between">
|
||||||
<Input
|
<Input
|
||||||
placeholder={'请填写真实姓名'}
|
placeholder="请填写手机号"
|
||||||
value={FormData?.realName || ''}
|
disabled={true}
|
||||||
onChange={(value) => {
|
maxLength={11}
|
||||||
setFormData({
|
value={FormData?.phone || ''}
|
||||||
...FormData,
|
|
||||||
realName: value
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
|
<Button style={{color: '#ffffff'}} open-type="getPhoneNumber" onGetPhoneNumber={handleGetPhoneNumber}>
|
||||||
|
<Space>
|
||||||
|
<Button size="small">点击获取</Button>
|
||||||
|
</Space>
|
||||||
|
</Button>
|
||||||
|
</View>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="性别" name="sex" required>
|
{
|
||||||
<Radio.Group
|
FormData?.phone && <Form.Item name="avatar" label="头像" initialValue={FormData?.avatar} required>
|
||||||
direction="horizontal"
|
<Button open-type="chooseAvatar" style={{height: '58px'}} onChooseAvatar={uploadAvatar}>
|
||||||
value={FormData?.sex || "0"}
|
<Avatar src={FormData?.avatar || user?.avatar} size="54"/>
|
||||||
>
|
</Button>
|
||||||
<Radio value="1">
|
|
||||||
男
|
|
||||||
</Radio>
|
|
||||||
<Radio value="2">
|
|
||||||
女
|
|
||||||
</Radio>
|
|
||||||
</Radio.Group>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="年龄" name="age" initialValue={FormData?.age} required>
|
}
|
||||||
<ConfigProvider theme={customTheme}>
|
<Form.Item name="realName" label="昵称" initialValue="" required>
|
||||||
<InputNumber
|
|
||||||
value={FormData?.age}
|
|
||||||
onChange={(value) => {
|
|
||||||
setFormData({
|
|
||||||
...FormData,
|
|
||||||
age: Number(value)
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
min={0}
|
|
||||||
max={120}
|
|
||||||
step={1}
|
|
||||||
/>
|
|
||||||
</ConfigProvider>
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label={FormData?.type == 1 ? '医生简介' : '个人简介'} name="introduction">
|
|
||||||
<TextArea
|
|
||||||
style={{
|
|
||||||
height: '50px',
|
|
||||||
backgroundColor: '#fafafa',
|
|
||||||
padding: '10px',
|
|
||||||
}}
|
|
||||||
value={FormData?.introduction || ''}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
{FormData?.type == 1 && (
|
|
||||||
<>
|
|
||||||
<Form.Item label="证书编号" name="userCode" required>
|
|
||||||
<Input
|
<Input
|
||||||
placeholder={'请填证书编号'}
|
type="nickname"
|
||||||
value={FormData?.userCode || ''}
|
className="info-content__input"
|
||||||
onChange={(value) => {
|
placeholder="请获取微信昵称"
|
||||||
setFormData({
|
value={FormData?.nickname || ''}
|
||||||
...FormData,
|
onInput={(e: InputEvent) => getWxNickname(e.detail.value)}
|
||||||
idCard: value
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
|
||||||
label={'上传证件'}
|
|
||||||
name="uploadImg1"
|
|
||||||
required
|
|
||||||
rules={[{message: '请上传医师资格证书'}
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<div onClick={uploadImg1}>
|
|
||||||
<Image src={FormData.uploadImg1 || ''} mode={'scaleToFill'} lazyLoad={false} />
|
|
||||||
</div>
|
|
||||||
</Form.Item>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
</CellGroup>
|
</CellGroup>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
||||||
@@ -242,4 +430,4 @@ const AddApply = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AddApply;
|
export default AddDoctor;
|
||||||
|
|||||||
@@ -58,18 +58,18 @@ const DealerIndex: React.FC = () => {
|
|||||||
|
|
||||||
console.log(getGradientBackground(),'getGradientBackground()')
|
console.log(getGradientBackground(),'getGradientBackground()')
|
||||||
|
|
||||||
if (error) {
|
// if (error) {
|
||||||
return (
|
// return (
|
||||||
<View className="p-4">
|
// <View className="p-4">
|
||||||
<View className="bg-red-50 border border-red-200 rounded-lg p-4 mb-4">
|
// <View className="bg-red-50 border border-red-200 rounded-lg p-4 mb-4">
|
||||||
<Text className="text-red-600">{error}</Text>
|
// <Text className="text-red-600">{error}</Text>
|
||||||
</View>
|
// </View>
|
||||||
<Button type="primary" onClick={refresh}>
|
// <Button type="primary" onClick={refresh}>
|
||||||
重试
|
// 重试
|
||||||
</Button>
|
// </Button>
|
||||||
</View>
|
// </View>
|
||||||
)
|
// )
|
||||||
}
|
// }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className="bg-gray-100 min-h-screen">
|
<View className="bg-gray-100 min-h-screen">
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ export const useConfig = () => {
|
|||||||
configWebsiteField().then(data => {
|
configWebsiteField().then(data => {
|
||||||
setConfig(data);
|
setConfig(data);
|
||||||
Taro.setStorageSync('config', data);
|
Taro.setStorageSync('config', data);
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
setError(err instanceof Error ? err : new Error('获取配置失败'));
|
setError(err instanceof Error ? err : new Error('获取配置失败'));
|
||||||
|
|||||||
@@ -23,8 +23,9 @@ function Category() {
|
|||||||
const initData = async () => {
|
const initData = async () => {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
|
const home = await listCmsNavigation({home: 1})
|
||||||
// 获取商品分类
|
// 获取商品分类
|
||||||
const categoryList = await listCmsNavigation({ model: 'goods' })
|
const categoryList = await listCmsNavigation({ parentId: home[0].navigationId || 0, position: 1 })
|
||||||
|
|
||||||
if (!categoryList || categoryList.length === 0) {
|
if (!categoryList || categoryList.length === 0) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
|
|||||||
@@ -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'}>
|
<View className={'py-3'} style={{paddingTop: '0'}}>
|
||||||
<div className={'flex flex-col justify-between items-center rounded-lg px-2'}>
|
<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'}>
|
<View key={index} className={'goods-waterfall-item bg-white'} style={{
|
||||||
<Image src={item.image} mode={'aspectFit'} lazyLoad={false}
|
borderRadius: '0 0 6px 6px'
|
||||||
radius="10px 10px 0 0" height="180"
|
}}>
|
||||||
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}/>
|
<View className={'goods-card'}>
|
||||||
<div className={'flex flex-col p-2 rounded-lg'}>
|
<Image
|
||||||
<div>
|
src={item.image}
|
||||||
<div className={'car-no text-sm'}>{item.name}</div>
|
lazyLoad={false}
|
||||||
<div className={'flex justify-between text-xs py-1'}>
|
style={{
|
||||||
<span className={'text-orange-500'}>{item.comments}</span>
|
borderRadius: '6px 6px 0 0',
|
||||||
<span className={'text-gray-400'}>已售 {item.sales}</span>
|
height: '180px'
|
||||||
</div>
|
}}
|
||||||
<div className={'flex justify-between items-center py-2'}>
|
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}
|
||||||
<div className={'flex text-red-500 text-xl items-baseline'}>
|
/>
|
||||||
<span className={'text-xs'}>¥</span>
|
<View className={'goods-info p-2 flex flex-col'}>
|
||||||
<span className={'font-bold text-2xl'}>{item.price}</span>
|
<View className={'goods-title text-sm font-bold'}>{item.name}</View>
|
||||||
</div>
|
<View className={'goods-meta'}>
|
||||||
<div className={'buy-btn'}>
|
<Text className={'goods-comments text-gray-400 text-xs'}>{item.comments}</Text>
|
||||||
<div className={'cart-icon'}>
|
</View>
|
||||||
<Share size={20} className={'mx-4 mt-2'}
|
<View className={'goods-price-section flex justify-between'}>
|
||||||
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}/>
|
<View className={'goods-price'}>
|
||||||
</div>
|
<Text className={'price-unit text-orange-600 font-bold text-lg'}>¥</Text>
|
||||||
<div className={'text-white pl-4 pr-5'}
|
<Text className={'price-number text-orange-600 font-bold text-lg'}>{item.price}</Text>
|
||||||
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}>购买
|
</View>
|
||||||
</div>
|
<View className={'goods-actions'}>
|
||||||
</div>
|
<Text className={'goods-sales text-gray-400 text-xs'}>已售 {item.sales}</Text>
|
||||||
</div>
|
</View>
|
||||||
</div>
|
</View>
|
||||||
</div>
|
</View>
|
||||||
</div>
|
</View>
|
||||||
|
</View>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</View>
|
||||||
</div>
|
</View>
|
||||||
|
</View>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -342,7 +342,9 @@ const GoodsDetail = () => {
|
|||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
<View className={'w-full'}>
|
<View className={'w-full'}>
|
||||||
|
<View className={'p-4 bg-white leading-7 '}>
|
||||||
<RichText nodes={goods.content || '内容详情'}/>
|
<RichText nodes={goods.content || '内容详情'}/>
|
||||||
|
</View>
|
||||||
<View className={'h-24'}></View>
|
<View className={'h-24'}></View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
@@ -361,11 +363,11 @@ const GoodsDetail = () => {
|
|||||||
</View>
|
</View>
|
||||||
</Popup>
|
</Popup>
|
||||||
{/*底部购买按钮*/}
|
{/*底部购买按钮*/}
|
||||||
<View className={'fixed bg-white w-full bottom-0 left-0 pt-4 pb-8'}>
|
<View className={'fixed bg-white w-full bottom-0 left-0 pt-4 pb-6'}>
|
||||||
<View className={'btn-bar flex justify-between items-center'}>
|
<View className={'btn-bar flex justify-between items-center'}>
|
||||||
<View className={'flex justify-center items-center mx-4'}>
|
<View className={'flex justify-center items-center mx-4'}>
|
||||||
<button open-type="contact" className={'flex items-center'}>
|
<button open-type="contact" className={'flex items-center text-sm py-2'}>
|
||||||
<Headphones size={18} style={{marginRight: '4px'}}/>咨询
|
<Headphones size={16} style={{marginRight: '4px'}}/>咨询
|
||||||
</button>
|
</button>
|
||||||
</View>
|
</View>
|
||||||
<View className={'buy-btn mx-4'}>
|
<View className={'buy-btn mx-4'}>
|
||||||
|
|||||||
Reference in New Issue
Block a user