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

14
.gitignore vendored Normal file
View File

@@ -0,0 +1,14 @@
# Windows
[Dd]esktop.ini
Thumbs.db
$RECYCLE.BIN/
# macOS
.DS_Store
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
# Node.js
node_modules/

39
README.md Normal file
View File

@@ -0,0 +1,39 @@
# venue_wx
#### 介绍
{**以下是码云平台说明,您可以替换此简介**
码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN。专为开发者提供稳定、高效、安全的云端软件开发协作平台
无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 码云特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

13
app.js Normal file
View File

@@ -0,0 +1,13 @@
//app.js
import api from './utils/api.js';
import pay from './utils/pay.js';
App({
onLaunch: function () {
},
globalData: {
userInfo: null
},
$api: api,
$pay: pay
})

41
app.json Normal file
View File

@@ -0,0 +1,41 @@
{
"pages": [
"pages/home/index",
"pages/about/index",
"pages/agreement/index",
"pages/basketballGym/index",
"pages/bookClasses/index",
"pages/bookClassesDetail/index",
"pages/confirmOrder/index",
"pages/facialCapturing/index",
"pages/gymnasium/index",
"pages/login/index",
"pages/mine/index",
"pages/myAccount/index",
"pages/myBills/index",
"pages/myBookings/index",
"pages/myBookingsList/index",
"pages/myMembershipCard/index",
"pages/notice/index",
"pages/questions/index",
"pages/register/index",
"pages/sportsGroundList/index",
"pages/userInfo/index",
"pages/loginIndex/index",
"pages/withdrawal/index"
],
"window": {
"backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "#1a191e",
"navigationBarTitleText": "智慧云馆",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"backgroundColor": "#252330"
},
"sitemapLocation": "sitemap.json",
"permission": {
"scope.userLocation": {
"desc": "需要获取您的地理位置,请确认授权,否则地图功能将无法使用"
}
}
}

17
app.wxss Normal file
View File

@@ -0,0 +1,17 @@
/**app.wxss**/
html,body {
background: #252330;
}
page {
position: relative;
background: #252330;
}
.container {
position: relative;
min-height: calc(100vh - 130rpx);
padding-top: 130rpx;
background: #252330;
}

View File

@@ -0,0 +1,40 @@
// component/actionSheet/actionSheet.js
Component({
/**
* 组件的属性列表
*/
properties: {
value:{
type: Array,
value: []
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
// 点击取消
cancel() {
this.triggerEvent('cancel', {}, {});
},
// 点击选择
click(e) {
let index = e.currentTarget.dataset.index;
this.triggerEvent('selected', this.data.value[index], {});
},
// 禁止背景滚动
unMove() {
return;
}
}
})

View File

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

View File

@@ -0,0 +1,7 @@
<!--component/actionSheet/actionSheet.wxml-->
<view class='popup-box' catchtouchmove='unMove' catchtap='cancel'>
<view class='body'>
<view class='cell' wx:for="{{value}}" wx:key="{{index}}" catchtap='click' data-index='{{index}}'>{{item.label}}</view>
<view class='cell cancel' catchtap='cancel'>取消</view>
</view>
</view>

View File

@@ -0,0 +1,32 @@
/* component/actionSheet/actionSheet.wxss */
.popup-box {
position: fixed;
top: 0;
left: 0;
display: flex;
align-items: flex-end;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.6);
z-index: 1;
}
.popup-box .body {
flex: 1;
background: #f5f5f5;
}
.popup-box .body .cell {
width: 100%;
height: 80rpx;
margin-bottom: 2rpx;
line-height: 80rpx;
text-align: center;
font-size: 26rpx;
background: #FFF;
}
.popup-box .body .cell.cancel {
margin-top: 8rpx;
}

View File

@@ -0,0 +1,104 @@
// pages/authorizedMask/authorizedMask.js
const app = getApp();
Component({
/**
* 组件的属性列表
*/
properties: {
isSetting: {
type: Boolean,
value: false
},
content: {
type: String,
value: '使用小程序需要您授权登录'
},
isCancel: {
type: Boolean,
value: false
},
/**
* Only: 只有一個
* TwainCance 兩個帶取消
* */
type: {
type: String,
value: 'Only'
}
},
/**
* 组件的初始数据
*/
data: {
showBox: true,
},
/**
* 组件的方法列表
*/
methods: {
stopSlide() {
return;
},
wxTap() {
this.setData({
showBox: false
})
},
// 微信登录
wxLogin(e) {
if (e.detail.errMsg === 'getUserInfo:fail auth deny') {
this.setData({
showBox: true
})
return
}
this.setData({
showBox: false
})
let that = this;
wx.login({
success: function(res) {
if (res.code) {
app.$api.login({
avatar: e.detail.userInfo.avatarUrl,
code: res.code,
nickname: e.detail.userInfo.nickName,
}).then(res => {
wx.setStorageSync('access_token', res.data.accessToken);
wx.setStorageSync('userInfo', e.detail.userInfo);
that.triggerEvent('loginSuccess', {}, {});
})
} else {
wx.showToast({
title: '登录失败',
icon: 'none',
})
}
},
fail: function(res) {
wx.showToast({
title: '登录失败',
icon: 'none',
})
},
})
},
// 取消
cance() {
this.triggerEvent('cance', {}, {});
},
// 打开设置
setSuccess: function (e) {
this.triggerEvent('setsuccess', e.detail, {});
// if (e.detail.authSetting["scope.userLocation"]) {//如果打开了地理位置就会为true
// this.setData({
// showFlag: true
// })
// }
}
}
})

View File

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

View File

@@ -0,0 +1,17 @@
<!--pages/authorizedMask/authorizedMask.wxml-->
<view class='auth-bg' catchtouchmove='stopSlide'>
<view class='auth-box' wx:if="{{showBox}}">
<!-- wx:if="{{type == 'TwainCance'}}" -->
<view class='close' bindtap='cance' wx:if="{{isCancel}}">
<image src='../../images/23@3x.png'></image>
</view>
<view class='message'>{{content}}</view>
<view class='btn-bg' wx:if="{{type == 'Only'}}">
<button open-type="getUserInfo" bindgetuserinfo="wxLogin" wx:if="{{!isSetting}}">授权登录</button>
<button open-type="openSetting" bindopensetting="setSuccess" wx:if="{{isSetting}}" >进入授权管理</button>
</view>
<!-- <view class='btn-bg btn-tow' wx:if="{{showBox}}">
<button open-type="openSetting" wx:if="{{isSetting}}">进入授权管理</button>
</view> -->
</view>
</view>

View File

@@ -0,0 +1,67 @@
/* pages/authorizedMask/authorizedMask.wxss */
.auth-bg {
position: fixed;
top: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.6);
z-index: 1001;
}
.auth-box {
position: relative;
width: 70%;
height: 350rpx;
background: #252330;
border-radius: 10rpx;
color: #989898;
}
.message {
display: flex;
justify-content: center;
align-items: center;
height: 250rpx;
/* border-bottom: 2rpx solid #EBEEF5; */
font-size: 28rpx;
}
.btn-bg>button {
width: 60%;
height: 70rpx;
line-height: 70rpx;
font-size: 26rpx;
color: #252330;
border-radius: 35rpx;
background: #ffc129;
}
.btn-bg.btn-tow {
display: flex;
}
button::after {
border: none;
border-radius: 0;
}
.close {
position: absolute;
top: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
width: 60rpx;
height: 60rpx;
}
.close>image {
width: 26rpx;
height: 26rpx;
}

