增加banneer占位图
This commit is contained in:
8
src/other_pages/bannerDetail/index.config.ts
Normal file
8
src/other_pages/bannerDetail/index.config.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: '',
|
||||
navigationStyle: 'custom',
|
||||
navigationBarBackgroundColor: '#FFFFFF',
|
||||
backgroundColor: '#FFFFFF',
|
||||
});
|
||||
|
||||
|
||||
16
src/other_pages/bannerDetail/index.scss
Normal file
16
src/other_pages/bannerDetail/index.scss
Normal file
@@ -0,0 +1,16 @@
|
||||
.banner_detail_page {
|
||||
min-height: 100vh;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.banner_detail_content {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.banner_detail_image {
|
||||
width: 100%;
|
||||
border-radius: 12px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
36
src/other_pages/bannerDetail/index.tsx
Normal file
36
src/other_pages/bannerDetail/index.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { View, Image } from '@tarojs/components';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { GeneralNavbar } from '@/components';
|
||||
import './index.scss';
|
||||
|
||||
function Index() {
|
||||
const [imgUrl, setImgUrl] = useState<string>('');
|
||||
|
||||
useEffect(() => {
|
||||
const instance = (Taro as any).getCurrentInstance?.();
|
||||
const params = instance?.router?.params || {};
|
||||
const url = params?.img ? decodeURIComponent(params.img) : '';
|
||||
setImgUrl(url);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<View className="banner_detail_page">
|
||||
<GeneralNavbar title="" showBack={true} />
|
||||
<View className="banner_detail_content">
|
||||
{imgUrl ? (
|
||||
<Image
|
||||
className="banner_detail_image"
|
||||
src={imgUrl}
|
||||
mode="widthFix"
|
||||
showMenuByLongpress
|
||||
/>
|
||||
) : null}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user