init project

This commit is contained in:
limqhz
2020-06-21 16:27:58 +08:00
commit e8fe10b5fb
178 changed files with 9964 additions and 0 deletions

162
pages/mine/index.js Normal file
View File

@@ -0,0 +1,162 @@
// pages/mine/index.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
members: {},
memberCard: 0,
showLogoutDialog: false,
gohome: true
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
wx.showLoading({
title: '加载中...',
mask: true,
})
app.$api.memberCenter({}).then(res => {
this.setData({
members: res.members,
memberCard: res.memberCard
})
}, err => {
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
return {
title: '智慧云馆'
}
},
// 跳转个人信息
pushUserInfo() {
wx.navigateTo({
url: '/pages/userInfo/index',
})
},
// 跳转充值页面
pushRecharge() {
wx.navigateTo({
url: '/pages/myAccount/index',
})
},
// 跳转会员卡页面
pushClubCard() {
wx.navigateTo({
url: '/pages/myMembershipCard/index',
})
},
// 跳转我的预约
pushMyOrder() {
wx.navigateTo({
url: '/pages/myBookingsList/index',
})
},
// 跳转我的账单
pushMyBill() {
wx.navigateTo({
url: '/pages/myBills/index',
})
},
// 跳转人脸采集
pushFacialCapturing() {
wx.navigateTo({
url: '/pages/facialCapturing/index',
})
},
// 跳转常见问题
pushFAQ() {
wx.navigateTo({
url: '/pages/questions/index',
})
},
// 跳转关于我们
pushAboutUs() {
wx.navigateTo({
url: '/pages/about/index',
})
},
// 退出登录
logout() {
this.setData({
showLogoutDialog: true
})
},
// 确认退出
confirmDeleteDialog() {
wx.removeStorageSync('accessToken');
wx.removeStorageSync('history');
wx.removeStorageSync('information');
this.setData({
showLogoutDialog: false
})
wx.redirectTo({
url: '/pages/login/index',
})
},
// 取消退出
cancelDeleteDialog() {
this.setData({
showLogoutDialog: false
})
}
})

6
pages/mine/index.json Normal file
View File

@@ -0,0 +1,6 @@
{
"usingComponents": {
"confirm-dialog": "/component/confirmDialog/confirmDialog",
"header": "/component/header/header"
}
}

57
pages/mine/index.wxml Normal file
View File

@@ -0,0 +1,57 @@
<!--pages/mine/index.wxml-->
<header></header>
<view class='container' wx:if="{{members.nickname}}">
<view class='body'>
<view class='header'>
<view class='info-box' bindtap='pushUserInfo'>
<image src='{{members.avatar ? members.avatar : "../../images/avatar.png"}}' mode='aspectFill'></image>
<text>{{members.nickname}}</text>
<view class='info-btn' >个人信息</view>
</view>
<view class='price-box'>
<view class='price-item' bindtap='pushRecharge'>
<view class='number money'>{{members.money}}</view>
<view class='price-title'>
<text>余额</text>
<view style='width:4rpx; height:4rpx; border-radius:50%; background:#7f7e81; margin: 0 6rpx;'></view>
<text>充值</text>
</view>
</view>
<view class='line'></view>
<view class='price-item' bindtap='pushClubCard'>
<view class='number'>{{memberCard}}</view>
<view class='price-title'>
<text>会员卡</text>
</view>
</view>
</view>
</view>
<view class='list'>
<view class='cell' bindtap='pushMyOrder'>
<text>我的预约</text>
<image src='../../images/15@3x.png'></image>
</view>
<view class='cell' bindtap='pushMyBill'>
<text>我的账单</text>
<image src='../../images/15@3x.png'></image>
</view>
<view class='cell' bindtap='pushFacialCapturing'>
<text>人脸采集</text>
<image src='../../images/15@3x.png'></image>
</view>
<view class='cell' bindtap='pushFAQ'>
<text>常见问题</text>
<image src='../../images/15@3x.png'></image>
</view>
<view class='cell unLine' bindtap='pushAboutUs'>
<text>关于我们</text>
<image src='../../images/15@3x.png'></image>
</view>
</view>
<view class='logout-btn' bindtap='logout'>退出登录</view>
</view>
</view>
<confirm-dialog title="{{'提示'}}" message="{{'请确认退出登录'}}" bindcancelselect="cancelDeleteDialog" bindconfirmselect="confirmDeleteDialog" wx:if="{{showLogoutDialog}}"></confirm-dialog>

125
pages/mine/index.wxss Normal file
View File

@@ -0,0 +1,125 @@
/* pages/mine/index.wxss */
.body {
min-height: calc(100vh - 60rpx);
padding: 30rpx;
}
.body .header {
display: flex;
flex-direction: column;
justify-content: space-between;
height: 250rpx;
padding: 40rpx;
background: #1a191e;
border-radius: 10rpx;
}
.body .header .info-box {
display: flex;
justify-content: space-between;
align-items: center;
}
.body .header .info-box>image {
width: 100rpx;
height: 100rpx;
margin-right: 30rpx;
border-radius: 50%;
}
.body .header .info-box>text {
flex: 1;
color: #fff;
font-size: 38rpx;
}
.body .header .info-box .info-btn {
width: 122rpx;
height: 46rpx;
border: 2rpx solid rgba(255, 255, 255, 0.4);
border-radius: 23rpx;
font-size: 24rpx;
color: #fff;
line-height: 46rpx;
text-align: center;
}
.body .header .price-box {
display: flex;
justify-content: space-between;
align-items: center;
text-align: center;
}
.body .header .price-box .price-item {
flex: 1;
}
.body .header .price-box .price-item .number {
margin-bottom: 18rpx;
font-size: 38rpx;
color: #fff;
line-height: 38rpx;
}
.body .header .price-box .price-item .number.money {
color: #f3515c;
}
.body .header .price-item .price-title {
display: flex;
justify-content: center;
align-items: center;
font-size: 24rpx;
line-height: 24rpx;
color: rgba(255, 255, 255, 0.6);
}
.body .header .price-item .price-title>text:last-child {
color: #b89e29;
}
.body .header .price-box .line {
width: 2rpx;
height: 50rpx;
background: #39383c;
}
.body .list {
margin-top: 30rpx;
border-radius: 10rpx;
background: #1a191e;
}
.body .list .cell {
display: flex;
justify-content: space-between;
align-items: center;
height: 98rpx;
padding: 0 30rpx;
border-bottom: 2rpx solid #212025;
font-size: 24rpx;
color: rgba(255, 255, 255, 0.6);
}
.body .list .cell>image {
width: 10rpx;
height: 16rpx;
}
.body .list .cell.unLine {
border-bottom: none;
}
.body .logout-btn {
margin: 150rpx 100rpx 0 100rpx;
text-align: center;
background: #1a191e;
height: 80rpx;
border-radius: 40rpx;
line-height: 80rpx;
font-size: 28rpx;
color: #c9ac2a;
}