View File

@@ -0,0 +1,72 @@
// component/confirmDialog/confirmDialog.js
Component({
/**
* 组件的属性列表
*/
properties: {
title: {
type: String,
value: ''
},
message: {
type: String,
value: ''
},
confirmBtnTitle: {
type: String,
value: '确认'
},
cancelBtnTitle: {
type: String,
value: '取消'
},
showCancel: {
type: Boolean,
value: true
},
isAuth: {
type: Boolean,
value: false
},
isUserInfo: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
unMove() {
return;
},
// 点击取消
cancel() {
this.triggerEvent('cancelselect', {}, {})
},
// 点击确认
confirm() {
this.triggerEvent('confirmselect', {}, {})
},
// 点击编辑授权
openSetting(e) {
this.triggerEvent('opensetting', e.detail, {});
},
// 点击获取个人信息
openUserInfo(e) {
this.triggerEvent('getuserinfo', e.detail, {});
}
}
})

View File

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

View File

@@ -0,0 +1,14 @@
<!--component/confirmDialog/confirmDialog.wxml-->
<view class='box' catchtouchmove='unMove'>
<view class='body'>
<view class='title'>{{title}}</view>
<view class='message'>{{message}}</view>
<view class='btn-box'>
<button wx:if="{{showCancel}}" bindtap='cancel'>{{cancelBtnTitle}}</button>
<view class='line' wx:if="{{showCancel}}"></view>
<button open-type='openSetting' wx:if="{{isAuth}}" bindopensetting="openSetting">{{confirmBtnTitle}}</button>
<button open-type='getUserInfo' wx:elif="{{isUserInfo}}" bindgetuserinfo="openUserInfo">{{confirmBtnTitle}}</button>
<button wx:else bindtap='confirm'>{{confirmBtnTitle}}</button>
</view>
</view>
</view>

View File

@@ -0,0 +1,67 @@
/* component/confirmDialog/confirmDialog.wxss */
.box {
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);
z-index: 1001;
}
.box .body {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
width: 72%;
min-height: 300rpx;
border-radius: 20rpx;
text-align: center;
background: #252330;
}
.box .body .title {
margin: 40rpx 0;
font-size: 32rpx;
line-height: 32rpx;
font-weight: bold;
color: #fff;
}
.box .body .message {
flex: 1;
margin: 0 20rpx 60rpx 20rpx;
font-size: 26rpx;
color: rgba(255, 255, 255, 0.6);
}
.box .body .btn-box {
display: flex;
width: 100%;
border-top: 2rpx solid #3d3b45;
}
.box .body .btn-box .line {
width: 2rpx;
height: 90rpx;
background: #3d3b45;
}
.box .body .btn-box>button {
flex: 1;
height: 90rpx;
background: none;
font-size: 32rpx;
color: #ffda2e;
line-height: 90rpx;
text-align: center;
}
.box .body .btn-box>button::after {
border: none;
}

106
component/header/header.js Normal file
View File

