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

View File

@@ -0,0 +1,292 @@
// pages/basketballGym/index.js
const app = getApp();
import {
getCurrentPageUrl
} from './../../utils/util.js'
let id = ''
Page({
/**
* 页面的初始数据
*/
data: {
venues: {},
isShowBuyVip: false,
buyVipObj: {},
showUnclickMask: false,
showCardMask: false,
flg: 100,
isWxLogin: false,
isGoHome: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
if (options.id) {
id = options.id;
}
if (options.scene) {
id = options.scene;
}
wx.showLoading({
title: '加载中...',
mask: true,
})
app.$api.venueDetail({
venueId: id
}).then(res => {
this.setData({
venues: res.venues
})
}, err => {
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
let pages = getCurrentPages();
this.setData({
isGoHome: pages.length == 1
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.setData({
showUnclickMask: false,
flg: 100
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
return {
title: this.data.venues.name,
imageUrl: this.data.venues.images[0].url
}
},
// 打开导航,
opnGPS() {
wx.openLocation({
latitude: Number(this.data.venues.latitude),
longitude: Number(this.data.venues.longitude),
name: this.data.venues.name,
address: this.data.venues.address,
})
},
// 充值
recharge() {
if (!wx.getStorageSync('accessToken')) {
wx.setStorageSync('history', getCurrentPageUrl());
wx.redirectTo({
url: '/pages/login/index',
})
return
}
wx.navigateTo({
url: '/pages/myAccount/index',
})
},
// 打电话
callPhone() {
wx.makePhoneCall({
phoneNumber: this.data.venues.phone,
})
},
// 购买套餐
nowBuy(e) {
let index = e.currentTarget.dataset.index;
if (!wx.getStorageSync('accessToken')) {
wx.setStorageSync('history', getCurrentPageUrl());
wx.redirectTo({
url: '/pages/login/index',
})
return
}
this.setData({
isShowBuyVip: true,
buyVipObj: this.data.venues.cards[index]
})
},
// 我要进场
enter() {
app.$api.venueJoin({
venueId: id
}).then(res => {
this.setData({
flg: res.flg
})
}, err => {
console.log(err);
})
},
// 弹框背景禁止滑动
unMove() {
return;
},
// 关闭进场步骤弹框
closeInStep() {
this.setData({
flg: 100
})
},
// 弹框背景禁止滑动
unMove() {
return;
},
// 关闭购买vip弹框
closeBuyVipPopup() {
this.setData({
isShowBuyVip: false
})
},
// 购买Vip
buyVip() {
let that = this;
this.setData({
showUnclickMask: true
})
app.$api.memberCardOrderCreate({
cardType: this.data.buyVipObj.cardType,
num: 1,
type: this.data.venues.type,
venueId: this.data.venues.id
}).then(res => {
app.$pay.wxPay(res.pay).then(res => {
that.setData({
isShowBuyVip: false,
showUnclickMask: false
})
}, err => {
that.setData({
isShowBuyVip: false,
showUnclickMask: false
})
})
}, err => {
// console.log(err);
this.setData({
isShowBuyVip: false,
showUnclickMask: false
})
if (err.data.err_code == 30022) {
this.setData({
isWxLogin: true,
isShowBuyVip: false
})
}
})
},
// 关闭
cancelCardMask() {
this.setData({
showCardMask: false
})
},
// 开启会员卡提示
showCardContent() {
this.setData({
showCardMask: true
})
},
// 关闭提示框
cancelDeleteDialog() {
this.setData({
flg: 100
})
},
// 点击提示框确认
confirmDeleteDialog() {
if (this.data.flg == 2) {
wx.navigateTo({
url: '/pages/myAccount/index?isPass=1',
})
}
if (this.data.flg == 1) {
wx.navigateTo({
url: '/pages/facialCapturing/index?isPass=1',
})
}
},
// 取消授权登录
cancelWXDialog() {
this.setData({
isWxLogin: false
})
},
// 授权微信
getUserInfo(e) {
app.$pay.payWxLoing(e.detail).then(res => {
wx.showToast({
title: '绑定成功',
duration: 2000,
})
this.setData({
isWxLogin: false
})
}, err => {
this.setData({
isWxLogin: false
})
})
}
})

View File

@@ -0,0 +1,7 @@
{
"navigationBarTitleText": "篮球场",
"usingComponents": {
"confirm-dialog": "/component/confirmDialog/confirmDialog",
"header": "/component/header/header"
}
}

View File

@@ -0,0 +1,148 @@
<!--pages/basketballGym/index.wxml-->
<header title="{{venues.name}}" isGoHome="{{isGoHome}}"></header>
<view class='container' wx:if="{{venues.name}}">
<swiper class='header' indicator-dots="{{venues.images.length > 1}}" autoplay="{{true}}" circular="{{true}}">
<block wx:for="{{venues.images}}" wx:key="{{index}}">
<swiper-item>
<image src="{{item.url}}" mode='aspectFill'></image>
</swiper-item>
</block>
</swiper>
<view class='cell-box'>
<view class='cell'>
<image src='../../images/42@3x.png' mode='aspectFit'></image>
<text>{{venues.businessTime}}</text>
</view>
<view class='cell' bindtap='opnGPS'>
<image src='../../images/41@3x.png' mode='aspectFit'></image>
<text>{{venues.address}}</text>
<view class='cell-right'>
<image src='../../images/34@3x.png' class='gps-img'></image>
<text>导航</text>
</view>
</view>
<view class='cell unline'>
<image src='../../images/36@3x.png' mode='aspectFit'></image>
<text>{{venues.contact}}</text>
<view class='phone-number' bindtap='callPhone'>{{venues.phone}}</view>
</view>
<view class='cell unline'>
<image src='../../images/25@3x.png' mode='aspectFit'></image>
<text>按时间段收费</text>
<view class='cell-right-btn' bindtap='recharge'>充值</view>
</view>
<view class='dynamic-height'>
<block wx:if="{{venues.venuePriceList.length>0}}">收费说明: </block>
<block wx:else>篮球馆暂未开放</block>
<block wx:for="{{venues.venuePriceList}}" wx:key="{{index}}">
<view>每日{{item.starTime}}-{{item.endTime}} {{item.price >= 0 ? "¥"+item.price + "/次" : '免费公益'}};</view>
</block>
</view>
</view>
<view class='cell-box'>
<view class='cell'>
<image src='../../images/40@3x.png' mode='aspectFit'></image>
<view class='title'>
<text>VIP会员享受专属特权</text>
<image src='../../images/5@3x.png' wx:if="{{venues.cardContent}}" bindtap='showCardContent'></image>
</view>
</view>
<view class='cell unline' wx:for="{{venues.cards}}" wx:key="{{index}}">
<view class='tip'>{{item.cardName}}</view>
<text>¥{{item.price}}</text>
<view class='buy-btn' bindtap='nowBuy' data-index='{{index}}'>立即购买</view>
</view>
<view class='cell unline'>
<view class='tip'>单次</view>
<text>选购</text>
<view class='buy-btn' bindtap='recharge'>立即购买</view>
</view>
</view>
<view class='cell-box'>
<view class='cell'>
<image src='../../images/35@3x.png' mode='aspectFit'></image>
<view class='title'>
<text>篮球馆介绍</text>
</view>
</view>
<view class='rich-box'>
<rich-text nodes="{{venues.description}}"></rich-text>
</view>
</view>
<view class='footer-btn' bindtap='enter'>我要进场</view>
</view>
<view class='in-step-popup' catchtouchmove='unMove' wx:if="{{flg == 0}}">
<view class='body'>
<view class='top'>
<view class='title'>
<image src='../../images/24@3x.png'></image>
<text>进场步骤</text>
</view>
<image src='../../images/23@3x.png' bindtap='closeInStep'></image>
</view>
<view class='center'>
<view class='item'>
<view class='step'>第一步</view>
<view class='message'>进入您所在的智能门禁人脸识别区域</view>
</view>
<image src='../../images/22@3x.png'></image>
<view class='item'>
<view class='step'>第二步</view>
<view class='message'>贴近门禁摄像头进行人脸识别</view>
</view>
<image src='../../images/22@3x.png'></image>
<view class='item'>
<view class='step'>第三步</view>
<view class='message'>识别成功门锁打开请在5秒钟内进门</view>
</view>
</view>
<view class='bottom'>
说明: 余额充足情况下,可直接进行人脸识别进场,无需再次使用手机。
</view>
</view>
</view>
<view class='buyVIPPopup' catchtouchmove='unMove' wx:if="{{isShowBuyVip}}">
<view class='popup-body'>
<view class='popup-header'>
<text>会员卡购买</text>
<image src='../../images/23@3x.png' catchtap='closeBuyVipPopup'></image>
</view>
<view class='popup-center'>
<view class='popup-cell'>
<text>会员卡类型</text>
<text>{{buyVipObj.cardName}}</text>
</view>
<view class='popup-cell'>
<text>价格</text>
<text>¥{{buyVipObj.price}}</text>
</view>
</view>
<view class='popup-btn' catchtap='buyVip'>确认支付</view>
</view>
</view>
<view class='unclick-mask' wx:if="{{showUnclickMask}}"></view>
<view class='card-mask' catchtouchmove='unMove' wx:if="{{showCardMask}}" bindtap='cancelCardMask'>
<view class='card-box' catchtap='unMove'>
<view class='close' catchtap='cancelCardMask'>
<image src='../../images/23@3x.png'></image>
</view>
<view class='title'>VIP会员享受专属特权</view>
<rich-text class='info-rich' nodes="{{venues.cardContent}}"></rich-text>
</view>
</view>
<confirm-dialog title="提示" message="余额不足,请先充值余额" confirmBtnTitle="充值" bindcancelselect="cancelDeleteDialog" bindconfirmselect="confirmDeleteDialog" wx:if="{{flg == 2}}"></confirm-dialog>
<confirm-dialog title="提示" message="请先上传照片,以供人脸识别入场" bindcancelselect="cancelDeleteDialog" bindconfirmselect="confirmDeleteDialog" wx:if="{{flg == 1}}"></confirm-dialog>
<confirm-dialog title="提示" message="请先绑定微信" confirmBtnTitle="绑定" isUserInfo="{{true}}" bindcancelselect="cancelWXDialog" bindgetuserinfo="getUserInfo" wx:if="{{isWxLogin}}"></confirm-dialog>
<view class='share-btn-box'>
<button open-type='share'></button>
<image src='https://yingdd.oss-cn-hangzhou.aliyuncs.com/9bc27242fd0c9f9f08d867dc027cc82b.png' style='width:100%; height: 100%'></image>
</view>

View File

@@ -0,0 +1,392 @@
/* pages/basketballGym/index.wxss */
.container {
padding-bottom: 130rpx;
min-height: calc(100vh - 330rpx);
}
.header {
width: 100%;
height: 350rpx;
}
.header image {
width: 100%;
height: 100%;
}
.cell-box {
margin: 30rpx 30rpx 0 30rpx;
background: #1a191e;
border-radius: 10rpx;
}
.cell-box .cell {
display: flex;
justify-content: space-between;
align-items: center;
height: 90rpx;
padding: 0 20rpx;
border-bottom: 2rpx solid #212025;
}
.cell-box .cell.unline {
border: none;
}
.cell-box .dynamic-height {
padding: 0 20rpx 20rpx 20rpx;
font-size: 24rpx;
color: rgba(255, 255, 255, 0.6);
line-height: 36rpx;
}
.cell-box .cell>image {
width: 34rpx;
height: 34rpx;
margin-right: 26rpx;
}
.cell-box .cell>text {
flex: 1;
font-size: 24rpx;
color: rgba(255, 255, 255, 0.6);
}
.cell-box .cell .cell-right {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: rgba(255, 255, 255, 0.6);
font-size: 20rpx;
}
.cell-box .cell .cell-right .gps-img {
width: 50rpx;
height: 50rpx;
border-radius: 50%;
}
.cell-box .cell .cell-right>text {
height: 20rpx;
margin-top: 6rpx;
line-height: 20rpx;
}
.cell-box .cell .cell-right-btn {
width: 120rpx;
height: 60rpx;
border-radius: 30rpx;
background: #ffda2e;
color: #1a191e;
font-size: 22rpx;
text-align: center;
line-height: 60rpx;
}
.cell-box .cell .phone-number {
color: #ffda2e;
font-size: 22rpx;
}
.cell-box .cell .title {
flex: 1;
display: flex;
align-items: center;
color: #fff;
font-size: 24rpx;
}
.cell-box .cell .title>image {
width: 26rpx;
height: 26rpx;
margin-left: 14rpx;
}
.cell-box .cell .tip {
min-width: 70rpx;
height: 30rpx;
padding: 0 4rpx;
margin-right: 22rpx;
font-size: 20rpx;
line-height: 30rpx;
border: 2rpx solid #ffda2e;
color: #ffda2e;
border-radius: 6rpx;
text-align: center;
}
.cell-box .cell .buy-btn {
font-size: 26rpx;
color: #ffda2e;
}
.cell-box .rich-box {
color: rgba(255, 255, 255, 0.6);
font-size: 24rpx;
padding: 30rpx 20rpx;
}
.cell-box .rich-box .wscnph {
width: calc(100% - 10rpx);
margin-left: 5rpx;
}
.footer-btn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 100rpx;
background: #ffda2e;
color: #1a191e;
font-size: 32rpx;
text-align: center;
line-height: 100rpx;
}
.in-step-popup {
position: fixed;
left: 0;
top: 0;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.4);
z-index: 2;
}
.in-step-popup .body {
width: 600rpx;
height: 840rpx;
background: #252330;
border-radius: 10rpx;
}
.in-step-popup .body .top {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
}
.in-step-popup .body .top .title>image {
width: 26rpx;
height: 26rpx;
}
.in-step-popup .body .top .title>text {
margin-left: 10rpx;
color: #fff;
font-weight: bold;
font-size: 28rpx;
line-height: 28rpx;
}
.in-step-popup .body .top>image {
width: 26rpx;
height: 26rpx;
}
.in-step-popup .body .center {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 40rpx;
}
.in-step-popup .body .center>image {
width: 24rpx;
height: 14rpx;
margin: 30rpx 0;
}
.in-step-popup .body .center .item .step {
margin-bottom: 12rpx;
font-size: 28rpx;
color: #ffda2e;
text-align: center;
line-height: 28rpx;
}
.in-step-popup .body .center .item .message {
max-width: 400rpx;
padding: 10rpx 20rpx;
border-radius: 25rpx;
background: #302e3b;
color: #fff;
font-size: 30rpx;
line-height: 50rpx;
text-align: center;
}
.in-step-popup .body .bottom {
margin: 40rpx 20rpx 0 20rpx;
font-size: 26rpx;
color: rgba(255, 255, 255, 0.6);
line-height: 30rpx;
}
.buyVIPPopup {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
background: rgba(0, 0, 0, 0.6);
}
.buyVIPPopup .popup-body {
position: relative;
display: flex;
flex-direction: column;
justify-content: space-between;
width: 540rpx;
height: 350rpx;
border-radius: 20rpx;
background: #252330;
}
.buyVIPPopup .popup-body .popup-header {
display: flex;
justify-content: space-between;
align-items: center;
height: 80rpx;
padding: 0 36rpx 0 26rpx;
}
.buyVIPPopup .popup-body .popup-header>text {
font-size: 26rpx;
color: #fff;
font-weight: bold;
}
.buyVIPPopup .popup-body .popup-header>image {
width: 26rpx;
height: 26rpx;
}
.buyVIPPopup .popup-body .popup-center {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
padding: 0 36rpx 0 26rpx;
font-size: 26rpx;
color: #96959c;
line-height: 26rpx;
}
.buyVIPPopup .popup-body .popup-center .popup-cell {
display: flex;
justify-content: space-between;
margin-bottom: 30rpx;
}
.buyVIPPopup .popup-body .popup-btn {
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
color: #252330;
background: #ffda2e;
font-size: 26rpx;
border-radius: 0 0 20rpx 20rpx;
}
.unclick-mask {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0);
}
.card-mask {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
background: rgba(0, 0, 0, 0.6);
}
.card-mask .card-box {
position: relative;
width: 70%;
/* min-height: 300rpx; */
border-radius: 20rpx;
background: #1a191e;
font-size: 24rpx;
line-height: 30rpx;
color: #5a595d;
padding: 30rpx;
}
.card-mask .card-box .close {
position: absolute;
top: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
width: 60rpx;
height: 60rpx;
}
.card-mask .card-box .close>image {
width: 26rpx;
height: 26rpx;
}
.card-mask .card-box .info-rich {
padding: 30rpx;
font-size: 26rpx;
line-height: 36rpx;
color: rgba(255, 255, 255, 0.8);
}
.card-mask .card-box .title {
text-align: center;
color: #ffda2e;
font-size: 28rpx;
}
.share-btn-box {
position: fixed;
right: 30rpx;
bottom: 130rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 110rpx;
height: 110rpx;
color: #1a191e;
font-size: 24rpx;
border-radius: 50%;
}
.share-btn-box>button {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0);
font-size: 24rpx;
color: #1a191e;
}
.share-btn-box>button::after {
border: none;
}