'增加城市图片'

This commit is contained in:
hackrobot
2024-09-26 14:29:17 +08:00
parent cba7b54279
commit a50a769b20
12 changed files with 25 additions and 11 deletions

BIN
src/images/changsha.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/images/chengdu.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
src/images/chongqing.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
src/images/dali.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
src/images/guangzhou.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
src/images/hangzhou.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

BIN
src/images/jingzhou.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
src/images/nanjing.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/images/wuhan.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
src/images/xian.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -27,6 +27,17 @@ import "animate.css";
import beijing from "../../images/beijing.jpg";
import shanghai from "../../images/shanghai.jpg";
import shenzhen from "../../images/shenzhen.jpg";
import guangzhou from "../../images/guangzhou.jpg";
import wuhan from "../../images/wuhan.jpg";
import hangzhou from "../../images/hangzhou.jpg";
import dali from "../../images/dali.jpg";
import chongqing from "../../images/chongqing.jpg";
import changsha from "../../images/changsha.jpg";
import jingzhou from "../../images/jingzhou.jpg";
import chengdu from "../../images/chengdu.jpg";
import nanjing from "../../images/nanjing.jpg";
import xian from "../../images/xian.jpg";
// export default class Index extends Component {
const Index = () => {
@@ -51,15 +62,18 @@ const Index = () => {
dom: custDom(),
},
{ cityName: "深圳", img: shenzhen, type: "item", dom: "" },
{ cityName: "广州", img: shenzhen, type: "item", dom: "" },
{ cityName: "武汉", img: shenzhen, type: "item", dom: "" },
{ cityName: "杭州", img: shenzhen, type: "item", dom: "" },
{ cityName: "大理", img: shenzhen, type: "item", dom: "" },
{ cityName: "重庆", img: shenzhen, type: "item", dom: "" },
{ cityName: "荆州", img: shenzhen, type: "item", dom: "" },
{ cityName: "长沙", img: shenzhen, type: "item", dom: "" },
{ cityName: "广州", img: guangzhou, type: "item", dom: "" },
{ cityName: "武汉", img: wuhan, type: "item", dom: "" },
{ cityName: "杭州", img: hangzhou, type: "item", dom: "" },
{ cityName: "大理", img: dali, type: "item", dom: "" },
{ cityName: "鹤岗", img: dali, type: "item", dom: "" },
{ cityName: "成都", img: chengdu, type: "item", dom: "" },
{ cityName: "南京", img: nanjing, type: "item", dom: "" },
{ cityName: "西安", img: xian, type: "item", dom: "" },
{ cityName: "重庆", img: chongqing, type: "item", dom: "" },
{ cityName: "长沙", img: changsha, type: "item", dom: "" },
{ cityName: "荆州", img: jingzhou, type: "item", dom: "" },
].map((item, index) => {
if (item.type === "custom") {
// 根据屏幕变化,添加自定义组件
@@ -79,10 +93,10 @@ const Index = () => {
{/* 温度 */}
<View className="itemDownleft">29度</View>
{/* 消费 */}
<View className="itemDownright">$1545/月</View>
<View className="itemDownright">¥1545/月</View>
</View>
<Image
style="width: 100%;height: 100%;background: #fff;border-radius: 5%;z-index:0"
style="width: 100%;height: 100%;background: #fff;border-radius: 5%;z-index:0;opacity: 0.93"
// mode="heightFix"
src={item.img}
/>

View File

@@ -5,7 +5,7 @@
flex-direction: column;
.up {
width: 100%;
height: 200px;
min-height: 200px;
background-color: red;
margin-bottom: 20px;
}