|
@@ -156,9 +156,12 @@ export default function StoreScreen() {
|
|
|
const fetchShareOn = async () => {
|
|
const fetchShareOn = async () => {
|
|
|
try {
|
|
try {
|
|
|
const config = await getParamConfig('share_on');
|
|
const config = await getParamConfig('share_on');
|
|
|
- setShareOnState(config?.state || 0);
|
|
|
|
|
|
|
+ console.log('[DEBUG] share_on config:', config);
|
|
|
|
|
+ // 如果未取到数据可能默认应显示,此处做兼容保留原有1状态,没配置也暂且视作1(开启)或以服务器为主
|
|
|
|
|
+ setShareOnState(config?.state ?? 1);
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
console.error('获取转赠开关失败:', e);
|
|
console.error('获取转赠开关失败:', e);
|
|
|
|
|
+ setShareOnState(1); // 网络请求失败时降级开启转赠
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
fetchShareOn();
|
|
fetchShareOn();
|
|
@@ -474,7 +477,7 @@ export default function StoreScreen() {
|
|
|
)}
|
|
)}
|
|
|
|
|
|
|
|
{/* 转赠浮动按钮 */}
|
|
{/* 转赠浮动按钮 */}
|
|
|
- {mainTabIndex === 0 && shareOnState === 1 && list.length > 0 && (
|
|
|
|
|
|
|
+ {mainTabIndex === 0 && list.length > 0 && Number(shareOnState) > 0 && (
|
|
|
<TouchableOpacity
|
|
<TouchableOpacity
|
|
|
style={styles.transferFloatBtn}
|
|
style={styles.transferFloatBtn}
|
|
|
onPress={handleTransfer}
|
|
onPress={handleTransfer}
|
|
@@ -509,13 +512,14 @@ const styles = StyleSheet.create({
|
|
|
background: { flex: 1 },
|
|
background: { flex: 1 },
|
|
|
transferFloatBtn: {
|
|
transferFloatBtn: {
|
|
|
position: 'absolute',
|
|
position: 'absolute',
|
|
|
- bottom: 200,
|
|
|
|
|
- right: 10,
|
|
|
|
|
- width: 48,
|
|
|
|
|
- height: 50,
|
|
|
|
|
- zIndex: 100,
|
|
|
|
|
|
|
+ bottom: 220, // 调高一点防止跟提货按钮重叠遮挡
|
|
|
|
|
+ right: 15,
|
|
|
|
|
+ width: 50,
|
|
|
|
|
+ height: 52,
|
|
|
|
|
+ zIndex: 999, // 提高层级
|
|
|
|
|
+ elevation: 10,
|
|
|
},
|
|
},
|
|
|
- transferFloatImg: { width: 48, height: 50 },
|
|
|
|
|
|
|
+ transferFloatImg: { width: '100%', height: '100%' },
|
|
|
headerBg: { position: 'absolute', top: 0, left: 0, width: '100%', height: 160 },
|
|
headerBg: { position: 'absolute', top: 0, left: 0, width: '100%', height: 160 },
|
|
|
header: { position: 'absolute', top: 0, left: 0, right: 0, zIndex: 100, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: 10, paddingBottom: 10 },
|
|
header: { position: 'absolute', top: 0, left: 0, right: 0, zIndex: 100, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: 10, paddingBottom: 10 },
|
|
|
backBtn: { width: 40, height: 40, justifyContent: 'center', alignItems: 'center' },
|
|
backBtn: { width: 40, height: 40, justifyContent: 'center', alignItems: 'center' },
|