diff --git a/src/pages/index/index.jsx b/src/pages/index/index.jsx
index 732cdc7..924c0a9 100644
--- a/src/pages/index/index.jsx
+++ b/src/pages/index/index.jsx
@@ -44,16 +44,55 @@ export default function Index() {
// });
}, []);
+ const CustomTest = () => {
+ return 自定义组件;
+ };
+
const HomeCardItem = () => {
return [
- { cityName: "北京", imagePath: beijing },
- { cityName: "上海", imagePath: shanghai },
- { cityName: "广州", imagePath: guangzhou },
- { cityName: "深圳", imagePath: shenzhen },
- { cityName: "深圳", imagePath: shenzhen },
- { cityName: "深圳", imagePath: shenzhen },
- { cityName: "深圳", imagePath: shenzhen },
-
+ {
+ cityName: "北京",
+ imagePath: beijing,
+ isCustom: false,
+ customCom: "test",
+ },
+ // 双数插入
+ {
+ cityName: "上海",
+ imagePath: shanghai,
+ isCustom: true,
+ customCom: ,
+ },
+ {
+ cityName: "上海",
+ imagePath: shanghai,
+ isCustom: false,
+ customCom: "test",
+ },
+ {
+ cityName: "上海",
+ imagePath: shanghai,
+ isCustom: true,
+ customCom: ,
+ },
+ {
+ cityName: "广州",
+ imagePath: guangzhou,
+ isCustom: false,
+ customCom: "test",
+ },
+ {
+ cityName: "上海",
+ imagePath: shanghai,
+ isCustom: true,
+ customCom: ,
+ },
+ {
+ cityName: "深圳",
+ imagePath: shenzhen,
+ isCustom: false,
+ customCom: "test",
+ },
].map((item, index) => {
return (
// 设置自动换行
@@ -61,19 +100,23 @@ export default function Index() {
style={{ marginRight: index % 2 != 1 ? "10px" : "0px" }}
className="homeCardItem"
>
-
- {/* 城市封面图片 */}
-
-
+ {!item.isCustom ? (
+
+ {/* 城市封面图片 */}
+
+
+ ) : (
+ item.customCom
+ )}
);
});
@@ -93,47 +136,48 @@ export default function Index() {
return (
- {/* 顶部 */}
-
- {/* 头像 */}
-
- {/* color="#F00" */}
-
- {
- Taro.request({
- url: " http://172.19.0.1:8082/test", //仅为示例,并非真实的接口地址
- method: "POST",
- data: {
- openid: "111",
- wxid: "22",
- },
- header: {
- "content-type": "application/json", // 默认值
- },
- success: function (res) {
- console.log(res.data);
- },
- });
- }}
- >
- 发起请求
-
+
+ {/* 顶部 */}
+
+ {/* 头像 */}
+
+ {/* color="#F00" */}
+
+ {
+ Taro.request({
+ url: " http://172.19.0.1:8082/test", //仅为示例,并非真实的接口地址
+ method: "POST",
+ data: {
+ openid: "111",
+ wxid: "22",
+ },
+ header: {
+ "content-type": "application/json", // 默认值
+ },
+ success: function (res) {
+ console.log(res.data);
+ },
+ });
+ }}
+ >
+ 发起请求
+
+
+
+ {/* 省份标签 */}
+
+
+
+
+ {/* 城市列表 */}
+
+
+
+
+
-
- {/* 省份标签 */}
-
-
-
-
- {/* 城市列表 */}
-
-
-
-
-
-
{/* 底部tabbar */}