Commit 2e3dab1c by tangjiale

更新代码

parent aad334a3
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-01-13 17:47:44
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-16 14:24:19
* @LastEditTime: 2022-06-17 15:03:36
*/
// wx.setStorageSync('host', 'https://sdb.youchengzhang.cn/'); //正式环境
// wx.setStorageSync('host', 'https://test.xiaobentiyu.cn'); //测试环境
......@@ -20,12 +20,12 @@ const plugins = requirePlugin('tfjsPlugin')
wx.setStorageSync('index', 0);
App({
onLaunch: function () {
let token = wx.getStorageSync("token")
if(!token){
wx.reLaunch({
url:'/subPages/login/login/index'
})
}
// let token = wx.getStorageSync("token")
// if(!token){
// wx.reLaunch({
// url:'/subPages/login/login/index'
// })
// }
this.autoUpdate();
// 获取手机系统信息
wx.getSystemInfo({
......@@ -109,10 +109,11 @@ App({
},
//定义全局配置跳转事件,当切换身份时指定跳转到对应身份的首页
checkUserType(){
//employ机构职员 parent家长 visitor游客 Unknown未知
let type = wx.getStorageSync('peopleType')
if(type == 'Teacher'){
wx.switchTab({url:'/pages/index/index'})
}else if(type == 'School'){
if(type == 'employ'){
wx.switchTab({url:'/pages/organ-index/organ-index'})
}else{
wx.switchTab({url:'/pages/index/index'})
}
},
......
{
"pages": [
"pages/index/index",
"pages/organ-my/organ-my",
"pages/organ-index/organ-index",
"pages/my/my",
"pages/sport/sport"
],
......@@ -9,7 +9,9 @@
{
"root": "subPages/organ",
"name": "organ",
"pages": []
"pages": [
"course-list/course-list"
]
},
{
"root": "subPages/course",
......@@ -74,7 +76,11 @@
"list": [
{
"pagePath": "pages/index/index",
"text": "选课"
"text": "首页"
},
{
"pagePath": "pages/organ-index/organ-index",
"text": "首页"
},
{
"pagePath": "pages/sport/sport",
......@@ -87,7 +93,9 @@
]
},
"usingComponents": {
"van-swipe-cell": "@vant/weapp/swipe-cell/index"
"van-swipe-cell": "@vant/weapp/swipe-cell/index",
"van-field": "@vant/weapp/field/index",
"van-sticky": "@vant/weapp/sticky/index"
},
"requiredBackgroundModes": [
"audio"
......
......@@ -10,6 +10,7 @@ Component({
gender:'',
height:'',
weight:'',
birthday:'',
relationShip:''
},
......@@ -33,6 +34,7 @@ Component({
this.data.stuinfo.stuId = userInfo.stuId
this.data.stuinfo.name = userInfo.stuName
this.data.stuinfo.gender = userInfo.stuGender
this.data.stuinfo.birthday = userInfo.birthday
this.data.stuinfo.relationShip = userInfo.relation
let idx = this.data.gxList.findIndex(v => v.value == userInfo.relation)
this.setData({stuinfo:this.data.stuinfo,gxIndex:idx,randerIdx:userInfo.stuGender==1?0:1})
......@@ -49,6 +51,10 @@ Component({
this.data.stuinfo.gender = this.data.randeList[value].value
this.setData({stuinfo:this.data.stuinfo,randerIdx:value})
},
pinkerDate(e){
this.data.stuinfo.birthday = e.detail.value
this.setData({stuinfo:this.data.stuinfo})
},
changeGx(e){
let {value} = e.detail
this.data.stuinfo.relationShip = this.data.gxList[value].value
......@@ -66,6 +72,10 @@ Component({
wx.showToast({title: '请选择孩子性别',icon: 'none',});
return
}
if(!param.birthday){
wx.showToast({title: '请选择出生日期',icon: 'none',});
return
}
if(!param.height){
wx.showToast({title: '请输入孩子身高',icon: 'none',});
return
......@@ -88,11 +98,23 @@ Component({
// /px/user/bindStu
},
wxGetUserInfo(){
API.getData('/px/user/getUserInfo', { }, function (res) {
if(res.code == 200){
wx.setStorageSync('userInfo',res.data)
}
});
wx.login({
success: res => {
API.getData('/wx/user/wx7d7fbc0e6746baf5/auth', {
code: res.code
}, function(res) {
if(res.code == 200){
API.getData('/px/user/getUserInfo', { }, function (ress) {
if(ress.code == 200){
wx.setStorageSync('userInfo',ress.data)
}
}, function () {
// wx.hideLoading()
});
}
})
}
})
},
},
......
......@@ -29,6 +29,18 @@
</view>
<view class="input-item">
<view class="input-t">出生日期</view>
<view class="input-bg">
<picker class="name" disabled="{{stuinfo.birthday}}" mode="date" bindchange="pinkerDate">
<view class="flex-s">
<view class="sex {{!stuinfo.birthday ? 'placeholder-c':''}}">{{stuinfo.birthday || '请选择出孩子出生日期'}}</view>
<xb-icon type="icon-icon_pull-down" class="change-icon" size="32" color="#000000"></xb-icon>
</view>
</picker>
</view>
</view>
<view class="input-item">
<view class="input-t">孩子身高</view>
<view class="input-bg">
<view class="flex-s">
......
......@@ -12,7 +12,7 @@
left: 0;
right: 0;
bottom: 0;
z-index: 99999;
z-index: 999;
background: #000;
display: none
}
......@@ -30,7 +30,7 @@
-webkit-transform-origin: center;
transform-origin: center;
transition: all .4s ease;
z-index: 100002;
z-index: 1111;
opacity: 0
}
......
......@@ -3,17 +3,17 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 11:29:18
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-14 11:35:23
* @LastEditTime: 2022-06-17 17:02:00
*/
const organTab = [
{
pagePath: "/pages/index/index",
pagePath: "/pages/organ-index/organ-index",
type:'page',
iconPath: "/tabBarImg/kc-tab.png",
selectedIconPath: "/tabBarImg/kc-tab-active.png",
text: "首页"
}, {
pagePath: "/pages/mine/mine",
pagePath: "/pages/my/my",
type:'page',
iconPath: "/tabBarImg/my-tab.png",
selectedIconPath: "/tabBarImg/my-tab-active.png",
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 16:44:43
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-16 15:35:33
* @LastEditTime: 2022-06-17 17:14:41
*/
var app = getApp();
var API = require("../../utils/request.js");
......@@ -61,14 +61,15 @@ Page({
},
onShow: function () {
let userInfo = wx.getStorageSync("userInfo")
this.setData({userInfo:userInfo || {}})
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().upDateBar()
this.getTabBar().setData({
selected: 2
selected: userInfo.peopleType == 'employ' ? 1 : 2
})
}
let userInfo = wx.getStorageSync("userInfo")
this.setData({userInfo:userInfo || {}})
//是否绑定孩子
if(userInfo.stuId){
......
<view class="mine" wx:if="{{userInfo}}">
<view class="mine-top" catchtap="setAvartar">
<image class="mine-bg" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/mine_bg.png"></image>
<view class="sport-main-bg"></view>
<view class="mine-top-content">
<view class="user-info">
<image class="user-avatar" wx:if="{{userInfo.gender == 1}}" src="https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/boy_default.png"></image>
......@@ -14,7 +15,10 @@
</view>
<view class="user-type" wx:if="{{userInfo.peopleType == 'parent'}}">家长</view>
<view class="teacher-type" wx:if="{{userInfo.peopleType == 'visitor'}}">游客</view>
<view class="jg-type" wx:if="{{userInfo.peopleType == 'employ'}}">管理员</view>
<view class="flex-c">
<view class="jg-type" wx:if="{{userInfo.peopleType == 'employ'}}">管理员</view>
<text class="place-name">{{userInfo.dptNames || ''}}</text>
</view>
</view>
</view>
<block wx:if="{{userInfo.stuId && childList && childList.length}}">
......
......@@ -17,6 +17,14 @@ page {
height: 360rpx;
z-index: -1;
}
.sport-main-bg{
position: absolute;
top: 360rpx;
left: 0;
width: 100%;
height: 216rpx;
background: linear-gradient(#F8F8F8, #FFFFFF);
}
.mine-top-content {
position: relative;
......@@ -41,7 +49,17 @@ page {
margin-left: 20rpx;
width: 522rpx;
}
.flex-c{
display: flex;
align-items: center;
}
.place-name{
font-size: 22rpx;
margin-left: 10rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.3);
}
.info-name-msg,
.info-name {
display: flex;
......@@ -111,7 +129,8 @@ page {
}
.jg-type{
max-width: 96rpx;
flex: none;
padding: 0px 10rpx;
height: 32rpx;
line-height: 32rpx;
text-align: center;
......@@ -641,7 +660,6 @@ padding-right: 0rpx;
.sport-main{
width: 100%;
height: 216rpx;
background: linear-gradient(#F8F8F8, #FFFFFF);
}
.mine-main{
......
/*
* @Author: tangjiale
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 14:15:22
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-18 17:30:37
*/
var API = require("../../utils/request");
Page({
/**
* 页面的初始数据
*/
data: {
navT: wx.getMenuButtonBoundingClientRect().top,
navH:wx.getMenuButtonBoundingClientRect().bottom - wx.getMenuButtonBoundingClientRect().top,
areaActive:0,
areaList:[
{name:'全部校区',value:''},{name:'湖南校区',value:'32'},{name:'长沙星沙体育飞跃机构',value:'32'},{name:'霍华德篮球迅雷',value:'32'}
], //所属校区列表
popupShow:false,
listActive:2, //1正式课 2体验课
list:[],
page:0,
loading:false,
finish:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
//1正式课 2体验课
this.setData({listActive:2,page:0,list:[],loading:false,finish:false},()=>{
this.queryCourseList()
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().upDateBar()
this.getTabBar().setData({
selected: 0
})
}
},
goJump(e){
let {link} = e.currentTarget.dataset
switch (Number(link)){
case 1: //体验课订单
wx.navigateTo({
url: '/subPages/organ/course-list/course-list?courseType=2'
})
break
case 2: //班课报名
wx.navigateTo({
url: '/subPages/organ/course-list/course-list?courseType=1'
})
break
case 3: //教练消课
break
case 3: //课时预警
break
}
},
changePopup(){
this.setData({popupShow:!this.data.popupShow})
},
changeArea(e){
let {index,data} = e.currentTarget.dataset
this.setData({areaActive:index,popupShow:false})
},
changeList(e){
let {type} = e.currentTarget.dataset
this.setData({listActive:type,page:0,list:[],loading:false,finish:false},()=>{
this.queryCourseList()
})
},
queryCourseList(){
let that = this
this.data.page ++
this.data.loading = true
API.getData('/px/course/getMobileCourseList', {
page:that.data.page,
size:10,
type:that.data.listActive, //课程类型(1:正式课,2:体验课)
}, (res) => {
if(res && res.data && res.data.length){
res.data.forEach(item => {
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.map(v => v.empName)).join('、') || ''
})
}
that.data.loading = true
that.data.finish = res.data.length < 10
that.data.list = that.data.list.concat(res.data || [])
that.setData({
page:that.data.page,
finish:that.data.finish,
loading:that.data.loading,
list:that.data.list
})
});
},
onReachBottom:function (){
if(this.data.loading && this.data.finish) return
this.queryCourseList()
},
gotoDetail(e){
let {id} = e.currentTarget.dataset
wx.navigateTo({
url: '/subPages/course/detail/detail?id=' + id,
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.onShow()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"navigationStyle": "custom",
"usingComponents": {
"t-popup":"../../components/t-popup/index"
}
}
\ No newline at end of file
<!-- 机构 我的页面 -->
<view class="page-bg">
<van-sticky z-index="99">
<view class="nav-bg" style="padding-top:{{navT}}px">
<view class="flex-c" style="height:{{navH}}px" bindtap="changePopup">
<view class="head-tabs">{{areaList[areaActive].name}}</view>
<image class="tab-icon" wx:if="{{!popupShow}}" src="/images/organ/btm-arror.png" />
<image class="tab-icon" wx:else src="/images/organ/top-arror.png" />
</view>
</view>
<view class="tab-content">
<!-- 菜单 -->
<view class="tabs-flex">
<view class="tabs-item" data-link="1" bindtap="goJump">
<image class="tabs-img" src="/images/organ/index-tab1.png"/>
<view class="tabs-text">体验课订单</view>
</view>
<view class="tabs-item" data-link="2" bindtap="goJump">
<image class="tabs-img" src="/images/organ/index-tab2.png"/>
<view class="tabs-text">班课报名</view>
</view>
<view class="tabs-item" data-link="3" bindtap="goJump">
<image class="tabs-img" src="/images/organ/index-tab3.png"/>
<view class="tabs-text">教练消课</view>
</view>
<view class="tabs-item" data-link="4" bindtap="goJump">
<image class="tabs-img" src="/images/organ/index-tab4.png"/>
<view class="tabs-text">课时预警</view>
</view>
</view>
<!-- 统计数据 -->
<view class="count-flex">
<view class="count-item">
<view class="count-title">体验课订购</view>
<view class="count-value">20</view>
</view>
<view class="count-item">
<view class="count-title">班课报名</view>
<view class="count-value">20</view>
</view>
<view class="count-item">
<view class="count-title">预警学生</view>
<view class="count-value">20</view>
</view>
<view class="count-item">
<view class="count-title">昨日新增</view>
<view class="count-value">20</view>
</view>
</view>
</view>
<view class="line"></view>
<view class="btm-tabs-bg">
<view class="list-flex">
<view class="list-tabs {{listActive==2?'list-tabs-active':''}}" data-type="2" bindtap="changeList">体验课</view>
<view class="list-tabs {{listActive==1?'list-tabs-active':''}}" data-type="1" bindtap="changeList">正式班课</view>
</view>
</view>
<!-- 头部校区切换弹窗 -->
<t-popup show="{{popupShow}}" closeOnClickOverlay="{{false}}" type="top">
<view class="popup-bg" style="padding-top:{{navT + navH + 7}}px">
<view class="area-item {{areaActive == index?'area-item-active':''}}" bindtap="changeArea"
data-index="{{index}}" data-data="{{item}}" wx:for="{{areaList}}">{{item.name}}</view>
</view>
</t-popup>
</van-sticky>
<view class="list-bg">
<block wx:if="{{list && list.length}}">
<view class="course-bg" wx:for="{{list}}" data-id="{{item.id}}" bindtap="gotoDetail">
<view class="course-img">
<image class="course-img" src="{{item.poster}}" mode="aspectFill"></image>
<view class="fexed-num" wx:if="{{listActive==2}}">{{item.peopleNum || 0}}人已体验</view>
<view class="fexed-num" wx:if="{{listActive==1}}">已购 {{item.peopleNum || 0}}人</view>
</view>
<view class="course-info">
<view class="course-info-h">
<view class="course-title">{{item.name}}</view>
<view class="course-tag">
<view class="tag-item {{item.courseStep==1?'xx-color':item.courseStep==2?'cz-color':'gz-color'}}">{{item.courseStep==1?'小学':item.courseStep==2?'初中':'高中'}}组</view>
<view class="tag-item">{{item.classHour}}课时</view>
<view class="tag-item">{{['','基础班','提高班','精英班','赛事班'][item.leveId]}}</view>
</view>
</view>
<view class="btm-text">
<view class="empNames-w">授课教练 {{item._empNames}}</view>
</view>
</view>
</view>
</block>
</view>
</view>
\ No newline at end of file
.page-bg{
overflow: hidden;
min-height: calc(100vh - 122rpx);
width: 100%;
background-color: #fff;
padding-bottom: calc(122rpx + env(safe-area-inset-bottom));
}
.flex-c{
display: flex;
align-items: center;
}
.nav-bg{
position: relative;
z-index: 9999;
width: 100%;
background-color: #fff;
padding-left: 30rpx;
}
.head-tabs{
position: relative;
max-width: 266rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 34rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
margin-right: 10rpx;
}
.tab-content{
padding: 30rpx;
background-color: #fff;
}
.tabs-flex{
display: flex;
align-items: center;
}
.tabs-item{
flex: 1;
}
.tabs-img{
display: block;
margin: 0rpx auto;
height: 108rpx;width: 108rpx;
}
.tabs-text{
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #000000;
margin-top: 10rpx;
text-align: center;
}
.count-flex{
display: flex;
margin-top: 40rpx;
padding: 30rpx 26rpx;
background: linear-gradient(180deg, #F5F5F5 0%, #F8F8F8 100%);
border-radius: 24rpx;
}
.count-item{
flex: 1;
}
.count-title{
text-align: center;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.count-value{
margin-top: 4rpx;
text-align: center;
font-size: 44rpx;
font-family: 'Number';
font-weight: bold;
color: #000000;
}
.line{
height: 20rpx;
width: 100%;
background-color: #f5f5f5;
}
.list-bg{
background-color: #fff;
padding: 0rpx 30rpx;
width: calc(100% - 60rpx);
}
.btm-tabs-bg{
padding: 0rpx 30rpx;
background-color: #fff;
}
.list-flex{
display: flex;
justify-content: space-between;
}
.list-tabs{
text-align: center;
padding: 24rpx 0rpx;
width: calc((100% - 62rpx) / 2);
border-bottom: 6rpx solid #fff;
}
.list-tabs-active{
font-weight: bold;
color: #FF811E !important;
border-color: #FF811E !important;
}
.course-bg{
width: 100%;
margin-top: 30rpx;
display: flex;
align-items: center;
}
.course-img{
position: relative;
width: 300rpx;
height: 186rpx;
border-radius: 24rpx;
object-fit: cover;
object-position: center;
}
.fexed-num{
position: absolute;
left: 10rpx;
bottom: 10rpx;
padding: 6rpx 16rpx;
border-radius: 22rpx;
background-color: rgba(0,0,0,0.24);
font-size: 22rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
}
.course-info{
height: 186rpx;
width: calc(100% - 320rpx);
margin-left: 20rpx;
}
.course-title{
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #000000;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.course-info-h{
height: 155rpx;
}
.course-tag{
margin-top: 10rpx;
display: flex;
align-items: center;
}
.tag-item{
margin-right: 10rpx;
padding: 4rpx 10rpx;
background: #F8F8F8;
border-radius: 8rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.xx-color{
background: rgba(45, 137,255, 0.12) !important;
color: #2D89FF !important;
}
.cz-color{
background: rgba(0, 187,104, 0.12) !important;
color: #00BB68 !important;
}
.gz-color{
background: rgba(38, 122,202, 0.12) !important;
color: #267ACA !important;
}
.btm-text{
display: flex;
justify-content: space-between;
align-items: center;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.3);
}
.waterfall-flex{
display: flex;
justify-content: space-between;
}
.flex-item{
position: relative;
overflow: hidden;
width: calc((100% - 22rpx) / 2);
}
.flex-item:nth-child(2n){
margin-left: 22rpx;
}
.w-course{
position: relative;
width: 100%;
margin: 22rpx 0rpx 18rpx 0rpx;
/* margin: 22rpx 0rx 18rpx 0rpx; */
}
.w-course-img{
position: relative;
height: 208rpx;
width: 100%;
object-fit: cover;
object-position: center;
border-radius: 24rpx;
}
.w-course-title{
position: relative;
margin-top: 20rpx;
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.w-empNames{
margin-top: 20rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.empNames-w{
position: relative;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* -------------------------- */
.popup-bg{
width: 100vw;
background-color: #fff;
padding-bottom: 30rpx;
border-radius: 0px 0px 24rpx 24rpx;
}
.area-item{
width: 100%;
font-size: 30rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
text-align: center;
padding: 24rpx 0rpx;
}
.tab-icon{
height: 36rpx;width: 36rpx;
}
.area-item-active{
background: #FAF8F6;
font-weight: bold !important;
color: #FF811E !important;
}
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!-- 机构 我的页面 -->
<view class="">
机构-我的
</view>
\ No newline at end of file
/* pages/orange-my/organ-my.wxss */
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 16:45:35
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-16 14:59:17
* @LastEditTime: 2022-06-18 14:30:24
*/
var API = require("../../utils/request");
var App = getApp();
......
......@@ -13,43 +13,43 @@
"miniprogram": {
"list": [
{
"name": "体验课订单列表",
"pathName": "subPages/course/attempt-list/attempt-list",
"name": "首页",
"pathName": "pages/organ-index/organ-index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "班课报名",
"pathName": "subPages/course/join-list/join-list",
"query": "",
"name": "",
"pathName": "subPages/course/detail/detail",
"query": "id=17094",
"launchMode": "default",
"scene": null
},
{
"name": "销课记录",
"pathName": "subPages/course/sales-list/sales-list",
"query": "",
"name": "",
"pathName": "subPages/course/pay-order/pay-order",
"query": "id=17094",
"launchMode": "default",
"scene": null
},
{
"name": "我的收藏",
"pathName": "subPages/course/collect-list/collect-list",
"name": "",
"pathName": "pages/my/my",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "运动",
"name": "",
"pathName": "pages/sport/sport",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/course/attempt-list/attempt-list",
"name": "机构-体验课订单",
"pathName": "subPages/organ/course-list/course-list",
"query": "",
"scene": null,
"launchMode": "default"
......
......@@ -2520,7 +2520,7 @@ Page({
grade = 3;
ppb_weight_val = userInfo.height || 110;
ppb_height_val = userInfo.weight || 40;
ppb_age_val = 10;
ppb_age_val = userInfo.age || 10;
// API.getData('/sch/member/getinfo', {}, (res)=> {
// console.log(res);
// if(res.code ==200){
......
......@@ -107,7 +107,7 @@
.course-price{
margin-left: 10rpx;
font-size: 44rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-family: 'Number';
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
......
......@@ -138,7 +138,7 @@ font-size: 24rpx;
display: flex;
margin-left: 10rpx;
font-size: 44rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-family: 'Number';
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-13 08:57:51
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-15 11:52:08
* @LastEditTime: 2022-06-18 15:11:26
*/
var API = require("../../../utils/request.js");
Page({
......@@ -15,7 +15,8 @@ Page({
detail:{},
showAll:false,
schoolActive:0
schoolActive:0,
peopleType:'',
},
/**
......@@ -29,6 +30,10 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
//peopleType 不同身份共用课程详情,但是employ机构职员没有部分功能
let peopleType = wx.getStorageSync('peopleType')
this.setData({peopleType:peopleType})
this.queryCourseDetail(this.options.id)
},
......
......@@ -28,7 +28,7 @@
<image class="detail-icon" src="../../../images/course/share-icon.png"></image>
<view>分享</view>
</button>
<view class="icon-text" bindtap="courseCollect">
<view class="icon-text" bindtap="courseCollect" wx:if="{{peopleType!='employ'}}">
<image wx:if="{{detail.hadCollect==2}}" class="detail-icon" src="/images/course/collect-icon.png"></image>
<image wx:if="{{detail.hadCollect==1}}" class="detail-icon" src="/images/course/collected-icon.png"></image>
<view>收藏</view>
......@@ -51,7 +51,7 @@
</view>
</picker>
</view>
<view class="call-bg" bindtap="callSchool" wx:if="{{detail.schoolList[schoolActive].tel}}">
<view class="call-bg" bindtap="callSchool" wx:if="{{detail.schoolList[schoolActive].tel && peopleType!='employ'}}">
<image class="call-icon" src="../../../images/course/call-icon.png"></image>
</view>
</view>
......@@ -64,7 +64,7 @@
</view>
</view>
<view class="fixed-btm flex-s">
<view class="fixed-btm flex-s" wx:if="{{peopleType!='employ'}}">
<view class="fixed-price red-c" wx:if="{{detail.type == 2}}"><text class="unit red-c">¥</text>{{detail.cost / 100}}</view>
<view class="fixed-btn {{detail.type == 1?'max-w':''}}" bindtap="gotoPay">{{detail.type==2?'立即抢购':'立即报名'}}</view>
</view>
......
......@@ -187,7 +187,7 @@
}
.fixed-price{
font-size: 60rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-family: 'Number';
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
......
......@@ -38,7 +38,7 @@
</view>
</block>
<block wx:if="{{!length && finish}}">
<block wx:if="{{!list.length && finish}}">
<empty></empty>
</block>
......
......@@ -107,7 +107,7 @@
.course-price{
margin-left: 10rpx;
font-size: 44rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-family: 'Number';
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-14 17:37:06
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-16 11:31:50
* @LastEditTime: 2022-06-18 14:02:50
*/
var API = require("../../../utils/request.js");
Page({
......@@ -17,7 +17,8 @@ Page({
params:{
stuName:'',
gender:'', //性别
releationShip:'', //关系
birthday:'', //出生日期
relationShip:'', //关系
schId:'', //所在校区
},
randeList:[{name:'男',value:1},{name:'女',value:2}],
......@@ -47,7 +48,8 @@ Page({
if(userInfo.stuId){
this.data.params.stuName = userInfo.stuName
this.data.params.gender = userInfo.stuGender
this.data.params.releationShip = userInfo.relation
this.data.params.relationShip = userInfo.relation
this.data.params.birthday = userInfo.birthday
let idx = this.data.gxList.findIndex(v => v.value == userInfo.relation)
this.setData({params:this.data.params,gxIndex:idx,randerIdx:userInfo.stuGender==1?0:1})
}
......@@ -72,7 +74,7 @@ Page({
},
changeGx(e){
let {value} = e.detail
this.data.params.releationShip = this.data.gxList[value].value
this.data.params.relationShip = this.data.gxList[value].value
this.setData({params:this.data.params,gxIndex:value})
},
changeXq(e){
......@@ -80,6 +82,10 @@ Page({
this.data.params.schId = this.data.detail.schoolList[value].id
this.setData({params:this.data.params,slIndex:value})
},
pinkerDate(e){
this.data.params.birthday = e.detail.value
this.setData({params:this.data.params})
},
inputName(e){
this.data.params.stuName = e.detail.value
......@@ -90,8 +96,6 @@ Page({
this.setData({params:this.data.params})
},
createOrder(){
// this.toPay({orderNo:'74d053a18af14a76a549956d48f539dc'})
// return
let param = this.data.params
if(!param.stuName){
wx.showToast({title: '请输入孩子姓名',icon: 'none',});
......@@ -101,7 +105,11 @@ Page({
wx.showToast({title: '请选择孩子性别',icon: 'none',});
return
}
if(!param.releationShip){
if(!param.birthday){
wx.showToast({title: '请选择出生日期',icon: 'none',});
return
}
if(!param.relationShip){
wx.showToast({title: '请选择与孩子关系',icon: 'none',});
return
}
......@@ -143,11 +151,17 @@ Page({
that.wxGetUserInfo()
that.toPay(res.data)
}else{
wx.showToast({
title: res.message,
duration: 2000,
icon: 'none'
});
if(res.message == 'hadUnPayOrder'){
wx.redirectTo({
url: '/subPages/course/attempt-list/attempt-list'
})
}else{
wx.showToast({
title: res.message,
duration: 2000,
icon: 'none'
});
}
}
})
},
......@@ -209,14 +223,22 @@ Page({
//如果当前身份为游客,报名课程或者订购体验课会自动给用户绑定小孩,身份转为家长,需查最新接口赋值
return
}
API.getData('/px/user/getUserInfo', { }, function (res) {
if(res.code == 200){
wx.setStorageSync('peopleType',res.data.peopleType)
wx.setStorageSync('userInfo',res.data)
}
}, function () {
// wx.hideLoading()
});
wx.login({
success: res => {
API.getData('/wx/user/wx7d7fbc0e6746baf5/auth', {
code: res.code
}, function(res) {
API.getData('/px/user/getUserInfo', { }, function (ress) {
if(ress.code == 200){
wx.setStorageSync('peopleType',ress.data.peopleType)
wx.setStorageSync('userInfo',ress.data)
}
}, function () {
// wx.hideLoading()
});
})
}
})
},
/**
......
......@@ -43,11 +43,22 @@
</view>
</view>
<view class="input-item">
<view class="input-t">出生日期</view>
<view class="input-bg">
<picker class="name" mode="date" bindchange="pinkerDate">
<view class="flex-s">
<view class="sex {{!params.birthday ? 'placeholder-c':''}}">{{params.birthday || '请选择出孩子出生日期'}}</view>
<xb-icon type="icon-icon_pull-down" class="change-icon" size="32" color="#000000"></xb-icon>
</view>
</picker>
</view>
</view>
<view class="input-item">
<view class="input-t">与孩子关系</view>
<view class="input-bg">
<picker class="name" bindchange="changeGx" value="{{gxIndex}}" range="{{gxList}}" range-key="name">
<view class="flex-s">
<view class="sex {{!params.releationShip ? 'placeholder-c':''}}">{{gxList[gxIndex].name || '请选择您与孩子的关系'}}</view>
<view class="sex {{!params.relationShip ? 'placeholder-c':''}}">{{gxList[gxIndex].name || '请选择您与孩子的关系'}}</view>
<xb-icon type="icon-icon_pull-down" class="change-icon" size="32" color="#000000"></xb-icon>
</view>
</picker>
......
......@@ -63,7 +63,7 @@ white-space: normal !important;
.price-t{
flex: none;
font-size: 48rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-family: 'Number';
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
......@@ -160,7 +160,7 @@ white-space: normal !important;
}
.fixed-price{
font-size: 60rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-family: 'Number';
font-weight: bold;
color: #FF4E4E;
}
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 15:52:31
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-15 18:40:48
* @LastEditTime: 2022-06-18 14:18:31
*/
var API = require("../../../utils/request.js");
var postData = {};
......@@ -35,7 +35,7 @@ Page({
code: res.code
}, function(res) {
wx.hideLoading();
console.log('/wx/user/auth', res);
console.log('/wx/user', res);
if(!res.data || res.data.code != 200) return
//根据用户类型来判断跳转页面
//employ机构职员 parent家长 visitor游客 Unknown未知
......@@ -46,15 +46,11 @@ Page({
wx.setStorageSync('peopleType',res.data.peopleType)
//获取用户微信相关的详细信息
that.wxGetUserInfo()
if(res.data.peopleType == 'parent'){
if(res.data.peopleType == 'employ'){
wx.reLaunch({
url: '/pages/index/index'
})
}else if(res.data.peopleType == 'employ'){
wx.reLaunch({
url: '/pages/index/index'
url: '/pages/organ-index/organ-index'
})
}else if(res.data.peopleType == 'visitor'){
}else {
wx.reLaunch({
url: '/pages/index/index'
})
......@@ -72,6 +68,8 @@ Page({
wxGetUserInfo(){
API.getData('/px/user/getUserInfo', { }, function (res) {
if(res.code == 200){
//TODO 开发阶段写死身份
// res.data.peopleType = 'employ'
wx.setStorageSync('userInfo',res.data)
}
});
......@@ -144,20 +142,17 @@ Page({
}
})
}
//TODO 开发阶段写死身份
// res.data.peopleType = 'employ'
wx.setStorageSync('token',res.data.token)
wx.setStorageSync('peopleType',res.data.peopleType)
//获取用户微信相关的详细信息
_this.wxGetUserInfo()
if(res.data.peopleType == 'parent'){
if(res.data.peopleType == 'employ'){
wx.reLaunch({
url: '/pages/index/index'
})
}else if(res.data.peopleType == 'employ'){
wx.reLaunch({
url: '/pages/index/index'
url: '/pages/organ-index/organ-index'
})
}else if(res.data.peopleType == 'visitor'){
}else {
wx.reLaunch({
url: '/pages/index/index'
})
......
/*
* @Author: tangjiale
* @eMail: 932055106@qq.com
* @Date: 2022-06-11 15:29:27
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-16 15:54:46
*/
var API = require("../../../utils/request.js")
Page({
data: {
......@@ -9,12 +16,12 @@ Page({
getData(){
var _this = this;
console.log("------12--------");
API.getDataAll('/api/miniapp/sys/config/register',{}, function (res) {
API.getDataAll('/px/user/getUserAgreement',{}, function (res) {
console.log(res);
_this.setData({
content: res.data.value.replace('<img ', '<img style="max-width:100%;height:auto"')
content: res.data.replace('<img ', '<img style="max-width:100%;height:auto"')
})
console.log(_this.data.content);
console.log(_this.data);
}, function () {
});
......
{
"usingComponents": {}
"usingComponents": {},
"navigationBarTitleText":"小奔运动"
}
\ No newline at end of file
// pages/orange-my/organ-my.js
// subPages/organ/experience-list/experience-list.js
Page({
/**
* 页面的初始数据
*/
data: {
courseType:'', //1正式课 2体验课
areaActive:0,
areaList:[
{name:'全部校区',value:''},{name:'湖南校区',value:'32'},{name:'长沙星沙体育飞跃机构',value:'32'},{name:'霍华德篮球迅雷',value:'32'}
], //所属校区列表
areaShow:false,
stateActive:0,
stateList:[
{name:'全部',value:''},{name:'待支付',value:1},{name:'已订购',value:2},{name:'待退款',value:3},
{name:'已退款',value:4},{name:'已关闭',value:5}
], //所属校区列表
stateShow:false,
type:0,
typeList:[{name:'学生',value:1},{name:'课程',value:2}],
typeShow:false,
value:'',
},
/**
......@@ -16,33 +34,53 @@ Page({
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
//1正式课 2体验课
let courseType = this.options.courseType || 1
this.setData({courseType:courseType})
wx.setNavigationBarTitle({
title: courseType== 1? '班课报名' : '体验课订单'
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
inputValue(e){
let value = e.detail
this.setData({value:value})
},
changeTypePopup(){
this.setData({typeShow:!this.data.typeShow})
},
changeType(e){
let {data,index} = e.currentTarget.dataset
this.setData({
type:index,
typeShow:false
})
},
changeStatePopup(){
this.setData({stateShow:!this.data.stateShow,areaShow:false,typeShow:false})
},
changeAreaPopup(){
this.setData({areaShow:!this.data.areaShow,stateShow:false,typeShow:false})
},
changeArea(e){
let {data,index} = e.currentTarget.dataset
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
this.setData({
areaActive:index,
areaShow:false
})
},
changeState(e){
let {data,index} = e.currentTarget.dataset
this.setData({
stateActive:index,
stateShow:false
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
......
{
"usingComponents": {
"t-popup":"/components/t-popup/index",
"xb-icon":"/components/t-icon/t-icon"
}
}
\ No newline at end of file
<!-- 机构职员 体验课/正式课 列表 -->
<view class="page-bg">
<van-sticky z-index="99">
<view class="page-top">
<!-- 校区 / 订单状态 筛选 -->
<view class="flex-s area-state">
<view class="area-select flex-s" bindtap="changeAreaPopup">
<view class="state-v {{areaActive!=0?'active-c':''}}">{{areaList[areaActive].name || '全部校区'}}</view>
<xb-icon type="icon-icon_pull-down" size="32"></xb-icon>
</view>
<view class="state-select flex-s" bindtap="changeStatePopup">
<view class="state-v state-w {{stateActive!=0?'active-c':''}}">{{stateList[stateActive].name || '全部'}}</view>
<xb-icon type="icon-icon_pull-down" size="32"></xb-icon>
</view>
</view>
<!-- 学生 / 课程 筛选 -->
<view class="search-ctn-bg">
<view class="search-ctn flex-c">
<view class="input-type flex-s" bindtap="changeTypePopup">
<view class="active-c">{{typeList[type].name}}</view><xb-icon type="icon-icon_pull-down" size="32"></xb-icon>
</view>
<view class="type-popup" wx:if="{{typeShow}}">
<view class="type-item {{type==index?'active-c':''}}" data-data="{{item}}" data-index="{{index}}"
wx:for="{{typeList}}" bindtap="changeType">{{item.name}}</view>
</view>
<view class="input-bg flex-c">
<van-field clearable style="width:100%"
value="{{ value }}"
placeholder="请输入用户名"
center="{{true}}"
border="{{ false }}"
bind:change="inputValue"
/>
</view>
</view>
</view>
<!-- 统计数据 -->
<view class="nums-ctn">
<block wx:if="{{courseType == 1}}">
<view class="nums-item"><text class="nums-t">报名学生</text><text class="nums-v">12</text></view>
<view class="nums-item"><text class="nums-t">已确认</text><text class="nums-v">12</text></view>
<view class="nums-item"><text class="nums-t">待确认</text><text class="nums-v">12</text></view>
</block>
<block wx:if="{{courseType == 2}}">
<view class="nums-item"><text class="nums-t">订单数量</text><text class="nums-v">12</text></view>
<view class="nums-item"><text class="nums-t">成功订购</text><text class="nums-v">12</text></view>
<view class="nums-item"><text class="nums-t">待取消</text><text class="nums-v">12</text></view>
</block>
</view>
</view>
<!--所属校区弹窗 -->
<t-popup show="{{areaShow}}" closeOnClickOverlay="{{false}}" type="top">
<view class="popup-bg">
<view class="area-item {{areaActive == index?'area-item-active':''}}" bindtap="changeArea"
data-index="{{index}}" data-data="{{item}}" wx:for="{{areaList}}">{{item.name}}</view>
</view>
</t-popup>
<!--订单状态弹窗 -->
<t-popup show="{{stateShow}}" closeOnClickOverlay="{{false}}" type="top">
<view class="popup-bg">
<view class="area-item {{stateActive == index?'area-item-active':''}}" bindtap="changeState"
data-index="{{index}}" data-data="{{item}}" wx:for="{{stateList}}">{{item.name}}</view>
</view>
</t-popup>
</van-sticky>
</view>
\ No newline at end of file
.page-bg{
min-height: 100vh;
width: 100%;
padding-bottom: 960rpx;
background-color: #f5f5f5;
}
.active-c{
color: #FF811E !important;
}
.page-top{
padding-bottom: 30rpx;
background-color: #fff;
}
.area-state{
padding: 20rpx 30rpx 0rpx 30rpx;
width: calc(100% - 60rpx);
height: 76rpx;
position: relative;
z-index: 2001 !important;
background-color: #fff;
}
.flex-s{
display: flex;
justify-content: space-between;
align-items: center;
}
.flex-c{display: flex;align-items: center;}
.area-select{
height: 76rpx;
width: calc(100% - 250rpx);
background: #F4F5F7;
border-radius: 20rpx;
font-weight: bold;
padding: 0rpx 24rpx;
}
.state-select{
padding: 0rpx 24rpx;
height: 76rpx;
width: 148rpx;
background: #F4F5F7;
border-radius: 20rpx;
font-weight: bold;
}
.state-v{
margin-right: 10rpx;
width: calc(100% - 10rpx);
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
color: #000000;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.search-ctn-bg{
padding: 20rpx 30rpx 0rpx 30rpx;
width: calc(100% - 60rpx);
background-color: #fff;
}
.search-ctn{
position: relative;
background: #F4F5F7;
border-radius: 20rpx;
padding: 18rpx 30rpx;
width: calc(100% - 60rpx);
}
.input-type{
position: relative;
flex: none;
height: 40rpx;
padding-right: 20rpx;
width: 108rpx;
border-right: 2rpx solid rgba(0, 0, 0, 0.1);
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.type-popup{
top: 105rpx;
left: 0rpx;
position: absolute;
height: 152rpx;
width: 172rpx;
background: #FFFFFF;
box-shadow: 0px 0px 16rpx 2rpx rgba(0, 0, 0, 0.12);
border-radius: 16rpx;
}
.type-item{
margin: 0rpx auto;
height: 76rpx;
width: 136rpx;
text-align: center;
line-height: 76rpx;
font-size: 28rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #000000;
}
.type-popup .type-item:first-child{border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);}
.input-bg{
position: relative;
height: 40rpx;
padding: 0rpx 20rpx;
width: calc(100% - 168rpx);
}
.input-bg .van-cell{
width: 100% !important;
padding: 0rpx !important;
background: none !important;
font-size: 30rpx !important;
font-family: PingFang SC-Regular, PingFang SC !important;
font-weight: 400 !important;
color: rgba(0, 0, 0, 0.9) !important;
}
.nums-ctn{
display: flex;
margin-top: 20rpx;
}
.nums-item{
flex: 1;
height: 54rpx;
display: flex;
align-items: center;
justify-content: center;
}
.nums-t{
font-size: 24rpx;margin-right: 10rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.nums-v{
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
}
/* -------------------------- */
.popup-bg{
padding-top:116rpx;
width: 100vw;
background-color: #fff;
padding-bottom: 30rpx;
border-radius: 0px 0px 24rpx 24rpx;
}
.area-item{
width: 100%;
font-size: 30rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
text-align: center;
padding: 24rpx 0rpx;
}
.tab-icon{
height: 36rpx;width: 36rpx;
}
.area-item-active{
background: #FAF8F6;
font-weight: bold !important;
color: #FF811E !important;
}
\ No newline at end of file
......@@ -29,6 +29,8 @@ function requestAll(url, postData, doSuccess, doFail) {
wx.reLaunch({
url:'/subPages/login/login/index'
})
}else if(res.data.code == 201){ //特殊业务逻辑处理
doSuccess(res.data);
}else{
doSuccess(res.data);
wx.showToast({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment