1
This commit is contained in:
@@ -1,30 +1,49 @@
|
||||
import React from 'react';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { View, Text, Image } from '@tarojs/components';
|
||||
import { GeneralNavbar } from '@/components';
|
||||
import { useGlobalState } from '@/store/global';
|
||||
import httpService from '@/services/httpService';
|
||||
import './index.scss';
|
||||
|
||||
const EnableNotificationPage: React.FC = () => {
|
||||
const { statusNavbarHeightInfo } = useGlobalState() || {};
|
||||
const { totalHeight = 98 } = statusNavbarHeightInfo || {};
|
||||
const [qrCodeUrl, setQrCodeUrl] = useState<string>('');
|
||||
|
||||
// 获取二维码
|
||||
useEffect(() => {
|
||||
const fetchQRCode = async () => {
|
||||
try {
|
||||
const res = await httpService.post('/parameter/many_key', {
|
||||
keys: 'ServiceAccountQRCode',
|
||||
});
|
||||
if (res.code === 0 && res.data?.ServiceAccountQRCode) {
|
||||
setQrCodeUrl(res.data.ServiceAccountQRCode);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取二维码失败:', error);
|
||||
}
|
||||
};
|
||||
fetchQRCode();
|
||||
}, []);
|
||||
|
||||
// 示例消息数据
|
||||
const exampleMessages = [
|
||||
{
|
||||
id: '1',
|
||||
avatar: require('@/static/userInfo/default_avatar.svg'),
|
||||
avatar: require('@/static/other_pages/albert-avatar.png'),
|
||||
name: 'Albert',
|
||||
content: '发现一家宝藏新球场,周末一起去试试吗?',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
avatar: require('@/static/userInfo/default_avatar.svg'),
|
||||
avatar: require('@/static/other_pages/evelyn-avatar.png'),
|
||||
name: 'Evelyn',
|
||||
content: '周五晚混双比赛,寻找NTRP 3.5队友!',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
avatar: require('@/static/userInfo/default_avatar.svg'),
|
||||
avatar: require('@/static/other_pages/cici-avatar.png'),
|
||||
name: 'CiCi',
|
||||
content: '我也在黄浦,明早8点晨练打球吗?',
|
||||
},
|
||||
@@ -64,11 +83,17 @@ const EnableNotificationPage: React.FC = () => {
|
||||
{/* 二维码区域 */}
|
||||
<View className="enable_notification_page__qr_section">
|
||||
<View className="enable_notification_page__qr_wrapper">
|
||||
<Image
|
||||
className="enable_notification_page__qr_image"
|
||||
src={require('@/static/other_pages/qr_code.svg')}
|
||||
mode="aspectFit"
|
||||
/>
|
||||
{qrCodeUrl ? (
|
||||
<Image
|
||||
className="enable_notification_page__qr_image"
|
||||
src={qrCodeUrl}
|
||||
mode="aspectFit"
|
||||
/>
|
||||
) : (
|
||||
<View className="enable_notification_page__qr_placeholder">
|
||||
<Text className="enable_notification_page__qr_loading">加载中...</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
<Text className="enable_notification_page__qr_text">长按关注👆开启提醒</Text>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user