commit e8fe10b5fb8d4932bdc393ee5aae4d863156af47 Author: limqhz Date: Sun Jun 21 16:27:58 2020 +0800 init project diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c16e483 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# Windows +[Dd]esktop.ini +Thumbs.db +$RECYCLE.BIN/ + +# macOS +.DS_Store +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes + +# Node.js +node_modules/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..0e1aca5 --- /dev/null +++ b/README.md @@ -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/) diff --git a/app.js b/app.js new file mode 100644 index 0000000..fe7a95b --- /dev/null +++ b/app.js @@ -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 +}) \ No newline at end of file diff --git a/app.json b/app.json new file mode 100644 index 0000000..7bed22d --- /dev/null +++ b/app.json @@ -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": "需要获取您的地理位置,请确认授权,否则地图功能将无法使用" + } + } +} \ No newline at end of file diff --git a/app.wxss b/app.wxss new file mode 100644 index 0000000..ac71e7c --- /dev/null +++ b/app.wxss @@ -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; +} diff --git a/component/actionSheet/actionSheet.js b/component/actionSheet/actionSheet.js new file mode 100644 index 0000000..05cd4f6 --- /dev/null +++ b/component/actionSheet/actionSheet.js @@ -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; + } + } +}) diff --git a/component/actionSheet/actionSheet.json b/component/actionSheet/actionSheet.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/component/actionSheet/actionSheet.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/component/actionSheet/actionSheet.wxml b/component/actionSheet/actionSheet.wxml new file mode 100644 index 0000000..61e3edc --- /dev/null +++ b/component/actionSheet/actionSheet.wxml @@ -0,0 +1,7 @@ + + + + {{item.label}} + 取消 + + diff --git a/component/actionSheet/actionSheet.wxss b/component/actionSheet/actionSheet.wxss new file mode 100644 index 0000000..69654e2 --- /dev/null +++ b/component/actionSheet/actionSheet.wxss @@ -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; +} \ No newline at end of file diff --git a/component/authorizedMask/authorizedMask.js b/component/authorizedMask/authorizedMask.js new file mode 100644 index 0000000..292ad9b --- /dev/null +++ b/component/authorizedMask/authorizedMask.js @@ -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 + // }) + // } + } + } +}) \ No newline at end of file diff --git a/component/authorizedMask/authorizedMask.json b/component/authorizedMask/authorizedMask.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/component/authorizedMask/authorizedMask.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/component/authorizedMask/authorizedMask.wxml b/component/authorizedMask/authorizedMask.wxml new file mode 100644 index 0000000..8d45b2f --- /dev/null +++ b/component/authorizedMask/authorizedMask.wxml @@ -0,0 +1,17 @@ + + + + + + + + {{content}} + + + + + + + \ No newline at end of file diff --git a/component/authorizedMask/authorizedMask.wxss b/component/authorizedMask/authorizedMask.wxss new file mode 100644 index 0000000..fb60505 --- /dev/null +++ b/component/authorizedMask/authorizedMask.wxss @@ -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; +} diff --git a/component/confirmDialog/confirmDialog.js b/component/confirmDialog/confirmDialog.js new file mode 100644 index 0000000..bb2e9a3 --- /dev/null +++ b/component/confirmDialog/confirmDialog.js @@ -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, {}); + } + } +}) diff --git a/component/confirmDialog/confirmDialog.json b/component/confirmDialog/confirmDialog.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/component/confirmDialog/confirmDialog.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/component/confirmDialog/confirmDialog.wxml b/component/confirmDialog/confirmDialog.wxml new file mode 100644 index 0000000..f56874c --- /dev/null +++ b/component/confirmDialog/confirmDialog.wxml @@ -0,0 +1,14 @@ + + + + {{title}} + {{message}} + + + + + + + + + \ No newline at end of file diff --git a/component/confirmDialog/confirmDialog.wxss b/component/confirmDialog/confirmDialog.wxss new file mode 100644 index 0000000..889d2d6 --- /dev/null +++ b/component/confirmDialog/confirmDialog.wxss @@ -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; +} diff --git a/component/header/header.js b/component/header/header.js new file mode 100644 index 0000000..712148a --- /dev/null +++ b/component/header/header.js @@ -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, + }) + } + } + } +}) \ No newline at end of file diff --git a/component/header/header.json b/component/header/header.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/component/header/header.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/component/header/header.wxml b/component/header/header.wxml new file mode 100644 index 0000000..224d26f --- /dev/null +++ b/component/header/header.wxml @@ -0,0 +1,11 @@ + + + + + + + + {{title}} + + + \ No newline at end of file diff --git a/component/header/header.wxss b/component/header/header.wxss new file mode 100644 index 0000000..538115d --- /dev/null +++ b/component/header/header.wxss @@ -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; +} diff --git a/images/10@3x.png b/images/10@3x.png new file mode 100644 index 0000000..6413299 Binary files /dev/null and b/images/10@3x.png differ diff --git a/images/11@3x.png b/images/11@3x.png new file mode 100644 index 0000000..b03f704 Binary files /dev/null and b/images/11@3x.png differ diff --git a/images/12@3x.png b/images/12@3x.png new file mode 100644 index 0000000..a7a4f55 Binary files /dev/null and b/images/12@3x.png differ diff --git a/images/13@3x.png b/images/13@3x.png new file mode 100644 index 0000000..f36e179 Binary files /dev/null and b/images/13@3x.png differ diff --git a/images/14@3x.png b/images/14@3x.png new file mode 100644 index 0000000..8582662 Binary files /dev/null and b/images/14@3x.png differ diff --git a/images/15@3x.png b/images/15@3x.png new file mode 100644 index 0000000..2e7cbbf Binary files /dev/null and b/images/15@3x.png differ diff --git a/images/16@3x.png b/images/16@3x.png new file mode 100644 index 0000000..3169ddb Binary files /dev/null and b/images/16@3x.png differ diff --git a/images/17@3x.png b/images/17@3x.png new file mode 100644 index 0000000..c119676 Binary files /dev/null and b/images/17@3x.png differ diff --git a/images/18@3x.png b/images/18@3x.png new file mode 100644 index 0000000..dbaf571 Binary files /dev/null and b/images/18@3x.png differ diff --git a/images/19@3x.png b/images/19@3x.png new file mode 100644 index 0000000..d7ce249 Binary files /dev/null and b/images/19@3x.png differ diff --git a/images/1@3x.png b/images/1@3x.png new file mode 100644 index 0000000..1fc12d2 Binary files /dev/null and b/images/1@3x.png differ diff --git a/images/20@3x.png b/images/20@3x.png new file mode 100644 index 0000000..4a8429f Binary files /dev/null and b/images/20@3x.png differ diff --git a/images/21@3x.png b/images/21@3x.png new file mode 100644 index 0000000..faaba3c Binary files /dev/null and b/images/21@3x.png differ diff --git a/images/22@3x.png b/images/22@3x.png new file mode 100644 index 0000000..0183bb2 Binary files /dev/null and b/images/22@3x.png differ diff --git a/images/23@3x.png b/images/23@3x.png new file mode 100644 index 0000000..28aaf86 Binary files /dev/null and b/images/23@3x.png differ diff --git a/images/24.png b/images/24.png new file mode 100644 index 0000000..308349b Binary files /dev/null and b/images/24.png differ diff --git a/images/24@3x.png b/images/24@3x.png new file mode 100644 index 0000000..2e148d1 Binary files /dev/null and b/images/24@3x.png differ diff --git a/images/25@3x.png b/images/25@3x.png new file mode 100644 index 0000000..1b51dab Binary files /dev/null and b/images/25@3x.png differ diff --git a/images/26@3x.png b/images/26@3x.png new file mode 100644 index 0000000..02451c9 Binary files /dev/null and b/images/26@3x.png differ diff --git a/images/27@3x.png b/images/27@3x.png new file mode 100644 index 0000000..184e747 Binary files /dev/null and b/images/27@3x.png differ diff --git a/images/28@3x.png b/images/28@3x.png new file mode 100644 index 0000000..2b7078e Binary files /dev/null and b/images/28@3x.png differ diff --git a/images/29@3x.png b/images/29@3x.png new file mode 100644 index 0000000..1efe3bc Binary files /dev/null and b/images/29@3x.png differ diff --git a/images/2@3x.png b/images/2@3x.png new file mode 100644 index 0000000..496ef57 Binary files /dev/null and b/images/2@3x.png differ diff --git a/images/30@3x.png b/images/30@3x.png new file mode 100644 index 0000000..7b676a5 Binary files /dev/null and b/images/30@3x.png differ diff --git a/images/31@3x.png b/images/31@3x.png new file mode 100644 index 0000000..d6742e5 Binary files /dev/null and b/images/31@3x.png differ diff --git a/images/32@3x.png b/images/32@3x.png new file mode 100644 index 0000000..1a2346c Binary files /dev/null and b/images/32@3x.png differ diff --git a/images/33@3x.png b/images/33@3x.png new file mode 100644 index 0000000..2720dad Binary files /dev/null and b/images/33@3x.png differ diff --git a/images/34@3x.png b/images/34@3x.png new file mode 100644 index 0000000..863009c Binary files /dev/null and b/images/34@3x.png differ diff --git a/images/35@3x.png b/images/35@3x.png new file mode 100644 index 0000000..615a0e1 Binary files /dev/null and b/images/35@3x.png differ diff --git a/images/36@3x.png b/images/36@3x.png new file mode 100644 index 0000000..315bbbc Binary files /dev/null and b/images/36@3x.png differ diff --git a/images/37@3x.png b/images/37@3x.png new file mode 100644 index 0000000..6b8c336 Binary files /dev/null and b/images/37@3x.png differ diff --git a/images/38@3x.png b/images/38@3x.png new file mode 100644 index 0000000..9d4a34f Binary files /dev/null and b/images/38@3x.png differ diff --git a/images/39@3x.png b/images/39@3x.png new file mode 100644 index 0000000..8ba84a9 Binary files /dev/null and b/images/39@3x.png differ diff --git a/images/3@3x.png b/images/3@3x.png new file mode 100644 index 0000000..8c9256e Binary files /dev/null and b/images/3@3x.png differ diff --git a/images/40@3x.png b/images/40@3x.png new file mode 100644 index 0000000..7088052 Binary files /dev/null and b/images/40@3x.png differ diff --git a/images/41@3x.png b/images/41@3x.png new file mode 100644 index 0000000..9083b72 Binary files /dev/null and b/images/41@3x.png differ diff --git a/images/42.png b/images/42.png new file mode 100644 index 0000000..abe6dc6 Binary files /dev/null and b/images/42.png differ diff --git a/images/42@3x.png b/images/42@3x.png new file mode 100644 index 0000000..a7ca520 Binary files /dev/null and b/images/42@3x.png differ diff --git a/images/43.png b/images/43.png new file mode 100644 index 0000000..888f4be Binary files /dev/null and b/images/43.png differ diff --git a/images/43@3x.png b/images/43@3x.png new file mode 100644 index 0000000..0ebd1f7 Binary files /dev/null and b/images/43@3x.png differ diff --git a/images/44@3x.png b/images/44@3x.png new file mode 100644 index 0000000..7bff73e Binary files /dev/null and b/images/44@3x.png differ diff --git a/images/45@3x.png b/images/45@3x.png new file mode 100644 index 0000000..8f93ef0 Binary files /dev/null and b/images/45@3x.png differ diff --git a/images/46@3x.png b/images/46@3x.png new file mode 100644 index 0000000..3ce9cd1 Binary files /dev/null and b/images/46@3x.png differ diff --git a/images/47@3x.png b/images/47@3x.png new file mode 100644 index 0000000..320455c Binary files /dev/null and b/images/47@3x.png differ diff --git a/images/48@3x.png b/images/48@3x.png new file mode 100644 index 0000000..151dea5 Binary files /dev/null and b/images/48@3x.png differ diff --git a/images/49@3x.png b/images/49@3x.png new file mode 100644 index 0000000..39f66b6 Binary files /dev/null and b/images/49@3x.png differ diff --git a/images/4@3x.png b/images/4@3x.png new file mode 100644 index 0000000..1793278 Binary files /dev/null and b/images/4@3x.png differ diff --git a/images/5@3x.png b/images/5@3x.png new file mode 100644 index 0000000..a7be770 Binary files /dev/null and b/images/5@3x.png differ diff --git a/images/61.png b/images/61.png new file mode 100644 index 0000000..1156ba1 Binary files /dev/null and b/images/61.png differ diff --git a/images/6@3x.png b/images/6@3x.png new file mode 100644 index 0000000..efe3ecf Binary files /dev/null and b/images/6@3x.png differ diff --git a/images/7@3x.png b/images/7@3x.png new file mode 100644 index 0000000..5c5ab3c Binary files /dev/null and b/images/7@3x.png differ diff --git a/images/8@3x.png b/images/8@3x.png new file mode 100644 index 0000000..9dabe35 Binary files /dev/null and b/images/8@3x.png differ diff --git a/images/9@3x.png b/images/9@3x.png new file mode 100644 index 0000000..adc5e2b Binary files /dev/null and b/images/9@3x.png differ diff --git a/images/avatar.png b/images/avatar.png new file mode 100644 index 0000000..5aa21d9 Binary files /dev/null and b/images/avatar.png differ diff --git a/images/back.png b/images/back.png new file mode 100644 index 0000000..de688c7 Binary files /dev/null and b/images/back.png differ diff --git a/images/noContent.png b/images/noContent.png new file mode 100644 index 0000000..3b8c633 Binary files /dev/null and b/images/noContent.png differ diff --git a/pages/about/index.js b/pages/about/index.js new file mode 100644 index 0000000..df4affd --- /dev/null +++ b/pages/about/index.js @@ -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: '智慧云馆' + } + } +}) \ No newline at end of file diff --git a/pages/about/index.json b/pages/about/index.json new file mode 100644 index 0000000..396dd61 --- /dev/null +++ b/pages/about/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/about/index.wxml b/pages/about/index.wxml new file mode 100644 index 0000000..e20cb25 --- /dev/null +++ b/pages/about/index.wxml @@ -0,0 +1,6 @@ + +
+ + + + \ No newline at end of file diff --git a/pages/about/index.wxss b/pages/about/index.wxss new file mode 100644 index 0000000..cf670ce --- /dev/null +++ b/pages/about/index.wxss @@ -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%; +} \ No newline at end of file diff --git a/pages/agreement/index.js b/pages/agreement/index.js new file mode 100644 index 0000000..7a2871a --- /dev/null +++ b/pages/agreement/index.js @@ -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: '智慧云馆' + } + } +}) \ No newline at end of file diff --git a/pages/agreement/index.json b/pages/agreement/index.json new file mode 100644 index 0000000..b43ff7a --- /dev/null +++ b/pages/agreement/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "智慧云馆服务条款", + "usingComponents": { + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/agreement/index.wxml b/pages/agreement/index.wxml new file mode 100644 index 0000000..93d940a --- /dev/null +++ b/pages/agreement/index.wxml @@ -0,0 +1,5 @@ + +
+ + + \ No newline at end of file diff --git a/pages/agreement/index.wxss b/pages/agreement/index.wxss new file mode 100644 index 0000000..273c9c8 --- /dev/null +++ b/pages/agreement/index.wxss @@ -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%; +} diff --git a/pages/basketballGym/index.js b/pages/basketballGym/index.js new file mode 100644 index 0000000..5adad51 --- /dev/null +++ b/pages/basketballGym/index.js @@ -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 + }) + }) + } + +}) \ No newline at end of file diff --git a/pages/basketballGym/index.json b/pages/basketballGym/index.json new file mode 100644 index 0000000..e7e2a94 --- /dev/null +++ b/pages/basketballGym/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "篮球场", + "usingComponents": { + "confirm-dialog": "/component/confirmDialog/confirmDialog", + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/basketballGym/index.wxml b/pages/basketballGym/index.wxml new file mode 100644 index 0000000..8d75912 --- /dev/null +++ b/pages/basketballGym/index.wxml @@ -0,0 +1,148 @@ + +
+ + + + + + + + + + + + {{venues.businessTime}} + + + + {{venues.address}} + + + 导航 + + + + + {{venues.contact}} + {{venues.phone}} + + + + 按时间段收费 + 充值 + + + 收费说明: + 篮球馆暂未开放 + + 每日{{item.starTime}}-{{item.endTime}} {{item.price >= 0 ? "¥"+item.price + "/次" : '免费公益'}}; + + + + + + + + VIP会员享受专属特权 + + + + + {{item.cardName}} + ¥{{item.price}} + 立即购买 + + + 单次 + 选购 + 立即购买 + + + + + + + 篮球馆介绍 + + + + + + + + 我要进场 + + + + + + + + 进场步骤 + + + + + + 第一步 + 进入您所在的智能门禁人脸识别区域 + + + + 第二步 + 贴近门禁摄像头进行人脸识别 + + + + 第三步 + 识别成功,门锁打开,请在5秒钟内进门 + + + + 说明: 余额充足情况下,可直接进行人脸识别进场,无需再次使用手机。 + + + + + + + + 会员卡购买 + + + + + 会员卡类型 + {{buyVipObj.cardName}} + + + 价格 + ¥{{buyVipObj.price}} + + + 确认支付 + + + + + + + + + + + VIP会员享受专属特权 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/basketballGym/index.wxss b/pages/basketballGym/index.wxss new file mode 100644 index 0000000..d0dfd94 --- /dev/null +++ b/pages/basketballGym/index.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/bookClasses/index.js b/pages/bookClasses/index.js new file mode 100644 index 0000000..4281197 --- /dev/null +++ b/pages/bookClasses/index.js @@ -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 => { + + }) + } +}) \ No newline at end of file diff --git a/pages/bookClasses/index.json b/pages/bookClasses/index.json new file mode 100644 index 0000000..cb3ee23 --- /dev/null +++ b/pages/bookClasses/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "预约课程", + "usingComponents": { + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/bookClasses/index.wxml b/pages/bookClasses/index.wxml new file mode 100644 index 0000000..bd09500 --- /dev/null +++ b/pages/bookClasses/index.wxml @@ -0,0 +1,54 @@ +
+ + + + + + + + + + + {{data.date}} + + {{data.week}} + + + + + + + + + + + + + + + + + + + + + {{item.name}} + {{i.name}} + + 时间: {{item.startTime}} ~ {{item.endTime}} + 价格: ¥{{item.price}} + + {{item.flg == 0 ? "预约":(item.flg == 1? "结束" : "满额")}} + + + + + + + 暂无课程 ~ + + + + + + \ No newline at end of file diff --git a/pages/bookClasses/index.wxss b/pages/bookClasses/index.wxss new file mode 100644 index 0000000..9e89daf --- /dev/null +++ b/pages/bookClasses/index.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/bookClassesDetail/index.js b/pages/bookClassesDetail/index.js new file mode 100644 index 0000000..11569ed --- /dev/null +++ b/pages/bookClassesDetail/index.js @@ -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], + }) + } +}) \ No newline at end of file diff --git a/pages/bookClassesDetail/index.json b/pages/bookClassesDetail/index.json new file mode 100644 index 0000000..a67b89b --- /dev/null +++ b/pages/bookClassesDetail/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/bookClassesDetail/index.wxml b/pages/bookClassesDetail/index.wxml new file mode 100644 index 0000000..8b012c7 --- /dev/null +++ b/pages/bookClassesDetail/index.wxml @@ -0,0 +1,97 @@ + +
+ + + + + + + + + + + + 开课时间: {{lesson.date}} {{lesson.startTime}} ~ {{lesson.endTime}} + + + + {{lesson.address}} + + + 导航 + + + + + 价格: ¥{{lesson.price}} + + + + + 已报: {{lesson.saleNum}} + 剩余: {{lesson.flg}} + + + + + + + + + {{lesson.coach.nickname}} + {{lesson.coach.description}} + + + + 展开 + + + + 收起 + + + + + + + + + 注意事项 + + + + + + + + + + + + + 课程介绍 + + + + + + + + 满额 + 已开始 + 已结束 + 课程预约 + + + + + + + \ No newline at end of file diff --git a/pages/bookClassesDetail/index.wxss b/pages/bookClassesDetail/index.wxss new file mode 100644 index 0000000..d42a2ce --- /dev/null +++ b/pages/bookClassesDetail/index.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/confirmOrder/index.js b/pages/confirmOrder/index.js new file mode 100644 index 0000000..32c41fe --- /dev/null +++ b/pages/confirmOrder/index.js @@ -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 + }) + } +}) \ No newline at end of file diff --git a/pages/confirmOrder/index.json b/pages/confirmOrder/index.json new file mode 100644 index 0000000..27b29e4 --- /dev/null +++ b/pages/confirmOrder/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "确认订单", + "usingComponents": { + "header": "/component/header/header", + "confirm-dialog": "/component/confirmDialog/confirmDialog" + } +} \ No newline at end of file diff --git a/pages/confirmOrder/index.wxml b/pages/confirmOrder/index.wxml new file mode 100644 index 0000000..d450c4c --- /dev/null +++ b/pages/confirmOrder/index.wxml @@ -0,0 +1,87 @@ + +
+ + {{lessonOrder.name}} + + + + 开课时间: {{lessonOrder.date}} {{lessonOrder.startTime}} ~ {{lessonOrder.endTime}} + + + + {{lessonOrder.address}} + + + + {{memberCardNum == 0? "暂无会员卡" : (memberCard.cardType ? "已使用" + memberCard.cardType : "未使用会员卡")}} + + + + + 人数 + + + + + {{count}} + + + + + + + {{memberCard.cardType ? "已使用" + memberCard.cardType : "合计: ¥" + (lessonOrder.price * count)}} + + + + + + + + + 微信支付 + + + + + 余额支付 + + + + + + + + + 注意事项 + + + + + + + + 确认订单 + + + + + + + + 不使用会员卡 + 取消 + + + + {{item.cardType}} + 有效期: {{item.startTime}} ~ {{item.endTime}} + + + + + 取消 + + + \ No newline at end of file diff --git a/pages/confirmOrder/index.wxss b/pages/confirmOrder/index.wxss new file mode 100644 index 0000000..3d6837b --- /dev/null +++ b/pages/confirmOrder/index.wxss @@ -0,0 +1,185 @@ +/* pages/confirmOrder/index.wxss */ + +.container { + padding-right: 30rpx; + padding-left: 30rpx; + padding-bottom: 130rpx; + min-height: calc(100vh - 260rpx); +} + +.title { + height: 100rpx; + padding: 0 20rpx; + line-height: 100rpx; + color: #fff; + font-size: 26rpx; +} + +.box { + background: #1a191e; + border-radius: 12rpx; +} + +.box .cell { + display: flex; + justify-content: space-between; + align-items: center; + height: 90rpx; + padding: 0 20rpx; + border-bottom: 2rpx solid #212025; +} + +.box .cell.unline { + border: none; +} + +.box .cell .title { + flex: 1; + height: 90rpx; + padding: 0; + line-height: 90rpx; +} + +.box .cell>image { + width: 34rpx; + height: 34rpx; + margin-right: 26rpx; +} + +.box .cell .right-img { + width: 12rpx; + height: 22rpx; + margin-right: 0; +} + +.box .cell .change-quantities { + display: flex; + align-items: center; + height: 100%; +} + +.box .cell .change-quantities .operator { + display: flex; + align-items: center; + width: 40rpx; + height: 40rpx; +} + +.box .cell .change-quantities .operator>image { + width: 100%; + height: 100%; +} + +.box .cell .change-quantities .number { + font-size: 22rpx; + color: #fff; + margin: 0 16rpx; +} + +.box .cell>text { + flex: 1; + font-size: 24rpx; + color: rgba(255, 255, 255, 0.6); +} + +.box .rich-box { + display: flex; + padding: 20rpx; + color: rgba(255, 255, 255, 0.6); + font-size: 24rpx; + line-height: 36rpx; +} + +.box .box-footer { + height: 90rpx; + padding: 0 20rpx; + text-align: right; + line-height: 90rpx; + color: #fff; + font-size: 24rpx; +} + +.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; +} + +.unclick-mask { + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: rgba(0, 0, 0, 0); +} + +.card-box { + position: fixed; + top: 0; + left: 0; + display: flex; + flex-direction: column; + justify-content: flex-end; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.6); +} + +.card-box .body-box { + background: #252330; + width: 100%; + min-height: 400rpx; +} + +.card-box .cencal-btn { + background: #ffda2e; + height: 80rpx; + width: 100%; + color: #252330; + line-height: 80rpx; + text-align: center; + font-size: 32rpx; +} + +.card-box .body-box .cell { + display: flex; + justify-content: space-between; + align-items: center; + height: 90rpx; + padding: 0 20rpx; +} + +.card-box .body-box .cell .tip { + height: 30rpx; + padding: 0 4rpx; + margin-right: 22rpx; + font-size: 20rpx; + line-height: 30rpx; + border: 2rpx solid #ffda2e; + color: #ffda2e; + border-radius: 6rpx; +} + +.card-box .body-box .cell .indate { + flex: 1; + font-size: 20rpx; + color: rgba(255, 255, 255, 0.6); +} + +.card-box .body-box .cell .buy-btn { + font-size: 26rpx; + color: #ffda2e; +} + +.card-box .body-box .cell>image { + width: 30rpx; + height: 30rpx; +} diff --git a/pages/facialCapturing/index.js b/pages/facialCapturing/index.js new file mode 100644 index 0000000..622547a --- /dev/null +++ b/pages/facialCapturing/index.js @@ -0,0 +1,172 @@ +// pages/facialCapturing/index.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + image: '../../images/19@3x.png', + isPass: false, + isDetail: false, + info: {} + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + this.setData({ + isPass: options.isPass ? true : false, + isDetail: options.isDetail ? true : false, + }) + this.getData() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() {}, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function() { + return { + title: '智慧云馆' + } + }, + + // 拍照 + photograph() { + this.getImage("camera") + }, + + // 相册 + photoAlbum() { + this.getImage("album") + }, + + // 拍照或相册 + getImage(val) { + let that = this; + wx.chooseImage({ + count: 1, + sizeType: ['compressed'], + sourceType: [val], + success: function(res) { + wx.showLoading({ + title: '正在上传...', + mask: true, + }) + app.$api.memberFaceInfo({ + filePath: res.tempFilePaths[0] + }).then(res => { + wx.showToast({ + title: '上传成功', + duration: 2000 + }) + that.getData() + // if (that.data.isPass) { + // setTimeout(function() { + // that.pass(); + // }, 2000) + // } + }, err => {}) + }, + fail: function(res) { + wx.hideLoading() + }, + }) + }, + + // 获取数据 + getData() { + app.$api.memberFaceInfoInfos({}).then(res => { + this.setData({ + info: res.info, + image: res.info.faceUrl ? res.info.faceUrl : '../../images/19@3x.png' + }) + }, err => { + + }) + }, + + // 跳过 + pass() { + let route = wx.getStorageSync('history'); + wx.removeStorageSync('history'); + if (!route || route == '/pages/login/index') { + + const pages = getCurrentPages(); + if (pages.length > 1) { + wx.navigateBack() + } else { + return wx.redirectTo({ + url: '/pages/mine/index', + }) + } + + } + wx.redirectTo({ + url: route, + }) + }, + + saveClick() { + if (this.data.isPass) { + const _this = this; + wx.showModal({ + title: '上传完成', + content: '您已完成所有手机注册流程,请直接站在门禁人脸识别区域进行人脸识别入场', + showCancel: false, + success: function() { + _this.pass(); + } + }) + } else { + wx.navigateBack() + } + + + // const pages = getCurrentPages(); + // const page = pages[pages.length - 2]; + // page.enter(); + // + } +}) \ No newline at end of file diff --git a/pages/facialCapturing/index.json b/pages/facialCapturing/index.json new file mode 100644 index 0000000..4c715bc --- /dev/null +++ b/pages/facialCapturing/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "运动场馆入门人脸采集信息", + "usingComponents": { + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/facialCapturing/index.wxml b/pages/facialCapturing/index.wxml new file mode 100644 index 0000000..f0d03c4 --- /dev/null +++ b/pages/facialCapturing/index.wxml @@ -0,0 +1,34 @@ + +
+ + 跳过 + + 上次采集时间: {{info.modifiedTime}} + + + + + + 说明: + + 1.照片仅用于场馆人脸识别入场 + 2.请在光线明亮的环境下进行拍照 + 3.每隔30天才能更新一次 + 4.必须使用本人头像,否则将导致无法入场 + + + + + + + + + + 拍照 + + + + 相册 + + + \ No newline at end of file diff --git a/pages/facialCapturing/index.wxss b/pages/facialCapturing/index.wxss new file mode 100644 index 0000000..1ca652a --- /dev/null +++ b/pages/facialCapturing/index.wxss @@ -0,0 +1,105 @@ +/* pages/facialCapturing/index.wxss */ + +.container { + position: relative; + display: flex; + align-items: center; + justify-content: center; + min-height: calc(100vh - 280rpx); + padding-bottom: 150rpx; +} + +.pass { + position: absolute; + top: 160rpx; + right: 30rpx; + width: 120rpx; + height: 60rpx; + line-height: 60rpx; + border-radius: 30rpx; + text-align: center; + background: #3b3945; + color: #FFF; + font-size: 28rpx; +} + +.body { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; + font-size: 24rpx; + line-height: 24rpx; + color: rgba(255, 255, 255, 0.6); +} + +.body .img-box { + position: relative; + width: 500rpx; + height: 500rpx; + margin: 40rpx 0 30rpx 0; +} + +.body .img-box>image { + width: 100%; + height: 100%; +} + +.body .img-box .border-img { + position: absolute; + left: 0; + top: 0; +} + +.body .state-box { + display: flex; +} + +.body .state-box .state { + display: flex; + flex-direction: column; +} + +.body .state-box .state>text { + margin-bottom: 16rpx; +} + +.footer { + position: fixed; + left: 0; + bottom: 0; + display: flex; + width: 100%; + height: 150rpx; + background: #1a191e; +} + +.footer .item-btn { + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + color: rgba(255, 255, 255, 0.6); + font-size: 26rpx; + line-height: 26rpx; +} + +.footer .item-btn>image { + width: 64rpx; + height: 52rpx; + margin-bottom: 18rpx; +} + +.register-btn { + margin-top: 40rpx; + width: 80%; + height: 80rpx; + border-radius: 40rpx; + background: #ffda2e; + color: #252330; + font-size: 26rpx; + line-height: 80rpx; +} \ No newline at end of file diff --git a/pages/gymnasium/index.js b/pages/gymnasium/index.js new file mode 100644 index 0000000..8323e69 --- /dev/null +++ b/pages/gymnasium/index.js @@ -0,0 +1,227 @@ +// pages/gymnasium/index.js +const app = getApp(); +import { + getCurrentPageUrl +} from './../../utils/util.js' +Page({ + + /** + * 页面的初始数据 + */ + data: { + isShowBuyVip: false, + venues: {}, + buyVipObj: {}, + showUnclickMask: false, + showCardMask: false, + isWxLogin: false, + isGoHome: false, + }, + + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + wx.showLoading({ + title: '加载中...', + }) + app.$api.venueDetail({ + venueId: options.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 + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + 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, + }) + }, + + // 打电话 + callPhone() { + wx.makePhoneCall({ + phoneNumber: this.data.venues.phone, + success: function(res) {}, + fail: function(res) {}, + complete: function(res) {}, + }) + }, + + // 购买套餐 + 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] + }) + + }, + + // 跳转预约课程 + pushBookClasses() { + wx.navigateTo({ + url: `/pages/bookClasses/index?type=${this.data.venues.type}&venueId=${this.data.venues.id}`, + }) + }, + + // 弹框背景禁止滑动 + unMove() { + return; + }, + + // 关闭购买vip弹框 + closeBuyVipPopup() { + this.setData({ + isShowBuyVip: false + }) + }, + + // 购买Vip + buyVip() { + 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 => { + this.setData({ + isShowBuyVip: false, + showUnclickMask: false + }) + }, err => { + this.setData({ + showUnclickMask: false, + isShowBuyVip: false + }) + }) + }, err => { + this.setData({ + showUnclickMask: false, + isShowBuyVip: 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({ + 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 + }) + }) + } +}) \ No newline at end of file diff --git a/pages/gymnasium/index.json b/pages/gymnasium/index.json new file mode 100644 index 0000000..18de6c8 --- /dev/null +++ b/pages/gymnasium/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "健身", + "usingComponents": { + "confirm-dialog": "/component/confirmDialog/confirmDialog", + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/gymnasium/index.wxml b/pages/gymnasium/index.wxml new file mode 100644 index 0000000..a06ef31 --- /dev/null +++ b/pages/gymnasium/index.wxml @@ -0,0 +1,96 @@ + +
+ + + + + + + + + + + + {{venues.businessTime}} + + + + {{venues.address}} + + + 导航 + + + + + {{venues.contact}} + {{venues.phone}} + + + + + + + VIP会员享受专属特权 + + + + + {{item.cardName}} + ¥{{item.price}} + 立即购买 + + + + + + + 项目介绍 + + + + + + + + 预约 + + + + + + 会员卡购买 + + + + + 会员卡类型 + {{buyVipObj.cardName}} + + + 价格 + ¥{{buyVipObj.price}} + + + 确认支付 + + + + + + + + + + + VIP会员享受专属特权 + + + + + + + + + + \ No newline at end of file diff --git a/pages/gymnasium/index.wxss b/pages/gymnasium/index.wxss new file mode 100644 index 0000000..840afbc --- /dev/null +++ b/pages/gymnasium/index.wxss @@ -0,0 +1,290 @@ +/* pages/gymnasium/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 .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 .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; +} + +.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: rgba(255, 255, 255, 0.6); + 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: rgba(255, 255, 255, 0.6); + 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.6) +} + +.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; +} \ No newline at end of file diff --git a/pages/home/index.js b/pages/home/index.js new file mode 100644 index 0000000..3d2fb09 --- /dev/null +++ b/pages/home/index.js @@ -0,0 +1,502 @@ +// pages/home/index.js +const app = getApp(); +let s = ''; +let m = 0; +let endM = 0; +let address = []; +let zoom = 6; +let mapCtx; +Page({ + /** + * 页面的初始数据 + */ + data: { + state: 2, + top: -200, + noticeList: [], + latitude: 0, + longitude: 0, + markers: [], + isShowAuth: false, + animationData: {}, + includePoints: [], + unClickDetail: false, + unClickBtn: false, + isShowMap: false, + gohome: true, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + this.setData({ + isShowMap: true + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function() { + this.getLocation(); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + // this.setData({ + // isShowAuth: false + // }) + this.data.unClickDetail = false + this.data.unClickBtn = false + clearTimeout(s); + m = endM; + this.getAnnouncementsList(); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + endM = m; + clearTimeout(s); + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function() { + return { + title: '智慧云馆' + } + }, + + // 公告滚动 + lun() { + // m -= 10 / (wx.getSystemInfoSync().screenWidth / 750); + let that = this; + // that.setData({ + // top: m + // }) + + // this.animation = animation; + let subHeight = 200 * (wx.getSystemInfoSync().screenWidth / 750); + let max = (that.data.noticeList.length - 1) * subHeight; + if (s) clearTimeout(s); + s = setTimeout(function() { + if (m * subHeight == max) { + + m = 0; + let animation1 = wx.createAnimation({ + delay: 0 + }) + this.animation1 = animation1; + this.animation1.translateY(-subHeight * m - (2 * (wx.getSystemInfoSync().screenWidth / 750))).step({ + duration: 0, + timingFunction: 'step-start' + }); + that.setData({ + animationData: animation1.export() + }) + that.lun() + } else { + m++; + let animation2 = wx.createAnimation({ + delay: 0 + }) + + this.animation2 = animation2; + this.animation2.translateY(-subHeight * m).step({ + duration: 1000, + timingFunction: "linear", + }); + that.setData({ + animationData: animation2.export() + }) + that.lun() + } + }, 2000); + }, + + // 切换列表 + changeTip(e) { + let state = e.currentTarget.dataset.state; + this.setData({ + state: state + }) + if (state == 3) { + wx.showToast({ + title: '暂未开放,敬请期待', + icon: 'none', + duration: 2000 + }) + let list = [{ + longitude: this.data.longitude, + latitude: this.data.latitude + }]; + this.setData({ + includePoints: list + }) + return; + } + // this.getLngLat(); + this.getLocation(); + }, + + // 点击地图标记点气泡 + clickCalloutTap(e) { + if (this.data.unClickDetail) { + return; + } + this.data.unClickDetail = true; + if (this.data.state == 1) { + wx.navigateTo({ + url: `/pages/basketballGym/index?id=${e.markerId}`, + }) + } + if (this.data.state == 2) { + wx.navigateTo({ + url: `/pages/gymnasium/index?id=${e.markerId}`, + }) + } + }, + + // 跳转详情列表 + pushList() { + if (this.data.unClickBtn) { + return; + } + this.data.unClickBtn = false; + wx.navigateTo({ + url: '/pages/sportsGroundList/index?state=' + this.data.state, + }) + }, + + // 打电话 + callPhoen() { + this.data.unClickBtn = false; + wx.makePhoneCall({ + phoneNumber: '13636573054', + }) + }, + + // 跳转个人中心 + pushMine() { + if (this.data.unClickBtn) { + return; + } + this.data.unClickBtn = false; + if (!wx.getStorageSync("accessToken")) { + wx.removeStorageSync('history'); + wx.navigateTo({ + url: '/pages/login/index', + }) + return + } + wx.navigateTo({ + url: '/pages/mine/index', + }) + }, + + // 获取公告列表 + getAnnouncementsList() { + let that = this; + app.$api.announcements({}).then(res => { + this.setData({ + noticeList: res.announcements + }) + // 公告列表添加前后 + // let len = this.data.noticeList.length + // if (len == 1 || len == 0) { + // return; + // } + // let list = []; + // for (let i = 0; i < len; i++) { + // list.push(this.data.noticeList[i]); + // } + // list.push(this.data.noticeList[0]); + // this.setData({ + // noticeList: list + // }) + // that.lun() + }, err => { + + }); + }, + + // 跳转公告详情 + pusnNotice(e) { + let id = e.currentTarget.dataset.id; + wx.navigateTo({ + url: `/pages/notice/index?id=${id}`, + success: function(res) {}, + fail: function(res) {}, + complete: function(res) {}, + }) + }, + + // 获取授权 + setAuthSuccess(e) { + if (e.detail.authSetting['scope.userLocation']) { + this.getLocation(); + this.setData({ + isShowAuth: false + }) + } + }, + + // 获取定位 + getLocation() { + let list = [ + // { + // // 中心 + // longitude: 121.4715700000, + // latitude: 31.2336800000 + // }, + { + // 北 + longitude: 121.3542938232, + latitude: 31.4409663733 + }, + { + // 东 + longitude: 121.7051696777, + latitude: 31.2750297303 + }, + { + // 南 + longitude: 121.4167785645, + latitude: 31.0317548780 + }, + { + // 西 + longitude: 121.2135314941, + latitude: 31.2433336586 + } + ]; + this.setData({ + includePoints: list, + }) + let that = this; + wx.getLocation({ + type: 'gcj02', + success: function(res) { + that.setData({ + latitude: res.latitude, + longitude: res.longitude, + }) + that.getData({ + latitude: res.latitude, + longitude: res.longitude, + zoom: 1 + }); + }, + fail: function(res) { + console.log(res); + if (res.errMsg == 'getLocation:fail auth deny' || res.errMsg == 'getLocation:fail:auth denied') { + that.setData({ + isShowAuth: true + }) + } + }, + }) + }, + + // 获取数据 + getData(e) { + wx.showLoading({ + title: '加载中...', + mask: true, + }) + app.$api.venuesMap({ + latitude: e.latitude, + longitude: e.longitude, + type: this.data.state, + zoom: e.zoom + }).then(res => { + address = []; + let list = [ + // { + // // 中心 + // longitude: 121.4715700000, + // latitude: 31.2336800000 + // }, + { + // 北 + longitude: 121.3542938232, + latitude: 31.4409663733 + }, + { + // 东 + longitude: 121.7051696777, + latitude: 31.2750297303 + }, + { + // 南 + longitude: 121.4167785645, + latitude: 31.0317548780 + }, + { + // 西 + longitude: 121.2135314941, + latitude: 31.2433336586 + } + ]; + + + for (let i = 0; i < res.venues.length; i++) { + let obj = {}; + obj.id = res.venues[i].id; + obj.latitude = res.venues[i].latitude + obj.longitude = res.venues[i].longitude + if (this.data.state == 1) { + obj.iconPath = '../../images/14@3x.png' + } + if (this.data.state == 2) { + obj.iconPath = '../../images/13@3x.png' + } + if (this.data.state == 3) { + obj.iconPath = '../../images/12@3x.png' + } + + list.push({ + longitude: res.venues[i].longitude, + latitude: res.venues[i].latitude + }) + + obj.title = res.venues[i].name + obj.width = 40; + obj.height = 40 + obj.callout = { + content: res.venues[i].name + '(点此进入)', + // color: '#fff', + // bgColor: '#000', + borderRadius: 15, + padding: 10, + display: 'BYCLICK' + }; + address.push(obj); + } + this.setData({ + includePoints: list, + markers: [{ + id: 0, + latitude: this.data.latitude, + longitude: this.data.longitude, + iconPath: '../../images/11@3x.png', + width: 20, + height: 33 + }, ...address] + }) + }, err => {}); + }, + + // 地图视野发生变化时触发 + regionchange(e) { + return; + console.log(e); + if (e.type == 'end') { + this.getLngLat() + } + }, + + getLngLat: function() { + var that = this; + let centerLatitude = 0; + let centerLongitude = 0; + let zoom = 7; + mapCtx = wx.createMapContext("map4select"); + mapCtx.getCenterLocation({ + success: function(res) { + centerLatitude = res.latitude; + centerLongitude = res.longitude; + // 获取视野范围 + that.getRegion(centerLatitude, centerLongitude) + } + }) + mapCtx.getScale({ + success: function(res) { + console.log("缩放级别", res); + } + }) + }, + + // 获取视野范围 + getRegion(centerLatitude, centerLongitude) { + let that = this; + mapCtx.getRegion({ + success: function(res) { + let m = GetDistance(res.northeast.latitude, res.northeast.longitude, res.northeast.latitude, res.southwest.longitude); + if (m <= 152.9) { + zoom = 7; + } else if (m <= 1200) { + zoom = 6; + } else if (m <= 4900) { + zoom = 5; + } else if (m <= 39100) { + zoom = 4; + } else { + zoom = 3; + }; + // that.getData({ + // latitude: centerLatitude, + // longitude: centerLongitude, + // zoom: zoom + // }); + } + }) + }, + + // 回到开始 + goFrist() { + let list = [{ + longitude: this.data.longitude, + latitude: this.data.latitude + }]; + // this.data.includePoints + this.setData({ + includePoints: list + }) + } +}) + +function Rad(d) { + return d * Math.PI / 180.0; //经纬度转换成三角函数中度分表形式。 +} + +//计算距离,参数分别为第一点的纬度,经度;第二点的纬度,经度 +function GetDistance(lat1, lng1, lat2, lng2) { + var radLat1 = Rad(lat1); + var radLat2 = Rad(lat2); + var a = radLat1 - radLat2; + var b = Rad(lng1) - Rad(lng2); + var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2))); + s = s * 6378.137; // 地球半径,千米; + s = Math.round(s * 10000) / 10000; //输出为公里 + s = Math.round(s * 1000) / 1; //单位修改为米,取整 + //s=s.toFixed(4); + return s; +} \ No newline at end of file diff --git a/pages/home/index.json b/pages/home/index.json new file mode 100644 index 0000000..5aed08e --- /dev/null +++ b/pages/home/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "confirm-dialog": "/component/confirmDialog/confirmDialog", + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/home/index.wxml b/pages/home/index.wxml new file mode 100644 index 0000000..6745bb6 --- /dev/null +++ b/pages/home/index.wxml @@ -0,0 +1,111 @@ + +
+ + + + + + + 篮球场 + + + + + + 健身 + + + + + 足球场 + + + + + + + + {{item.tag}} + {{item.content}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/home/index.wxss b/pages/home/index.wxss new file mode 100644 index 0000000..0f2ba7e --- /dev/null +++ b/pages/home/index.wxss @@ -0,0 +1,244 @@ +/* pages/home/index.wxss */ +.container { + display: flex; + flex-direction: column; +} + +.header { + position: relative; + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + min-height: 160rpx; + background: #fff; + border-bottom: 2rpx solid rgba(0, 0, 0, 0.1); +} + +.header .item-box { + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + color: #747377; + font-size: 24rpx; + line-height: 24rpx; +} + +.header .item-box.isActive { + color: #ffca00; +} + +.header .item-box>image { + width: 66rpx; + height: 58rpx; + margin-bottom: 16rpx; +} + +.body { + flex: 1; + position: relative; +} + +/* .body .swiper-box { + position: absolute; + top: 4rpx; + left: 50%; + transform: translateX(-50%); + display: flex; + justify-content: center; + width: 700rpx; + height: 200rpx; + background: #fff; + z-index: 10001; + border-radius: 10rpx; + box-shadow: 0px 2rpx 8rpx rgba(136, 136, 136, 0.6); +} */ + +.body .map-box { + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: 100%; + height: 100%; +} + +.notice-item-box { + position: relative; + display: flex; + justify-content: space-between; + align-content: center; + height: 160rpx; + padding: 10rpx 30rpx; + background: #fff; +} + +.notice-item-box .image-box { + position: relative; + width: 220rpx; + height: 100%; +} + +.notice-item-box .image-box .shadow-image { + position: absolute; + top: 0; + left: 0; + width: 50rpx; + height: 100%; +} + +.notice-item-box .image-box .show-image { + width: 100%; + height: 100%; +} + +.notice-item-box .text-box { + position: relative; + flex: 1; +} + +.notice-item-box .text-box .tip { + position: absolute; + top: 0; + left: 0; + height: 36rpx; + padding: 4rpx 12rpx; + line-height: 36rpx; + font-size: 24rpx; + background: #424242; + color: #fff; +} + +.notice-item-box .text-box .message { + margin-top: 56rpx; + margin-right: 20rpx; + height: 90rpx; + font-size: 22rpx; + line-height: 30rpx; + white-space: normal; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + color: #8f8f8f; +} + +/* .notice-box { + position: absolute; + left: 0; + width: 100%; +} + +.notice-box .notice { + position: relative; + padding: 20rpx; + display: flex; + justify-content: space-between; + align-items: center; + height: calc(100% - 40rpx); +} + +.notice-box .notice .text-box { + position: relative; + flex: 1; +} + +.notice-box .notice .text-box .tip { + position: absolute; + top: 0; + left: 0; + height: 36rpx; + line-height: 36rpx; + font-size: 24rpx; + background: #424242; + color: #fff; +} + +.notice-box .notice .text-box .message { + margin-top: 56rpx; + margin-right: 20rpx; + height: 90rpx; + font-size: 22rpx; + line-height: 30rpx; + white-space: normal; + color: #8f8f8f; +} + +.notice-box .notice .image-box { + position: relative; + width: 220rpx; + height: 100%; +} + +.notice-box .notice .image-box .shadow-image { + position: absolute; + top: 0; + left: 0; + width: 50rpx; + height: 100%; +} + +.notice-box .notice .image-box .show-image { + width: 100%; + height: 100%; +} */ + +.share-box { + position: absolute; + top: 30rpx; + /* left: 30rpx; */ + width: 130rpx; + height: 190rpx; +} + +.share-box .title { + font-size: 22rpx; + line-height: 30rpx; + text-align: center; +} + +.phone-box { + position: absolute; + bottom: 30rpx; + left: 30rpx; + width: 130rpx; + height: 130rpx; +} + +.mine-box { + position: absolute; + bottom: 30rpx; + right: 30rpx; + width: 130rpx; + height: 130rpx; +} + +.hide-btn { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: none; + z-index: 10001; +} + +.hide-btn::after { + border: none; +} + +.wx-button-cover-view-wrapper { + height: 100%; +} + +.wx-button-cover-view-inner { + height: 100%; +} + +.img { + width: 130rpx; + height: 130rpx; +} diff --git a/pages/index/index.js b/pages/index/index.js new file mode 100644 index 0000000..77aa4b1 --- /dev/null +++ b/pages/index/index.js @@ -0,0 +1,77 @@ +// pages/index/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + animationData: {} + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var animation = wx.createAnimation({ + duration: 5000, + timingFunction: "ease", + delay: 1000 + }) + // this.animation = animation; + animation.translateY(200).step() + this.setData({ + animationData: animation.export() + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + return { + title: '智慧云馆' + } + } +}) \ No newline at end of file diff --git a/pages/index/index.json b/pages/index/index.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/pages/index/index.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml new file mode 100644 index 0000000..09c43dc --- /dev/null +++ b/pages/index/index.wxml @@ -0,0 +1,4 @@ + +pages/index/index.wxml + + \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss new file mode 100644 index 0000000..8e9c81f --- /dev/null +++ b/pages/index/index.wxss @@ -0,0 +1 @@ +/* pages/index/index.wxss */ \ No newline at end of file diff --git a/pages/login/index.js b/pages/login/index.js new file mode 100644 index 0000000..3476b5f --- /dev/null +++ b/pages/login/index.js @@ -0,0 +1,162 @@ +// pages/login/index.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + showUnclickMask: false, + isGoHome: false, + isLogin: false, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function() { + let pages = getCurrentPages(); + this.setData({ + isGoHome: pages.length == 1 + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + if (this.data.isLogin) { + this.pushRoute() + return; + } + let that = this; + this.setData({ + showUnclickMask: false + }) + }, + + pushRoute() { + let route = wx.getStorageSync('history'); + wx.removeStorageSync('history'); + if (!route || route == '/pages/login/index') { + return wx.redirectTo({ + url: '/pages/mine/index', + }) + } + wx.redirectTo({ + url: route, + }) + }, + + changeLoginStatus() { + this.setData({ + isLogin: true + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function() { + return { + title: '智慧云馆' + } + }, + + // 登录 + loginClick() { + wx.navigateTo({ + url: '/pages/loginIndex/index', + }) + }, + + // 注册 + registerClick(e) { + wx.redirectTo({ + url: '/pages/register/index?codeType=' + 2, + }) + }, + + // 微信登录 + wxLogin(e) { + if (e.detail.errMsg == 'getUserInfo:fail auth deny') { + return; + } + this.setData({ + showUnclickMask: true + }) + let that = this; + wx.login({ + success: function(res) { + app.$api.memberLoginWX({ + avatar: e.detail.userInfo.avatarUrl, + code: res.code, + nickname: e.detail.userInfo.nickName + }).then(res => { + wx.setStorageSync('information', res.information); + if (!res.authorization) { + wx.redirectTo({ + url: '/pages/register/index?codeType=' + 1, + }) + return; + } + wx.setStorageSync('accessToken', res.authorization.accessToken); + let route = wx.getStorageSync('history'); + wx.removeStorageSync('history'); + if (!route || route == '/pages/login/index') { + return wx.redirectTo({ + url: '/pages/mine/index', + }) + } + wx.redirectTo({ + url: route, + }) + }, err => { + that.setData({ + showUnclickMask: false + }) + }); + }, + fail: function(res) { + that.setData({ + showUnclickMask: false + }) + }, + }) + }, +}) \ No newline at end of file diff --git a/pages/login/index.json b/pages/login/index.json new file mode 100644 index 0000000..396dd61 --- /dev/null +++ b/pages/login/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/login/index.wxml b/pages/login/index.wxml new file mode 100644 index 0000000..6dce9e3 --- /dev/null +++ b/pages/login/index.wxml @@ -0,0 +1,15 @@ + +
+ + + + + 快速微信登录 + + + + + + + + \ No newline at end of file diff --git a/pages/login/index.wxss b/pages/login/index.wxss new file mode 100644 index 0000000..c248a86 --- /dev/null +++ b/pages/login/index.wxss @@ -0,0 +1,78 @@ +/* pages/login/index.wxss */ + +.container { + min-height: calc(100vh - 230rpx); + padding: 230rpx 124rpx 0 124rpx; +} + +.login-btn { + margin-top: 100rpx; + height: 80rpx; + border-radius: 40rpx; + background: #ffda2e; + color: #252330; + font-size: 26rpx; + line-height: 80rpx; +} + +.register-btn { + margin-top: 38rpx; + height: 80rpx; + border-radius: 40rpx; + background: none; + border: 2rpx solid #6e602f; + font-size: 26rpx; + line-height: 80rpx; + color: #cdb02e; +} + +.line-between { + position: relative; + height: 4rpx; + margin-top: 190rpx; + margin-bottom: 70rpx; + background: #3f3e49; +} + +.line-between .line-between-text { + position: absolute; + top: 0; + left: 50%; + transform: translate(-50%, -50%); + padding: 0 40rpx; + background: #252330; + font-size: 24rpx; + color: rgba(255, 255, 255, 0.6); +} + +.wechat-btn { + position: relative; + width: 100rpx; + height: 100rpx; + margin: 0 auto; +} + +.wechat-btn>button { + position: absolute; + background: none; + width: 100%; + height: 100%; +} + +.wechat-btn>button::after { + border: none; +} + +.wechat-btn>image { + width: 100%; + height: 100%; +} + +.unclick-mask{ + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: rgba(0, 0, 0, 0); +} \ No newline at end of file diff --git a/pages/loginIndex/index.js b/pages/loginIndex/index.js new file mode 100644 index 0000000..917c762 --- /dev/null +++ b/pages/loginIndex/index.js @@ -0,0 +1,174 @@ +// pages/loginIndex/index.js +const app = getApp(); +let timer; +Page({ + + /** + * 页面的初始数据 + */ + data: { + isFocus: '', + body: { + phone: '', + code: '' + }, + isGetCode: false, + code: '获取验证码', + showUnclickMask: false, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + // 输入框获取聚焦时 + inputFocus(event) { + let key = event.currentTarget.dataset.type; + this.setData({ + isFocus: key + }) + }, + + // 输入框失去焦点时 + inputBlur(event) { + let key = event.currentTarget.dataset.type; + this.setData({ + isPhoneFocus: '' + }) + }, + + // 输入框输入时 + inputChange(event) { + let key = event.currentTarget.dataset.type; + this.data.body[key] = event.detail.value; + }, + + // 获取验证码 + getCode() { + if (this.data.isGetCode) { + return; + } + if (!this.data.body.phone) { + wx.showToast({ + title: '请输入手机号', + icon: 'none', + }) + return; + } + this.data.isGetCode = true; + + app.$api.smsLogin({ + mobile: this.data.body.phone + }).then(res => { + clearTimeout(timer); + this.countdown(60); + }, err => { + this.data.isGetCode = false; + }) + }, + + // 倒计时 + countdown(val) { + if (val == 0) { + this.data.isGetCode = false; + clearTimeout(timer); + return; + } + let that = this; + timer = setTimeout(function () { + val-- + that.countdown(val); + that.setData({ + code: val == 0 ? '获取验证码' : val + ' s' + }) + }, 1000) + }, + + // 跳转到协议 + pushAgreement() { + wx.navigateTo({ + url: '/pages/agreement/index', + }) + }, + + // 登录 + loginClick() { + if (!this.data.body.code) { + wx.showToast({ + title: '请输入验证码', + icon: 'none', + }) + return; + } + this.setData({ + showUnclickMask: true + }) + let that = this; + app.$api.memberLogin({ + captcha: this.data.body.code, + mobile: this.data.body.phone + }).then(res => { + wx.setStorageSync('accessToken', res.authorization.accessToken); + that.setData({ + showUnclickMask: false + }) + const pages = getCurrentPages(); + let page = pages[pages.length - 2]; + page.changeLoginStatus(); + wx.navigateBack(); + // return wx.redirectTo({ + // url: '/pages/login/index', + // }) + }, err => { + that.setData({ + showUnclickMask: false + }) + }) + }, + +}) \ No newline at end of file diff --git a/pages/loginIndex/index.json b/pages/loginIndex/index.json new file mode 100644 index 0000000..396dd61 --- /dev/null +++ b/pages/loginIndex/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/loginIndex/index.wxml b/pages/loginIndex/index.wxml new file mode 100644 index 0000000..406ad26 --- /dev/null +++ b/pages/loginIndex/index.wxml @@ -0,0 +1,16 @@ + +
+ + + + + + + + + + 登录即代表同意 + + + + \ No newline at end of file diff --git a/pages/loginIndex/index.wxss b/pages/loginIndex/index.wxss new file mode 100644 index 0000000..b37100a --- /dev/null +++ b/pages/loginIndex/index.wxss @@ -0,0 +1,72 @@ +/* pages/loginIndex/index.wxss */ +.container { + min-height: calc(100vh - 230rpx); + padding: 230rpx 124rpx 0 124rpx; +} + +.input-box { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 30rpx; + border-bottom: 2rpx solid #3f3e49; +} + +.input-box>input { + flex: 1; + margin: 20rpx 0; + font-size: 24rpx; + color: #fff; +} + +.input-box.isActive { + border-bottom: 2rpx solid #6e602f; +} + +.input-box .placeholder { + color: rgba(255, 255, 255, 0.6); +} + +.input-box>button { + padding: 0; + width: 120rpx; + background: none; + font-size: 24rpx; + color: rgba(255, 255, 255, 0.6); + text-align: center; +} + +.input-box>button::after { + border: none; +} + +.agreement { + display: flex; + align-items: center; + margin-top: 30rpx; + font-size: 22rpx; + color: rgba(255, 255, 255, 0.6); +} + +.agreement>button { + padding: 0; + margin: 0; + color: #b1992f; + font-size: 22rpx; + line-height: 22rpx; + background: none; +} + +.agreement>button::after { + border: none; +} + +.login-btn { + margin-top: 100rpx; + height: 80rpx; + border-radius: 40rpx; + background: #ffda2e; + color: #252330; + font-size: 26rpx; + line-height: 80rpx; +} \ No newline at end of file diff --git a/pages/mine/index.js b/pages/mine/index.js new file mode 100644 index 0000000..b71ba8d --- /dev/null +++ b/pages/mine/index.js @@ -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 + }) + } +}) \ No newline at end of file diff --git a/pages/mine/index.json b/pages/mine/index.json new file mode 100644 index 0000000..106588a --- /dev/null +++ b/pages/mine/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "confirm-dialog": "/component/confirmDialog/confirmDialog", + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/mine/index.wxml b/pages/mine/index.wxml new file mode 100644 index 0000000..fd39341 --- /dev/null +++ b/pages/mine/index.wxml @@ -0,0 +1,57 @@ + +
+ + + + + + {{members.nickname}} + 个人信息 + + + + {{members.money}} + + 余额 + + 充值 + + + + + {{memberCard}} + + 会员卡 + + + + + + + + 我的预约 + + + + 我的账单 + + + + 人脸采集 + + + + 常见问题 + + + + 关于我们 + + + + + 退出登录 + + + + \ No newline at end of file diff --git a/pages/mine/index.wxss b/pages/mine/index.wxss new file mode 100644 index 0000000..5557370 --- /dev/null +++ b/pages/mine/index.wxss @@ -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; +} diff --git a/pages/myAccount/index.js b/pages/myAccount/index.js new file mode 100644 index 0000000..c436643 --- /dev/null +++ b/pages/myAccount/index.js @@ -0,0 +1,171 @@ +// pages/myAccount/index.js +const app = getApp(); +import { + getCurrentPageUrl +} from './../../utils/util.js' +Page({ + + /** + * 页面的初始数据 + */ + data: { + selectIndex: 0, + member: {}, + recharges: [], + isWxLogin: false, + gohome: true, + isUnClick: false, + options: {} + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + this.setData({ + options: options + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + this.getData(); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function() { + return { + title: '智慧云馆' + } + }, + + // 余额提现 + pushWithdraw() { + wx.navigateTo({ + url: '/pages/withdrawal/index?money=' + this.data.member.money, + }) + }, + + // 我的账单 + pushBills() { + wx.navigateTo({ + url: '/pages/myBills/index', + }) + }, + + // 选择充值金额 + selectPrice(e) { + let index = e.currentTarget.dataset.index; + this.setData({ + selectIndex: index + }) + }, + + // 点击微信支付 + clickBuy() { + if (this.data.isUnClick) { + return; + } + this.data.isUnClick = true; + app.$api.orderRecharge({ + rechargeId: this.data.recharges[this.data.selectIndex].id + }).then(res => { + app.$pay.wxPay(res.pay).then(res => { + if (this.data.options.isPass == 1) { + wx.redirectTo({ + url: '/pages/facialCapturing/index?isPass=' + 1, + }) + } else { + this.getData(); + this.data.isUnClick = false; + } + }, err => { + this.data.isUnClick = false; + }) + }, err => { + if (err.data.err_code == 30022) { + this.setData({ + isWxLogin: true, + }) + } + this.data.isUnClick = false; + }) + }, + + // 获取数据 + getData() { + wx.showLoading({ + title: '加载中...', + mask: true, + }) + app.$api.recharges({}).then(res => { + this.setData({ + member: res.member, + recharges: res.recharges + }) + }, err => {}); + }, + // 取消授权登录 + cancelDeleteDialog() { + 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 + }) + }) + } +}) \ No newline at end of file diff --git a/pages/myAccount/index.json b/pages/myAccount/index.json new file mode 100644 index 0000000..aba945b --- /dev/null +++ b/pages/myAccount/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "我的账户", + "usingComponents": { + "header": "/component/header/header", + "confirm-dialog": "/component/confirmDialog/confirmDialog" + } +} \ No newline at end of file diff --git a/pages/myAccount/index.wxml b/pages/myAccount/index.wxml new file mode 100644 index 0000000..95bd9e1 --- /dev/null +++ b/pages/myAccount/index.wxml @@ -0,0 +1,32 @@ + +
+ + + + + 余额提现 + + + ¥{{member.money}} + 当前余额 + + + + 我的账单 + + + + 快速充值 + + + + + {{item.rechargeMoney}} + + 到账: ¥{{item.toMoney}} + + + 微信充值 + + + \ No newline at end of file diff --git a/pages/myAccount/index.wxss b/pages/myAccount/index.wxss new file mode 100644 index 0000000..08968e0 --- /dev/null +++ b/pages/myAccount/index.wxss @@ -0,0 +1,105 @@ +/* pages/myAccount/index.wxss */ + +.container { + min-height: calc(100vh - 190rpx); + padding: 30rpx; + padding-top: 160rpx; +} + +.header { + display: flex; + justify-content: space-around; + align-items: center; + height: 200rpx; + background: #1a191e; + border-radius: 20rpx; +} + +.header .item { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + height: 86rpx; +} + +.header .item>image { + width: 42rpx; + height: 42rpx; +} + +.header .item>text { + margin-top: 20rpx; + font-size: 24rpx; + line-height: 24rpx; + color: rgba(255, 255, 255, 0.6); +} + +.header .item>text:first-child { + /* margin-top: -10rpx; */ + color: #f3515c; + font-size: 36rpx; + line-height: 30rpx; + font-weight: bold; +} + +.title { + margin-top: 50rpx; + margin-bottom: 40rpx; + color: #fff; + font-size: 24rpx; + line-height: 24rpx; +} + +.list { + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} + +.list .cell { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: calc((100% - 88rpx)/ 3); + height: 140rpx; + margin-bottom: 20rpx; + border: 8rpx solid #3b3945; + border-radius: 16rpx; + color: rgba(255, 255, 255, 0.6); +} + +.list .cell.isActive { + color: #ffda2e; + border-color: #ffda2e; +} + +.list .cell .top>text:first-child { + font-size: 20rpx; + line-height: 20rpx; +} + +.list .cell .top>text:last-child { + font-size: 32rpx; + font-weight: bold; + line-height: 32rpx; +} + +.list .cell .bottom { + margin-top: 20rpx; + font-size: 24rpx; + line-height: 24rpx; +} + +.footer-btn { + height: 80rpx; + margin: 100rpx; + margin-bottom: 0rpx; + background: #ffda2e; + color: #252330; + line-height: 80rpx; + text-align: center; + font-size: 30rpx; + border-radius: 40rpx; +} \ No newline at end of file diff --git a/pages/myBills/index.js b/pages/myBills/index.js new file mode 100644 index 0000000..e7c89ef --- /dev/null +++ b/pages/myBills/index.js @@ -0,0 +1,105 @@ +// pages/myBills/index.js +const app = getApp(); +let page = 1; +Page({ + + /** + * 页面的初始数据 + */ + data: { + list: [], + isShowNewplot: false, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getData(); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + page = 1; + this.getData() + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + page++ + this.getData(); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + return { + title: '智慧云馆' + } + }, + + getData() { + wx.showLoading({ + title: '加载中...', + mask: true, + }) + app.$api.memberMoneyLogBill({ + page: page, + pageSize: 10 + }).then(res => { + let list = []; + if (page != 1) { + list = this.data.list; + } + if (res.page.data.length == 0) { + page-- + } + for (let i = 0; i < res.page.data.length; i++) { + list.push(res.page.data[i]); + } + this.setData({ + list: list, + isShowNewplot: true + }) + wx.stopPullDownRefresh() + }, err => { + wx.stopPullDownRefresh() + this.setData({ + isShowNewplot: true + }) + }) + } +}) \ No newline at end of file diff --git a/pages/myBills/index.json b/pages/myBills/index.json new file mode 100644 index 0000000..9718ee0 --- /dev/null +++ b/pages/myBills/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "我的账单", + "enablePullDownRefresh": true, + "usingComponents": { + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/myBills/index.wxml b/pages/myBills/index.wxml new file mode 100644 index 0000000..5b05587 --- /dev/null +++ b/pages/myBills/index.wxml @@ -0,0 +1,28 @@ + +
+ + + + + + {{item.venue.name}}进场 + 购买{{item.venue.name}}{{item.cardType}} + 预约{{item.venueLesson.name}} + 充值 + {{item.venueLesson.name}}退款 + 提现 + 提现失败 + 提现审核通过 + 单次扣款 + {{item.createdTime}} + + 使用{{item.cardType}} + {{item.money > 0 ? "+" : ""}}{{item.money}} + + + + + + + 暂无记录 ~ + diff --git a/pages/myBills/index.wxss b/pages/myBills/index.wxss new file mode 100644 index 0000000..8894136 --- /dev/null +++ b/pages/myBills/index.wxss @@ -0,0 +1,61 @@ +/* pages/myBills/index.wxss */ +.container { + min-height: calc(100vh - 190rpx); + padding: 160rpx 0 30rpx 0; +} + +.list { + background: #1a191e; +} + +.list .cell { + display: flex; + justify-content: space-between; + align-items: center; + height: 120rpx; + padding: 0 30rpx; + border-bottom: 2rpx solid #212025; +} + +.list .cell .left .title { + font-size: 24rpx; + line-height: 24rpx; + color: #FFF; +} + +.list .cell .left .date { + margin-top: 24rpx; + font-size: 20rpx; + line-height: 20rpx; + color: rgba(255, 255, 255, 0.6); +} + +.list .cell .right { + font-size: 26rpx; + color: #FFF; + font-weight: bold; +} + +.list .cell .right.isActive { + color: #caae2a; +} + +.newplot { + position: fixed; + top: 140rpx; + 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; +} diff --git a/pages/myBookings/index.js b/pages/myBookings/index.js new file mode 100644 index 0000000..bcc01a8 --- /dev/null +++ b/pages/myBookings/index.js @@ -0,0 +1,226 @@ +// pages/myBookings/index.js +const app = getApp(); +let orderSn = "" +Page({ + + /** + * 页面的初始数据 + */ + data: { + isSignIn: false, + memberLessonTicket: {}, + showDeleteDialog: false, + isGoHome: false, + endDate: false, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + if (options.scene) { + app.$api.memberLessonTicketsSing({ + coachId: options.scene + }).then(res => { + orderSn = res.orderSn; + wx.showToast({ + title: '签到成功', + duration: 2000 + }) + let that = this; + setTimeout(function() { + that.getData(); + }, 2000) + }, err => { + setTimeout(function() { + if (!options.orderSn) { + wx.redirectTo({ + url: '/pages/home/index', + }) + } else { + wx.redirectTo({ + url: '/pages/myBookings/index?orderSn=' + options.orderSn, + }) + } + }, 2000) + }) + } else { + orderSn = options.orderSn; + this.getData(); + } + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + 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: '智慧云馆' + } + }, + + // 取消预约 + cancelBooking() { + if (!this.data.isSignIn) { + this.setData({ + showDeleteDialog: true + }) + return; + } else { + wx.showToast({ + title: '距离开课48小时内不得取消', + icon: 'none', + }) + } + }, + + // 我要签到 + signIn() { + let that = this; + // if (!this.data.isSignIn) { + // this.setData({ + // showDeleteDialog: true + // }) + // return; + // } + // let currentDate = new Date().getTime(); + // let startDate = new Date(this.data.memberLessonTicket.venueLesson.date.replace(/-/g, "/") + ' ' + this.data.memberLessonTicket.venueLesson.startTime).getTime(); + + // if (currentDate < startDate) { + // wx.showToast({ + // title: '课程还未开始', + // icon: 'none', + // }) + // return; + // } + wx.scanCode({ + onlyFromCamera: true, + success: function(res) { + if (!res.path) { + wx.showToast({ + title: '二维码错误', + icon: 'none', + }) + return; + } + wx.redirectTo({ + url: '/' + res.path + '&orderSn=' + orderSn, + }) + // that.setData({ + // isSignIn: true + // }) + }, + }) + }, + // 获取数据 + getData() { + app.$api.memberLessonTicketsDetail({ + orderSn: orderSn + }).then(res => { + let currentDate = new Date().getTime(); + let startDate = currentDate; + if (res.memberLessonTicket) { + startDate = new Date(res.memberLessonTicket.venueLesson.date.replace(/-/g, "/") + ' ' + res.memberLessonTicket.venueLesson.startTime).getTime(); + } + if (!res.memberLessonTicket) { + wx.navigateBack({ + delta: 1, + }) + } + this.setData({ + memberLessonTicket: res.memberLessonTicket, + isSignIn: (startDate - currentDate) / 1000 / 60 / 60 < 48, + }) + }, err => { + + }) + }, + + // 取消弹框 + cancelDeleteDialog() { + this.setData({ + showDeleteDialog: false + }) + }, + + // 确认删除 + confirmDeleteDialog() { + app.$api.memberLessonTicketsCancel({ + orderSn: this.data.memberLessonTicket.orderSn + }).then(res => { + wx.showToast({ + title: '取消成功', + }) + this.setData({ + showDeleteDialog: false + }) + this.getData(); + }, err => { + this.setData({ + showDeleteDialog: false + }) + }); + }, + + // 打开导航, + opnGPS() { + wx.openLocation({ + latitude: Number(this.data.memberLessonTicket.venueLesson.latitude), + longitude: Number(this.data.memberLessonTicket.venueLesson.longitude), + name: this.data.memberLessonTicket.venueLesson.name, + address: this.data.memberLessonTicket.venueLesson.address, + }) + }, + + // 点击图片 + clickImage() { + wx.previewImage({ + urls: [this.data.memberLessonTicket.venueLesson.coach.wechatCode], + }) + } +}) \ No newline at end of file diff --git a/pages/myBookings/index.json b/pages/myBookings/index.json new file mode 100644 index 0000000..5e84d0c --- /dev/null +++ b/pages/myBookings/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "我的预约", + "usingComponents": { + "confirm-dialog": "/component/confirmDialog/confirmDialog", + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/myBookings/index.wxml b/pages/myBookings/index.wxml new file mode 100644 index 0000000..58fd584 --- /dev/null +++ b/pages/myBookings/index.wxml @@ -0,0 +1,64 @@ + +
+ + + + + {{memberLessonTicket.venueLesson.name}} + + + 已预约 + 未签到 + 已签到 + 已取消 + + + + {{memberLessonTicket.venueLesson.date}} {{memberLessonTicket.venueLesson.startTime}} ~ {{memberLessonTicket.venueLesson.endTime}} + + + + + {{memberLessonTicket.venueLesson.address}} + + + 导航 + + + + + {{memberLessonTicket.memberCard.cardType ? '已使用' + memberLessonTicket.memberCard.cardType : "未使用会员卡"}} + + + + 人数 + {{memberLessonTicket.lessonCount}}人 + + + + 费用 + 已支付: ¥{{memberLessonTicket.order.price}} + + + + 助理教练信息 + + + + 扫一扫加好友 + + + + + + 取消预约 + + 我要签到 + + + + + \ No newline at end of file diff --git a/pages/myBookings/index.wxss b/pages/myBookings/index.wxss new file mode 100644 index 0000000..f9c3164 --- /dev/null +++ b/pages/myBookings/index.wxss @@ -0,0 +1,117 @@ +/* pages/myBookings/index.wxss */ + +.container { + min-height: calc(100vh - 290rpx); + padding: 160rpx 30rpx 130rpx 30rpx; +} + +.cell-box { + 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 .title { + flex: 1; + display: flex; + align-items: center; + color: #fff; + font-size: 26rpx; +} + +.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 .state { + font-size: 22rpx; + color: #ffda2e; +} + +.cell-box .cell .cell-right-white { + color: #fff; + font-size: 24rpx; +} + +.cell-box .qrCode-box { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 300rpx; +} + +.cell-box .qrCode-box>image { + width: 200rpx; + height: 200rpx; +} + +.cell-box .qrCode-box>text { + margin-top: 20rpx; + font-size: 22rpx; + line-height: 22rpx; + color: rgba(255, 255, 255, 0.6); +} + +.footer-box { + position: fixed; + bottom: 0; + left: 0; + display: flex; + width: 100%; + height: 100rpx; +} + +.footer-btn { + flex: 1; + background: #767578; + color: #1a191e; + font-size: 32rpx; + text-align: center; + line-height: 100rpx; +} + +.footer-btn.isActive { + background: #ffda2e; +} diff --git a/pages/myBookingsList/index.js b/pages/myBookingsList/index.js new file mode 100644 index 0000000..7a95d84 --- /dev/null +++ b/pages/myBookingsList/index.js @@ -0,0 +1,131 @@ +// pages/myBookingsList/index.js +const app = getApp(); +let page = 1; +Page({ + + /** + * 页面的初始数据 + */ + data: { + state: 0, + list: [], + isShowNewplot: false, + gohome: true + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + this.getData(); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + page = 1; + this.getData(); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function() { + page++; + this.getData(); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function() { + return { + title: '智慧云馆' + } + }, + + // 切换标签 + changeTab(e) { + let state = e.currentTarget.dataset.state; + this.setData({ + state: state + }) + page = 1; + this.getData(); + }, + + // 获取数据 + getData() { + wx.showLoading({ + title: '加载中...', + mask: true, + }) + app.$api.memberLessonTicketsReserve({ + page: page, + pageSize: 10, + status: this.data.state + }).then(res => { + let list = []; + if (page == 1) { + this.setData({ + list: [] + }) + } else { + list = this.data.list; + } + for (let i = 0; i < res.page.data.length; i++) { + let currentDate = new Date().getTime(); + let endDate = 0; + if (res.page.data[i].date) { + endDate = new Date(res.page.data[i].date.replace(/-/g, "/") + ' ' + res.page.data[i].endTime).getTime(); + } + res.page.data[i].isEnd = currentDate > endDate; + list.push(res.page.data[i]); + } + this.setData({ + list: list, + isShowNewplot: true + }) + wx.stopPullDownRefresh() + }, err => { + wx.stopPullDownRefresh() + }) + }, + + // 点击CEll + clickCell(e) { + let orderSn = e.currentTarget.dataset.ordersn; + wx.navigateTo({ + url: `/pages/myBookings/index?orderSn=${orderSn}`, + }) + } +}) \ No newline at end of file diff --git a/pages/myBookingsList/index.json b/pages/myBookingsList/index.json new file mode 100644 index 0000000..ab66812 --- /dev/null +++ b/pages/myBookingsList/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "我的预约", + "enablePullDownRefresh": true, + "usingComponents": { + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/myBookingsList/index.wxml b/pages/myBookingsList/index.wxml new file mode 100644 index 0000000..1fcee97 --- /dev/null +++ b/pages/myBookingsList/index.wxml @@ -0,0 +1,44 @@ + +
+ + + + + 已预约 + + + 已完成 + + + + + + 预约单号: {{item.orderSn}} + 已预约 + 未签到 + 已完成 + 已取消 + + + + + + + {{item.lessonName}} + ({{item.lessonCount}}人) + + ¥{{item.order.price}} + + + {{item.date}} {{item.startTime}} ~ {{item.endTime}} + + {{item.address}} + + + + + + + + 暂无预约 ~ + \ No newline at end of file diff --git a/pages/myBookingsList/index.wxss b/pages/myBookingsList/index.wxss new file mode 100644 index 0000000..10188f5 --- /dev/null +++ b/pages/myBookingsList/index.wxss @@ -0,0 +1,134 @@ +/* pages/myBookingsList/index.wxss */ + +.container { + min-height: calc(100vh - 260rpx); + padding: 250rpx 30rpx 30rpx 30rpx; +} + +.header { + position: fixed; + top: 120rpx; + left: 0; + display: flex; + justify-content: space-between; + width: 100%; + height: 90rpx; + background: #1a191e; +} + +.header .btn-box { + flex: 1; + height: 100%; + text-align: center; +} + +.header .btn-box .item-btn { + width: 90rpx; + height: 84rpx; + margin: 0 auto; + font-size: 28rpx; + line-height: 90rpx; + border-bottom: 6rpx solid #1a191e; + color: rgba(255, 255, 255, 0.6); +} + +.header .btn-box .item-btn.isActive { + color: #ffda2e; + border-bottom: 6rpx solid #ffda2e; +} + +.cell { + margin-bottom: 30rpx; + border-radius: 20rpx; + background: #1a191e; +} + +.cell .top { + display: flex; + justify-content: space-between; + align-items: center; + height: 80rpx; + padding: 0 26rpx; + border: 2rpx solid #212025; +} + +.cell .top>text:first-child { + font-size: 24rpx; + color: #fff; +} + +.cell .top>text:last-child { + color: rgba(255, 255, 255, 0.6); + font-size: 24rpx; +} + +.cell .top>text:last-child.isActive { + color: #ffda2e; +} + +.cell .bottom { + display: flex; + justify-content: space-between; + padding: 20rpx 24rpx; +} + +.cell .bottom>image { + width: 130rpx; + height: 110rpx; +} + +.cell .bottom .goods-box { + flex: 1; + margin-left: 20rpx; +} + +.cell .bottom .goods-box .title-box { + display: flex; + justify-content: space-between; + align-items: center; +} + +.cell .bottom .goods-box .title-box .title-left { + flex: 1; + height: 26rpx; + color: #fff; + font-size: 24rpx; + line-height: 26rpx; +} + +.cell .bottom .goods-box .title-box .title-left>text:first-child { + font-size: 26rpx; + color: #ffda2e; +} + +.cell .bottom .goods-box .title-box .title-right { + font-size: 24rpx; + color: #FFF; +} + +.cell .bottom .goods-box .message { + font-size: 22rpx; + color: #FFF; + line-height: 22rpx; + margin-top: 16rpx; +} + +.newplot { + position: fixed; + top: 260rpx; + 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; +} \ No newline at end of file diff --git a/pages/myMembershipCard/index.js b/pages/myMembershipCard/index.js new file mode 100644 index 0000000..5e6f9da --- /dev/null +++ b/pages/myMembershipCard/index.js @@ -0,0 +1,142 @@ +// pages/myMembershipCard/index.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + unfoldIndex: 1, + cards: [], + showCardMask: false, + venues: {}, + isShowNewplot: false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + this.getData(); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function() { + return { + title: '智慧云馆' + } + }, + + // 展开Cell + unfoldCell(e) { + let index = e.currentTarget.dataset.index; + if (this.data.unfoldIndex == index) { + this.setData({ + unfoldIndex: '' + }) + } else { + this.setData({ + unfoldIndex: index + }) + } + }, + + // 选择默认 + selectDefault(e) { + let cardFlg = e.currentTarget.dataset.cardflg; + let id = e.currentTarget.dataset.id; + if (cardFlg == 0) { + app.$api.memberVenueUpdateCard({ + cardId: id + }).then(res => { + this.getData(); + }) + } + }, + // 获取数据 + getData() { + wx.showLoading({ + title: '加载中...', + mask: true, + }) + app.$api.memberVenueCard({}).then(res => { + let list = []; + for (let i = 0; i < res.cards.length; i++) { + let card = res.cards[i]; + for (let j = 0; j < card.memberCards.length; j++) { + card.memberCards[j].startTime = card.memberCards[j].startTime.split(' ')[0]; + card.memberCards[j].endTime = card.memberCards[j].endTime.split(' ')[0]; + } + list.push(card); + } + this.setData({ + cards: list, + isShowNewplot: true + }) + }, err => { + this.setData({ + isShowNewplot: true + }) + }); + }, + + // 关闭 + cancelCardMask() { + this.setData({ + showCardMask: false + }) + }, + + // 开启会员卡提示 + showCardContent(e) { + this.setData({ + showCardMask: true, + venues: this.data.cards[e.currentTarget.dataset.index] + }) + }, + +}) \ No newline at end of file diff --git a/pages/myMembershipCard/index.json b/pages/myMembershipCard/index.json new file mode 100644 index 0000000..3bda79c --- /dev/null +++ b/pages/myMembershipCard/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "我的会员卡", + "usingComponents": { + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/myMembershipCard/index.wxml b/pages/myMembershipCard/index.wxml new file mode 100644 index 0000000..a9d2fb9 --- /dev/null +++ b/pages/myMembershipCard/index.wxml @@ -0,0 +1,40 @@ + +
+ + + + 默认 + + + {{item.name}} + + + + + + + + + + {{data.cardType}} + 有效期: {{data.startTime}} - {{data.endTime}} + {{data.cardFlg == 0 ? "可使用" : (data.cardFlg == 1 ? "待使用" : "已失效")}} + + + + + + + + + + + VIP会员享受专属特权 + + + + + + + 暂无会员卡 ~ + \ No newline at end of file diff --git a/pages/myMembershipCard/index.wxss b/pages/myMembershipCard/index.wxss new file mode 100644 index 0000000..e938f2b --- /dev/null +++ b/pages/myMembershipCard/index.wxss @@ -0,0 +1,182 @@ +/* pages/myMembershipCard/index.wxss */ + +.container { + min-height: calc(100vh - 190rpx); + padding: 160rpx 30rpx 30rpx 30rpx; +} + +.cell { + margin-bottom: 30rpx; + border-radius: 20rpx; + background: #1a191e; +} + +.cell .header { + display: flex; + justify-content: space-between; + align-items: center; + height: 90rpx; + padding: 0 20rpx; + border-bottom: 2rpx solid #212025; +} + +.cell .header .default { + color: #fff; + font-size: 24rpx; +} + +.cell .header .icon { + width: 32rpx; + height: 30rpx; + margin: 0 26rpx 0 40rpx; +} + +.cell .header .title { + flex: 1; + font-size: 24rpx; + color: #fff; +} + +.cell .header .tip-icon { + width: 26rpx; + height: 26rpx; + margin-right: 16rpx; +} + +.cell .header .right-arrow { + width: 22rpx; + height: 12rpx; +} + +.cell .body { + animation: dropDown 0.5s linear; +} + +.cell .body .card-cell { + display: flex; + justify-content: space-between; + align-items: center; + height: 90rpx; + padding: 0 30rpx; +} + +.cell .body .card-cell .default-icon { + width: 30rpx; + height: 30rpx; +} + +.cell .body .card-cell .tab { + width: 100rpx; + height: 26rpx; + padding: 0 4rpx; + margin-left: 40rpx; + margin-right: 16rpx; + font-size: 20rpx; + color: #b69d29; + border: 2rpx solid #b69d29; + line-height: 26rpx; + border-radius: 13rpx; + text-align: center; +} + +.cell .body .card-cell .tab.isActive { + color: rgba(255, 255, 255, 0.6); + border: 2rpx solid #737275; +} + +.cell .body .card-cell .indate { + flex: 1; + font-size: 20rpx; + color: rgba(255, 255, 255, 0.6); +} + +.cell .body .card-cell .state { + color: rgba(255, 255, 255, 0.6); + font-size: 24rpx; +} + +.cell .body .card-cell .state.isActive { + color: #b69d29; + font-size: 24rpx; +} + +.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: rgba(255, 255, 255, 0.6); + 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.6); +} + +.card-mask .card-box .title { + text-align: center; + color: #ffda2e; + font-size: 28rpx; +} + +.newplot { + position: fixed; + top: 120rpx; + 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; +} + +.unClickClass { + height: 28rpx; + width: 28rpx; + border-radius: 50%; + /* background: #737275; */ + border: 2rpx solid rgba(255, 255, 255, 0.3); +} diff --git a/pages/notice/index.js b/pages/notice/index.js new file mode 100644 index 0000000..36f8458 --- /dev/null +++ b/pages/notice/index.js @@ -0,0 +1,84 @@ +// pages/notice/index.js +const app = getApp(); +let id = '' +Page({ + + /** + * 页面的初始数据 + */ + data: { + announcement: {}, + isGoHome: false, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + id = options.id; + app.$api.announcementDetail({ + id: id + }).then(res => { + res.announcement.description = res.announcement.description.replace(/section/g, "div"); + this.setData({ + announcement: res.announcement + }) + }, err => { + + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + 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: '智慧云馆' + } + } +}) \ No newline at end of file diff --git a/pages/notice/index.json b/pages/notice/index.json new file mode 100644 index 0000000..44abfcf --- /dev/null +++ b/pages/notice/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "公告", + "usingComponents": { + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/notice/index.wxml b/pages/notice/index.wxml new file mode 100644 index 0000000..58544bc --- /dev/null +++ b/pages/notice/index.wxml @@ -0,0 +1,12 @@ + +
+ + + {{announcement.title}} + {{announcement.time}} + + + + + + diff --git a/pages/notice/index.wxss b/pages/notice/index.wxss new file mode 100644 index 0000000..f9a884c --- /dev/null +++ b/pages/notice/index.wxss @@ -0,0 +1,38 @@ +/* pages/notice/index.wxss */ + +.container { + /* min-height: calc(1100 - 200rpx); */ + background: #fff; +} + +.body { + padding-bottom: 40rpx; + padding-left: 30rpx; + padding-right: 30rpx; + background: #fff; +} + +.title { + padding-top: 40rpx; + font-size: 32rpx; + font-weight: bold; +} + +.date { + height: 20rpx; + margin-top: 36rpx; + font-size: 20rpx; + color: #cfcfcf; + line-height: 20rpx; +} + +.rich-box { + margin-top: 40rpx; + + font-size: 26rpx; + line-height: 40rpx; +} + +.rich-box .wscnph { + width: 100%; +} diff --git a/pages/questions/index.js b/pages/questions/index.js new file mode 100644 index 0000000..dc0ce83 --- /dev/null +++ b/pages/questions/index.js @@ -0,0 +1,93 @@ +// pages/questions/index.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + questions: [] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + app.$api.faqs({}).then(res => { + this.setData({ + questions: res.faqs + }) + }, err => { + + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function() { + return { + title: '智慧云馆' + } + }, + + // 打开答案 + openAnswer(e) { + let index = e.currentTarget.dataset.index; + let list = []; + for (let i = 0; i < this.data.questions.length; i++) { + let item = this.data.questions[i] + if (i == index) { + item.isOpenAnswer = !item.isOpenAnswer; + } else { + item.isOpenAnswer = false; + } + list.push(item) + } + this.setData({ + questions: list + }) + } +}) \ No newline at end of file diff --git a/pages/questions/index.json b/pages/questions/index.json new file mode 100644 index 0000000..05f4ad8 --- /dev/null +++ b/pages/questions/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "常见问题", + "usingComponents": { + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/questions/index.wxml b/pages/questions/index.wxml new file mode 100644 index 0000000..de5ea51 --- /dev/null +++ b/pages/questions/index.wxml @@ -0,0 +1,14 @@ + +
+ + + + + {{index + 1}}. {{item.problem}} + + + + {{item.answer}} + + + diff --git a/pages/questions/index.wxss b/pages/questions/index.wxss new file mode 100644 index 0000000..876f92b --- /dev/null +++ b/pages/questions/index.wxss @@ -0,0 +1,40 @@ +/* pages/questions/index.wxss */ + +.container { + padding: 20rpx; + padding-top: 150rpx; + min-height: calc(100vh - 170rpx); +} + +.body { + background: #1a191e; + border-radius: 10rpx; +} + +.body .cell { + overflow: hidden; + border-bottom: 2rpx solid #212025; +} + +.body .cell .question { + display: flex; + justify-content: space-between; + align-items: center; + height: 90rpx; + padding: 0 20rpx; + color: #fff; + font-size: 24rpx; +} + +.body .cell .question>image { + width: 22rpx; + height: 12rpx; +} + +.body .cell .answer { + padding: 50rpx; + border-top: 2rpx solid #212025; + color: rgba(255, 255, 255, 0.6); + font-size: 22rpx; + line-height: 38rpx; +} diff --git a/pages/register/index.js b/pages/register/index.js new file mode 100644 index 0000000..6d604cf --- /dev/null +++ b/pages/register/index.js @@ -0,0 +1,315 @@ +// pages/register/index.js +const app = getApp(); +let timer = ''; +let codeType = 0; +let changeType = ''; +Page({ + + /** + * 页面的初始数据 + */ + data: { + isFocus: '', + body: {}, + code: "获取验证码", + isGetCode: false, + ageList: [{ + label: '男', + value: 0 + }, { + label: '女', + value: 1 + }, { + label: '不选择', + value: 2 + }], + isShowSexPopup: false, + sexLabel: '选择性别(选填)', + changeFrom: {}, + unClick: false, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + let that = this; + changeType = options.changeType ? options.changeType : ''; + codeType = options.codeType; + this.setData({ + changeFrom: options + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function() { + return { + title: '智慧云馆' + } + }, + + // 输入框获取聚焦时 + inputFocus(event) { + let key = event.currentTarget.dataset.type; + this.setData({ + isFocus: key + }) + }, + + // 输入框输入时 + inputChange(event) { + let key = event.currentTarget.dataset.type; + this.data.body[key] = event.detail.value; + }, + + // 输入框失去焦点时 + inputBlur(event) { + let key = event.currentTarget.dataset.type; + this.setData({ + isFocus: '' + }) + }, + + // 获取验证码 + getCode() { + if (this.data.isGetCode) { + return; + } + if (!this.data.body.phone) { + wx.showToast({ + title: '请输入手机号', + icon: 'none', + }) + return; + } + this.data.isGetCode = true; + + if (this.data.changeFrom.codeType != 3) { + app.$api.smsRegister({ + mobile: this.data.body.phone, + 'type': codeType + }).then(res => { + clearTimeout(timer); + this.countdown(60); + }, err => { + this.data.isGetCode = false; + }) + } + if (this.data.changeFrom.codeType == 3) { + app.$api.memberSmsUpdate({ + mobile: this.data.body.phone, + }).then(res => {}, err => {}) + } + }, + + // 倒计时 + countdown(val) { + if (val == 0) { + this.data.isGetCode = false; + clearTimeout(timer); + return; + } + let that = this; + timer = setTimeout(function() { + val-- + that.countdown(val); + that.setData({ + code: val == 0 ? '获取验证码' : val + ' s' + }) + }, 1000) + }, + + // 点击选择性别 + changeSex() { + this.setData({ + isShowSexPopup: true + }) + }, + + // 取消选择性别 + cancelSex() { + this.setData({ + isShowSexPopup: false + }) + }, + + // 选择性别 + selectedSex(e) { + this.data.body.sex = e.detail.value; + this.setData({ + isShowSexPopup: false, + sexLabel: e.detail.label == '不选择' ? "选择性别(选填)" : e.detail.label + }) + }, + + // 注册 + registerClick(e) { + if (this.data.unClick) { + return; + } + if (!this.data.body.phone) { + wx.showToast({ + title: '请输入手机号', + icon: 'none', + }) + return; + } + if (!this.data.body.code) { + wx.showToast({ + title: '请输入验证码', + icon: 'none', + }) + return; + } + if (this.data.body.age > 100) { + wx.showToast({ + title: '输入年龄不得超过100', + icon: 'none', + }) + return; + } + this.data.unClick = true; + if (codeType == 2) { + app.$api.memberRegister({ + address: this.data.body.address ? this.data.body.address : '', + age: this.data.body.age ? this.data.body.age : '', + captcha: this.data.body.code ? this.data.body.code : '', + mobile: this.data.body.phone ? this.data.body.phone : '', + name: this.data.body.name ? this.data.body.name : '', + sex: this.data.body.sex ? this.data.body.sex : '', + }).then(res => { + this.data.unClick = false; + wx.setStorageSync('accessToken', res.authorization.accessToken); + // if (wx.getStorageSync('history').indexOf("basketballGym") > -1) { + wx.redirectTo({ + url: '/pages/myAccount/index?isPass=' + 1, + }) + // } else { + // wx.redirectTo({ + // url: '/pages/facialCapturing/index?isPass=' + 1, + // }) + // } + + }, err => { + this.data.unClick = false; + }) + } else if (codeType == 1) { + app.$api.memberLoginWXPhone({ + avatar: wx.getStorageSync('information').avatar, + nickname: wx.getStorageSync('information').nickname, + openId: wx.getStorageSync('information').openId, + address: this.data.body.address ? this.data.body.address : '', + age: this.data.body.age ? this.data.body.age : '', + captcha: this.data.body.code ? this.data.body.code : '', + mobile: this.data.body.phone ? this.data.body.phone : '', + name: this.data.body.name ? this.data.body.name : '', + sex: this.data.body.sex ? this.data.body.sex : '', + }).then(res => { + this.data.unClick = false; + wx.setStorageSync('accessToken', res.authorization.accessToken); + // if (wx.getStorageSync('history').indexOf("basketballGym") > -1) { + wx.redirectTo({ + url: '/pages/myAccount/index?isPass=' + 1, + }) + // } else { + // wx.redirectTo({ + // url: '/pages/facialCapturing/index?isPass=' + 1, + // }) + // } + }, err => { + this.data.unClick = false; + }) + } + }, + + // 保存修改 + saveClick() { + let body = {}; + if (this.data.changeFrom.label == "phone") { + if (!this.data.body.code) { + wx.showToast({ + title: '请输入验证码', + icon: 'none', + }) + return; + } + body.mobile = this.data.body.phone ? this.data.body.phone : this.data.changeFrom.value; + body.captcha = this.data.body.code; + } else { + if (this.data.changeFrom.label == 'age' && this.data.body.age > 100) { + wx.showToast({ + title: '输入年龄不得超过100', + icon: 'none', + }) + return; + } + if (this.data.changeFrom.label == 'nickname' && this.data.body.nickname === '') { + wx.showToast({ + title: '请输入昵称', + icon: 'none', + }) + return; + } + body[this.data.changeFrom.label] = this.data.body[this.data.changeFrom.label] != undefined ? this.data.body[this.data.changeFrom.label] : this.data.changeFrom.value + } + + app.$api.memberUpdateInformation(body).then(res => { + wx.showToast({ + title: '保存成功', + duration: 2000 + }); + setTimeout(function() { + wx.navigateBack({ + delta: 1, + }) + }, 2000); + + }, err => { + + }) + } +}) \ No newline at end of file diff --git a/pages/register/index.json b/pages/register/index.json new file mode 100644 index 0000000..773af37 --- /dev/null +++ b/pages/register/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "action-sheet": "/component/actionSheet/actionSheet", + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/register/index.wxml b/pages/register/index.wxml new file mode 100644 index 0000000..94e6a2e --- /dev/null +++ b/pages/register/index.wxml @@ -0,0 +1,46 @@ + +
+ + + + + + + + + + + + + + + + + {{sexLabel}} + {{sexLabel}} + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/register/index.wxss b/pages/register/index.wxss new file mode 100644 index 0000000..5fcb5e7 --- /dev/null +++ b/pages/register/index.wxss @@ -0,0 +1,67 @@ +/* pages/register/index.wxss */ +page { + position: relative; +} + +.container { + min-height: calc(100vh - 230rpx); + padding: 230rpx 124rpx 0 124rpx; +} + +.input-box { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 30rpx; + border-bottom: 2rpx solid #3f3e49; +} + +.input-box>input { + /* flex: 1; */ + margin: 20rpx 0; + font-size: 24rpx; + font-weight: bold; + color: #fff; +} + +.input-box>text { + margin: 30rpx 0; + color: rgba(255, 255, 255, 0.6); + font-size: 24rpx; +} + +.input-box>image { + width: 12rpx; + height: 22rpx; +} + +.input-box.isActive { + border-bottom: 2rpx solid #6e602f; +} + +.input-box .placeholder { + color: rgba(255, 255, 255, 0.6); +} + +.input-box>button { + padding: 0; + width: 200rpx; + background: none; + font-size: 24rpx; + color: rgba(255, 255, 255, 0.6); + text-align: center; +} + +.input-box>button::after { + border: none; +} + +.register-btn { + margin-top: 200rpx; + height: 80rpx; + border-radius: 40rpx; + background: #ffda2e; + color: #252330; + font-size: 26rpx; + line-height: 80rpx; +} \ No newline at end of file diff --git a/pages/sportsGroundList/index.js b/pages/sportsGroundList/index.js new file mode 100644 index 0000000..337eed1 --- /dev/null +++ b/pages/sportsGroundList/index.js @@ -0,0 +1,178 @@ +// pages/sportsGroundList/index.js +const app = getApp(); +let latitude = 0; // 纬度 +let longitude = 0; // 经度 +let page = 1; +Page({ + + /** + * 页面的初始数据 + */ + data: { + state: 1, + venues: [], + isShowAuth: false, + isShowNewplot: false, + isGoHome: false, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + let that = this; + this.setData({ + state: options.state + }) + this.getLocation(); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function() { + let pages = getCurrentPages(); + this.setData({ + isGoHome: pages.length == 1 + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + this.getData(); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function() { + this.getData(++page); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function() { + return { + title: '智慧云馆' + } + }, + + // 切换列表 + changeTip(e) { + let state = e.currentTarget.dataset.state; + this.setData({ + state: state + }) + + this.getData(); + }, + + // 点击cell + clickCell(e) { + let id = e.currentTarget.dataset.id; + if (this.data.state == 1) { + wx.navigateTo({ + url: `/pages/basketballGym/index?id=${id}`, + }) + } + if (this.data.state == 2) { + wx.navigateTo({ + url: `/pages/gymnasium/index?id=${id}`, + }) + } + }, + + // 获取数据 + getData(e) { + wx.showLoading({ + title: '加载中...', + mask: true, + }) + app.$api.venues({ + latitude: latitude, + longitude: longitude, + page: e ? e : 1, + pageSize: 10, + type: this.data.state + }).then(res => { + page = res.page.data.length > 0 ? res.page.page : page--; + let list = []; + if (e) { + list = this.data.venues + } + for (let i = 0; i < res.page.data.length; i++) { + list.push(res.page.data[i]); + } + this.setData({ + venues: list, + isShowNewplot: true + }) + if (this.data.state == 3) { + wx.showToast({ + title: '暂未开放,敬请期待', + icon: 'none', + }) + } + wx.stopPullDownRefresh(); + }, err => { + wx.stopPullDownRefresh(); + this.setData({ + isShowNewplot: true + }) + }) + }, + + // 活动当前坐标 + getLocation() { + let that = this; + wx.getLocation({ + type: 'gcj02', + success: function(res) { + latitude = res.latitude; + longitude = res.longitude; + that.getData() + }, + fail: function(res) { + if (res.errMsg == 'getLocation:fail auth deny' || res.errMsg == 'getLocation:fail:auth denied') { + that.setData({ + isShowAuth: true + }) + } + }, + }) + }, + + // 获取授权 + setAuthSuccess(e) { + if (e.detail.authSetting['scope.userLocation']) { + this.getLocation(); + this.setData({ + isShowAuth: false + }) + } + }, +}) \ No newline at end of file diff --git a/pages/sportsGroundList/index.json b/pages/sportsGroundList/index.json new file mode 100644 index 0000000..7639371 --- /dev/null +++ b/pages/sportsGroundList/index.json @@ -0,0 +1,7 @@ +{ + "enablePullDownRefresh": true, + "usingComponents": { + "confirm-dialog": "/component/confirmDialog/confirmDialog", + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/sportsGroundList/index.wxml b/pages/sportsGroundList/index.wxml new file mode 100644 index 0000000..dabf4f7 --- /dev/null +++ b/pages/sportsGroundList/index.wxml @@ -0,0 +1,42 @@ + +
+ + + + + + 篮球场 + + + + + + 健身 + + + + + 足球场 + + + + + + + + {{item.name}} + + {{item.address}} + {{item.distance}}km + + + + + + + + + + + 暂无运动场馆 ~ + \ No newline at end of file diff --git a/pages/sportsGroundList/index.wxss b/pages/sportsGroundList/index.wxss new file mode 100644 index 0000000..304e8fc --- /dev/null +++ b/pages/sportsGroundList/index.wxss @@ -0,0 +1,96 @@ +/* pages/sportsGroundList/index.wxss */ + +.container { + min-height: calc(100vh - 300rpx); + padding-top: 270rpx; + padding-bottom: 30rpx; +} + +.header { + position: fixed; + top: 120rpx; + left: 0; + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + height: 140rpx; + background: #1a191e; + border-bottom: 2rpx solid #212025; +} + +.header .item-box { + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + color: rgba(255, 255, 255, 0.6); + font-size: 24rpx; + line-height: 24rpx; +} + +.header .item-box.isActive { + color: #ffca00; +} + +.header .item-box>image { + width: 66rpx; + height: 58rpx; + margin-bottom: 16rpx; +} + +.list .cell-box { + display: flex; + justify-content: space-between; + align-items: center; + height: 140rpx; + margin-bottom: 30rpx; + padding: 0 26rpx 0 16rpx; + background: #1a191e; +} + +.list .cell-box>image { + width: 130rpx; + height: 110rpx; + margin-right: 20rpx; +} + +.list .cell-box .cell { + flex: 1; +} + +.list .cell-box .cell .title { + color: #fff; + font-size: 28rpx; + line-height: 28rpx; +} + +.list .cell-box .cell .address { + display: flex; + justify-content: space-between; + margin-top: 30rpx; + font-size: 24rpx; + line-height: 24rpx; + color: rgba(255, 255, 255, 0.6); +} + +.newplot { + position: fixed; + top: 260rpx; + 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; +} \ No newline at end of file diff --git a/pages/userInfo/index.js b/pages/userInfo/index.js new file mode 100644 index 0000000..a5f9a94 --- /dev/null +++ b/pages/userInfo/index.js @@ -0,0 +1,180 @@ +// pages/userInfo/index.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + setList: [], + isShowSheet: false, + members: {}, + gohome: true + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + this.getData(); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function() { + return { + title: '智慧云馆' + } + }, + + // 切换头像 + changeAvatar() { + let that = this; + wx.chooseImage({ + count: 1, + success: function (e) { + wx.showLoading({ + title: '正在上传...', + mask: true, + }) + app.$api.uploadAvatar({ + filePath: e.tempFilePaths[0] + }).then(res => { + wx.showToast({ + title: '上传成功', + icon: 'success', + }) + that.getData(); + }, err => {}); + }, + fail: function (res) { + console.log(res); + }, + }) + }, + + // 修改性别 + changeSex(val) { + this.setData({ + setList: [{ + label: '男', + value: 0, + type: 'sex' + }, { + label: '女', + value: 1, + type: 'sex' + }, { + label: '不选择', + value: 2, + type: 'sex' + }], + isShowSheet: true + }) + }, + + // 隐藏sheet弹框 + cancelSheet() { + this.setData({ + isShowSheet: false + }) + }, + + // 选择sheet + selectedSheet(e) { + let obj = e.detail; + if (obj.type == 'avatar') { + if (obj.value == 0) { + this.photograph('camera'); + } + if (obj.value == 1) { + this.photograph('album'); + } + } + if (obj.type == 'sex') { + this.updateSex(obj.value); + } + this.setData({ + isShowSheet: false + }) + }, + + // 修改性别 上传服务器 + updateSex(val) { + app.$api.memberUpdateInformation({ + sex: val + }).then(res => { + this.getData(); + }, err => { + + }) + }, + + // 修改信息 + changeMessage(e) { + let label = e.currentTarget.dataset.label; + let value = e.currentTarget.dataset.value ? e.currentTarget.dataset.value : ""; + wx.removeStorageSync('history'); + wx.navigateTo({ + url: `/pages/register/index?label=${label}&value=${value}&codeType=3`, + }) + }, + + // 获取数据 + getData() { + wx.showLoading({ + title: '加载中...', + mask: true, + }) + app.$api.memberInformation({}).then(res => { + this.setData({ + members: res.members + }) + }, err => { + + }) + } +}) \ No newline at end of file diff --git a/pages/userInfo/index.json b/pages/userInfo/index.json new file mode 100644 index 0000000..6bef9c4 --- /dev/null +++ b/pages/userInfo/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "action-sheet": "/component/actionSheet/actionSheet", + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/userInfo/index.wxml b/pages/userInfo/index.wxml new file mode 100644 index 0000000..7365419 --- /dev/null +++ b/pages/userInfo/index.wxml @@ -0,0 +1,50 @@ + +
+ + + + + 头像 + + + + + + + 昵称 + {{members.nickname}} + + + + 手机号 + {{members.mobile}} + + + + + + + + 姓名 + {{members.name}} + + + + 性别 + {{members.sex == 0 ? "男" : (members.sex == 1 ? "女" : "")}} + + + + 年龄 + {{members.age}} + + + + 地址 + {{members.address}} + + + + + + \ No newline at end of file diff --git a/pages/userInfo/index.wxss b/pages/userInfo/index.wxss new file mode 100644 index 0000000..10680eb --- /dev/null +++ b/pages/userInfo/index.wxss @@ -0,0 +1,61 @@ +/* pages/userInfo/index.wxss */ + +.container { + padding: 190rpx 30rpx 30rpx 30rpx; + min-height: calc(100vh - 190rpx); +} + +.list { + margin-bottom: 30rpx; + background: #1a191e; + border-radius: 20rpx; +} + +.list .cell { + display: flex; + justify-content: space-between; + align-items: center; + min-height: 90rpx; + padding: 0 30rpx; + border-bottom: 2rpx solid #212025; +} + +.list .cell.avatar { + height: 120rpx; +} + +.list .cell.unLine { + border-bottom: none; +} + +.list .cell .title { + font-size: 24rpx; + color: rgba(255, 255, 255, 0.6); +} + +.list .cell .right-cell { + display: flex; + justify-content: flex-end; + align-items: center; +} + +.list .cell .avatar-img { + width: 80rpx; + height: 80rpx; + border-radius: 50%; +} + +.list .cell .right-arrow { + width: 12rpx; + height: 22rpx; + margin-left: 24rpx; +} + +.list .cell .message { + flex: 1; + margin: 20rpx 0; + text-align: right; + color: #FFF; + font-size: 24rpx; + line-height: 30rpx; +} \ No newline at end of file diff --git a/pages/withdrawal/index.js b/pages/withdrawal/index.js new file mode 100644 index 0000000..79261b2 --- /dev/null +++ b/pages/withdrawal/index.js @@ -0,0 +1,178 @@ +// pages/withdrawal/index.js +const app = getApp(); +let money = 0; +Page({ + + /** + * 页面的初始数据 + */ + data: { + cardholder: '', + bank: '', + bankCard: '', + money: '', + isUnClick: false, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + this.setData({ + money:options.money + }) + money = options.money + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + this.data.isUnClick = false; + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function() { + return { + title: '智慧云馆' + } + }, + + // 修改持卡人 + cardholderInput(e) { + this.data.cardholder = e.detail.value; + }, + + // 修改银行 + bankInput(e) { + this.data.bank = e.detail.value; + }, + + // 修改银行卡号 + bankCardInput(e) { + this.data.bankCard = e.detail.value; + }, + + // 提现金额 + moneyInput(e) { + this.data.money = e.detail.value; + }, + + // 确认提现 + withdrawalClick(e) { + if (!this.data.cardholder) { + wx.showToast({ + title: '请输入持卡人', + icon: 'none', + }) + return; + } + if (!this.data.bank) { + wx.showToast({ + title: '请输入开户银行', + icon: 'none', + }) + return; + } + if (this.data.bankCard.length != 16) { + wx.showToast({ + title: '请输入16位银行卡号', + icon: 'none', + }) + return; + } + if (!this.data.money) { + wx.showToast({ + title: '请输入提现金额', + icon: 'none', + }) + return; + } + if (this.data.money > money) { + wx.showToast({ + title: '提现金额不得大于余额', + icon: 'none', + }) + return; + } + console.log(/^([1-9][\d]{0,7}|0)(\.[\d]{1,2})?$/.test(this.data.money)); + if (!/^([1-9][\d]{0,7}|0)(\.[\d]{1,2})?$/.test(this.data.money)) { + wx.showToast({ + title: '请输入正确的金额', + icon: 'none', + }) + return; + } + if (this.data.isUnClick) { + return + } + wx.showLoading({ + title: '加载中...', + mask: true, + }) + this.data.isUnClick = true; + app.$api.memberBankBind({ + bankName: this.data.bank, + bankNo: this.data.bankCard, + name: this.data.cardholder + }).then(res => { + app.$api.memberWithdrawApply({ + bankId: res.bankId, + money: this.data.money + }).then(res => { + wx.showToast({ + title: '已受理提现申请', + duration: 2000 + }), + setTimeout(function() { + wx.navigateBack({ + delta: 1, + }) + }, 2000) + }, err => { + this.data.isUnClick = false; + }) + }, err => { + this.data.isUnClick = false; + + }) + + } +}) \ No newline at end of file diff --git a/pages/withdrawal/index.json b/pages/withdrawal/index.json new file mode 100644 index 0000000..a67b89b --- /dev/null +++ b/pages/withdrawal/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "header": "/component/header/header" + } +} \ No newline at end of file diff --git a/pages/withdrawal/index.wxml b/pages/withdrawal/index.wxml new file mode 100644 index 0000000..25aae38 --- /dev/null +++ b/pages/withdrawal/index.wxml @@ -0,0 +1,27 @@ + +
+ + + + 持卡人 + + + + 银行 + + + + 银行卡卡号 + + + + + 提现金额 + + + + + 可提现余额为 {{money}} + 确认提现 + + \ No newline at end of file diff --git a/pages/withdrawal/index.wxss b/pages/withdrawal/index.wxss new file mode 100644 index 0000000..756878f --- /dev/null +++ b/pages/withdrawal/index.wxss @@ -0,0 +1,79 @@ +/* pages/withdrawal/index.wxss */ +.container { + min-height: calc(100vh - 190rpx); + padding: 30rpx; + padding-top: 190rpx; +} + +.box { + background: #1a191e; + border-radius: 20rpx; +} + +.box .cell { + display: flex; + justify-content: space-between; + align-items: center; + height: 90rpx; + padding: 0 20rpx; + border-bottom: 2rpx solid #212025; + font-size: 24rpx; + color: rgba(255, 255, 255, 0.6); +} + +.box .cell.unLine { + border: none; +} + +.box .cell>input { + flex: 1; + margin-left: 20rpx; + color: #FFF; + text-align: right; +} + +.box.bottom { + padding: 50rpx; + margin-top: 30rpx; +} + +.box .label { + font-size: 24rpx; + color: #FFF; + margin-top: 10rpx; +} + +.box .input-box { + display: flex; + /* align-items: center; */ + margin-top: 60rpx; + margin-bottom: 10rpx; + border-bottom: 2rpx solid #212025; + color: #FFF; + font-size: 30rpx; + font-weight: bold; +} + +.box .input-box>input { + height: 70rpx; + font-size: 52rpx; + font-weight: bold; + margin-bottom: 20rpx; + margin-left: 20rpx; +} + +.box .btn-box { + height: 80rpx; + margin: 60rpx 20rpx 20rpx 20rpx; + background: #ffda2e; + color: #1a191e; + border-radius: 40rpx; + line-height: 80rpx; + text-align: center; + font-size: 28rpx; +} + +.message { + font-size: 24rpx; + color: rgba(255, 255, 255, 0.6); +} \ No newline at end of file diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..9114597 --- /dev/null +++ b/project.config.json @@ -0,0 +1,58 @@ +{ + "description": "项目配置文件。", + "packOptions": { + "ignore": [] + }, + "setting": { + "urlCheck": false, + "es6": true, + "enhance": false, + "postcss": true, + "preloadBackgroundData": false, + "minified": true, + "newFeature": true, + "coverView": true, + "nodeModules": false, + "autoAudits": false, + "showShadowRootInWxmlPanel": true, + "scopeDataCheck": false, + "uglifyFileName": false, + "checkInvalidKey": true, + "checkSiteMap": true, + "uploadWithSourceMap": true, + "compileHotReLoad": false, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + }, + "useIsolateContext": true, + "useCompilerModule": true, + "userConfirmedUseCompilerModuleSwitch": false + }, + "compileType": "miniprogram", + "libVersion": "2.10.2", + "appid": "wx73eb8a9ed10a029d", + "projectname": "%E6%99%BA%E6%85%A7%E4%BA%91%E9%A6%86", + "isGameTourist": false, + "simulatorType": "wechat", + "simulatorPluginLibVersion": {}, + "condition": { + "search": { + "current": -1, + "list": [] + }, + "conversation": { + "current": -1, + "list": [] + }, + "game": { + "currentL": -1, + "list": [] + }, + "miniprogram": { + "current": -1, + "list": [] + } + } +} \ No newline at end of file diff --git a/sitemap.json b/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/utils/api.js b/utils/api.js new file mode 100644 index 0000000..1c1e35d --- /dev/null +++ b/utils/api.js @@ -0,0 +1,435 @@ +//testURL +//const BASE_URL = 'http://2t716830p2.zicp.vip'; +//prodURL +const BASE_URL = 'https://api.hongyutiyu.top'; +// const platformId = 1; +import { + getCurrentPageUrl +} from './util.js' + +function isUnLogin() { + wx.setStorageSync('history', getCurrentPageUrl()); + wx.removeStorageSync('accessToken'); + wx.redirectTo({ + url: '/pages/login/index', + }) +} + +function buildURL(url, needToken) { + let token = wx.getStorageSync('accessToken'); + + if (!needToken) { + return token ? url + (url.indexOf('?') >= 0 ? '&' : '?') + "access_token=" + token : url + } + + if (!token) { + // wx.redirectTo({ + // url: '/pages/login/index', + // }) + isUnLogin(); + return; + } + return url + (url.indexOf('?') >= 0 ? '&' : '?') + "access_token=" + token; +} + +export function fetchPost(url, params, needToken, multiple) { + url = buildURL(url, needToken); + + // params.platformId = platformId; + + // 如果url不存在,返回错误 + if (!url) { + return new Promise((resolve, reject) => { + reject(); + }) + } + + console.log("网络请求", url, params); + + // 如果上传图片 + if (multiple) { + return new Promise((resolve, reject) => { + wx.uploadFile({ + url: BASE_URL + url, + filePath: params.filePath, + name: 'image', + formData: {}, + success: function(response) { + console.log(response.data); + let res = JSON.parse(response.data); + console.log(res); + if (response.statusCode == 200) { + if (res.err_code == 0) { + // wx.hideLoading(); + resolve(res); + } else { + if (res.err_code == 10003 || res.err_code == 10006 || res.err_code == 20006) { + // wx.removeStorageSync('accessToken'); + // wx.redirectTo({ + // url: '/pages/login/index', + // }) + isUnLogin(); + reject(res); + return; + } else if (res.err_code == 20005) { + wx.removeStorageSync('accessToken'); + wx.removeStorageSync('history'); + wx.hideLoading(); + wx.showToast({ + title: res.err_msg, + icon: 'none', + duration: 2000 + }) + reject(res); + } else { + wx.hideLoading(); + wx.showToast({ + title: res.err_msg, + icon: 'none', + duration: 2000 + }) + reject(res); + } + } + } else { + wx.hideLoading(); + wx.showToast({ + title: '网络错误', + icon: 'none', + }) + reject(response); + } + }, + fail: function(err) { + console.log(err); + wx.hideLoading(); + wx.showToast({ + title: '网络错误', + icon: 'none', + }) + reject(response); + }, + }) + }) + } + + // 获取POST数据 + return new Promise((resolve, reject) => { + wx.request({ + url: BASE_URL + url, + data: params, + header: { + 'content-type': 'application/x-www-form-urlencoded' + }, + method: 'POST', + success: function(res) { + console.log("POST返回数据", url,res); + if (res.data.err_code == 0) { + wx.hideLoading(); + resolve(res.data); + } else { + if (res.data.err_code == 10003 || res.data.err_code == 10006 || res.data.err_code == 20006) { + // wx.removeStorageSync('accessToken'); + // wx.redirectTo({ + // url: '/pages/login/index', + // }) + isUnLogin(); + reject(res); + return; + } else if (res.data.err_code == 30022) { + reject(res); + } else if (res.data.err_code == 20005) { + wx.removeStorageSync('accessToken'); + wx.removeStorageSync('history'); + wx.hideLoading(); + wx.showToast({ + title: res.data.err_msg, + icon: 'none', + duration: 2000 + }) + reject(res); + } else { + wx.hideLoading(); + wx.showToast({ + title: res.data.err_msg, + icon: 'none', + duration: 2000 + }) + reject(res); + } + + } + }, + fail: function(res) { + wx.hideLoading(); + wx.showToast({ + title: '网络错误', + icon: 'none', + duration: 2000 + }) + reject(res); + + }, + }) + }) +} + +// get请求 +export function fetchGet(url, params, needToken) { + url = buildURL(url, needToken); + + if (!url) { + return new Promise((resolve, reject) => { + reject(); + }) + } + // params.platformId = platformId; + + return new Promise((resolve, reject) => { + wx.request({ + url: BASE_URL + url, + data: params, + method: 'GET', + success: function(res) { + console.log("GET返回数据", url, res); + if (res.statusCode == 200) { + if (res.data.err_code == 0) { + wx.hideLoading(); + resolve(res.data); + } else { + if (res.data.err_code == 10003 || res.data.err_code == 10006 || res.data.err_code == 20006) { + isUnLogin(); + reject(res); + return; + } else if (res.data.err_code == 20005) { + wx.removeStorageSync('accessToken'); + wx.removeStorageSync('history'); + wx.hideLoading(); + wx.showToast({ + title: res.data.err_msg, + icon: 'none', + duration: 2000 + }) + reject(res); + } else { + wx.hideLoading(); + wx.showToast({ + title: res.data.err_msg, + icon: 'none', + duration: 2000 + }) + reject(res); + } + } + } else { + wx.hideLoading(); + reject(res) + wx.showToast({ + title: '网络错误', + icon: 'none', + duration: 2000 + }) + } + }, + fail: function(res) { + wx.hideLoading(); + reject(res) + wx.showToast({ + title: '网络错误', + icon: 'none', + duration: 2000 + }) + }, + }) + }) +} + +// 暴露接口 +export default { + /** + * 公告 + */ + // 首页公告 + announcements(params) { + return fetchGet('/announcements', params, false); + }, + // 公告详情 + announcementDetail(params) { + return fetchGet('/announcement/detail', params, false); + }, + + /** + * 场馆 + */ + // 场馆列表 + venues(params) { + return fetchGet('/venues', params, false); + }, + // 场馆列表详情 + venueDetail(params) { + return fetchPost('/venue/detail', params, false); + }, + // 预约课程时间显示 + venueLessonShow(params) { + return fetchGet('/venue/lesson/show', params, false); + }, + // 健身馆对应时间的课程 + venueLessonDate(params) { + return fetchPost('/venue/lesson/date', params, false); + }, + // 课程详情 + venueLessonDetail(params) { + return fetchPost('/venue/lesson/detail', params, false); + }, + // 确认订单页面 + venueLessonOrder(params) { + return fetchPost('/venue/lesson/order', params, true); + }, + // 预约课程(会员卡) + memberLessonTicketOrderMemberCard(params) { + return fetchPost('/member/lesson/ticket/order/memberCard', params, true); + }, + // 预约课程(微信支付) + memberLessonTicketOrderWX(params) { + return fetchPost('/member/lesson/ticket/order/wx', params, true); + }, + // 篮球馆我要进场 + venueJoin(params) { + return fetchGet('/venue/join', params, true); + }, + + /** + * 个人中心 + */ + // 常见问题 + faqs(params) { + return fetchGet('/faqs', params, false); + }, + // 个人中心 + memberCenter(params) { + return fetchPost('/member/center', params, true); + }, + // 关于我们 + aboutUs(params) { + return fetchGet('/about/uss', params, false); + }, + // 上传图像 + uploadAvatar(params) { + return fetchPost('/upload/avatar', params, true, true); + }, + // 个人信息 + memberInformation(params) { + return fetchPost('/member/information', params, true); + }, + // 修改个人信息 + memberUpdateInformation(params) { + return fetchPost('/member/update/information', params, true); + }, + // 充值界面 + recharges(params) { + return fetchGet('/recharges', params, true); + }, + // 我的预约 + memberLessonTicketsReserve(params) { + return fetchPost('/member/lesson/tickets/reserve', params, true); + }, + // 预约详情页 + memberLessonTicketsDetail(params) { + return fetchPost('/member/lesson/tickets/detail', params, true); + }, + // 取消预约 + memberLessonTicketsCancel(params) { + return fetchPost('/member/lesson/tickets/cancel', params, true); + }, + // 我的会员卡 + memberVenueCard(params) { + return fetchPost('/member/venue/card', params, true) + }, + + /** + * 登录注册 + */ + // 发送登录验证码 + smsLogin(params) { + return fetchPost('/member/sms/login', params, false); + }, + // 手机验证码登录 + memberLogin(params) { + return fetchPost('/member/login', params, false); + }, + // 微信快捷登录 + memberLoginWX(params) { + return fetchPost('/member/login/wx', params, false); + }, + // 发送注册验证码 + smsRegister(params) { + return fetchPost('/member/sms/register', params, false); + }, + // 手机验证码注册 + memberRegister(params) { + return fetchPost('/member/register', params, false); + }, + // 微信绑定手机号 + memberLoginWXPhone(params) { + return fetchPost('/member/login/wx/phone', params, false); + }, + // 发送修改手机验证码 + memberSmsUpdate(params) { + return fetchPost('/member/sms/update', params, false); + }, + + /** + * 支付 + */ + // 购买会员卡 + memberCardOrderCreate(params) { + return fetchPost('/member/card/order/create', params, true); + }, + // 充值 + orderRecharge(params) { + return fetchPost('/order/recharge', params, true); + }, + + // 首页地图查询场馆 + venuesMap(params) { + return fetchGet('/venues/map', params, false); + }, + + // 协议 + protocols(params) { + return fetchGet('/protocols', params, false) + }, + + // 上传人脸识别图片 + memberFaceInfo(params) { + return fetchPost('/member/face/info', params, true, true); + }, + // 添加银行卡 + memberBankBind(params) { + return fetchPost('/member/bank/bind', params, true); + }, + // 提现申请 + memberWithdrawApply(params) { + return fetchPost('/member/withdraw/apply', params, true); + }, + // 我的账单 + memberMoneyLogBill(params) { + return fetchPost('/member/money/log/bill', params, true); + }, + // 签到 + memberLessonTicketsSing(params) { + return fetchPost('/member/lesson/tickets/sing', params, true); + }, + // 人脸信息 + memberFaceInfoInfos(params) { + return fetchPost('/member/face/info/infos', params, true); + }, + // 修改默认会员卡 + memberVenueUpdateCard(params) { + return fetchGet('/member/venue/updateCard', params, true); + }, + // 已用手机号登录,支付,再跳转微信登录 + memberLoginCheckWx(params) { + return fetchPost('/member/login/checkWx', params, true); + } +} \ No newline at end of file diff --git a/utils/pay.js b/utils/pay.js new file mode 100644 index 0000000..c5d7ce5 --- /dev/null +++ b/utils/pay.js @@ -0,0 +1,63 @@ +export function pay(body) { + return new Promise((resolve, reject) => { + console.log(body) + wx.requestPayment({ + timeStamp: body.time_stamp, + nonceStr: body.nonce_str, + package: 'prepay_id=' + body.prepay_id, + signType: body.sign_type, + paySign: body.pay_sign, + success: function(res) { + wx.showToast({ + title: '支付成功', + icon: 'success', + }) + resolve(res); + }, + fail: function(res) { + console.log(res); + reject(res); + }, + }) + }) +} + +export function payWxLoing(body) { + console.log(body) + + const app = getApp(); + return new Promise((resolve, reject) => { + if (!body.userInfo) { + reject(body); + return; + } + wx.login({ + success: function(res) { + wx.showLoading({ + title: '加载中...', + mask: true, + }) + app.$api.memberLoginCheckWx({ + avatar: body.userInfo.avatarUrl, + code: res.code, + nickname: body.userInfo.nickName + }).then(obj => { + wx.setStorageSync('accessToken', obj.authorization.accessToken); + resolve(res); + }) + }, + fail: function(res) { + reject(res); + }, + }) + }) +} + +export default { + wxPay(body) { + return pay(body); + }, + payWxLoing(body) { + return payWxLoing(body); + } +} \ No newline at end of file diff --git a/utils/util.js b/utils/util.js new file mode 100644 index 0000000..7218c71 --- /dev/null +++ b/utils/util.js @@ -0,0 +1,32 @@ +const formatTime = date => { + const year = date.getFullYear() + const month = date.getMonth() + 1 + const day = date.getDate() + const hour = date.getHours() + const minute = date.getMinutes() + const second = date.getSeconds() + + return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') +} + +const formatNumber = n => { + n = n.toString() + return n[1] ? n : '0' + n +} + +// 获取当前页url +const getCurrentPageUrl = () => { + let pages = getCurrentPages(); + let currentPage = pages[pages.length - 1]; + let url = '/' + currentPage.route; + let options = currentPage.options; + for (let key in options) { + url += (url.indexOf('?') >= 0 ? '&' : '?') + `${key}=${options[key]}`; + } + return url; +} + +module.exports = { + formatTime: formatTime, + getCurrentPageUrl: getCurrentPageUrl +}