feat: 长按下载
This commit is contained in:
parent
857a22dd6a
commit
d18bca1ccf
@ -40,15 +40,6 @@ export const AppDownload = (props: AppDownloadProps) => {
|
||||
<HandlersSvg style={{ marginBottom: -4, zIndex: 3 }} />
|
||||
<View style={styles.qrCode}>
|
||||
<QRDownloadScreen url={platform == "ios" ? IOS_APP_STORE_URL : ANDROID_APK_URL} />
|
||||
{/* <QRCode
|
||||
value={platform == "ios" ? IOS_APP_STORE_URL : ANDROID_APK_URL}
|
||||
size={200}
|
||||
color="black"
|
||||
backgroundColor="white"
|
||||
logoSize={50}
|
||||
logoBorderRadius={10}
|
||||
logoBackgroundColor="#f0f0f0"
|
||||
/> */}
|
||||
</View>
|
||||
</View>
|
||||
{/* Description */}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import * as Haptics from 'expo-haptics';
|
||||
import * as MediaLibrary from 'expo-media-library';
|
||||
import React, { useRef } from 'react';
|
||||
import { Alert, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
||||
import { Alert, StyleSheet, TouchableOpacity, View } from 'react-native';
|
||||
import QRCode from 'react-native-qrcode-svg';
|
||||
import { captureRef } from 'react-native-view-shot';
|
||||
|
||||
@ -42,45 +42,26 @@ export default function QRDownloadScreen(prop: { url: string }) {
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.title}>长按保存二维码</Text>
|
||||
|
||||
{/* 可截图的容器 */}
|
||||
<TouchableOpacity onLongPress={saveQRToGallery} activeOpacity={0.8}>
|
||||
<View ref={qrViewRef} style={styles.qrContainer}>
|
||||
<QRCode value={qrValue} size={200} />
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
|
||||
<Text style={styles.tip}>👉 长按二维码即可保存</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
// flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
padding: 20,
|
||||
backgroundColor: '#f8f8f8',
|
||||
},
|
||||
title: {
|
||||
fontSize: 18,
|
||||
fontWeight: 'bold',
|
||||
marginBottom: 20,
|
||||
textAlign: 'center',
|
||||
},
|
||||
qrContainer: {
|
||||
padding: 16,
|
||||
backgroundColor: '#fff',
|
||||
borderRadius: 12,
|
||||
borderWidth: 1,
|
||||
borderColor: '#ddd',
|
||||
shadowColor: '#000',
|
||||
shadowOffset: { width: 0, height: 2 },
|
||||
shadowOpacity: 0.1,
|
||||
shadowRadius: 4,
|
||||
elevation: 3,
|
||||
},
|
||||
tip: {
|
||||
marginTop: 20,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user