diff --git a/src/api/cms/cmsWebsiteField/model/index.ts b/src/api/cms/cmsWebsiteField/model/index.ts index 4863d36..222f79f 100644 --- a/src/api/cms/cmsWebsiteField/model/index.ts +++ b/src/api/cms/cmsWebsiteField/model/index.ts @@ -43,6 +43,7 @@ export interface Config { siteName?: string; siteLogo?: string; domain?: string; + apiUrl?: string; icpNo?: string; copyright?: string; loginBgImg?: string; diff --git a/src/api/system/dict/index.ts b/src/api/system/dict/index.ts index 0076c39..a017f6a 100644 --- a/src/api/system/dict/index.ts +++ b/src/api/system/dict/index.ts @@ -9,9 +9,7 @@ import {SERVER_API_URL} from "@/utils/server"; export async function listDictionaries(params?: DictParam) { const res = await request.get>( SERVER_API_URL + '/system/dict', - { - params - } + params ); if (res.code === 0) { return res.data; diff --git a/src/app.config.ts b/src/app.config.ts index 5e83456..ae304e4 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -4,7 +4,7 @@ export default { 'pages/cart/cart', 'pages/find/find', 'pages/user/user', - 'pages/cms/category/index' + 'pages/category/category' ], "subpackages": [ { @@ -126,6 +126,12 @@ export default { selectedIconPath: "assets/tabbar/home-active.png", text: "首页", }, + { + pagePath: "pages/category/category", + iconPath: "assets/tabbar/category.png", + selectedIconPath: "assets/tabbar/category-active.png", + text: "分类", + }, { pagePath: "pages/cart/cart", iconPath: "assets/tabbar/cart.png", diff --git a/src/app.ts b/src/app.ts index 41fd67b..94746fc 100644 --- a/src/app.ts +++ b/src/app.ts @@ -6,10 +6,12 @@ import './app.scss' import {loginByOpenId} from "@/api/layout"; import {TenantId} from "@/config/app"; import {saveStorageByLoginUser} from "@/utils/server"; -import {parseInviteParams, saveInviteParams, trackInviteSource, handleInviteRelation, debugInviteInfo} from "@/utils/invite"; -import {configWebsiteField} from "@/api/cms/cmsWebsiteField"; +import {parseInviteParams, saveInviteParams, trackInviteSource, handleInviteRelation} from "@/utils/invite"; +import { useConfig } from "@/hooks/useConfig"; // 引入新的自定义Hook function App(props: { children: any; }) { + const { refetch: handleTheme } = useConfig(); // 使用新的Hook + const reload = () => { Taro.login({ success: (res) => { @@ -38,6 +40,8 @@ function App(props: { children: any; }) { }; // 可以使用所有的 React Hooks useEffect(() => { + // 设置主题 (现在由useConfig Hook处理) + handleTheme() // Taro.getSetting:获取用户的当前设置。返回值中只会出现小程序已经向用户请求过的权限。 Taro.getSetting({ success: (res) => { @@ -53,13 +57,12 @@ function App(props: { children: any; }) { // 处理小程序启动参数中的邀请信息 const options = Taro.getLaunchOptionsSync() handleLaunchOptions(options) - handleTheme() }) // 处理启动参数 const handleLaunchOptions = (options: any) => { try { - console.log('=== 小程序启动参数处理开始 ===') + console.log('=== 小程 序启动参数处理开始 ===') console.log('完整启动参数:', JSON.stringify(options, null, 2)) // 解析邀请参数 @@ -82,10 +85,6 @@ function App(props: { children: any; }) { }) }, 1000) - // 打印调试信息 - setTimeout(() => { - debugInviteInfo() - }, 2000) } else { console.log('❌ 未检测到邀请参数') } @@ -96,15 +95,6 @@ function App(props: { children: any; }) { } } - const handleTheme = () => { - configWebsiteField().then(data => { - // 设置主题 - if(data.theme && !Taro.getStorageSync('user_theme')){ - Taro.setStorageSync('user_theme', data.theme) - } - }) - } - // 对应 onHide useDidHide(() => { }) @@ -112,4 +102,4 @@ function App(props: { children: any; }) { return props.children } -export default App +export default App \ No newline at end of file diff --git a/src/assets/tabbar/category-active.png b/src/assets/tabbar/category-active.png new file mode 100644 index 0000000..eebe3d5 Binary files /dev/null and b/src/assets/tabbar/category-active.png differ diff --git a/src/assets/tabbar/category.png b/src/assets/tabbar/category.png new file mode 100644 index 0000000..1f955de Binary files /dev/null and b/src/assets/tabbar/category.png differ diff --git a/src/cms/category/components/ArticleList.tsx b/src/cms/category/components/ArticleList.tsx index 3f46857..ffe5d29 100644 --- a/src/cms/category/components/ArticleList.tsx +++ b/src/cms/category/components/ArticleList.tsx @@ -1,15 +1,25 @@ import {Image, Cell} from '@nutui/nutui-react-taro' +import {View, Text} from '@tarojs/components' import Taro from '@tarojs/taro' const ArticleList = (props: any) => { return ( <> -
- {props.data.map((item, index) => { + + {props.data.map((item: any, index: number) => { return ( + {item.title} + {item.comments && ( + + {item.comments} + + )} + + } extra={ } @@ -18,7 +28,7 @@ const ArticleList = (props: any) => { /> ) })} -
+ ) } diff --git a/src/doctor/apply/add.config.ts b/src/doctor/apply/add.config.ts index ac37521..4748cd8 100644 --- a/src/doctor/apply/add.config.ts +++ b/src/doctor/apply/add.config.ts @@ -1,4 +1,4 @@ export default definePageConfig({ - navigationBarTitleText: '邀请注册', + navigationBarTitleText: '会员注册', navigationBarTextStyle: 'black' }) diff --git a/src/doctor/apply/add.tsx b/src/doctor/apply/add.tsx index f862bf3..897bd9b 100644 --- a/src/doctor/apply/add.tsx +++ b/src/doctor/apply/add.tsx @@ -1,5 +1,5 @@ import {useEffect, useState, useRef} from "react"; -import {Loading, CellGroup, Input, Form, Avatar, Button, Space} from '@nutui/nutui-react-taro' +import {Loading, CellGroup, Input, Form, Avatar, Radio, Button, Space, InputNumber, TextArea, ConfigProvider} from '@nutui/nutui-react-taro' import {Edit} from '@nutui/icons-react-taro' import Taro from '@tarojs/taro' import {View} from '@tarojs/components' @@ -11,6 +11,8 @@ 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"; +import {DictData} from "@/api/system/dict-data/model"; +import {listDictData} from "@/api/system/dict-data"; // 类型定义 interface ChooseAvatarEvent { @@ -19,16 +21,20 @@ interface ChooseAvatarEvent { }; } -interface InputEvent { - detail: { - value: string; - }; +const customTheme = { + nutuiInputnumberButtonWidth: '30px', + nutuiInputnumberButtonHeight: '30px', + nutuiInputnumberButtonBorderRadius: '2px', + nutuiInputnumberButtonBackgroundColor: `#f4f4f4`, + nutuiInputnumberInputHeight: '30px', + nutuiInputnumberInputMargin: '0 2px', } const AddUserAddress = () => { const {user, loginUser} = useUser() const [loading, setLoading] = useState(true) const [FormData, setFormData] = useState() + const [userType, setUserType] = useState() const formRef = useRef(null) const reload = async () => { @@ -47,6 +53,9 @@ const AddUserAddress = () => { nickname: '', }) } + listDictData({dictCode: 'UserType'}).then((data) => { + setUserType(data) + }) } @@ -217,23 +226,6 @@ const AddUserAddress = () => { } } - // 获取微信昵称 - 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 @@ -382,9 +374,13 @@ const AddUserAddress = () => { > - - - + { + FormData?.phone && + + + } { - { - FormData?.phone && - - - } - - getWxNickname(e.detail.value)} + {FormData?.refereeId && } + + + + {FormData?.type} + + + {userType?.map((item) => ( + { + setFormData({ + ...FormData, + type: item.value + }) + }}> + {item.label} + + ))} + + + + + + 男 + + + 女 + + + + + + + + + + + + {FormData?.type == 1 && ( + +