Browse Source

续期提醒

epass
wangyx 5 months ago
parent
commit
61048145c9
  1. 18
      app.js
  2. 10
      app.json
  3. 55
      components/navigationBar/navigationBar.js
  4. 4
      components/navigationBar/navigationBar.json
  5. 18
      components/navigationBar/navigationBar.wxml
  6. 58
      components/navigationBar/navigationBar.wxss
  7. BIN
      images/bg.png
  8. BIN
      images/mine/md-restore.png
  9. 77
      pages/index/index.js
  10. 3
      pages/index/index.wxml
  11. 7
      project.private.config.json
  12. 73
      subpages/index/renewalApplication/renewalApplication.js
  13. 10
      subpages/index/renewalApplication/renewalApplication.json
  14. 15
      subpages/index/renewalApplication/renewalApplication.wxml
  15. 51
      subpages/index/renewalApplication/renewalApplication.wxss

18
app.js

@ -1,6 +1,24 @@
// app.js
App({
onLaunch: function (options) {
const { statusBarHeight, platform, windowHeight }=wx.getSystemInfoSync()
const { top, height } = wx.getMenuButtonBoundingClientRect()
// 状态栏高度
wx.setStorageSync('statusBarHeight', statusBarHeight)
// 屏幕高度
wx.setStorageSync('windowHeight', windowHeight)
// 胶囊按钮高度 一般是32 如果获取不到就使用32
wx.setStorageSync('menuButtonHeight', height ? height : 32)
// 判断胶囊按钮信息是否成功获取
if (top && top !== 0 && height && height !== 0) {
const navigationBarHeight = (top - statusBarHeight) * 2 + height
// 导航栏高度
wx.setStorageSync('navigationBarHeight', navigationBarHeight)
} else {
wx.setStorageSync('navigationBarHeight', platform === 'android' ? 48 : 40)
}
//获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度)
//这个最初我是在组件中获取,但是出现了一个问题,当第一次进入小程序时导航栏会把
//页面内容盖住一部分,当打开调试重新进入时就没有问题,这个问题弄得我是莫名其妙

10
app.json

@ -23,6 +23,13 @@
"editUser/editUser",
"checkInRecord/checkInRecord"
]
},
{
"root": "subpages/index",
"name": "index",
"pages": [
"renewalApplication/renewalApplication"
]
}
],
"window": {
@ -45,7 +52,8 @@
"text": "消息",
"pagePath": "pages/message/message",
"iconPath": "images/icon/home.png"
},{
},
{
"text": "服务",
"pagePath": "pages/serve/serve",
"iconPath": "images/icon/home.png"

55
components/navigationBar/navigationBar.js

@ -0,0 +1,55 @@
// components/navigationBar.js
Component({
/**
* 组件的属性列表
*/
properties: {
title:{
type: String,
value: '续期提醒'
},
backgroundImage:{
type: String,
value: ''
},
isSowArrow:{
type: Boolean,
value: false
},
isShowBg:{
type: Boolean,
value: false
},
height:{
type:String,
value:''
}
},
/**
* 组件的初始数据
*/
data: {
// 状态栏高度
statusBarHeight: wx.getStorageSync('statusBarHeight') + 'px',
// 导航栏高度
navigationBarHeight: wx.getStorageSync('navigationBarHeight') + 'px',
// 胶囊按钮高度
menuButtonHeight: wx.getStorageSync('menuButtonHeight') + 'px',
// 导航栏和状态栏高度
navigationBarAndStatusBarHeight: wx.getStorageSync('statusBarHeight') + wx.getStorageSync('navigationBarHeight') + 'px'
},
/**
* 组件的方法列表
*/
methods: {
handleGoToBack(){
wx.navigateBack({
delta: 1
})
}
}
})

4
components/navigationBar/navigationBar.json

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

18
components/navigationBar/navigationBar.wxml

@ -0,0 +1,18 @@
<!-- components/navigationBar.wxml -->
<view class="navigation-container" style="{{'height: ' + navigationBarAndStatusBarHeight}}">
<view class="navbg" wx:if="{{isShowBg && backgroundImage}}" style="background-image:url({{backgroundImage}}); background-size: 100% 100%; background-repeat: no-repeat; height: {{height}}">
<!-- 空白来占位状态栏 -->
<view style="{{'height: ' + statusBarHeight}}"></view>
<!-- 自定义导航栏 -->
<view class="navigation-bar" style=" height: {{navigationBarHeight}}">
<view class="arrow-content">
<view class="arrow" wx:if="{{isSowArrow}}" bindtap="handleGoToBack"></view>
</view>
<view class="navigation-title" style="{{'line-height:' + navigationBarHeight}}">{{title}}</view>
</view>
</view>
</view>
<!-- 空白占位fixed空出的位置 -->
<view style="{{'height: ' + navigationBarAndStatusBarHeight}}"></view>

58
components/navigationBar/navigationBar.wxss

@ -0,0 +1,58 @@
/* components/navigationBar.wxss */
.navigation-container {
position: fixed;
width: 100%;
z-index: 99;
top: 0;
left: 0;
}
.navigation-bar {
position: relative;
display: flex;
flex-direction: row;
align-items: center;
}
.navigation-buttons {
display: flex;
align-items: center;
margin-left: 10px;
border: 1px solid rgba(0, 0, 0, 0.05);
box-sizing: border-box;
border-radius: 15px;
background-color: transparent;
}
.nav-img {
height: 22px;
margin-left: 28rpx;
width: 22px;
}
.navigation-title {
position: absolute;
left: 104rpx;
right: 104rpx;
text-align: center;
font-size: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.arrow-content{
position: absolute;
left: 40rpx;
z-index: 999;
display: flex;
align-items: center;
}
.arrow {
width: 18rpx;
height: 18rpx;
border: 5rpx solid #101010;
border-right-color: transparent;
border-bottom-color: transparent;
transform: rotate(-45deg);
}

BIN
images/bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
images/mine/md-restore.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

77
pages/index/index.js

@ -1,7 +1,6 @@
// pages/index/index.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
@ -11,30 +10,38 @@ Page({
interval: 3000,
duration: 1000,
imgUrls: [
'/images/banner/banner1.png',
'/images/banner/banner1.png',
'/images/banner/banner1.png',
"/images/banner/banner1.png",
"/images/banner/banner1.png",
"/images/banner/banner1.png",
],
navList: [
{
name:'政策资讯'
},{
name:'入住办理'
},{
name:'退房确认'
},{
name:'续期申请'
},{
name:'续期合同'
},{
name:'报修'
},{
name:'报事'
},{
name:'生活圈'
name: "政策资讯",
},
{
name: "入住办理",
},
{
name: "退房确认",
},
{
name: "续期申请",
url: "/subpages/index/renewalApplication/renewalApplication",
},
{
name: "续期合同",
},
{
name: "报修",
},
{
name: "报事",
},
{
name: "生活圈",
},
],
searchValue:''
searchValue: "",
},
/**
@ -49,49 +56,35 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
onShareAppMessage() {},
});

3
pages/index/index.wxml

@ -15,7 +15,8 @@
<view class="ellipsis">青岛人彩棉租住房申请条件的先骨干说明</view>
</view>
<van-grid square border="{{false}}">
<van-grid-item use-slot wx:for="{{ navList }}" wx:key="index">
<van-grid-item use-slot wx:for="{{ navList }}" wx:key="index" link-type="navigateTo"
url="{{item.url}}">
<image style="width: 100rpx;min-height: 100rpx;" src="{{'../../images/icon/nav_'+index + '.png'}}" />
<text class="text-28 m-top-12">{{item.name}}</text>
</van-grid-item>

7
project.private.config.json

@ -14,6 +14,13 @@
"condition": {
"miniprogram": {
"list": [
{
"name": "subpages/index/renewalApplication/renewalApplication",
"pathName": "subpages/index/renewalApplication/renewalApplication",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "subpages/mine/editUser/editUser",
"pathName": "subpages/mine/editUser/editUser",

73
subpages/index/renewalApplication/renewalApplication.js

@ -0,0 +1,73 @@
// subpages/index/renewalApplication/renewalApplication.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
// 跳转首页
submit() {
wx.navigateBack({
delta: 1
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

10
subpages/index/renewalApplication/renewalApplication.json

@ -0,0 +1,10 @@
{
"navigationStyle": "custom",
"usingComponents": {
"navigationBar": "/components/navigationBar/navigationBar",
"van-image": "@vant/weapp/image/index",
"van-button": "@vant/weapp/button/index"
}
}

15
subpages/index/renewalApplication/renewalApplication.wxml

@ -0,0 +1,15 @@
<view class="cont">
<navigationBar title="续期申请" isSowArrow="true" isShowBg="true" backgroundImage="/images/bg.png" height="200px"></navigationBar>
<view class="tip-cont">
<van-image width="72" height="72" src="/images/mine/md-restore.png" custom-class="cusImage" />
<view class="txt">
<view>温馨提示:</view>
<view class="des">您需要登陆“爱山东”APP搜索“青岛人才”,
进入青岛免租金住房系统进行续期申请。</view>
</view>
</view>
<van-button slot="button" block type="primary" round color="linear-gradient(to right, #0DC6C6 , #46DBD5)" bind:tap="submit" custom-class="btn">
我知道了
</van-button>
</view>

51
subpages/index/renewalApplication/renewalApplication.wxss

@ -0,0 +1,51 @@
/* subpages/index/renewalApplication/renewalApplication.wxss */
page{
background: #f8f8f8;
}
.cont {
position: relative;
background: #f8f8f8;
padding: 36rpx;
height: 87vh;
}
.tip-cont {
position: absolute;
width: 678rpx;
height: 624rpx;
display: flex;
align-items: center;
flex-direction: column;
z-index: 999;
background-color: #fff;
border-radius: 10rpx;
top: 214rpx;
}
.cusImage {
margin-top: 90rpx;
}
.txt {
margin-top: 100rpx;
padding: 0 32rpx;
}
.des {
margin-top: 38rpx;
line-height: 46rpx;
font-size: 32rpx;
}
.btn {
position: absolute;
top: 390px;
max-width: 440rpx;
width: calc(100% - 10rpx);
height: 80rpx;
}
Loading…
Cancel
Save