diff --git a/config/index.js b/config/index.js index 5773dc2..6a8e4e5 100644 --- a/config/index.js +++ b/config/index.js @@ -1,12 +1,17 @@ import { defineConfig } from '@tarojs/cli' +// import * as path from 'path'; //引入node的path模块 import devConfig from './dev' import prodConfig from './prod' +const path = require('path'); //引入node的path模块 // https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数 export default defineConfig(async (merge, { command, mode }) => { const baseConfig = { projectName: 'yidooplanet', + alias: { + '@': path.resolve(__dirname, '..', 'src') + }, date: '2024-3-19', designWidth: 750, deviceRatio: { diff --git a/src/images/city/beijing.jpg b/src/images/city/beijing.jpg new file mode 100644 index 0000000..4ae84e6 Binary files /dev/null and b/src/images/city/beijing.jpg differ diff --git a/src/pages/index/index.jsx b/src/pages/index/index.jsx index c274106..c96d862 100644 --- a/src/pages/index/index.jsx +++ b/src/pages/index/index.jsx @@ -1,9 +1,10 @@ -import { View, Text } from "@tarojs/components"; +import { View, Text, Image } from "@tarojs/components"; import { useLoad } from "@tarojs/taro"; -import { AtButton } from "taro-ui"; -import { AtIcon } from "taro-ui"; -import { AtAvatar } from "taro-ui"; + +import { AtAvatar, AtTag, AtIcon } from "taro-ui"; import "./index.scss"; +import beijing from "@/images/city/beijing.jpg"; +// import beijing from "../../images/city/beijing.jpg"; export default function Index() { useLoad(() => { @@ -14,7 +15,14 @@ export default function Index() { return [1, 2, 3].map((item, index) => { return ( - left + + {/* 城市封面图片 */} + + right ); @@ -26,9 +34,28 @@ export default function Index() { {/* 顶部 */} {/* 头像 */} - - - + + {/* color="#F00" */} + + + + {/* 省份标签 */} + + + 北京 + + + 上海 + + + 广州 + + + 深圳 + + + 武汉 + {/* 城市列表 */} diff --git a/src/pages/index/index.scss b/src/pages/index/index.scss index 1d13dc6..25b085c 100644 --- a/src/pages/index/index.scss +++ b/src/pages/index/index.scss @@ -7,8 +7,16 @@ flex-direction: row; // justify-content: space-between; align-items: center; + margin-bottom: 10px; } + .provinceTag { + display: flex; + flex-direction: row; + // justify-content: space-between; + align-items: center; + margin-bottom: 10px; + } .homeCards { display: flex;