main
liudan 1 year ago
parent 65d02d53fc
commit aa0b3bb48e
  1. 171
      components/navbar.vue
  2. 24
      components/page/banner/index.vue
  3. 3
      pages.json
  4. 5
      pages/index/index.vue
  5. BIN
      static/indexBg.png

@ -0,0 +1,171 @@
<template>
<view class="navbar" :style="{height:statusBarHeight+navBareight +'px'}"> <!-- 如若不写 高度始终为44 没有找到原因 -->
<view class="narbar-flexd">
<view :style="{height:statusBarHeight+'px',background:''}"></view>
<view :class="isCenter?'narbar-content':'isCenter'" :style="{height:navBareight+'px'}" >
<!-- 左侧返回按钮 -->
<view class="left" @click="onBack" v-if="back&&toIndex" :style="[{color},{paddingTop}]">
<u-icon name="arrow-left" size="20"></u-icon>
<!-- <uni-icons type="arrowleft" size="25" :color='color' ></uni-icons> -->
<!-- <u--image :showLoading="true" src="https://bsl-lj-rent.oss-cn-shanghai.aliyuncs.com/idn-mac/indexs/lianxi.png" width="60rpx" height="71rpx" @click="click"></u--image> -->
</view>
<!-- 不去扫码返回按钮 -->
<view class="left" @click="onBackIndex" v-if="back&&!toIndex" :style="[{color},{paddingTop}]">
<u-icon name="arrow-left" size="20"></u-icon>
<!-- <uni-icons type="arrowleft" size="25" :color='color' ></uni-icons> -->
<!-- <u--image :showLoading="true" src="https://bsl-lj-rent.oss-cn-shanghai.aliyuncs.com/idn-mac/indexs/lianxi.png" width="60rpx" height="71rpx" @click="click"></u--image> -->
</view>
<view class="title">
{{title}}
</view>
</view>
</view>
<view class="navHeight" :style="{height:statusBarHeight+navBareight +'px'}"></view>
</view>
</template>
<script>
export default {
data() {
return {
statusBarHeight:20,
navBareight: 45,
windowWidth: 375,
};
},
props:{
title:{ // ()
type:String,
default:'#fff'
},
toIndex:{
type:Boolean,
default:true
},
color:{ // ()
type:String,
default:'#222'
},
//使background 使backgroundColor
background:{ // ()
type:String,
default:'transparent'
},
back:{ // ()
type:Boolean,
default:false
},
isCenter:{//
type:Boolean,
default:true
}
},
created() {
// --
let {
statusBarHeight,
windowWidth
} = uni.getSystemInfoSync()
this.statusBarHeight = statusBarHeight
this.windowWidth = windowWidth
//
//#ifndef H5 || MP-ALIPAY ||APP-PLUS
//
let {
top,
bottom,
left
} = uni.getMenuButtonBoundingClientRect()
// =-+-
this.navBareight = (bottom - statusBarHeight) + (top - statusBarHeight)
this.windowWidth = left
//#endif
},
methods: {
//
onBack() {
this.$emit("onBack");
uni.navigateBack({
delta:1,//2
})
},
onBackIndex(){
uni.switchTab({
url:'/pages/index/index'
})
}
}
}
</script>
<style lang="scss">
.navbar {
background-color: #19B459;
// background-image: url('https://bsl-lj-rent.oss-cn-shanghai.aliyuncs.com/idn-mac/index/90.png') !important;
// background-size: 100% 100% !important;
.narbar-flexd {
// background-image: url('https://bsl-lj-rent.oss-cn-shanghai.aliyuncs.com/idn-mac/index/90.png') !important;
background-size: 100% 100% !important;
position: fixed;
top: 0;
left: 0;
z-index: 99;
width: 100%;
// padding-bottom: 10rpx;
.narbar-content {
// height: 45px;
padding: 0 24upx;
// margin-bottom: 10px;
display: flex;
box-sizing: border-box;
justify-content:center;
align-items: center;
background-color: #19B459;
.left{
position: absolute;
left: 5%;
font-weight: 600;
}
.title{
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
}
}
.isCenter{
// height: 45px;
padding: 0 24upx;
// margin-bottom: 10px;
display: flex;
box-sizing: border-box;
justify-content:flex-start;
align-items: center;
.left{
position: absolute;
left: 5%;
font-weight: 600;
}
.title{
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 500;
color: #222222;
}
}
}
.navHeight {
height: 60px;
}
}
</style>

@ -14,11 +14,12 @@
</view> --> </view> -->
<!-- 新的 --> <!-- 新的 -->
<view class="outerContainer"> <view class="outerContainer">
<image src="../../../static/indexBg.png" mode="widthFix" class="indexBg"></image>
<view class="diy-banner"> <view class="diy-banner">
<!-- 图片轮播 --> <!-- 图片轮播 -->
<swiper class="swiper-box" :autoplay="autoplay" :duration="duration" :circular="true" :interval="itemStyle.interval * 1000" @change="_bindChange"> <swiper class="swiper-box" :autoplay="autoplay" :duration="duration" :circular="true" :interval="itemStyle.interval * 1000" @change="_bindChange">
<swiper-item v-for="(dataItem, index) in dataList" :key="index"> <swiper-item v-for="(dataItem, index) in dataList" :key="index">
<image mode="widthFix" class="slide-image" :src="dataItem.imgUrl" @click="onLink(dataItem.link)"/> <image mode="aspectFill" class="slide-image" :src="dataItem.imgUrl" @click="onLink(dataItem.link)"/>
</swiper-item> </swiper-item>
</swiper> </swiper>
<!-- 指示点 --> <!-- 指示点 -->
@ -106,9 +107,20 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.outerContainer{ .outerContainer{
background: #19B459; // background: #19B459;
padding:0 24rpx; // padding:0 24rpx;
padding-top: 26rpx; padding-top: 26rpx;
position: relative;
.indexBg{
width:100%;
height:auto;
position: absolute;
top:0;
left:0;
z-index:1;
}
} }
.diy-banner { .diy-banner {
position: relative; position: relative;
@ -116,12 +128,14 @@
background: #E3E5E7; background: #E3E5E7;
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
margin-top: 26rpx;
position: relative;
z-index:2;
margin:0 24rpx;
// padding-top: 26rpx;
// swiper // swiper
.swiper-box { .swiper-box {
height: 100%; height: 100%;
.slide-image { .slide-image {
width: 100%; width: 100%;
height: 100%; height: 100%;

@ -36,7 +36,8 @@
{ {
"path" : "pages/index/index", "path" : "pages/index/index",
"style" : { "style" : {
"enablePullDownRefresh" : true "enablePullDownRefresh" : true,
"navigationStyle": "custom"
} }
}, },
{ {

@ -1,5 +1,6 @@
<template> <template>
<view class="container"> <view class="container">
<navbar title="首页" :isCenter="true"></navbar>
<!-- 店铺页面组件 --> <!-- 店铺页面组件 -->
<Page :items="items" /> <Page :items="items" />
</view> </view>
@ -9,12 +10,14 @@
import { setCartTabBadge } from '@/core/app' import { setCartTabBadge } from '@/core/app'
import * as Api from '@/api/page' import * as Api from '@/api/page'
import Page from '@/components/page' import Page from '@/components/page'
import navbar from '@/components/navbar.vue'
const App = getApp() const App = getApp()
export default { export default {
components: { components: {
Page Page,
navbar
}, },
data() { data() {
return { return {

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Loading…
Cancel
Save