@@ -0,0 +1,106 @@
// components/header/header.js
Component({
/**
* 组件的属性列表
*/
properties: {
title: {
type: String,
value: '智慧云馆'
},
icon: {
type: String,
value: '../../images/back.png'
},
showIcon: {
type: Boolean,
value: true
},
isGoHome: {
type: Boolean,
value: false
},
isHistory: {
type: Boolean,
value: false
},
isLogin: {
type: Boolean,
value: false
},
},
/**
* 组件的初始数据
*/
data: {
unIcon: false
},
ready() {
let pages = getCurrentPages();
this.setData({
showIcon: pages.length > 1,
})
// console.log(pages);
// if (this.isLogin()) {
// this.setData({
// unIcon: pages[pages.length - 2].data.gohome
// })
// }
// pages/register/index
// pages/facialCapturing/index options isPass 1
},
/**
* 组件的方法列表
*/
methods: {
isLogin() {
let pages = getCurrentPages();
let currentPage = pages[pages.length - 1];
let perPage = pages[pages.length - 2]
if (currentPage.route == 'pages/login/index') {
return true;
}
if (currentPage.route == 'pages/register/index') {
return true;
}
if (currentPage.route == 'pages/facialCapturing/index' && currentPage.options.isPass == 1) {
return true;
}
return false;
},
iconClick() {
let pages = getCurrentPages();
let route = wx.getStorageSync('history');
if (this.data.isGoHome) {
wx.redirectTo({
url: '/pages/home/index',
})
} else if (this.data.isLogin) {
wx.redirectTo({
url: '/pages/login/index',
})
} else if (this.data.isHistory && route) {
if (pages[pages.length - 2].data.gohome) {
wx.reLaunch({
url: '/pages/home/index',
})
return;
}
wx.removeStorageSync('history');
wx.redirectTo({
url: route,
})
} else {
wx.navigateBack({
delta: 1,
})
}
}
}
})

View File

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

View File

@@ -0,0 +1,11 @@
<!--components/header/header.wxml-->
<view class='header-bg'>
<view class='icon' bindtap='iconClick' wx:if="{{(showIcon || isGoHome)}}">
<image src='{{icon}}' mode='aspectFit' wx:if="{{!isGoHome}}"></image>
<image src='../../images/24.png' mode='aspectFit' wx:if="{{isGoHome}}"></image>
</view>
<view class='title'>
<view class='title-box'>{{title}}</view>
</view>
<view class='right' wx:if="{{showIcon || isGoHome}}"></view>
</view>

View File

