完成简易版的充值和充值记录查询页面,简单的我的页面
This commit is contained in:
29
components/cell/index.js
Normal file
29
components/cell/index.js
Normal file
@@ -0,0 +1,29 @@
|
||||
// components/cell/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
title: String,
|
||||
rightArrow: { type: Boolean, value: true },
|
||||
borderBottom: Boolean,
|
||||
openType: String,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
click() {
|
||||
this.triggerEvent("click")
|
||||
}
|
||||
}
|
||||
})
|
4
components/cell/index.json
Normal file
4
components/cell/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
28
components/cell/index.wxml
Normal file
28
components/cell/index.wxml
Normal file
@@ -0,0 +1,28 @@
|
||||
<!--components/cell/index.wxml-->
|
||||
|
||||
<template name="rightIcon">
|
||||
<image src="/assets/images/right.png" class="rightIcon" />
|
||||
</template>
|
||||
|
||||
<template name="content">
|
||||
<view wx:if="{{!rightArrow}}">
|
||||
{{title}}
|
||||
</view>
|
||||
<view wx:else style="display: flex; justify-content: space-between;align-items: center; width: 100%;">
|
||||
{{title}}
|
||||
<template is="rightIcon" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<view class="cellWrapper" wx:if="{{!openType}}" bind:tap="click">
|
||||
<view class="content">
|
||||
<template is="content" data="{{title, rightArrow}}" />
|
||||
</view>
|
||||
<view class="borderBottom border" wx:if="{{borderBottom}}"></view>
|
||||
</view>
|
||||
<view wx:else bind:tap="click">
|
||||
<button class="button" open-type="{{openType}}" plain="true">
|
||||
<template is="content" data="{{title, rightArrow}}" />
|
||||
</button>
|
||||
<view class="borderBottom border" wx:if="{{borderBottom}}"></view>
|
||||
</view>
|
24
components/cell/index.wxss
Normal file
24
components/cell/index.wxss
Normal file
@@ -0,0 +1,24 @@
|
||||
/* components/cell/index.wxss */
|
||||
@import "/app.wxss";
|
||||
.content {
|
||||
padding: 20rpx 24rpx;
|
||||
background-color: #fff;
|
||||
line-height: 42rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.button {
|
||||
background-color: #fff !important;
|
||||
padding: 20rpx 24rpx !important;
|
||||
border: none !important;
|
||||
line-height: 42rpx !important;
|
||||
font-size: 36rpx !important;
|
||||
display: flex !important;
|
||||
justify-content: left !important;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.rightIcon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
41
components/navigator/index.js
Normal file
41
components/navigator/index.js
Normal file
@@ -0,0 +1,41 @@
|
||||
// components/navigator/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
title: String,
|
||||
canBack: Boolean,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
lifetimes: {
|
||||
attached: function() {
|
||||
const that = this;
|
||||
wx.getSystemInfo({
|
||||
success: function (res) {
|
||||
that.setData({
|
||||
statusBarHeight : res.statusBarHeight,
|
||||
navBarHeight : res.statusBarHeight , // 顶部导航栏高度为 44px
|
||||
jiaonangheight: wx.getMenuButtonBoundingClientRect().height, // 胶囊高度
|
||||
jiaonangwidth:wx.getMenuButtonBoundingClientRect().width,
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
back() {
|
||||
wx.navigateBack();
|
||||
}
|
||||
}
|
||||
})
|
6
components/navigator/index.json
Normal file
6
components/navigator/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
|
||||
}
|
||||
}
|
9
components/navigator/index.wxml
Normal file
9
components/navigator/index.wxml
Normal file
@@ -0,0 +1,9 @@
|
||||
<view class="navigator" style="height: {{(statusBarHeight + 46)}}px;">
|
||||
<view class="navigatorTitle">
|
||||
|
||||
{{title}}
|
||||
</view>
|
||||
<view style="display: flex; width: 100%; background-color: transparent;height: 46px;position: absolute;bottom: 0;left: 0;;align-items:center;">
|
||||
<image src="/assets/images/left.png" bind:tap="back" wx:if="{{canBack}}" class="back" />
|
||||
</view>
|
||||
</view>
|
23
components/navigator/index.wxss
Normal file
23
components/navigator/index.wxss
Normal file
@@ -0,0 +1,23 @@
|
||||
/* components/navigator/index.wxss */
|
||||
.navigator {
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.navigatorTitle {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 46px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.back {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-top: 10rpx;
|
||||
z-index: 100;
|
||||
}
|
24
components/scrollPageWrapper/index.js
Normal file
24
components/scrollPageWrapper/index.js
Normal file
@@ -0,0 +1,24 @@
|
||||
// components/scrollPageWrapper/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
4
components/scrollPageWrapper/index.json
Normal file
4
components/scrollPageWrapper/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
4
components/scrollPageWrapper/index.wxml
Normal file
4
components/scrollPageWrapper/index.wxml
Normal file
@@ -0,0 +1,4 @@
|
||||
<!--components/scrollPageWrapper/index.wxml-->
|
||||
<view style="display:flex; flex-direction: column;width: 100vw;height: 100vh;">
|
||||
<slot />
|
||||
</view>
|
1
components/scrollPageWrapper/index.wxss
Normal file
1
components/scrollPageWrapper/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* components/scrollPageWrapper/index.wxss */
|
Reference in New Issue
Block a user