<template>
<view class="content">
<image class="logo" src="/static//icon/sytb.png"></image>
<view :style="{ height: `calc(${globalData.statusBarHeight}rpx + 158rpx)` }"></view>
<view class="content-swiper">
<u-swiper :list="swiperList" keyName="img" @change="e => (current = e.current)" :autoplay="true"
height="300rpx">
<view slot="indicator" class="indicator">
<view class="indicator__dot" v-for="(item, index) in swiperList" :key="index"
:class="[index === current && 'indicator__dot--active']"></view>
</view>
</u-swiper>
</view>
<view class="content-matter">
<view class="content-matter-market">
<view></view>
<view>用户需求广场</view>
</view>
<view class="content-matter-marketplace" v-for="(v , index) in 10" @click="clickJump" :key="index">
<image src="/static//icon/sytb.png" mode=""></image>
<view class="content-matter-marketplace-bazaar">
<view class="">
灯泡灯芯坏了
</view>
<view class="">
说明:有一个字不是特别亮,希望换一盏灯希望换一盏灯希望换一盏灯
</view>
<view class="">
<text>维修时间:</text>
<text>2023-02-23</text>
</view>
</view>
</view>
</view>
<com-navbar :leftIcon="false" :homeShow="false" bgColor="transparent" title="首页"
:titleStyle="{ color: '#FFFFFF', fontSize: '32rpx',scrollTopHeader: scrollTopHeader }" />
<com-tabbar @tabBarChange='tabBarChange' :list="tabBarList"></com-tabbar>
</view>
</template>
<script>
import apiBaseConfig from '@/config/index.js';
import uniGo from '@/utils/unIGO.js';
export default {
data() {
return {
title: 'Hello',
imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData,
scrollTopHeader: 0,
tabBarList: [{
name: "首页", // name
icon: "/static/tabbar/tb1.png", // 图标
selectIcon: "/static/tabbar/td1.png", // 选中图标
url: "/pages/home/index", // 页面路径
type: 'home'
}, {
name: "我的需求", // name
icon: "/static/tabbar/tb2.png", // 图标
selectIcon: "/static/tabbar/td2.png", // 选中图标
url: "/pages/demand/index", // 页面路径
type: 'type'
}, {
name: "发布", // name
icon: "/static/tabbar/fb.png", // 图标
selectIcon: "/static/tabbar/fb.png", // 选中图标
url: "/pages/release/index", // 页面路径
type: 'type'
}, {
name: "动态",
icon: "/static/tabbar/tb3.png", // 图标
selectIcon: "/static/tabbar/td3.png", // 选中图标
url: "/pages/order/index",
type: 'type'
}, {
name: "我的",
icon: "/static/tabbar/tb4.png", // 图标
selectIcon: "/static/tabbar/td4.png", // 选中图标
url: "/pages/my/index",
type: 'type'
}],
}
},
onLoad() {
},
onPageScroll(res) {
// console.log('页面滚动了onPageScroll-app', res.scrollTop);
this.scrollTopHeader = res.scrollTop;
},
methods: {
clickJump() {
uniGo.navigateTo({
url: `/home/index/index`
});
},
tabBarChange(url,type) {
if(type == 'type'){
uniGo.reLaunch({
url: url
});
}
}
}
}
</script>
<style>
page {
background-color: #f3f4f6;
}
</style>
<style lang="scss" scoped>
.content {
display: flex;
flex-direction: column;
// align-items: center;
justify-content: center;
&-swiper {
height: 280rpx;
background: #d8d8d8;
border-radius: 10rpx;
overflow: hidden;
width: calc(100% - 20rpx * 2);
margin: 0rpx 20rpx 0rpx;
}
&-matter {
margin: 28rpx 20rpx 50rpx;
&-market {
display: flex;
align-items: center;
margin-bottom: 20rpx;
>view:nth-child(1) {
width: 6rpx;
height: 36rpx;
background: linear-gradient(180deg, #2C66FF 0%, #579FFF 100%);
border-radius: 3rpx;
margin-right: 14rpx;
}
>view:nth-child(2) {
font-size: 28rpx;
font-family: AlibabaPuHuiTi-Medium, AlibabaPuHuiTi;
font-weight: 500;
color: #333333;
}
}
&-marketplace {
display: flex;
background-color: #ffffff;
border-radius: 8rpx;
padding: 20rpx;
margin-bottom: 20rpx;
>image {
width: 170rpx;
height: 170rpx;
margin-right: 20rpx;
}
&-bazaar {
width: 460rpx;
>view:nth-child(1) {
font-size: 28rpx;
font-family: AlibabaPuHuiTi-Medium, AlibabaPuHuiTi;
font-weight: 700;
color: #333333;
margin-top: 8rpx;
}
>view:nth-child(2) {
margin-top: 6rpx;
font-size: 24rpx;
font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi;
font-weight: 400;
color: #444444;
}
>view:nth-child(3) {
margin-top: 9rpx;
font-size: 20rpx;
font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi;
font-weight: 400;
color: #5281FF;
}
}
}
}
}
.logo {
width: 100%;
height: 340rpx;
position: absolute;
z-index: -1;
top: 0%;
left: 0%;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>