PhotoWall.tsx 928 B

123456789101112131415161718192021222324
  1. import { View } from "@tarojs/components";
  2. import './PhotoWall.scss'
  3. import Taro from "@tarojs/taro";
  4. import { useState } from "react";
  5. import NewTimePicker from "@/_health/base/new_timepicker";
  6. export default function PhotoWall() {
  7. const screenWidth = Taro.getSystemInfoSync().screenWidth
  8. const space = 2
  9. const itemWidth = (screenWidth-space*2)/3.0
  10. const [list, setList] = useState(new Array(10).fill("aaa"))
  11. return <View style={{display:'flex',flexDirection:'column'}}>
  12. <NewTimePicker />
  13. <View className="photo_wall">
  14. {
  15. list.map((item, index) => {
  16. return <View key={index} style={{ width: itemWidth, height: itemWidth, backgroundColor: 'pink',marginBottom:space }}></View>
  17. })
  18. }
  19. <View style={{ width: itemWidth, height: itemWidth }} />
  20. <View style={{ width: itemWidth, height: itemWidth }} />
  21. </View>
  22. </View>
  23. }