diff --git a/src/app.config.ts b/src/app.config.ts index bcf1ed9..d4cbc25 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -3,7 +3,8 @@ export default defineAppConfig({ 'pages/index/index', 'pages/order/order', 'pages/kefu/kefu', - 'pages/user/user' + 'pages/user/user', + 'pages/article/article' ], "subpackages": [ { @@ -70,38 +71,38 @@ export default defineAppConfig({ navigationBarTitleText: 'WeChat', navigationBarTextStyle: 'black' }, - // tabBar: { - // custom: false, - // color: "#8a8a8a", - // selectedColor: "#9a23d4", - // backgroundColor: "#ffffff", - // list: [ - // { - // pagePath: "pages/index/index", - // iconPath: "assets/tabbar/home.png", - // selectedIconPath: "assets/tabbar/home-active.png", - // text: "寄件", - // }, - // { - // pagePath: "pages/order/order", - // iconPath: "assets/tabbar/order.png", - // selectedIconPath: "assets/tabbar/order-active.png", - // text: "查件", - // }, + tabBar: { + custom: false, + color: "#8a8a8a", + selectedColor: "#9a23d4", + backgroundColor: "#ffffff", + list: [ + { + pagePath: "pages/index/index", + iconPath: "assets/tabbar/home.png", + selectedIconPath: "assets/tabbar/home-active.png", + text: "首页", + }, + { + pagePath: "pages/article/article", + iconPath: "assets/tabbar/order.png", + selectedIconPath: "assets/tabbar/order-active.png", + text: "学习", + }, // { // pagePath: "pages/kefu/kefu", // iconPath: "assets/tabbar/kefu.png", // selectedIconPath: "assets/tabbar/kefu-active.png", // text: "客服", // }, - // { - // pagePath: "pages/user/user", - // iconPath: "assets/tabbar/user.png", - // selectedIconPath: "assets/tabbar/user-active.png", - // text: "我的", - // }, - // ], - // }, + { + pagePath: "pages/user/user", + iconPath: "assets/tabbar/user.png", + selectedIconPath: "assets/tabbar/user-active.png", + text: "我的", + }, + ], + }, requiredPrivateInfos: [ "getLocation", "chooseLocation" diff --git a/src/cms/help.config.ts b/src/cms/help.config.ts index 6606072..d74c9f2 100644 --- a/src/cms/help.config.ts +++ b/src/cms/help.config.ts @@ -1,3 +1,3 @@ export default definePageConfig({ - navigationBarTitleText: '帮助中心' + navigationBarTitleText: '文章详情' }) diff --git a/src/hjm/query.tsx b/src/hjm/query.tsx index 4af04b4..3391d49 100644 --- a/src/hjm/query.tsx +++ b/src/hjm/query.tsx @@ -4,6 +4,7 @@ import {getHjmCar, pageHjmCar} from "@/api/hjm/hjmCar"; import {HjmCar} from "@/api/hjm/hjmCar/model"; import {Image,Cell} from '@nutui/nutui-react-taro' import './location.scss' +import {copyText} from "@/utils/common"; /** * 文章终极列表 @@ -86,7 +87,7 @@ const Query = () => {
- + copyText(`${item?.code}`)}> 车辆编号:{item?.code} diff --git a/src/pages/article/article.config.ts b/src/pages/article/article.config.ts new file mode 100644 index 0000000..f4b4cdf --- /dev/null +++ b/src/pages/article/article.config.ts @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '学习' +}) diff --git a/src/pages/article/article.tsx b/src/pages/article/article.tsx new file mode 100644 index 0000000..913112e --- /dev/null +++ b/src/pages/article/article.tsx @@ -0,0 +1,50 @@ +import {useEffect, useState} from "react"; +import {ArrowRight} from '@nutui/icons-react-taro' +import {pageCmsArticle} from "@/api/cms/cmsArticle"; +import {CmsArticle} from "@/api/cms/cmsArticle/model"; +import Taro from '@tarojs/taro' + +/** + * 文章终极列表 + * @constructor + */ +const Article = () => { + // const {params} = useRouter(); + // const [categoryId, setCategoryId] = useState(3494) + const [list, setList] = useState([]) + + const reload = () => { + // if (params.id) { + // setCategoryId(Number(params.id)) + // } + pageCmsArticle({}).then(res => { + if (res?.list) { + setList(res?.list) + } + }) + } + + useEffect(() => { + reload() + }, []) + + return ( +
+
+
+ { + list.map((item, index) => { + return ( +
Taro.navigateTo({url: `/cms/help?id=${item.articleId}`}) }> +
{item.title}
+ +
+ ) + }) + } +
+
+
+ ) +} +export default Article diff --git a/src/pages/index/Header.tsx b/src/pages/index/Header.tsx index c362449..1d5dcef 100644 --- a/src/pages/index/Header.tsx +++ b/src/pages/index/Header.tsx @@ -42,7 +42,6 @@ const Header = (props: any) => {
} > - 首页 { + setMarkers([]) pageHjmCar({keywords}).then(res => { setList(res?.list || []) if (res?.list && res?.list.length > 0) { - // const data = res?.list[0]; - // setLongitude(data?.longitude) - // setLatitude(data?.latitude) + setScale(16) + const data = res?.list[0]; + setLongitude(data?.longitude) + setLatitude(data?.latitude) + setMarkers([{ + id: data.id, + latitude: data.latitude, + longitude: data.longitude, + title: `${data.organization}`, + name: `${data.organization}` + }]) } }) }; useEffect(() => { - Taro.hideTabBar() + // Taro.hideTabBar() setScale(14) getLocation().then() // 获取站点信息