富文本介绍

This commit is contained in:
eric
2022-11-21 13:19:24 +08:00
parent 04cbc3adbd
commit bd3d5652e9
9 changed files with 57 additions and 20 deletions

View File

@@ -106,13 +106,14 @@ const Home = () => {
// Toast.show(`onCancel`);
};
const getLocation = () => {
// 获取地理位置
const getLocation = async() => {
// 获取地理位置
Taro.getLocation({
type: "wgs84",
success: function (res) {
success: function (res: any) {
// 地理位置信息-经纬度
console.log('lbsres---',res)
console.log("lbsres---", res);
const latitude = res.latitude;
const longitude = res.longitude;
const speed = res.speed;
@@ -241,8 +242,8 @@ const Home = () => {
text="打卡"
className="iconStyle"
onClick={() => {
getLocation();
// chooseImage();
// getLocation();
chooseImage();
}}
/>
<GridItem

View File

@@ -6,6 +6,7 @@ import { getTable } from "../../utils/index";
const mountainPeak = () => {
const [dataSource, setdataSource] = useState<any>([]);
const [currentIndex, setcurrentIndex] = useState(0);
useEffect(() => {
// 设置标题
@@ -34,29 +35,38 @@ const mountainPeak = () => {
useEffect(() => {
let objParams = {
tableName: "cityNew",
id: "80516fb66370bcf300b8f43c5f4dd52b",
okFun: (res) => {
console.log("res", res);
tableName: "mountains",
// id: "80516fb66370bcf300b8f43c5f4dd52b",
okFun: (res: any) => {
console.log("res--", res);
setdataSource(res?.data ?? []);
},
};
// getTable(objParams)
getTable(objParams);
}, []);
return (
<View className={`peakContent`}>
{/* 边栏 */}
<Sidebar activeKey={0} className={`peak_Sidebar`}>
<SidebarItem title="梧桐山" className={`peak_Sidebar`}/>
<SidebarItem title="梧桐山" className={`peak_Sidebar`} />
<Sidebar
activeKey={0}
className={`peak_Sidebar`}
onChange={(e: any) => {
console.log('e',e)
setcurrentIndex(e?.detail);
}}
>
{(dataSource ?? []).map((item: any) => {
return (
<SidebarItem title={item?.sideTitle} className={`peak_Sidebar`} />
);
})}
</Sidebar>
{/* 富文本 */}
<View onClick={() => {}}>
<View>{dataSource?.[0]?.actTitle}</View>
<RichText nodes={dataSource?.[0]?.richText} />
{/* <View>{dataSource?.[currentIndex]?.actTitle}</View> */}
<RichText nodes={dataSource?.[currentIndex]?.richText} />
</View>
</View>
);

View File

@@ -117,7 +117,7 @@ const my = (props: any) => {
</View>
<View className="cellArr">
{/* <Cell icon="manager" title="打卡记录" isLink /> */}
<Cell icon="manager" title="打卡记录" isLink />
{/* <Cell icon="manager" title="个人资料" isLink /> */}
<Cell