描述:页面

This commit is contained in:
SelfRidicule 2024-02-23 11:59:50 +08:00
parent f2de81dfdb
commit 5cd3b51e41
3 changed files with 67 additions and 78 deletions

View File

@ -30,15 +30,7 @@ Page({
"text": "我的" "text": "我的"
}, },
], ],
IMG_NAME: app.IMG_NAME, IMG_NAME: app.IMG_NAME,
indicatorDots: true,
autoplay: true,
interval: 3000,
duration: 1000,
bannerList: [{
bannerImg: ''
}],
menuList: [ menuList: [
// { // {
// name: "创业活动", // name: "创业活动",
@ -143,12 +135,14 @@ Page({
path: "" path: ""
}, },
], ],
homelist: [], bannerList: [{
background: [{ bg: '/profile/static/index/banner/1.jpg',
bg: '/profile/banner/1.jpg',
url: '' url: ''
}, { }, {
bg: '/profile/banner/2.jpg', bg: '/profile/static/index/banner/2.jpg',
url: ''
},{
bg: '/profile/static/index/banner/3.jpg',
url: '' url: ''
}] }]
}, },
@ -175,7 +169,6 @@ Page({
parkName: wx.getStorageSync('parkName') parkName: wx.getStorageSync('parkName')
}) })
wx.setStorageSync('MemberInfo', res.data) wx.setStorageSync('MemberInfo', res.data)
that.getHotList()
} }
}) })
} else { } else {
@ -185,34 +178,6 @@ Page({
} }
}, },
//轮播高度自适应——获取图片高度
imgHeight: function (e) {
var winWid = wx.getSystemInfoSync().windowWidth; //获取当前屏幕的宽度
var imgh = e.detail.height; //图片高度
var imgw = e.detail.width; //图片宽度
var swiperH = winWid * imgh / imgw + "px"
this.setData({
Height: swiperH //设置高度
})
// this.setData({
// Height: '300rpx' //设置高度
// })
},
getHotList() {
let that = this
app.AjaxRequest('get', {
'content-type': 'application/json',
'Authorization': 'Bearer ' + app.Getopenid()
}, '/menu/bannerList', {
isTop: true
}, function (res) {
that.setData({
homelist: res.data
})
})
},
navapply(e) { navapply(e) {
if (wx.getStorageSync('token')) { if (wx.getStorageSync('token')) {
if (e.currentTarget.dataset.path) { if (e.currentTarget.dataset.path) {

View File

@ -1,18 +1,22 @@
<view class="page"> <view class="page">
<scroll-view style="height:100%;" scroll-y="true"> <!-- 园区 -->
<view bindtap="navparkList" class="topList"> <view bindtap="navparkList" class="topList">
<text style="font-size: 28rpx;">当前园区:{{parkName? parkName:'请先选择园区'}}</text> <text style="font-size: 28rpx;">当前园区:{{parkName? parkName:'请先选择园区'}}</text>
<text style="color: #939393;font-size: 36rpx;"> > </text> <text style="color: #939393;font-size: 36rpx;"> > </text>
</view> </view>
<swiper class='swiper-box' indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" circular='true' style='height:{{Height}}' wx:if="{{background.length > 0}}">
<block wx:for="{{background}}" wx:key="index"> <!-- 轮播图 -->
<swiper-item> <swiper class='swiper-box' indicator-dots autoplay interval="3000" duration="1000" circular='true'>
<image src="{{IMG_NAME + item.bg}}" mode="widthFix" style="width:100%" bindload='imgHeight'></image> <swiper-item wx:for="{{bannerList}}" wx:key="index">
<image class="img" src="{{IMG_NAME + item.bg}}" mode="aspectFill"></image>
</swiper-item> </swiper-item>
</block>
</swiper> </swiper>
<view style="font-size: 12pt;background: white;padding: 20rpx 30rpx;">我的应用</view> <!-- 菜单模块 -->
<view class="itemTitleView">
<view class="title">我的应用</view>
<image class="img" src="{{IMG_NAME + '/profile/static/index/scan.png'}}" mode="aspectFill"></image>
</view>
<view class="fixed"> <view class="fixed">
<view class="fixedbox" wx:for='{{menuList}}' wx:key='index' data-path="{{item.path}}" data-name="{{item.name}}" bindtap="navapply"> <view class="fixedbox" wx:for='{{menuList}}' wx:key='index' data-path="{{item.path}}" data-name="{{item.name}}" bindtap="navapply">
<image class="menuImg" src="{{IMG_NAME + item.img}}"></image> <image class="menuImg" src="{{IMG_NAME + item.img}}"></image>
@ -20,9 +24,6 @@
</view> </view>
</view> </view>
</scroll-view>
<!-- tabBar --> <!-- tabBar -->
<view class="tab-bar"> <view class="tab-bar">
<view wx:for="{{tabBarList}}" wx:key="index" class="tab-bar-item {{item.bulge?'bulge':''}}" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab"> <view wx:for="{{tabBarList}}" wx:key="index" class="tab-bar-item {{item.bulge?'bulge':''}}" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">

View File

@ -1,12 +1,6 @@
@import "../../app.wxss"; @import "../../app.wxss";
@import "../../tabBar.wxss"; @import "../../tabBar.wxss";
page {
overflow: hidden;
}
.topList { .topList {
display: none; display: none;
width: 100%; width: 100%;
@ -20,19 +14,14 @@ page {
z-index: 9999999; z-index: 9999999;
} }
.swiper-box {
margin-top: 70rpx;
}
.page { .page {
width: 100%; width: 100%;
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
color: black; color: black;
overflow: auto; overflow: auto;
border-top: 1rpx solid #f4f4f4; background-color: #FFFFFF;
background-color: #F5F5F5; padding-top: 20rpx;
/* padding: 0 26rpx; */
} }
.activityList { .activityList {
@ -49,6 +38,27 @@ page {
position: relative; position: relative;
} }
.itemTitleView {
border-left: 8rpx solid #2A6FFF;
display: flex;
justify-content: space-between;
align-items: center;
margin: 40rpx 50rpx 0;
}
.itemTitleView .title {
margin-left: 10rpx;
font-size: 28rpx;
font-weight: bold;
color: #141414;
}
.itemTitleView .img {
width: 36rpx;
height: 36rpx;
}
.fixed { .fixed {
background: white; background: white;
padding: 0 30rpx 240rpx 30rpx; padding: 0 30rpx 240rpx 30rpx;
@ -93,6 +103,19 @@ page {
filter: gray; filter: gray;
} }
.swiper-box {
box-sizing: border-box;
/* width: 100%; */
height: 358rpx;
margin: 0 22rpx;
}
.swiper-box .img {
border-radius: 14rpx;
width: 100%;
height: 100%;
}
/* 轮播小点点 */ /* 轮播小点点 */
.swiper-box .wx-swiper-dots.wx-swiper-dots-horizontal { .swiper-box .wx-swiper-dots.wx-swiper-dots-horizontal {
margin-left: 36%; margin-left: 36%;