@@ -0,0 +1,48 @@
/* components/header/header.wxss */
.header-bg {
position: fixed;
top: 0;
left: 0;
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: 100rpx;
padding-top: 40rpx;
background: #1a191e;
color: #fff;
font-size: 26rpx;
z-index: 1001;
}
.header-bg .icon {
display: flex;
align-items: center;
width: 90rpx;
height: 80%;
}
.header-bg .icon>image {
width: 80%;
height: 50%;
}
.header-bg .title {
flex: 1;
display: flex;
justify-content: center;
/* width: 50%; */
text-align: center;
}
.header-bg .title .title-box {
width: 50%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.header-bg .right {
width: 90rpx;
}

BIN
images/10@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
images/11@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
images/12@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
images/13@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
images/14@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/15@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/16@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
images/17@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
images/18@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
images/19@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
images/1@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/20@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
images/21@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
images/22@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/23@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
images/24@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
images/25@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
images/26@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
images/27@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
images/28@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
images/29@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
images/2@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
images/30@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
images/31@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
images/32@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
images/33@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
images/34@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
images/35@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/36@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
images/37@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/38@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/39@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
images/3@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/40@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/41@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
images/42.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 B

BIN
images/42@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
images/43.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
images/43@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
images/44@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
images/45@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
images/46@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/47@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
images/48@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
images/49@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
images/4@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
images/5@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
images/61.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
images/6@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

BIN
images/7@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
images/8@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
images/9@3x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
images/avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
images/back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
images/noContent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

79
pages/about/index.js Normal file
View File

@@ -0,0 +1,79 @@
// pages/about/index.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
us: {
},
isGoHome: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
app.$api.aboutUs({}).then(res => {
this.setData({
us: res.uss
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
let pages = getCurrentPages();
this.setData({
isGoHome: pages.length == 1
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return {
title: '智慧云馆'
}
}
})

5
pages/about/index.json Normal file
View File

@@ -0,0 +1,5 @@
{
"usingComponents": {
"header": "/component/header/header"
}
}

6
pages/about/index.wxml Normal file
View File

@@ -0,0 +1,6 @@
<!--pages/about/index.wxml-->
<header isGoHome="{{isGoHome}}"></header>
<view class='container' wx:if="{{us.description}}">
<image class='logo' src='{{us.image}}' mode='aspectFit'></image>
<rich-text class='info' nodes="{{us.description}}"></rich-text>
</view>

23
pages/about/index.wxss Normal file
View File

@@ -0,0 +1,23 @@
/* pages/about/index.wxss */
.container {
display: flex;
align-items: center;
flex-direction: column;
padding: 180rpx 50rpx 50rpx;
min-height: calc(100vh - 240rpx);
}
.logo {
width: 400rpx;
height: 100rpx;
}
.info {
margin-top: 60rpx;
font-size: 24rpx;
color: #FFF;
line-height: 36rpx;
}
.wscnph {
width: 100%;
}

78
pages/agreement/index.js Normal file
View File

@@ -0,0 +1,78 @@
// pages/agreement/index.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
protocols: {},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
app.$api.protocols({}).then(res => {
this.setData({
protocols: res.protocols
})
}, res => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
let pages = getCurrentPages();
this.setData({
isGoHome: pages.length == 1
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
return {
title: '智慧云馆'
}
}
})

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "智慧云馆服务条款",
"usingComponents": {
"header": "/component/header/header"
}
}

View File

@@ -0,0 +1,5 @@
<!--pages/agreement/index.wxml-->
<header title="智慧云馆服务条款"></header>
<view class='container' wx:if="{{protocols.content}}">
<rich-text class='info' nodes="{{protocols.content}}"></rich-text>
</view>

View File

@@ -0,0 +1,17 @@
/* pages/agreement/index.wxss */
.container {
padding: 180rpx 50rpx 20rpx 50rpx;
min-height: calc(100vh - 210rpx);
}
.info {
margin-top: 60rpx;
font-size: 24rpx;
color: #fff;
line-height: 36rpx;
}
.wscnph {
width: 100%;
}

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;
}

196
pages/bookClasses/index.js Normal file
View File

@@ -0,0 +1,196 @@
// pages/bookClasses/index.js
const app = getApp();
let weekday = [
'星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'
];
let veneuType = '';
let venueId = '';
let isFrist = true;
let clickDate = '';
Page({
/**
* 页面的初始数据
*/
data: {
currentIndex: 1,
calendar: [],
venueLessons: [],
isShowNewplot: false,
isGoHome: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
isFrist = false;
veneuType = options.type;
venueId = options.venueId;
app.$api.venueLessonShow({
type: options.type,
venueId: options.venueId
}).then(res => {
let list = [];
let subList = [];
let currentDate = new Date(new Date().setHours(8, 0, 0, 0));
let currentDateValue = ''
for (let i = 0; i < res.lessons.length; i++) {
if (i % 7 == 0 && i != 0) {
list.push(subList);
subList = [];
}
let obj = {}
let date = new Date(res.lessons[i].dateList);
obj.date = (date.getMonth() + 1) + '.' + date.getDate()
obj.week = weekday[date.getDay()];
obj.value = res.lessons[i].dateList;
obj.flg = res.lessons[i].flg;
if (currentDate.getTime() == date.getTime()) {
obj.isSelected = true;
currentDateValue = obj.value;
clickDate = obj.value;
}
subList.push(obj);
}
list.push(subList);
subList = [];
this.setData({
calendar: list,
isShowNewplot: true,
})
this.getData(currentDateValue);
}, err => {
this.setData({
isShowNewplot: true,
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
let pages = getCurrentPages();
this.setData({
isGoHome: pages.length == 1
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
// if (isFrist) {
// // clickDate = new
// this.getData(clickDate);
// }
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
isFrist = true;
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
return {
title: '预约课程'
}
},
// 向左划
leftClick() {
if (this.data.currentIndex == 0) {
return;
}
this.data.currentIndex--;
this.setData({
currentIndex: this.data.currentIndex
})
},
// 向右滑
rightClick() {
if (this.data.currentIndex == this.data.calendar.length - 1) {
return;
}
this.data.currentIndex++;
this.setData({
currentIndex: this.data.currentIndex
})
},
// 点击日历
clickItem(e) {
let idx = e.currentTarget.dataset.idx;
let index = e.currentTarget.dataset.index;
for (let i = 0; i < this.data.calendar.length; i++) {
for (let j = 0; j < this.data.calendar[i].length; j++) {
if (index == i && idx == j) {
this.data.calendar[i][j].isSelected = true;
} else {
this.data.calendar[i][j].isSelected = false;
}
}
}
this.setData({
calendar: this.data.calendar
})
clickDate = this.data.calendar[index][idx].value;
this.getData(this.data.calendar[index][idx].value);
},
// 跳转详情
clickCell(e) {
let id = e.currentTarget.dataset.id;
wx.navigateTo({
url: `/pages/bookClassesDetail/index?id=${id}`,
success: function(res) {},
fail: function(res) {},
complete: function(res) {},
})
},
getData(date) {
wx.showLoading({
title: '加载中...',
mask: true,
})
app.$api.venueLessonDate({
date: date,
type: veneuType,
venueId: venueId
}).then(res => {
this.setData({
venueLessons: res.venueLessons
})
}, err => {
})
}
})

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "预约课程",
"usingComponents": {
"header": "/component/header/header"
}
}

View File

@@ -0,0 +1,54 @@
<header title="预约课程" isGoHome="{{isGoHome}}"></header>
<view class="container">
<view class='header'>
<!-- wx:if="{{currentIndex > 0}}" -->
<view class='img' bindtap='leftClick'>
<image src='../../images/44@3x.png' mode='aspectFit'></image>
</view>
<swiper class='swiper' current="{{currentIndex}}">
<block wx:for="{{calendar}}" wx:key="{{index}}">
<swiper-item class="cell">
<view wx:for="{{item}}" wx:for-item="data" class='{{data.isSelected? "item isActive" : "item"}}' wx:key="{{index}}" wx:for-index="idx" data-idx='{{idx}}' data-index='{{index}}' bindtap='clickItem'>
<view class='date'>{{data.date}}</view>
<!-- wx:if="{{data.isSelected}}" -->
<view class='date' >{{data.week}}</view>
<view class='flg' wx:if="{{data.flg == 1}}">预</view>
<view class='flg past' wx:if="{{data.flg == 2}}">预</view>
</view>
</swiper-item>
</block>
</swiper>
<!-- wx:if="{{currentIndex < calendar.length - 1}}" -->
<view class='img' bindtap='rightClick'>
<image src='../../images/43@3x.png' mode='aspectFit'></image>
</view>
</view>
<view class='list'>
<view class='cell' wx:for="{{venueLessons}}" wx:key="{{index}}" bindtap='clickCell' data-id='{{item.id}}'>
<view class='image-box'>
<image src='{{item.coach.avatar}}' mode='aspectFill'></image>
<!-- <view class='sold-out'>已售{{item.saleNum}}份</view> -->
</view>
<view class='cell-center'>
<view class='title-box'>
<text>{{item.name}}</text>
<view wx:for="{{item.venueLessonTagConfigs}}" wx:for-item="i" wx:for-index="idx" wx:key="{{idx}}" class='tip'>{{i.name}}</view>
</view>
<text>时间: {{item.startTime}} ~ {{item.endTime}}</text>
<text>价格: ¥{{item.price}} </text>
</view>
<view class='{{item.flg == 0? "type-btn isActive" : "type-btn"}}'>{{item.flg == 0 ? "预约":(item.flg == 1? "结束" : "满额")}}</view>
</view>
</view>
</view>
<view class='newplot' wx:if="{{isShowNewplot && venueLessons.length == 0}}">
<image src='../../images/noContent.png'></image>
<text>暂无课程 ~</text>
</view>
<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,226 @@
/* pages/bookClasses/index.wxss */
.header {
display: flex;
justify-content: space-between;
align-items: center;
height: 140rpx;
padding: 0 16rpx;
background: #1a191e;
}
.header .swiper {
flex: 1;
height: 100%;
margin: 0 10rpx;
}
.header .img {
display: flex;
justify-content: center;
align-items: center;
width: 20rpx;
height: 100%;
border-radius: 4rpx;
}
.header .img>image {
width: 20rpx;
height: 40rpx;
}
.header .swiper .cell {
display: flex;
justify-content: space-around;
align-items: center;
}
.header .swiper .cell .item {
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: calc((100% - 120rpx)/7);
/* height: 60rpx; */
height: 70rpx;
border: 2rpx solid #57565a;
border-radius: 10rpx;
color: #fff;
}
.header .swiper .cell .item .date {
font-size: 20rpx;
}
.header .swiper .cell .item.isActive {
/* flex-direction: column; */
/* width: calc((100% - 140rpx)/7 + 20rpx); */
/* height: 70rpx; */
border: 2rpx solid #b39a29;
color: #9b8627;
}
.header .swiper .cell .item .flg {
position: absolute;
top: 0;
right: 0;
transform: translate(35%, -50%);
height: 36rpx;
width: 36rpx;
font-size: 20rpx;
background: #ffda2e;
color: #1a191e;
line-height: 36rpx;
text-align: center;
border-radius: 50%;
z-index: 100;
}
.header .swiper .cell .item .flg.past {
background: #989898;
}
.list .cell {
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
height: 160rpx;
margin-top: 30rpx;
padding: 0 16rpx;
background: #1a191e;
}
.list .cell .image-box {
position: relative;
width: 130rpx;
height: 110rpx;
background: orange;
}
.list .cell .image-box>image {
width: 100%;
height: 100%;
}
.list .cell .image-box .sold-out {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 30rpx;
background: rgba(0, 0, 0, 0.6);
color: #fff;
font-size: 20rpx;
text-align: center;
line-height: 30rpx;
}
.list .cell .cell-center {
display: flex;
flex-direction: column;
justify-content: space-around;
flex: 1;
margin-left: 24rpx;
}
.list .cell .cell-center .title-box {
display: flex;
align-items: center;
margin-bottom: 20rpx;
}
.list .cell .cell-center .title-box>text {
color: #fff;
font-size: 26rpx;
line-height: 26rpx;
}
.list .cell .cell-center .title-box .tip {
margin-left: 10rpx;
font-size: 20rpx;
line-height: 20rpx;
color: #a08a27;
border: 2rpx solid #675a23;
border-radius: 4rpx;
padding: 4rpx 6rpx;
}
.list .cell .cell-center>text {
font-size: 24rpx;
line-height: 24rpx;
color: #b89e29;
}
.list .cell .cell-center>text:last-child {
margin-top: 12rpx;
}
.list .cell .type-btn {
position: absolute;
top: calc(50% + 6rpx);
right: 20rpx;
transform: translateY(-50%);
height: 50rpx;
width: 100rpx;
background: #767578;
color: #1a191e;
text-align: center;
line-height: 50rpx;
border-radius: 25rpx;
font-size: 24rpx;
}
.list .cell .type-btn.isActive {
background: #ffda2e;
}
.newplot {
position: fixed;
top: 270rpx;
bottom: 0;
left: 0;
right: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #fff;
font-size: 28rpx;
}
.newplot>image {
width: 200rpx;
height: 200rpx;
margin-top: -200rpx;
}
.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;
}

View File

@@ -0,0 +1,166 @@
// pages/bookClassesDetail/index.js
const app = getApp();
let id = '';
import {
getCurrentPageUrl
} from './../../utils/util.js'
Page({
/**
* 页面的初始数据
*/
data: {
isOpenCoach: false,
isOpenAnnouncements: false,
lesson: {},
isGoHome: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
wx.showLoading({
title: '加载中...',
})
id = options.id;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
let pages = getCurrentPages();
this.setData({
isGoHome: pages.length == 1
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
app.$api.venueLessonDetail({
lessonId: id
}).then(res => {
let now = new Date().getTime()
let isStartTime = now > new Date(res.lesson.date.replace(/-/g, "/") + " " + res.lesson.startTime).getTime()
let isEndTime = now > new Date(res.lesson.date.replace(/-/g, "/") + " " + res.lesson.endTime).getTime();
if (res.lesson.flg == 0) {
res.lesson.btnStatus = 1;
}
if (isStartTime) {
res.lesson.btnStatus = 2;
}
if (isEndTime) {
res.lesson.btnStatus = 3
}
if (!res.lesson.btnStatus) {
res.lesson.btnStatus = 0
}
this.setData({
lesson: res.lesson,
isOpenCoach: res.lesson.coach.description.length < 40,
isOpenAnnouncements: res.lesson.coach
})
}, err => {
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
return {
title: this.data.lesson.name,
imageUrl: this.data.lesson.venueLessonImages[0].url
}
},
// 打开导航
opnGPS() {
wx.openLocation({
latitude: Number(this.data.lesson.latitude),
longitude: Number(this.data.lesson.longitude),
name: this.data.lesson.venueName,
address: this.data.lesson.address,
})
},
// 展开教练
openCoach() {
this.setData({
isOpenCoach: true
})
},
// 收起
closeCoach() {
this.setData({
isOpenCoach: false
})
},
// 展开注意事项
openAnnouncements() {
this.setData({
isOpenAnnouncements: true
})
},
// 收起
closeAnnouncements() {
this.setData({
isOpenAnnouncements: false
})
},
// 预约课程
pushBookClasses() {
if (!wx.getStorageSync('accessToken')) {
wx.setStorageSync('history', getCurrentPageUrl());
wx.redirectTo({
url: '/pages/login/index',
})
return
}
wx.navigateTo({
url: `/pages/confirmOrder/index?id=${id}&venueId=${this.data.lesson.venueId}&venueType=${this.data.lesson.venueType}`,
})
},
// 点击教练头像
clickImage() {
wx.previewImage({
urls: [this.data.lesson.coach.avatar],
})
}
})

View File

@@ -0,0 +1,5 @@
{
"usingComponents": {
"header": "/component/header/header"
}
}

View File

@@ -0,0 +1,97 @@
<!--pages/bookClassesDetail/index.wxml-->
<header title="{{lesson.name}}" isGoHome="{{isGoHome}}"></header>
<view class='container' wx:if="{{lesson.name}}">
<swiper class='header' indicator-dots="{{lesson.venueLessonImages.length > 1}}" autoplay="{{true}}" circular="{{true}}">
<block wx:for="{{lesson.venueLessonImages}}" 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>开课时间: {{lesson.date}} {{lesson.startTime}} ~ {{lesson.endTime}}</text>
</view>
<view class='cell'>
<image src='../../images/41@3x.png' mode='aspectFit'></image>
<text>{{lesson.address}}</text>
<view class='cell-right' bindtap='opnGPS'>
<image src='../../images/34@3x.png' class='gps-img'></image>
<text>导航</text>
</view>
</view>
<view class='cell'>
<image src='../../images/33@3x.png' mode='aspectFit'></image>
<text>价格: ¥{{lesson.price}}</text>
</view>
<view class='cell unline'>
<image src='../../images/39@3x.png' mode='aspectFit'></image>
<view class='more-text'>
<text>已报: {{lesson.saleNum}}</text>
<text>剩余: {{lesson.flg}}</text>
</view>
</view>
</view>
<view class='cell-box'>
<view class='coach-info'>
<image src='{{lesson.coach.avatar}}' mode='aspectFill' bindtap='clickImage'></image>
<view class='coach-text'>
<view class='name'>{{lesson.coach.nickname}}</view>
<view class='{{isOpenCoach ? "info":"info pack-up"}}'>{{lesson.coach.description}}</view>
</view>
</view>
<view class='unfold' bindtap='openCoach' wx:if="{{!isOpenCoach}}">
<text>展开</text>
<image src='../../images/15@3x.png'></image>
</view>
<view class='unfold' bindtap='closeCoach' wx:if="{{isOpenCoach && lesson.coach.description}}">
<text>收起</text>
<image src='../../images/48@3x.png' style='width:22rpx; height:12rpx;'></image>
</view>
</view>
<view class='cell-box' wx:if="{{lesson.note}}">
<view class='cell'>
<image src='../../images/32@3x.png' mode='aspectFit'></image>
<view class='title'>
<text>注意事项</text>
</view>
</view>
<view class='rich-box'>
<rich-text nodes="{{lesson.note}}"></rich-text>
</view>
<!-- <view class='unfold' style='margin-top:20rpx' bindtap='openAnnouncements' wx:if="{{!isOpenAnnouncements}}">
<text>展开</text>
<image src='../../images/15@3x.png'></image>
</view>
<view class='unfold' bindtap='closeAnnouncements' wx:if="{{isOpenAnnouncements}}">
<text>收起</text>
<image src='../../images/48@3x.png' style='width:22rpx; height:12rpx;'></image>
</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="{{lesson.description}}"></rich-text>
</view>
</view>
<view class='footer-btn' style='background: #767578' wx:if="{{lesson.btnStatus == 1}}">满额</view>
<view class='footer-btn' style='background: #767578' wx:elif="{{lesson.btnStatus == 2}}">已开始</view>
<view class='footer-btn' style='background: #767578' wx:elif="{{lesson.btnStatus == 3}}">已结束</view>
<view class='footer-btn' bindtap='pushBookClasses' wx:elif="{{lesson.btnStatus == 0}}">课程预约</view>
</view>
<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,212 @@
/* pages/bookClassesDetail/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 .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 .more-text {
flex: 1;
font-size: 24rpx;
color: rgba(255, 255, 255, 0.6);
}
.cell-box .cell .more-text>text:first-child {
margin-right: 58rpx;
}
.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 .coach-info {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 30rpx;
}
.cell-box .coach-info>image {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
margin-right: 26rpx;
}
.cell-box .coach-info .coach-text {
flex: 1;
}
.cell-box .coach-info .coach-text .name {
height: 26rpx;
margin-bottom: 20rpx;
color: #d1b32b;
font-size: 26rpx;
line-height: 26rpx;
}
.cell-box .coach-info .coach-text .info {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.6);
line-height: 30rpx;
}
.cell-box .coach-info .coach-text .info.pack-up {
height: 60rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.cell-box .unfold {
display: flex;
justify-content: flex-end;
align-items: center;
padding: 0 30rpx 18rpx 0;
color: rgba(255, 255, 255, 0.6);
font-size: 22rpx;
}
.cell-box .unfold>image {
width: 12rpx;
height: 22rpx;
margin-left: 16rpx;
}
.cell-box .rich-box {
display: flex;
padding: 20rpx;
color: rgba(255, 255, 255, 0.6);
font-size: 24rpx;
line-height: 36rpx;
}
.cell-box .rich-box.pack-up {
height: 48rpx;
overflow: hidden;
/* text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical; */
}
.cell-box .cell .title {
flex: 1;
display: flex;
align-items: center;
color: #fff;
font-size: 24rpx;
}
.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;
}
.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;
}

333
pages/confirmOrder/index.js Normal file
View File

@@ -0,0 +1,333 @@
// pages/confirmOrder/index.js
const app = getApp();
import {
getCurrentPageUrl
} from './../../utils/util.js'
let id = '';
let venueId = '';
let venueType = '';
Page({
/**
* 页面的初始数据
*/
data: {
count: 1,
lessonOrder: {},
memberCard: {},
memberCardNum: 0,
showUnclickMask: false,
memberCardList: [],
showCardPopup: false,
isWxLogin: false,
payType: 2
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
id = options.id;
venueId = options.venueId;
venueType = options.venueType;
this.getData();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.setData({
showUnclickMask: false
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
return {
title: '智慧云馆'
}
},
// 选择会员卡
selectMembershipCard() {
if (this.data.memberCardNum == 0) {
return;
}
this.setData({
showCardPopup: true
})
},
// 增加数量
add() {
if (this.data.count >= (this.data.lessonOrder.num - this.data.lessonOrder.saleNum)) {
wx.showToast({
title: '库存不足',
icon: 'none',
duration: 2000,
})
return;
}
if (this.data.memberCard.cardType) {
wx.showToast({
title: '使用会员卡仅能预约一人',
icon: 'none',
duration: 2000,
})
return;
}
if (this.data.count >= 4) {
wx.showToast({
title: '每单最多预约四人',
icon: 'none',
duration: 2000,
})
return;
}
if (this.data.count >= 1 && this.data.lessonOrder.price == 0) {
wx.showToast({
title: '免费课程仅能预约一人',
icon: 'none',
duration: 2000,
})
return;
}
this.setData({
count: ++this.data.count
})
},
// 减少人数
sub() {
if (this.data.count == 1) {
return;
}
this.setData({
count: --this.data.count
})
},
// 确认订单
confirmOrder() {
let that = this;
this.setData({
showUnclickMask: true
})
wx.showLoading({
title: '加载中...',
})
if (this.data.memberCard.cardType) {
app.$api.memberLessonTicketOrderMemberCard({
lessonId: id,
memberCardId: this.data.memberCard.id,
num: this.data.count
}).then(res => {
wx.showToast({
title: '预约成功',
icon: 'success',
duration: 2000
})
setTimeout(function() {
that.setData({
showUnclickMask: false
})
wx.redirectTo({
url: '/pages/myBookings/index?orderSn=' + res.orderSn,
})
}, 2000)
}, err => {
that.setData({
showUnclickMask: false
})
})
} else {
app.$api.memberLessonTicketOrderWX({
lessonId: id,
num: this.data.count,
type:this.data.payType
}).then(res => {
if (!res.pay.time_stamp) {
wx.showToast({
title: '预约成功',
icon: 'success',
duration: 2000
})
setTimeout(function() {
that.setData({
showUnclickMask: false
})
wx.redirectTo({
url: '/pages/myBookings/index?orderSn=' + res.pay.orderSn,
})
}, 2000)
return;
}
app.$pay.wxPay(res.pay).then(data => {
setTimeout(function() {
that.setData({
showUnclickMask: false
})
wx.redirectTo({
url: '/pages/myBookings/index?orderSn=' + res.pay.orderSn,
})
}, 2000)
}, err => {
console.log("SSSSS")
wx.showToast({
title: '取消支付,预约失败',
icon: 'none'
})
this.setData({
showUnclickMask: false
})
});
}, err => {
this.setData({
showUnclickMask: false,
})
if (err.data.err_code == 30022) {
this.setData({
isWxLogin: true,
isShowBuyVip: false
})
}
})
}
},
getData() {
wx.showLoading({
title: '加载中...',
})
app.$api.venueLessonOrder({
lessonId: id,
venueId: venueId,
venueType: venueType
}).then(res => {
for (let i = 0; i < res.memberCard.length; i++) {
if (res.memberCard[i].status == 1 && res.memberCard[i].cardFlg == 0) {
this.data.memberCard = res.memberCard[i];
}
if (res.memberCard[i].cardFlg == 0) {
this.data.memberCardNum++;
}
res.memberCard[i].startTime = res.memberCard[i].startTime.split(' ')[0];
res.memberCard[i].endTime = res.memberCard[i].endTime.split(' ')[0];
}
this.setData({
lessonOrder: res.lessonOrder,
memberCardList: res.memberCard,
memberCard: this.data.memberCard,
memberCardNum: this.data.memberCardNum
})
}, err => {
})
},
// 隐藏会员卡弹框
cencalCardBox() {
this.setData({
showCardPopup: false
})
},
unTap() {
return;
},
unUserCard() {
this.setData({
memberCard: {},
showCardPopup: false
})
},
// 选择会员卡
changeCard(e) {
let id = e.currentTarget.dataset.id;
let obj = {};
for (let i = 0; i < this.data.memberCardList.length; i++) {
if (id == this.data.memberCardList[i].id) {
obj = this.data.memberCardList[i]
}
}
this.setData({
memberCard: obj,
showCardPopup: false,
count: 1
})
},
// 取消授权登录
cancelDeleteDialog() {
this.setData({
isWxLogin: false
})
},
// 授权微信
getUserInfo(e) {
console.log(e.detail);
app.$pay.payWxLoing(e.detail).then(res => {
wx.showToast({
title: '绑定成功',
duration: 2000,
})
this.setData({
isWxLogin: false
})
}, err => {
this.setData({
isWxLogin: false
})
})
},
// 选中支付方式
changePayType(e) {
this.setData({
payType: e.currentTarget.dataset.type
})
}
})

View File

@@ -0,0 +1,7 @@
{
"navigationBarTitleText": "确认订单",
"usingComponents": {
"header": "/component/header/header",
"confirm-dialog": "/component/confirmDialog/confirmDialog"
}
}

View File

@@ -0,0 +1,87 @@
<!--pages/confirmOrder/index.wxml-->
<header title="确认订单"></header>
<view class='container' wx:if="{{lessonOrder.name}}">
<view class='title'>{{lessonOrder.name}}</view>
<view class='box'>
<view class='cell'>
<image src='../../images/42@3x.png' mode='aspectFit'></image>
<text>开课时间: {{lessonOrder.date}} {{lessonOrder.startTime}} ~ {{lessonOrder.endTime}}</text>
</view>
<view class='cell'>
<image src='../../images/41@3x.png' mode='aspectFit'></image>
<text>{{lessonOrder.address}}</text>
</view>
<view class='cell' bindtap='selectMembershipCard'>
<image src='../../images/40@3x.png' mode='aspectFit'></image>
<text>{{memberCardNum == 0? "暂无会员卡" : (memberCard.cardType ? "已使用" + memberCard.cardType : "未使用会员卡")}}</text>
<image class='right-img' src='../../images/46@3x.png' wx:if="{{memberCardNum > 0}}"></image>
</view>
<view class='cell'>
<image src='../../images/39@3x.png' mode='aspectFit'></image>
<text>人数</text>
<view class='change-quantities'>
<view class='operator' bindtap='sub'>
<image src='../../images/38@3x.png'></image>
</view>
<view class='number'>{{count}}</view>
<view class='operator' bindtap='add'>
<image src='../../images/37@3x.png'></image>
</view>
</view>
</view>
<view class='box-footer'>
{{memberCard.cardType ? "已使用" + memberCard.cardType : "合计: ¥" + (lessonOrder.price * count)}}
</view>
<!-- wx:if="{{lesson.note}}" -->
</view>
<view class="box" style="margin-top: 30rpx;">
<view class="cell" bindtap="changePayType" data-type="2">
<image src='../../images/42.png' mode='aspectFit' wx:if="{{payType == 2}}"></image>
<image src='../../images/43.png' mode='aspectFit' wx:else></image>
<text>微信支付</text>
</view>
<view class="cell" bindtap="changePayType" data-type="1">
<image src='../../images/42.png' mode='aspectFit' wx:if="{{payType == 1}}"></image>
<image src='../../images/43.png' mode='aspectFit' wx:else></image>
<text>余额支付</text>
</view>
</view>
<view class='box' style='margin-top: 30rpx;'>
<view class='cell'>
<image src='../../images/32@3x.png' mode='aspectFit'></image>
<view class='title'>
<text>注意事项</text>
</view>
</view>
<view class='rich-box'>
<rich-text nodes="{{lessonOrder.note}}"></rich-text>
</view>
</view>
<view class='footer-btn' bindtap='confirmOrder'>确认订单</view>
</view>
<view class='unclick-mask' wx:if="{{showUnclickMask}}"></view>
<view class='card-box' wx:if="{{showCardPopup}}" bindtap='cencalCardBox'>
<view class='body-box' catchtap='unTap'>
<view class='cell' catchtap='unUserCard'>
<view class='buy-btn'>不使用会员卡</view>
<view class='buy-btn'>取消</view>
<!-- <image src='../../images/3@3x.png' wx:if="{{memberCard.cardType}}"></image>
<image src='../../images/4@3x.png' wx:else></image> -->
</view>
<view class='cell' wx:for="{{memberCardList}}" wx:key="{{index}}" wx:if="{{item.cardFlg == 0}}" data-id='{{item.id}}' catchtap="changeCard">
<text class='tip'>{{item.cardType}}</text>
<text class='indate'>有效期: {{item.startTime}} ~ {{item.endTime}}</text>
<image src='../../images/4@3x.png' wx:if="{{memberCard.id == item.id}}"></image>
<image src='../../images/3@3x.png' wx:else></image>
</view>
</view>
<view class='cencal-btn'>取消</view>
</view>
<confirm-dialog title="提示" message="请先绑定微信" confirmBtnTitle="绑定" isUserInfo="{{true}}" bindcancelselect="cancelDeleteDialog" bindgetuserinfo="getUserInfo" wx:if="{{isWxLogin}}"></confirm-dialog>

Some files were not shown because too many files have changed in this diff Show More