From 70e2382ac4b27dae08f8625d7af7c75c225884a0 Mon Sep 17 00:00:00 2001 From: fan <1028505585@qq.com> Date: Fri, 22 Nov 2024 08:20:47 +0800 Subject: [PATCH 1/3] FPS:d --- app/(tabs)/User.tsx | 8 ++- app/MyViews/Systemnotification.tsx | 82 +++++++++++++++++++++++++++++ app/MyViews/_layout.tsx | 1 + assets/images/shengyin.png | Bin 0 -> 415 bytes 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 app/MyViews/Systemnotification.tsx create mode 100644 assets/images/shengyin.png diff --git a/app/(tabs)/User.tsx b/app/(tabs)/User.tsx index 3701fae..8889bf3 100644 --- a/app/(tabs)/User.tsx +++ b/app/(tabs)/User.tsx @@ -13,6 +13,9 @@ export default function User() { const handlePress = () => { router.push('/MyViews/SetUp'); } + const handlePress1 = () => { + router.push('/MyViews/Systemnotification'); + } const GoOut = () => { // 弹窗确认退出 Alert.alert("确定要退出登录吗?", @@ -128,7 +131,10 @@ export default function User() { style={{ width: "20", height: "20", marginLeft: "10" }} > - 系统通知 > + + 系统通知 > + + diff --git a/app/MyViews/Systemnotification.tsx b/app/MyViews/Systemnotification.tsx new file mode 100644 index 0000000..98f3ed5 --- /dev/null +++ b/app/MyViews/Systemnotification.tsx @@ -0,0 +1,82 @@ +import { StyleSheet, Text, View, Image } from 'react-native' +import React, { useState } from 'react' + +export default function Systemnotification() { + const [data, setData] = useState([ + { + id: 1, + img: "../../assets/images/shengyin.png", + title: "系统通知", + content: "系统设计公告,最新版本6.1", + time: "2022-13-01 10:00" + }, + { + id: 2, + img: "../../assets/images/shengyin.png", + title: "系统通知", + content: "系统设计公告,最新版本6.1", + time: "2022-12-01 10:00" + }, + { + id: 2, + img: "../../assets/images/shengyin.png", + title: "系统通知", + content: "系统设计公告,最新版本6.1", + time: "2022-11-01 10:00" + }, + ]) + + + return ( + + { + data.map((item) => ( + + + + + + {item.title} + {item.time} + {item.content} + + + + + )) + } + + + ) +} + +const styles = StyleSheet.create({ + fryns: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + padding: 10, + borderBottomWidth: 1, + borderBottomColor: "#ccc", + fontSize: 12, + height: 100 + }, + img: { + width: 30, + height: 30, + margin: 20, + }, + btgt: { + width: 300, + // height: 50, + // backgroundColor: "red", + margin: 20, + }, + btsdf: { + fontSize: 12, + color: "#999999", + } +}) \ No newline at end of file diff --git a/app/MyViews/_layout.tsx b/app/MyViews/_layout.tsx index 04e013d..4ea93ff 100644 --- a/app/MyViews/_layout.tsx +++ b/app/MyViews/_layout.tsx @@ -9,6 +9,7 @@ export default function RootMy() { + Px$SxH1eR9HvtmoZL+Koo}G14_LEdj>JFq}l@*$5?U(ZLYgzRDF{1$#(M9Y5Hj@1YF$w^+IHw7>wm`dB*Q%7l zP#X-@sB8tQY$5D<$6}tD_bq@j5{g=c+5^?o;t>>VAQ0j1=zM-X0Za-^3QP(dt^#|v z;y!!Ta7sawUZ_^wH;$bLC|Tf7ry=Da+LeYz2has}L5vbe+UoQ{H~}z9bR}aJ0R99W zRxCG)d^cvD*olb>&{lO2K+_WzgmVD1lD%F|ZHPMX?uXotzX13?j0W}2SSkPj002ov JPDHLkV1oCftSJBh literal 0 HcmV?d00001 -- Gitee From 948a98ec5b0824371332836f36d93623850080df Mon Sep 17 00:00:00 2001 From: fan <1028505585@qq.com> Date: Fri, 22 Nov 2024 08:26:14 +0800 Subject: [PATCH 2/3] feat:fpsUPDATE --- app/(tabs)/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx index d012926..bca7c38 100644 --- a/app/(tabs)/index.tsx +++ b/app/(tabs)/index.tsx @@ -92,6 +92,7 @@ export default function Index() { ); }; + //1 return ( -- Gitee From 3b8daa1ab4b30e8b9f8aa4eaffa80332629c30cf Mon Sep 17 00:00:00 2001 From: Fps-lab <1028505585@qq.com> Date: Fri, 29 Nov 2024 10:58:24 +0800 Subject: [PATCH 3/3] update:fps --- app/(tabs)/User.tsx | 14 +- app/(tabs)/index.tsx | 6 +- app/AndroidManifest.xml | 93 + app/MyViews/GaiZhang.tsx | 443 +- app/MyViews/SetUp.tsx | 31 +- app/MyViews/Systemnotification.tsx | 4 +- app/MyViews/_layout.tsx | 6 +- app/MyViews/download.tsx | 12 + app/MyViews/province_city_area.js | 319 + app/YgFile/Excellentclass.tsx | 227 + app/YgFile/ExcellentclassShow.tsx | 633 ++ app/YgFile/MeetingShow.tsx | 40 + app/YgFile/Preview.tsx | 27 + app/YgFile/TumorHospital.tsx | 277 + app/YgFile/VideoPlayer.tsx | 204 + app/YgFile/_layout.tsx | 37 +- app/api/axios.js | 26 + app/wxapi/WXEntryActivity.java | 8 + assets/images/11111111213111112.jpg | Bin 0 -> 97351 bytes assets/images/QQhaoyou.png | Bin 0 -> 1364 bytes assets/images/c3_1.png | Bin 0 -> 265334 bytes assets/images/dianzan.png | Bin 0 -> 467 bytes assets/images/dianzanHong.png | Bin 0 -> 516 bytes assets/images/fenxaing.png | Bin 0 -> 567 bytes assets/images/quanping.png | Bin 0 -> 483 bytes assets/images/u1128.png | Bin 0 -> 143692 bytes assets/images/u1129.png | Bin 0 -> 112934 bytes assets/images/u1130.png | Bin 0 -> 18556 bytes assets/images/u1132.png | Bin 0 -> 40648 bytes assets/images/u567.png | Bin 0 -> 104547 bytes assets/images/u569.png | Bin 0 -> 257085 bytes assets/images/u571.png | Bin 0 -> 234698 bytes assets/images/weixin.png | Bin 0 -> 772 bytes assets/images/xiala.png | Bin 0 -> 283 bytes assets/images/xiaoxi copy.png | Bin 0 -> 567 bytes assets/images/xiazaibai.png | Bin 0 -> 345 bytes assets/images/xinlang.png | Bin 0 -> 1213 bytes "assets/images/\346\250\252\345\261\217.png" | Bin 0 -> 549 bytes package-lock.json | 7918 ++++++++++++++++-- package.json | 34 +- 40 files changed, 9640 insertions(+), 719 deletions(-) create mode 100644 app/AndroidManifest.xml create mode 100644 app/MyViews/download.tsx create mode 100644 app/MyViews/province_city_area.js create mode 100644 app/YgFile/Excellentclass.tsx create mode 100644 app/YgFile/ExcellentclassShow.tsx create mode 100644 app/YgFile/MeetingShow.tsx create mode 100644 app/YgFile/Preview.tsx create mode 100644 app/YgFile/TumorHospital.tsx create mode 100644 app/YgFile/VideoPlayer.tsx create mode 100644 app/api/axios.js create mode 100644 app/wxapi/WXEntryActivity.java create mode 100644 assets/images/11111111213111112.jpg create mode 100644 assets/images/QQhaoyou.png create mode 100644 assets/images/c3_1.png create mode 100644 assets/images/dianzan.png create mode 100644 assets/images/dianzanHong.png create mode 100644 assets/images/fenxaing.png create mode 100644 assets/images/quanping.png create mode 100644 assets/images/u1128.png create mode 100644 assets/images/u1129.png create mode 100644 assets/images/u1130.png create mode 100644 assets/images/u1132.png create mode 100644 assets/images/u567.png create mode 100644 assets/images/u569.png create mode 100644 assets/images/u571.png create mode 100644 assets/images/weixin.png create mode 100644 assets/images/xiala.png create mode 100644 assets/images/xiaoxi copy.png create mode 100644 assets/images/xiazaibai.png create mode 100644 assets/images/xinlang.png create mode 100644 "assets/images/\346\250\252\345\261\217.png" diff --git a/app/(tabs)/User.tsx b/app/(tabs)/User.tsx index 8889bf3..1dc70aa 100644 --- a/app/(tabs)/User.tsx +++ b/app/(tabs)/User.tsx @@ -16,6 +16,9 @@ export default function User() { const handlePress1 = () => { router.push('/MyViews/Systemnotification'); } + const handlePress2 = () => { + router.push('/MyViews/download'); + } const GoOut = () => { // 弹窗确认退出 Alert.alert("确定要退出登录吗?", @@ -74,7 +77,10 @@ export default function User() { style={{ width: "20", height: "20", marginLeft: "10" }} > - 我的下载 > + + 我的下载 > + + @@ -164,7 +170,7 @@ export default function User() { const styles = StyleSheet.create({ body56: { - height: "128", + height: 150, backgroundColor: '#ffffff', marginTop: "1.5", flexDirection: "row", @@ -202,8 +208,8 @@ const styles = StyleSheet.create({ }, Zhong1: { - height: "40", - marginTop: "1", + height: 45, + marginTop: 1, backgroundColor: "#ffffff", justifyContent: "center", diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx index bca7c38..c082c83 100644 --- a/app/(tabs)/index.tsx +++ b/app/(tabs)/index.tsx @@ -35,6 +35,10 @@ export default function Index() { router.push("/YgFile/Academic"); } else if (value === "学术中心") { router.push("/YgFile/Oncologist"); + } else if (value === "精品课程") { + router.push("/YgFile/Excellentclass"); + } else if (value === "肿瘤会议") { + router.push("/YgFile/TumorHospital"); } }; useEffect(() => { @@ -92,7 +96,7 @@ export default function Index() { ); }; - //1 + return ( diff --git a/app/AndroidManifest.xml b/app/AndroidManifest.xml new file mode 100644 index 0000000..a562c15 --- /dev/null +++ b/app/AndroidManifest.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/MyViews/GaiZhang.tsx b/app/MyViews/GaiZhang.tsx index 6f69bf5..21fe08b 100644 --- a/app/MyViews/GaiZhang.tsx +++ b/app/MyViews/GaiZhang.tsx @@ -5,28 +5,116 @@ import { TextInput, Button, ScrollView, + Modal, + TouchableOpacity, + Alert, + ActivityIndicator, + Image } from 'react-native' import React, { useState, useEffect } from 'react' import { Switch } from '@rneui/themed'; // 弹出层 第三方库 -import { Picker } from '@react-native-picker/picker'; +import Checkbox from 'expo-checkbox'; // 复选框 + + export default function GaiZhang() { const [name, setName] = useState(''); const [phone, setPhone] = useState(''); const [email, setEmail] = useState(''); const [address, setAddress] = useState(''); + const [address0, setAddress0] = useState(''); const [workunit, setWorkunit] = useState(''); const [department, setDepartment] = useState(''); - const [selectedValue, setSelectedValue] = useState('其他'); - const [selectedValue1, setSelectedValue1] = useState('其他'); - const [selectedValue2, setSelectedValue2] = useState('其他'); - const [checked, setChecked] = useState(false); + const [received, setReceived] = useState(''); + const [department1, setDepartment1] = useState(''); + const [modalVisible, setModalVisible] = useState(false); + const [modalVisible1, setModalVisible1] = useState(false); + const [loading, setLoading] = useState(false); // 控制加载状态 + const [checked, setChecked] = useState(false); // 控制开关状态 + const [isChecked1, setChecked1] = useState(false); // 控制开关状态 + const [isChecked2, setChecked2] = useState(false); // 控制开关状态 + const [isChecked3, setChecked3] = useState(false); // 控制开关状态 + const [modalVisible5, setModalVisible5] = useState(false); + const arr = ['MD-医生', 'MM-医学硕士', 'MS-医学学士', 'Ph.D-理学博士', 'Pham.D-药学博士', 'RN-注册护士', '其他']; + + const sheng = ["安徽省", "福建省", "甘肃省", "广东省", "贵州省", + "海南省", "河北省", "河南省", "湖北省" + , "湖南省", "江苏省", "江西省", "辽宁省", + "内蒙古自治区", "宁夏回族自治区", "青海省", "山东省", "山西省", "陕西省", "上海市", "四川省", "台湾省", "天津市", "西藏自治区", "香港特别行政区", "新疆维吾尔自治区", "云南省", "浙江省", "重庆市" + ] + const shi = [ + "石家庄市", "唐山市", "保定市", "邯郸市", "张家口市", "宁波市", "杭州市", + "宁波市", "温州市", "襄阳市", "绍兴市", "湖州市", "深圳市", "汕头市", + "洛阳市", "开封市", "宜昌市", "新乡市", "南阳市", "福州市", "厦门市", + ] + const qu = [ + "东城区", "西城区", "朝阳区", "丰台区", "石景山区", "海淀区", "门头沟区", + "房山区", "黄浦区", "花都区", "徐汇区", "从化区", "增城区", "金牛区", + "西湖区", "下城区", "上城区", "新郑区", "金堂区", "青白江区", "成华区", + ] + const ji1 = [ + "正高级", "副高级", "中级", "初级" + ] + const jishi = [ + "主治医师", "住院医师", "医师", "医士", "医助", + "主任医师", "主任药师", "主任护师", "主任技师", "教授", "研究员" + ] + const [sheng1, setSheng1] = useState('河北省'); + const [shi1, setShi1] = useState('邯郸市'); + const [qu1, setQu1] = useState('成华区'); + + const [ji, setJi] = useState('正高级'); + const [jishi1, setJishi1] = useState('主治医生'); + + + useEffect(() => { + setAddress0(sheng1 + "-" + shi1 + "-" + qu1); + setDepartment1(ji + "-" + jishi1); + }, []) + + + const setReceivew = (value: string) => { + setReceived(value); + setModalVisible(false); + } + const setReceivew1 = (value: string) => { + setSheng1(value); + } + const setReceivew2 = (value: string) => { + setShi1(value); + } + const setReceivew3 = (value: string) => { + setQu1(value); + setModalVisible1(false) + } + const setReceive12 = (value: string) => { + setJi(value); + } + const setReceive127 = (value: string) => { + setJishi1(value); + setModalVisible5(false) + } + + const handleSave = () => { + // 设置加载状态为 true + setLoading(true); + + // 模拟延迟操作(比如调用API或其他操作) + setTimeout(() => { + // 完成后关闭加载状态 + setLoading(false); + + // 弹出加载成功的提示框 + Alert.alert('加载成功', '数据已成功保存!'); + }, 3000); // 模拟3秒的加载时间 + }; + return ( - + 基本资料 @@ -57,37 +145,169 @@ export default function GaiZhang() { /> + 教育程度 - setSelectedValue1(itemValue)} + setModalVisible(true)} + /> + + setModalVisible(false)} > - - - - - - - - + + + 教育程度 + + + {arr.map((item, index) => ( + { + setReceivew(item) + }} + > + + {item} + + + ))} + + + + {/* 照片上传 + + + 上传照片 + */} + + + + + {loading ? '正在保存...' : '保存'} + + {loading && } + + + ) } const styles = StyleSheet.create({ + Fovr: { + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'center', + width: 200, + }, + title: { + fontSize: 18, + marginBottom: 20, + }, + picker: { + height: 50, + width: 250, + marginVertical: 10, + }, + selectedText: { + marginTop: 20, + fontSize: 16, + }, + + section: { + flexDirection: 'row', + alignItems: 'center', + }, + paragraph: { + fontSize: 15, + }, + paragraph1: { + fontSize: 15, + marginLeft: 10, + marginTop: 10, + }, + checkbox: { + margin: 8, + }, container: { flex: 1, padding: 20, @@ -320,4 +654,29 @@ const styles = StyleSheet.create({ justifyContent: "flex-start", alignItems: "center", }, + modalContainer: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: 'rgba(0, 0, 0, 0.5)', + }, + modalContent: { + backgroundColor: 'white', + padding: 20, + borderRadius: 10, + width: '80%', + }, + modalTitle: { + fontSize: 18, + fontWeight: 'bold', + marginBottom: 20, + }, + titleItem: { + paddingVertical: 10, + borderBottomWidth: 1, + borderBottomColor: '#ddd', + }, + titleText: { + fontSize: 16, + }, }) \ No newline at end of file diff --git a/app/MyViews/SetUp.tsx b/app/MyViews/SetUp.tsx index 31b2e1c..ca8c2fb 100644 --- a/app/MyViews/SetUp.tsx +++ b/app/MyViews/SetUp.tsx @@ -1,12 +1,13 @@ -import { StyleSheet, Text, View, Image, TouchableOpacity, Alert } from 'react-native' -import React from 'react' +import { StyleSheet, Text, View, Image, TouchableOpacity, Alert, ToastAndroid } from 'react-native' +import React,{useState} from 'react' import { router } from 'expo-router' export default function SetUp() { - const Toex = () => { - Alert.alert("暂无更新") + const [cun, setCun] = useState(5) + const Toex = () => { + Alert.alert("暂无更新") } const Toex1 = () => { router.push("/MyViews/GaiZhang") @@ -14,6 +15,14 @@ export default function SetUp() { const Toex2 = () => { router.push("/MyViews/Changepassword") } + const Toecleax = () => { + ToastAndroid.showWithGravity( + '清理缓存成功', + ToastAndroid.LONG, + ToastAndroid.CENTER + ); + setCun(0) + } return ( @@ -33,7 +42,7 @@ export default function SetUp() { > 检查更新 - > + 2.0 > @@ -81,7 +90,11 @@ export default function SetUp() { > - 清理缓存 > + + 清理缓存 { cun }M > + @@ -90,11 +103,11 @@ export default function SetUp() { const styles = StyleSheet.create({ Zhong: { - height: "40", - marginTop: "1", + height: 40, + marginTop: 1, backgroundColor: "#ffffff", justifyContent: "center", - width: "358", + width: "100%" }, }) \ No newline at end of file diff --git a/app/MyViews/Systemnotification.tsx b/app/MyViews/Systemnotification.tsx index 98f3ed5..15f2e78 100644 --- a/app/MyViews/Systemnotification.tsx +++ b/app/MyViews/Systemnotification.tsx @@ -39,9 +39,9 @@ export default function Systemnotification() { /> - {item.title} + {item.title} {item.time} - {item.content} + {item.content} diff --git a/app/MyViews/_layout.tsx b/app/MyViews/_layout.tsx index 4ea93ff..99f2391 100644 --- a/app/MyViews/_layout.tsx +++ b/app/MyViews/_layout.tsx @@ -10,10 +10,8 @@ export default function RootMy() { - + + ); diff --git a/app/MyViews/download.tsx b/app/MyViews/download.tsx new file mode 100644 index 0000000..6322a6a --- /dev/null +++ b/app/MyViews/download.tsx @@ -0,0 +1,12 @@ +import { StyleSheet, Text, View } from 'react-native' +import React from 'react' + +export default function download() { + return ( + + download + + ) +} + +const styles = StyleSheet.create({}) \ No newline at end of file diff --git a/app/MyViews/province_city_area.js b/app/MyViews/province_city_area.js new file mode 100644 index 0000000..6220702 --- /dev/null +++ b/app/MyViews/province_city_area.js @@ -0,0 +1,319 @@ +import React, { Component } from 'react'; +import { View, Text, FlatList, Modal, TouchableOpacity } from 'react-native'; +import CHINA_REGION from './china_region_last'; +let style = { + selectBtn: { paddingLeft: 10, paddingRight: 10, }, + selectArea: { paddingBottom: 50 }, + selectStatusTrue: { color: "#05a5d1" }, + selectProvinceAreaTxt: { height: 30, paddingLeft: 15, lineHeight: 30, paddingRight: 15, }, + hide: { display: "none" }, + show: {}, + FashionAddLine: { + height: 60, + borderBottomWidth: 2, + borderBottomColor: "rgba(224,224,224,0.50)", + flexDirection: "row" + }, + FashionAddLineLabel: { + width: 95, + paddingLeft: 15, + justifyContent: "center", + alignItems: "flex-start", + }, + FashionAddLine2: { + height: 75, + borderBottomColor: "#F8F8F8", + borderBottomWidth: 10, + }, + sku: { + position: "absolute", + left: 0, + top: 0, + right: 0, + bottom: 0, + backgroundColor: "rgba(0,0,0,.5)" + }, + skuBackImg: { + position: "absolute", + left: 0, + top: 0, + right: 0, + bottom: 0, + }, + openProvinceCityAreaContentWarp: { + position: "absolute", + left: 0, + bottom: 0, + right: 0, + height: 310, + backgroundColor: "#ffffff", + }, + skuTitle: { + height: 50, + position: "relative", + borderBottomWidth: 1, + borderBottomColor: "rgba(224,224,224,0.50)", + alignItems: "center", + justifyContent: "center", + }, + skuTitleTxt: { + fontSize: 16, + color: "#4f4f4f", + }, + skuContentClose: { + width: 48, + height: 48, + justifyContent: "center", + alignItems: "center", + position: "absolute", + top: 0, + right: 0, + }, + skuContentCloseIcon: { + color: "#9B9B9B", + fontSize: 12, + }, + openProvinceCityAreaContent: { + height: 260, + }, + openProvinceCityAreaContentA: { + height: 40, + borderBottomColor: '#ddd', + borderBottomWidth: 1, + flexDirection: 'row', + justifyContent: "flex-start", + alignItems: "center", + }, +}; + +class ProvinceCityArea extends Component { + constructor(p) { + super(p); + let province = []; + for (let code in CHINA_REGION) { + province.push(code); + } + this.state = { + openProvinceCityArea: this.props.openProvinceCityArea || false, + selectStatus: { s1: 1, s2: 0, s3: 0 }, + address: { + province: "", + city: "", + area: "", + }, + province: province, + city: [], + area: [], + }; + if (this.props.color) { + style.selectStatusTrue.color = this.props.color; + } + this.setProvince = this.setProvince.bind(this); + this.setCity = this.setCity.bind(this); + this.setArea = this.setArea.bind(this); + } + setProvince(x) { + if (x != this.state.address.province) { + let a = this.state.address; + a.province = x; + a.city = ''; + a.area = ''; + let city = []; + for (let code in CHINA_REGION[x]) { + city.push(code); + } + this.setState({ + address: a, + city: city, + area: [], + selectStatus: { s1: 0, s2: 1, s3: 0 } + }, () => { + this.props.callback && this.props.callback(this.state.address); + }); + } + } + setCity(x) { + if (x != this.state.address.city) { + let a = this.state.address; + a.city = x; + a.area = ''; + let area = CHINA_REGION[a.province][x]; + this.setState({ + address: a, + area: area, + selectStatus: { s1: 0, s2: 0, s3: 1 } + }, () => { + this.props.callback && this.props.callback(this.state.address); + }); + } + } + setArea(x) { + if (x != this.state.address.city) { + let a = this.state.address; + a.area = x; + this.setState({ + address: a, + selectStatus: { s1: 0, s2: 0, s3: 1 }, + openProvinceCityArea: false, + }, () => { + this.props.callback && this.props.callback(this.state.address); + }); + } else { + this.setState({ + openProvinceCityArea: false, + }); + } + } + flatListKey(item, index) { + return index.toString(); + } + componentDidMount() { + let initData = this.props.initData || {}, address = { + province: initData.province || "", + city: initData.city || "", + area: initData.area || "", + }, city = [], area = []; + if (initData.province) { + for (let x in CHINA_REGION[address.province]) { + city.push(x); + } + } + if (initData.province && initData.city) { + try { + area = CHINA_REGION[initData.province][initData.city]; + } catch (e) { } + } + this.setState({ + openProvinceCityArea: this.props.openProvinceCityArea, + address: address, + city: city, + area: area, + }); + } + componentWillReceiveProps(nextProps) { + this.setState({ + openProvinceCityArea: nextProps.openProvinceCityArea + }) + } + render() { + let selectProvinceBtn = [style.selectBtn], selectCityBtn = [style.selectBtn], selectAreaBtn = [style.selectBtn], + selectProvinceArea = [style.selectArea], selectCityArea = [style.selectArea], selectAreaArea = [style.selectArea]; + if (this.state.selectStatus.s1) { + selectProvinceBtn.push(style.selectStatusTrue); + selectProvinceArea.push(style.show); + } else { + selectProvinceArea.push(style.hide); + } + if (this.state.selectStatus.s2) { + selectCityBtn.push(style.selectStatusTrue); + selectCityArea.push(style.show); + } else { + selectCityArea.push(style.hide); + } + if (this.state.selectStatus.s3) { + selectAreaBtn.push(style.selectStatusTrue); + selectAreaArea.push(style.show); + } else { + selectAreaArea.push(style.hide); + } + if (this.state.address.province) { + selectCityBtn.push(style.show); + } else { + selectCityBtn.push(style.hide); + } + if (this.state.address.province && this.state.address.city) { + selectAreaBtn.push(style.show); + } else { + selectAreaBtn.push(style.hide); + } + return this.setState({ openProvinceCityArea: false })}> + + this.setState({ openProvinceCityArea: false })}> + + + 所在地区 + this.setState({ openProvinceCityArea: false })}> + 关闭 + + + + + { + this.setState({ selectStatus: { s1: 1, s2: 0, s3: 0 } }); + }} style={selectProvinceBtn}>{this.state.address.province || '请选择'} + { + this.setState({ selectStatus: { s1: 0, s2: 1, s3: 0 } }); + }} style={selectCityBtn}>{this.state.address.city || '请选择'} + { + this.setState({ selectStatus: { s1: 0, s2: 0, s3: 1 } }); + }} style={selectAreaBtn}>{this.state.address.area || '请选择'} + + + ({ length: 30, offset: 30 * index, index })} + renderItem={({ item, separators }) => { + let s = [style.selectProvinceAreaTxt]; + if (item == this.state.address.province) { + s.push(style.selectStatusTrue); + } + return { + this.setProvince(item); + }}> + {item} + + }} + /> + + + ({ length: 30, offset: 30 * index, index })} + renderItem={({ item, separators }) => { + let s = [style.selectProvinceAreaTxt]; + if (item == this.state.address.city) { + s.push(style.selectStatusTrue); + } + return { + this.setCity(item); + }}> + {item} + + }} + /> + + + ({ length: 30, offset: 30 * index, index })} + renderItem={({ item, separators }) => { + let s = [style.selectProvinceAreaTxt]; + if (item == this.state.address.area) { + s.push(style.selectStatusTrue); + } + return { + this.setArea(item); + }}> + {item} + + }} + /> + + + + + + } +} +export default ProvinceCityArea; \ No newline at end of file diff --git a/app/YgFile/Excellentclass.tsx b/app/YgFile/Excellentclass.tsx new file mode 100644 index 0000000..6e7d51a --- /dev/null +++ b/app/YgFile/Excellentclass.tsx @@ -0,0 +1,227 @@ +import { + StyleSheet, + Text, + TextInput, + View, + Dimensions, + TouchableHighlight, + ScrollView, + Image, + TouchableOpacity, +} from "react-native"; +import React, { useEffect, useState } from "react"; +import Ionicons from "@expo/vector-icons/Ionicons"; +import { Tabs } from "@ant-design/react-native"; +import axiosApi from "../api/axios"; +import { router } from "expo-router"; + +export default function Excellentclass() { + const tabs = [ + { title: "外科肿瘤学" }, + { title: "内科肿瘤学" }, + { title: "临床试验" }, + { title: "护理专区" }, + ]; + const [data1, setData1] = useState([]); // 轮播图数据 + const [text, onChangeText] = useState(""); + const [state, setState] = useState(false); //控制搜索框的显示 + const [activeKey, setActiveKey] = useState("home"); // 当前选中的标签 + const style = { + alignItems: 'center', + justifyContent: 'center', + height: 150, + backgroundColor: '#fff', + } + // 获取轮播图数据 + const fetchCarouselImages = async () => { + try { + const response = await axiosApi.get("/fps/course"); + setData1(response.data.course); + } catch (error) { + console.error("错误原因", error); + } + }; + + useEffect(() => { + fetchCarouselImages(); + + }, []); + + + return ( + + {/* 搜索 */} + {state ? ( + <> + + + + + + + + ) : ( + <> + + { + setState(true); + }} + > + + + 搜索 + + + + + )} + {/* 病例分享 */} + + + + { + data1.map((item) => ( + + { + router.push({ + pathname: "/YgFile/ExcellentclassShow", + params: { + name: item.coursetitle, + num: item.num, + } + }) + }} + > + + + + + + {item.coursetitle} + 主讲:{item.coursename} 2023-10-05 + + + )) + } + + + + + { + data1.map((item) => ( + + + + + + {item.coursetitle} + 主讲:{item.coursename} 2023-10-05 + + + )) + } + + + + + { + data1.map((item) => ( + + + + + + {item.coursetitle} + 主讲:{item.coursename} 2023-10-05 + + + )) + } + + + + + { + data1.map((item) => ( + + + + + + {item.coursetitle} + 主讲:{item.coursename} 2023-10-05 + + + )) + } + + + + + ); +} + +const styles = StyleSheet.create({ + style1: { + alignItems: "left", + justifyContent: "center", + }, + q1: { + width: Dimensions.get("window").width, + height: 120, + backgroundColor: "white", + marginBottom: 10, + flexDirection: "row", + }, + container: { + flex: 1, + }, + searchbox: { + width: Dimensions.get("window").width, + height: 70, + alignItems: "center", + justifyContent: "center", + }, + search: { + width: Dimensions.get("window").width - 100, + height: 40, + display: "flex", + flexDirection: "row", + justifyContent: "center", + alignItems: "center", + backgroundColor: "#FFF", + borderRadius: 20, + }, + searchinput: { + width: Dimensions.get("window").width - 100, + height: 40, + display: "flex", + flexDirection: "row", + alignItems: "center", + backgroundColor: "#FFF", + borderRadius: 20, + }, + input: { + height: 40, + width: "90%", + }, + Tabbar: { + width: Dimensions.get("window").width, + height: 100, + }, +}); diff --git a/app/YgFile/ExcellentclassShow.tsx b/app/YgFile/ExcellentclassShow.tsx new file mode 100644 index 0000000..8747189 --- /dev/null +++ b/app/YgFile/ExcellentclassShow.tsx @@ -0,0 +1,633 @@ +import React, { useState, useEffect, useCallback, useRef } from 'react'; +import { + StyleSheet, + Text, View, + Dimensions, + ScrollView, + Image, + TouchableOpacity, + Modal, + TextInput, + Alert, + Platform +} from 'react-native'; +import { Tabs } from "@ant-design/react-native"; +import Collapsible from 'react-native-collapsible'; +import axiosApi from '../api/axios'; +import VideoPlayer from "./VideoPlayer" +import * as Sharing from 'expo-sharing'; +import * as FileSystem from 'expo-file-system'; + +export default function ExcellentclassShow() { + const tabs = [ + { title: "课程介绍" }, + { title: "讲者介绍" }, + { title: "课程目录" }, + { title: "课程课件" }, + { title: "用户评论" }, + ]; + const [num, setNum] = useState(1226) + const [flag, setFlag] = useState(false) + const [data, setData] = useState([]) + + const [collapsed, setCollapsed] = useState(true); + const [collapsed1, setCollapsed1] = useState(true); + const [collapsed2, setCollapsed2] = useState(true); + const [visible, setVisible] = useState(false); + const [visible1, setVisible1] = useState(false); + const [text, setText] = useState(''); // 管理输入框的内容 + + + + + + const getdate = async () => { + try { + const response = await axiosApi.get("/fps/xiang"); + setData(response.data.xiang); + } catch (error) { + console.error("错误原因", error); + } + } + useEffect(() => { + getdate() + }, []) + const toggleModal = () => { + setVisible(!visible); // 切换弹出层的显示/隐藏状态 + }; + + + + const videoSource = "https://media.w3.org/2010/05/sintel/trailer.mp4"; // 远程视频链接 + + const toggleModal1 = async () => { + const filename = 'small.mp4'; + let localUri = videoSource; // 先假设 videoSource 是远程 URL + + // 如果 videoSource 是一个远程 URL,则下载到本地存储 + if (videoSource.startsWith('http')) { + try { + const result = await FileSystem.downloadAsync( + videoSource, + FileSystem.documentDirectory + filename + ); + localUri = result.uri; // 下载后的本地文件路径 + } catch (error) { + console.error('下载文件失败:', error); + Alert.alert('错误', '文件下载失败'); + return; + } + } + + // 直接分享本地文件 + shareAsync(localUri, filename, 'video/mp4'); + } + + const shareAsync = async (uri: string, filename: string = '', mimeType: string = '') => { + try { + if (await Sharing.isAvailableAsync()) { + // 直接分享本地文件 + await Sharing.shareAsync(uri, { + mimeType: mimeType, + dialogTitle: `分享 ${filename}`, // 分享时的标题 + UTI: mimeType, // 设置 MIME 类型 + }); + } else { + Alert.alert('错误', '该设备不支持分享功能'); + } + } catch (error) { + console.error("分享文件时出错:", error); + Alert.alert("错误", "文件分享失败"); + } + } + + + + + + + + + const togsdgleModal1 = () => { + setVisible1(!visible1); // 切换弹出层的显示/隐藏状态 + } + const toggle1Modal = async () => { + if (text) { + let obj = { + xiangname: "李四", + xiangtitle: text + }; + try { + const response = await axiosApi.post("/fps/xiangadd", obj); + if (response.data.code === 200) { + Alert.alert("发布成功"); + setVisible(false); + setText(""); + getdate(); + } else { + Alert.alert("发布失败", "请稍后再试"); + } + } catch (error) { + Alert.alert("发布失败", "发生了错误,请检查网络连接"); + } + } else { + Alert.alert("请输入内容"); + } + }; + + + const weixin = async () => { + + }; + const qq = () => { + console.log(2222); + + + + } + const xinlang = () => { + console.log(33333333); + } + + + + return ( + + + + + + + + + + 为了切实帮助我国广大临床医务工作者提高对结直肠癌的诊治能力和规范化诊疗行为,打造一个在线学习、交流、提升规范化诊疗能力的平台。CSCO肿瘤协会于2018年成立CSCO-希望之路空中学院,通过国内领域知名专家对《中国临床肿瘤学会结直肠癌诊疗指南2018版》的标准化解读和病理研讨,促进结直肠癌诊疗的规范化开展。为中国患者提供更精准、高效、安全的规范化诊疗。 + 在此,我们诚挚地邀请您收看本期希望公开课,并积极参与网络互动。 + + + + + + 袁英,男,副主任医师,副教授,医学博士。1973年8月出生,于1996年7月毕业于新乡医学院临床医学系眼耳鼻喉专业,2001年于山东大学医学院取得硕士学位,2006年于山东大学医学院取得医学博士学位。 + + 现任聊城市人民医院眼耳鼻喉医院副院长,聊城市人民医院耳鼻咽喉-头颈外科主任。是聊城市耳鼻咽喉-头颈外科学科带头人。 在专业技能及教学科研方面积累了丰富的经验,尤其是在头颈肿瘤的基础与临床、成人及小儿鼾症手术治疗、嗓音外科以及鼻内镜外科技术等方面有颇深造诣。 + + 在聊城首先创立了双腔尿管法取小儿食道异物,为此类急症病人极大地缩短了住院时间和降低了费用;在我市系统开创了保留喉功能的喉癌下咽癌手术以及面中部掀翻进路鼻肿瘤切除术,规范了手术方式,最大限度的在彻底切除肿瘤的同时提高患者手术后的生存质量。 + + 撰写的博士论文《下咽后壁癌的手术治疗及Kai-1基因在下咽癌中的表达及意义》得到专家好评;建立了聊城市头颈肿瘤患者的资料库,进行了大量的临床随访和宣教工作,提高了喉癌、下咽癌术后生存率;在晚期甲状腺癌如何保留呼吸及吞咽功能方面进行了深入地探索,为此类患者带来重生的希望;对鼾症的监测和手术治疗进行发展和规范,开展了上气道多平面手术、个性化治疗等手段,开创性的进行了硬腭截短、下颌前徙、舌根部分切除、软腭及舌根等离子减容治疗等国内新技术,明显提高了鼾症手术治愈率和有效率。开展了微创外科进行小儿扁桃体腺样体切除术以及喉嗓音整复手术,技术水平在同级医院处于领先地位。 + + 承担了省市级科研项目4项,编著了《口腔耳鼻咽喉急危重症》(副主编),在国内专业期刊杂志上发表论著6篇,其中2项研究为国内领先水平。目前担任山东省中西医结合委员耳鼻咽喉分会委员,中国听力与语言康复委员会山东分会委员。 + + + + + + setCollapsed(!collapsed)} style={styles.header}> + 01.结直肠癌病理 共3节 + + + + 1.1结直肠癌概述 + 时长:11:45″ + + + 1.2结直肠癌概述 + 时长:11:45″ + + + 1.3结直肠癌概述 + 时长:11:45″ + + + + setCollapsed1(!collapsed1)} style={styles.header1}> + 01.结直肠癌病理 共3节 + + + + 1.1结直肠癌概述 + 时长:11:45″ + + + 1.2结直肠癌概述 + 时长:11:45″ + + + 1.3结直肠癌概述 + 时长:11:45″ + + + + setCollapsed2(!collapsed2)} style={styles.header1}> + 01.结直肠癌病理 共3节 + + + + 1.1结直肠癌概述 + 时长:11:45″ + + + 1.2结直肠癌概述 + 时长:11:45″ + + + 1.3结直肠癌概述 + 时长:11:45″ + + + + + + + + + + + + + + + + + + + + + + + + { + data.map((item: any, index: any) => { + return ( + + + + {item.xiangname} + {item.xiangtitle} + 2019-05-23 + + + ) + }) + } + + + + + + + { + setNum(1227) + setFlag(!flag) + } + } + > + + { + flag ? : + } + {num} + + + { + toggleModal() + }} + > + 1423 + + + + + { + toggleModal1() + }} + > + 136 + + + + + + + + + {/* Modal 弹出层 */} + + + + + + 取消 + + + 评论 + { + toggle1Modal() + }} + > + 发布 + + + + + + + + + + + + + + + + + + 分享 + + + + + + + + + + { + weixin() + }} + > + + + 微信好友 + + + + { + qq() + }} + > + + + QQ好友 + + + + + { + xinlang() + }} + > + + + 新浪微博 + + + + + + { + togsdgleModal1() + }} + > + 取消 + + + + + + + + ); +} + +const styles = StyleSheet.create({ + slider: { + width: '100%', + height: 40, + marginTop: -30, + }, + downloadButton1: { + position: 'absolute', + bottom: 20, // 确保按钮距离底部一定距离 + right: 20, // 确保按钮距离右侧一定距离 + backgroundColor: 'rgba(0, 0, 0, 0.5)', + paddingVertical: 10, + paddingHorizontal: 20, + borderRadius: 5, + zIndex: 1, // 确保按钮在视频之上 + }, + q1: { + width: "80%", + height: 85, + backgroundColor: '#fff', + marginTop: 20, + flexDirection: 'row', + justifyContent: 'space-around', + alignItems: 'center', + alignSelf: 'center', + }, + Shuru: { + width: "100%", + height: 60, + backgroundColor: '#fff', + }, + Shuru1: { + width: "100%", + height: 150, + backgroundColor: '#fff', + }, + + modalBackground: { + flex: 1, + height: 500, + justifyContent: 'flex-end', // 让弹出层显示在底部 + alignItems: 'center', + backgroundColor: 'rgba(0, 0, 0, 0.5)', // 半透明背景 + }, + modalContent: { + backgroundColor: 'white', + padding: 20, + width: '100%', + borderTopLeftRadius: 10, + flexDirection: 'row', + alignItems: 'center', + borderBottomWidth: 0.5, + borderBottomColor: '#e4e4e4', + justifyContent: 'space-between', + }, + bottom: { + width: "100%", + flexDirection: 'row', + justifyContent: 'space-around', + alignItems: 'center', + height: 50, + backgroundColor: '#fff', + borderTopWidth: 1, + borderTopColor: '#e4e4e4', + }, + header: { + alignItems: 'center', + height: 40, + borderBottomWidth: 1, + borderBottomColor: '#e4e4e4', + }, + header1: { + alignItems: 'center', + height: 40, + borderBottomWidth: 1, + borderBottomColor: '#e4e4e4', + marginTop: 10, + }, + collapsedContent: { + marginTop: 10, + padding: 15, + backgroundColor: '#f0f0f0', + borderRadius: 5, + }, + headerText: { + fontSize: 18, + color: '#333', + }, + panel: { + padding: 10, + }, + panelText: { + fontSize: 16, + color: '#333', + }, + container: { + flex: 1, + backgroundColor: '#fff', + }, + top: { + width: Dimensions.get('window').width, + height: 240, + backgroundColor: 'red', + }, + topText: { + color: '#fff', + fontSize: 20, + }, + tabs: { + flex: 1, + marginTop: 10, // 添加顶部的间隔,避免和上面的元素重叠 + }, + tabContent: { + padding: 15, + height: Dimensions.get('window').height - 400, + backgroundColor: '#fff', + }, + playButton: { + position: 'absolute', + top: '40%', // 将按钮放置在视频的中间 + left: '40%', + backgroundColor: 'rgba(0, 0, 0, 0.5)', // 半透明背景 + paddingVertical: 10, + paddingHorizontal: 20, + borderRadius: 5, + }, + playButtonText: { + color: '#fff', + fontSize: 18, + }, + downloadButton: { + position: 'absolute', + // 放在视频的底部 + bottom: 10, + right: 10, + + }, + downloadButtonText: { + color: 'red', + fontSize: 16, + }, + downloadButtonText1: { + color: 'white', + fontSize: 16, + flexDirection: 'row', + alignItems: 'center', + }, + body: { + flexDirection: 'row', + marginTop: 10, + marginBottom: 10, + }, + input: { + width: '100%', + height: 40, + padding: 10, + borderWidth: 1, + borderColor: '#ccc', + borderRadius: 5, + marginBottom: 20, + }, +}); \ No newline at end of file diff --git a/app/YgFile/MeetingShow.tsx b/app/YgFile/MeetingShow.tsx new file mode 100644 index 0000000..208d731 --- /dev/null +++ b/app/YgFile/MeetingShow.tsx @@ -0,0 +1,40 @@ +import { StyleSheet, Text, View, ScrollView, Image } from 'react-native' +import React from 'react' + +export default function MeetingShow() { + return ( + + + + 由中国临床肿瘤学会(CSCO)、北京市希思科临床肿瘤学研究基金会共同主办的第十七届全国临床肿瘤学大会暨2014年CSCO学术年会于2014年9月17日~21日在厦门国际会议中心隆重召开。 + + 本届年会秉承“提升规范水平,拓展国际视野”的主题,得到了广大CSCO会员的支持和国家有关部门的充分肯定,大会共安排500多个主题或专题报告讲座,59个中文专场、10个英文专场、48场学术早餐会和卫星会,在会上交流科研论文1200余篇。吸引了2万多名参会代表和100多家临床肿瘤学相关的企事业单位和学术组织踊跃参加,创CSCO年会参会人数的又一个新高。“场场爆满”“站座难求”的局面是今年CSCO的一大特色,参会者极高的学习热情一直持续到CSCO的最后一天。 + + + 首先,本届年会最大的特色—举办国际联合专场 + + + 与美国临床肿瘤学会(ASCO)、欧洲肿瘤内科学会(ESMO)、国际肺癌研究学会(IASLC)、日本临床肿瘤学会(JSMO)、国际癌症免疫治疗学会(SITC)、美国华裔血液及肿瘤学家学会(CAHON)、美中抗癌协会(US CACA)等国际上很有影响力的学会共同举办联合专场(Joint Symposium),创下了CSCO年会国际联合专场数量的新高,这些专场上的讲者给大家带来各个国家、地区及各个研究领域的最新进展,内容涵盖目前肿瘤诊治的焦点和热点话题。 + + 这些联合专场,体现了CSCO对于“将推广国际化的工作落到实处、以国际视野推动我国临床肿瘤学发展”的具体行动。 + + + 其次,全体大会——我国临床肿瘤学者本年度杰出贡献和工作的浓缩 + + + 今年一改以往第一天举办开幕式的传统,将开幕式改为9月19日下午的全体大会(Plenary Session)的形式。全体大会占据9月19日整个下午,而且也是当天下午唯一安排的学术场次。之所以占据了这么重要的位置,是因为其中每个环节设置都浓聚了大家近1年来的心血和努力。同时,这个下午也是我国临床肿瘤学前辈以及当前活跃在我国临床肿瘤学领域的“主力们”作出的杰出贡献和工作的一个浓缩。 + + 全体大会由我国3位临床肿瘤学领域德高望重的前辈——孙燕院士、廖美琳教授、管忠震教授任荣誉主席,秦叔逵教授、马军教授和吴一龙教授担任大会主席。在全体大会上颁出了首个“CSCO年度成就奖”,中国人民解放军第八一医院的秦叔逵教授获此殊荣。颁奖典礼之后,全体大会安排了重量级的学术报告,由美国Dana Farber癌症研究所的Pasi A. Jänne教授带来的关于“肺癌免疫治疗和靶向治疗进展(Development of Immunotherapy and Targeted Therapy for Lung Cancer)”以及4篇最重要的口头交流报告。肿瘤的免疫治疗已经发展到了一个新的阶段和高度,是如今肿瘤治疗的热点和焦点。这些口头报告的加入使全体大会的学术性特点更加鲜明,彰显了我国临床肿瘤学研究在1年来取得的重要成果,也让世界更多地听到来自中国的“好声音”。 + + + + + + + ) +} + +const styles = StyleSheet.create({}) \ No newline at end of file diff --git a/app/YgFile/Preview.tsx b/app/YgFile/Preview.tsx new file mode 100644 index 0000000..7bda5c3 --- /dev/null +++ b/app/YgFile/Preview.tsx @@ -0,0 +1,27 @@ +import { StyleSheet, Text, View, ScrollView } from 'react-native' +import React from 'react' + +export default function Preview() { + return ( + + + 会议时间:2019.5.14-2019.5.19 + 会议地点:捷克 布拉格 + 会议地点 + 2019年国际胃癌大会(IGCC)将于2019年5月8日至11日在捷克布拉格举行。IGCC是国际胃癌协会 (IGCA)主办的两年一届的全球性会议,会议主题涵盖胃癌的基础和转化研究、预防、诊断(含早诊和筛查)、治疗、康复等各个方面。国际胃癌协会(IGCA)成立于1995年3月29日,其宗旨是为推进胃癌的预防、诊断和治疗研究提供一个国际论坛;促进全世界胃癌的根除。 + BUILDING BRIDGES will be the motto of the 2019 International Gastric Cancer Congress. + 摘要提交截止日期:2018年11月30日 + Registration Fee Includes + - Coffee breaks and lunches during main congress days + - Welcome reception admission + - Congress bag with all materials + 参会对象: + 政府代表、医院管理者、科室主任、副主任、医生及从相关领域研究的专家、科研人员、医药企业等。 + + + + + ) +} + +const styles = StyleSheet.create({}) \ No newline at end of file diff --git a/app/YgFile/TumorHospital.tsx b/app/YgFile/TumorHospital.tsx new file mode 100644 index 0000000..f789d13 --- /dev/null +++ b/app/YgFile/TumorHospital.tsx @@ -0,0 +1,277 @@ +import { + Text, + View, + ScrollView, + StyleSheet, + Image, + Dimensions, + ActivityIndicator, + TouchableOpacity, +} from "react-native"; +import Swiper from "react-native-swiper"; +import React, { useEffect, useState } from "react"; +import axiosApi from "../api/axios"; +import { router } from "expo-router"; + +export default function TumorHospital() { + + const [data1, setData1] = useState([]); // 轮播图数据 + const [data2, setData2] = useState([]); // 会议报告数据 + const [loading, setLoading] = useState(true); // 加载状态 + // 获取轮播图数据 + const fetchCarouselImages = async () => { + try { + const response = await axiosApi.get("/fps/carousel"); + setData1(response.data.carousel); + } catch (error) { + console.error("错误原因", error); + } finally { + setLoading(false); + } + }; + + useEffect(() => { + fetchCarouselImages(); + + }, []); + + + // 轮播图内容渲染 + const renderCarousel = () => { + if (loading) { + return ( + + + Loading... + + ); + } + if (data1.length === 0) { + return ( + + 暂无图片 + + ); + } + return ( + + {data1.map((item, index) => ( + + + + ))} + + ); + }; + + + + return ( + + + {renderCarousel()} + + + 会议预告 + + + 更多 > + + + + { + data1.map((item, index) => { + return ( + { + router.push({ + pathname: '/YgFile/Preview', + params: { + name: item.carouseltitle, + } + }) + }} + > + + + + {item.carouseltitle} + {item.carouseltitle}国际胃癌大会(IGCC)将于2019年5月8日至11日在捷克布拉格举行。会 (IGCA)主办的两年一届的全球性会议,会议主题涵盖胃癌的基础和转化研究、预防、诊断(含早诊和筛查)、治疗、康复等各个方面。国际胃癌协会(IGC1995年3月2进胃癌的预防、诊断和治疗研究提供一个 + + + + + ) + }) + } + + + + 会议报道 + + + 更多 > + + + + { + data1.map((item, index) => { + return ( + + { + router.push({ + pathname: "/YgFile/MeetingShow", + params: { + name: item.carouseltitle, + } + }) + }} + > + + + + {item.carouseltitle} + + ) + }) + } + + + + + ) +} + +const styles = StyleSheet.create({ + eqwe: { + width: "100%", + marginTop: 1, + }, + eqw1e: { + width: "50%", + marginTop: 1, + flexDirection: "row", + justifyContent: "space-between", + }, + q1: { + width: "100%", + height: 120, + padding: 10, + marginTop: 3, + backgroundColor: "#FFF", + flexDirection: "row", + }, + q11: { + width: "100%", + height: 200, + padding: 10, + marginTop: 3, + backgroundColor: "#FFF", + + }, + mdoe: { + padding: 10, + flexDirection: "row", + justifyContent: "space-between", + width: "100%", + backgroundColor: "#FFF", + marginTop: 10, + }, + container: { + flex: 1, + backgroundColor: "#f2f2f2", + }, + wrapper: { + height: 200, + }, + slide: { + flex: 1, + justifyContent: "center", + alignItems: "center", + backgroundColor: "transparent", + }, + slideImage: { + width: Dimensions.get("window").width, + height: "100%", + resizeMode: "cover", + }, + title: { + width: Dimensions.get("window").width, + color: "#000", + fontSize: 16, + textAlign: "center", + backgroundColor: "#FFF", + paddingHorizontal: 8, + paddingVertical: 4, + marginLeft: -9, + borderRadius: 5, + }, + dot: { + backgroundColor: "rgba(255, 255, 255, 0.5)", + width: 8, + height: 8, + borderRadius: 4, + marginHorizontal: 3, + }, + activeDot: { + backgroundColor: "#FFF", + width: 10, + height: 10, + borderRadius: 5, + marginHorizontal: 3, + }, + main: { + width: Dimensions.get("window").width, + flexDirection: "row", + height: 200, + display: "flex", + justifyContent: "space-around", + alignItems: "center", + flexWrap: "wrap", + backgroundColor: "#FFF", + marginTop: 40, + }, + loadingContainer: { + justifyContent: "center", + alignItems: "center", + height: 200, + }, + errorContainer: { + justifyContent: "center", + alignItems: "center", + height: 200, + }, + logimg: { + width: 60, + height: 60, + borderRadius: "50%", + backgroundColor: "#E4E4E4", + justifyContent: "center", + alignItems: "center", + margin: 10, + }, + imgs: { + width: 30, + height: 30, + }, +}); diff --git a/app/YgFile/VideoPlayer.tsx b/app/YgFile/VideoPlayer.tsx new file mode 100644 index 0000000..d46c3fe --- /dev/null +++ b/app/YgFile/VideoPlayer.tsx @@ -0,0 +1,204 @@ +import React, { useState, useEffect, useRef } from 'react'; +import { + View, + Text, StyleSheet, ActivityIndicator, Image, TouchableOpacity, + Platform, + Alert, + Button +} from 'react-native'; +import * as FileSystem from 'expo-file-system'; +import * as ScreenOrientation from 'expo-screen-orientation'; +import { shareAsync } from 'expo-sharing'; +import { useEvent } from 'expo'; +import { useVideoPlayer, VideoView } from 'expo-video'; + +const VideoPlayer = () => { + const [loading, setLoading] = useState(true); + const [cachedVideo, setCachedVideo] = useState(null); + const [currentTime, setCurrentTime] = useState(0); + const [totalDuration, setTotalDuration] = useState(0); + const [isFullScreen, setIsFullScreen] = useState(false); + const [error, setError] = useState(null); + const videoSource = "https://media.w3.org/2010/05/sintel/trailer.mp4" + + const videoRef = useRef(null); + + const player = useVideoPlayer(videoSource, player => { + player.loop = true; + player.play(); + }); + + const { isPlaying } = useEvent(player, 'playingChange', { isPlaying: player.playing }); + + const xia1 = async () => { + // 锁定屏幕为横屏模式 + await ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.LANDSCAPE); + + // 更新状态,设置当前为横屏模式 + setIsFullScreen(true); + } + + + // 下载视频 + const xia = async () => { + const filename = 'small.mp4'; + const result = await FileSystem.downloadAsync( + videoSource, + FileSystem.documentDirectory + filename + ); + save(result.uri, filename, 'video/mp4'); + } + const save = async (uri: string, filename: string, mimeType: string) => { + try { + if (Platform.OS === 'android') { + const permissions = await FileSystem.StorageAccessFramework.requestDirectoryPermissionsAsync() + if (permissions.granted) { + const base64 = await FileSystem.readAsStringAsync(uri, { + encoding: FileSystem.EncodingType.Base64, + }); + // 创建文件并写入 + const newUri = await FileSystem.StorageAccessFramework.createFileAsync( + permissions.directoryUri, + filename, + mimeType + ); + await FileSystem.writeAsStringAsync(newUri, base64, { + encoding: FileSystem.EncodingType.Base64, + }); + Alert.alert("文件已保存", `文件已成功保存到: ${newUri}`); + } else { + shareAsync(uri); // 如果没有权限,可以让用户分享文件 + } + } else { + shareAsync(uri) + } + } catch (error) { + console.error("保存文件时出错:", error); + Alert.alert("错误", "文件保存失败"); + } + + } + + + return ( + + + +