Commit a230a21f by 匡雅琴

车生活、家生活基本页面搭建

1 parent 5a43dd0e
Component({
data: {},
properties: {
title: String
},
methods: {}
})
\ No newline at end of file \ No newline at end of file
{
"component": true
}
\ No newline at end of file \ No newline at end of file
<view class="title">
{{title}}
</view>
\ No newline at end of file \ No newline at end of file
.title {
font-weight: 500;
font-size: 36rpx;
color: #333333;
position: relative;
}
.title::after {
content: "";
display: block;
width: 144rpx;
height: 12rpx;
background-image: linear-gradient(90deg, #61a5ff00 0%, #2699fd 100%);
border-radius: 6rpx;
position: absolute;
bottom: 4rpx;
}
Component({
data: {},
properties: {
menuList: {
type: Array,
value: []
}
},
methods: {}
})
\ No newline at end of file \ No newline at end of file
{
"component": true
}
\ No newline at end of file \ No newline at end of file
<view class="menu-box">
<view class="menu-item-box" wx:for="{{menuList}}" wx:key="index">
<view class="menu-item">
<glsx-image webp src="home/menu_icon/{{item.iconUrl}}" class="menu-item-icon"></glsx-image>
<view class="menu-item-text">
{{item.name}}
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
.menu-box {
background: #ffffff;
border-radius: 8rpx;
display: flex;
flex-wrap: wrap;
/* justify-content: space-around; */
padding: 30rpx 34rpx 30rpx 36rpx;
}
.menu-item-box {
width: 128rpx;
height: 116rpx;
text-align: center;
margin-right: 36rpx;
}
.menu-item-box:nth-child(4n) {
margin-right: 0;
}
.menu-item-box:nth-child(n+5) {
margin-top: 32rpx;
}
.menu-item-icon {
width: 72rpx;
height: 72rpx;
}
.menu-item-text {
font-weight: 400;
font-size: 24rpx;
color: #282829;
text-align: center;
margin-top: 12rpx;
}
// packageIndex/pages/carLife/index.js // packageIndex/pages/carLife/index.js
import {tripMenu,maintainCarMenu} from '../constant/lifeConstant'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
tripMenu,
maintainCarMenu
}, },
/** /**
......
{ {
"usingComponents": {} "usingComponents": {
"main-title": "../../components/MainTitle/MainTitle",
"menu-box": "../../components/MenuBox/MenuBox"
},
"navigationBarTitleText": "车生活"
} }
\ No newline at end of file \ No newline at end of file
/* packageIndex/pages/carLife/index.wxss */
\ No newline at end of file \ No newline at end of file
/* packageIndex/pages/carLife/index.wxss */
.carlife-box {
padding: 30rpx;
background: #f8f8f8;
.carlife-img {
width: 690rpx;
height: 268rpx;
}
.title-box {
margin: 30rpx 0 20rpx 0;
}
}
<!--packageIndex/pages/carLife/index.wxml--> <view class="carlife-box">
<text>packageIndex/pages/carLife/index.wxml</text> <glsx-image webp src="home/carlife_bg.png" class="carlife-img"></glsx-image>
<view class="title-box">
<main-title title="省心出行" ></main-title>
</view>
<menu-box menuList="{{tripMenu}}"></menu-box>
<view class="title-box">
<main-title title="养车服务"></main-title>
</view>
<menu-box menuList="{{maintainCarMenu}}"></menu-box>
<view class="title-box">
<main-title title="甄选车品"></main-title>
</view>
</view>
const recreationMenu = [
{
iconUrl: 'movie.png',
name: '猫眼电影',
iconTip: '19元起'
},
{
iconUrl: 'movie.png',
name: '酷狗音乐'
},
{
iconUrl: 'movie.png',
name: '爱奇艺'
},
{
iconUrl: 'movie.png',
name: 'Keep'
}
]
const foodMenu = [
{
iconUrl: 'movie.png',
name: '星巴克'
},
{
iconUrl: 'movie.png',
name: '瑞幸咖啡',
iconTip: '9.9元起'
},
{
iconUrl: 'movie.png',
name: '奈雪的茶'
},
{
iconUrl: 'movie.png',
name: '麦当劳',
iconTip: '新品'
}
]
const tripMenu = [
{
iconUrl: 'movie.png',
name: '滴滴出行',
iconTip: '10元券'
},
{
iconUrl: 'movie.png',
name: '高德打车'
},
{
iconUrl: 'movie.png',
name: '美团骑车'
},
{
iconUrl: 'movie.png',
name: '青桔单车',
iconTip: '3元券'
},
{
iconUrl: 'movie.png',
name: '哈罗单车'
},
{
iconUrl: 'movie.png',
name: '哈罗单车'
}
]
const maintainCarMenu = [
{
iconUrl: 'movie.png',
name: '道路救援',
iconTip: '免费'
},
{
iconUrl: 'movie.png',
name: '送油'
},
{
iconUrl: 'movie.png',
name: '搭电'
},
{
iconUrl: 'movie.png',
name: '换胎'
}
]
export {
recreationMenu,
foodMenu,
tripMenu,
maintainCarMenu
}
\ No newline at end of file \ No newline at end of file
// packageIndex/pages/carLife/index.js
import {recreationMenu,foodMenu} from '../constant/lifeConstant'
Page({
/**
* 页面的初始数据
*/
data: {
recreationMenu,
foodMenu
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"main-title": "../../components/MainTitle/MainTitle",
"menu-box": "../../components/MenuBox/MenuBox"
},
"navigationBarTitleText": "家生活"
}
\ No newline at end of file \ No newline at end of file
/* packageIndex/pages/homeLife/index.wxss */
.homelife-box {
padding: 30rpx;
background: #f8f8f8;
.homelife-img {
width: 690rpx;
height: 268rpx;
}
.title-box {
margin: 30rpx 0 20rpx 0;
}
}
\ No newline at end of file \ No newline at end of file
<view class="homelife-box">
<glsx-image webp src="home/homelife_bg.png" class="homelife-img"></glsx-image>
<main-title title="娱乐推荐"></main-title>
<menu-box menuList="{{recreationMenu}}"></menu-box>
<main-title title="美食推荐"></main-title>
<menu-box menuList="{{foodMenu}}"></menu-box>
</view>
/* pages/tab/select/index.wxss */ /* pages/tab/select/index.wxss */
.strategy-box { .strategy-box {
padding: 30rpx; padding: 30rpx;
background: #F8F8F8;
.strategy-item { .strategy-item {
width: 690rpx; width: 690rpx;
background: #ffffff; background: #ffffff;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!