Commit 65a3ec3e by tangjiale

更新代码

parent 55d01334
......@@ -11,7 +11,10 @@
"name": "organ",
"pages": [
"course-list/course-list",
"course-destroy/course-destroy"
"destroy-list/destroy-list",
"early-warning/early-warning",
"destory-course/destory-course",
"destory-student/destory-student"
]
},
{
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 14:11:05
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-15 09:00:29
* @LastEditTime: 2022-06-22 10:20:56
*/
const app = getApp()
var API = require("../../utils/request.js");
......@@ -25,13 +25,14 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.aiUrl()
this.queryRecomdList()
this.setData({
page:0,list:[],loading:false,finish:false
})
this.queryList()
wx.stopPullDownRefresh()
},
onShow: function () {
......@@ -44,6 +45,7 @@ Page({
//因为小程序会有个默认启动页/index/index,当初始化时,身份不同则需要重定向到指定配置的身份首页
app.checkUserType()
// this.aiUrl()
},
queryRecomdList(){
......@@ -52,7 +54,7 @@ Page({
API.getData('/px/course/getMobileCourseList', {page:1,size:2,type:2}, function (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('、') || ''
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.filter(v => v.empPosition == 'coach')).map(e => e.empName).join('、') || ''
})
}
that.setData({tyCourseList:res.data})
......@@ -70,7 +72,8 @@ Page({
that.data.loading = true
if(res.data && res.data.length){
res.data.forEach(item => {
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.map(v => v.empName)).join('、') || ''
// item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.map(v => v.empName)).join('、') || ''
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.filter(v => v.empPosition == 'coach')).map(e => e.empName).join('、') || ''
})
}
that.data.finish = res.data.length < 10
......@@ -129,7 +132,7 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.onLoad()
},
/**
......
{
"usingComponents": {},
"navigationBarTitleText": "小奔运动"
"enablePullDownRefresh":true,
"navigationBarTitleText": "小奔体育"
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 16:44:43
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-21 10:32:17
* @LastEditTime: 2022-06-22 14:31:33
*/
var app = getApp();
var API = require("../../utils/request.js");
......@@ -78,7 +78,9 @@ Page({
}
//获取角色列表
this.queryPeopleList()
if(userInfo.peopleType){
this.queryPeopleList()
}
},
//切换小孩身份
checkStu:tool.throttle(function(e){
......@@ -112,6 +114,12 @@ Page({
});
},2000),
handleTab(e){
if(!this.data.userInfo.peopleType){
wx.reLaunch({
url:'/subPages/login/login/index'
})
return
}
let {type} = e.currentTarget.dataset
let that = this
switch(type){
......@@ -156,12 +164,10 @@ Page({
if (res.confirm) {
API.getData('/px/user/loginOut', {}, (res) => {
if(res.code == 200){
wx.getStorageSync("token","")
wx.getStorageSync("peopleType","")
wx.getStorageSync("userInfo",{})
wx.reLaunch({
url:'/subPages/login/login/index'
})
wx.removeStorageSync("token")
wx.removeStorageSync("peopleType")
wx.removeStorageSync("userInfo")
wx.switchTab({url:'/pages/index/index'})
}
})
} else if (res.cancel) {
......
......@@ -61,7 +61,7 @@
<view class="mine-main management-bg" wx:else></view>
<!-- 功能菜单 -->
<view class="menu" wx:if="{{userInfo.peopleType}}">
<view class="menu">
<view class="menu-list">
<view wx:for="{{userInfo.peopleType=='employ'?optionTab['employ']:optionTab['parent']}}"
class="menu-item" data-type="{{item.event}}" bindtap="handleTab">
......@@ -75,7 +75,7 @@
</view>
<!-- 退出 -->
<view class="layout-btn" data-type="layout" bindtap="handleTab">
<view class="layout-btn" data-type="layout" bindtap="handleTab" wx:if="{{userInfo.peopleType}}">
退出登录
</view>
<view class="block"></view>
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 14:15:22
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-21 11:43:52
* @LastEditTime: 2022-06-22 16:25:54
*/
var API = require("../../utils/request");
Page({
......@@ -92,10 +92,13 @@ Page({
break
case 3: //教练消课
wx.navigateTo({
url: '/subPages/organ/course-destroy/course-destroy'
url: '/subPages/organ/destroy-list/destroy-list'
})
break
case 3: //课时预警
case 4: //课时预警
wx.navigateTo({
url: '/subPages/organ/early-warning/early-warning'
})
break
}
},
......@@ -131,7 +134,8 @@ Page({
}, (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('、') || ''
// item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.map(v => v.empName)).join('、') || ''
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.filter(v => v.empPosition == 'coach')).map(e => e.empName).join('、') || ''
})
}
that.data.loading = true
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 16:45:35
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-18 14:30:24
* @LastEditTime: 2022-06-22 10:30:08
*/
var API = require("../../utils/request");
var App = getApp();
......@@ -158,7 +158,7 @@ nextType() {
}
let userInfo = wx.getStorageSync("userInfo")
//如果没有绑定小孩 或者 绑定了小孩没有填写身高体重
if(!userInfo.stuId || !userInfo.height){
if(userInfo && (!userInfo.stuId || !userInfo.height)){
this.setData({popupShow:true},() =>{
this.selectComponent("#userInput").checkUserChild()
})
......@@ -193,6 +193,13 @@ nextType() {
},
//去运动
sport(e){
let userInfo = wx.getStorageSync("userInfo") || {}
if(!userInfo.peopleType){
wx.reLaunch({
url:'/subPages/login/login/index'
})
return
}
var project = e.currentTarget.dataset.item.id;
//存运动id到ai运动识别页面用到
getApp()['_aiSportType'] = project || 1
......@@ -202,6 +209,14 @@ nextType() {
},
//开始跳绳(选择跳绳模式)
checkSkip() {
let userInfo = wx.getStorageSync("userInfo") || {}
if(!userInfo.peopleType){
wx.reLaunch({
url:'/subPages/login/login/index'
})
return
}
var that = this;
var type = that.data.skipType;
var select = that.data.selectType;
......
......@@ -45,7 +45,7 @@
"compileType": "miniprogram",
"libVersion": "2.17.0",
"appid": "wx7d7fbc0e6746baf5",
"projectname": "小奔运动",
"projectname": "小奔体育",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"editorSetting": {
......
......@@ -13,67 +13,11 @@
"miniprogram": {
"list": [
{
"name": "首页",
"pathName": "pages/organ-index/organ-index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/course/detail/detail",
"query": "id=17094",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/course/pay-order/pay-order",
"query": "id=17094",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/my/my",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/sport/sport",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "机构-体验课订单",
"pathName": "subPages/organ/course-list/course-list",
"query": "courseType=1",
"pathName": "subPages/organ/destory-student/destory-student",
"query": "stuId=16&schId=",
"scene": null,
"launchMode": "default"
},
{
"name": "",
"pathName": "pages/organ-index/organ-index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "教练销课",
"pathName": "subPages/organ/course-destroy/course-destroy",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "个人资料",
"pathName": "subPages/login/organ-info/organ-info",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
......
......@@ -149,7 +149,7 @@ Page({
var medalId = res.target.dataset.item.medalRefId;
var medalContent = res.target.dataset.item.name;
return{
title:'我在小奔运动获得' + medalContent + '勋章,快来和我一起训练吧!',
title:'我在小奔体育获得' + medalContent + '勋章,快来和我一起训练吧!',
path:'packageA/skip/medalShare/medalShare?medalId=' + medalId,
imageUrl:'https://cdn.xiaobentiyu.cn/sport_minapp_img/medal-share.png'
}
......@@ -165,7 +165,7 @@ Page({
var medalId = res.target.dataset.item.medalRefId;
var medalContent = res.target.dataset.item.name;
return{
title:'我在小奔运动获得' + medalContent + '勋章,快来和我一起训练吧!',
title:'我在小奔体育获得' + medalContent + '勋章,快来和我一起训练吧!',
path:'packageA/skip/medalShare/medalShare?medalId=' + medalId,
imageUrl:'https://cdn.xiaobentiyu.cn/sport_minapp_img/medal-share.png'
}
......@@ -197,7 +197,7 @@ Page({
var medalId = res.target.dataset.id;
var medalContent = res.target.dataset.content;
return{
title:'我在小奔运动获得' + medalContent + '勋章,快来和我一起训练吧!',
title:'我在小奔体育获得' + medalContent + '勋章,快来和我一起训练吧!',
path:'packageA/skip/medalShare/medalShare?medalId=' + medalId + '&dan=1',
imageUrl:'https://cdn.xiaobentiyu.cn/sport_minapp_img/medal-share.png'
}
......
......@@ -11,7 +11,7 @@
<view class="share-user">
<view class="user-info">
<image src="{{imgSrc || ''}}"></image>
<view class="name jg-name">{{stuName || '小奔运动'}}</view>
<view class="name jg-name">{{stuName || '小奔体育'}}</view>
</view>
<view class="stand" bindtap="standerHtml">
<view class="text">国家标准</view>
......@@ -34,7 +34,7 @@
<view class="share-user">
<view class="user-info">
<image src="{{imgSrc}}"></image>
<view class="name jg-name">{{stuName || '小奔运动'}}</view>
<view class="name jg-name">{{stuName || '小奔体育'}}</view>
</view>
<!-- <view class="stand" bindtap="standerHtml"> -->
<view class="stand">
......@@ -61,7 +61,7 @@
<view class="share-user">
<view class="user-info">
<image src="{{imgSrc || ''}}"></image>
<view class="name jg-name">{{stuName || '小奔运动'}}</view>
<view class="name jg-name">{{stuName || '小奔体育'}}</view>
</view>
<!-- <view class="stand" bindtap="standerHtml">
<view class="text">国家标准</view>
......@@ -85,7 +85,7 @@
<image src="{{imgSrc}}"></image>
</view>
<view class="share-ce">
<view class="name">{{stuName || '小奔运动'}}</view>
<view class="name">{{stuName || '小奔体育'}}</view>
<view class="share-time">{{createTime || 0}}</view>
</view>
</view>
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-15 19:42:49
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-16 11:10:27
* @LastEditTime: 2022-06-22 14:34:27
*/
var API = require("../../../utils/request.js");
Page({
......@@ -30,9 +30,14 @@ Page({
onShow: function () {
this.setData({page:0,list:[],loading:false,finish:false},()=>{
this.queryCourseList()
wx.stopPullDownRefresh()
})
},
onPullDownRefresh: function () {
this.onShow()
},
onReachBottom:function (){
if(this.data.loading && this.data.finish) return
this.queryCourseList()
......@@ -48,7 +53,8 @@ Page({
}, (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('、') || ''
// item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.map(v => v.empName)).join('、') || ''
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.filter(v => v.empPosition == 'coach')).map(e => e.empName).join('、') || ''
})
}
that.data.loading = true
......
......@@ -2,5 +2,6 @@
"usingComponents": {
"empty":"/components/empty/empty"
},
"navigationBarTitleText": "体验课订购"
"navigationBarTitleText": "体验课订购",
"enablePullDownRefresh":true
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-15 19:42:49
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-16 11:02:56
* @LastEditTime: 2022-06-22 14:37:13
*/
var API = require("../../../utils/request.js");
Page({
......@@ -30,6 +30,7 @@ Page({
onShow: function () {
this.setData({page:0,list:[],loading:false,finish:false},()=>{
this.queryCourseList()
wx.stopPullDownRefresh()
})
},
......@@ -38,6 +39,10 @@ Page({
this.queryCourseList()
},
onPullDownRefresh: function () {
this.onShow()
},
queryCourseList(){
let that = this
this.data.page ++
......@@ -48,7 +53,8 @@ Page({
}, (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('、') || ''
// item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.map(v => v.empName)).join('、') || ''
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.filter(v => v.empPosition == 'coach')).map(e => e.empName).join('、') || ''
})
}
that.data.loading = true
......
......@@ -2,5 +2,6 @@
"usingComponents": {
"empty":"/components/empty/empty"
},
"navigationBarTitleText": "我的收藏"
"navigationBarTitleText": "我的收藏",
"enablePullDownRefresh":true
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-13 08:57:51
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-18 15:11:26
* @LastEditTime: 2022-06-22 10:20:31
*/
var API = require("../../../utils/request.js");
Page({
......@@ -64,7 +64,8 @@ Page({
}, (res) => {
if(res.data && res.data.detail){
res.data.detail = res.data.detail.replace(/<img/g, '<img class="rich-img" ');
res.data['_empNames'] = (res.data.pxEmployeeList.map(v => v.empName)).join('、')
// res.data['_empNames'] = (res.data.pxEmployeeList.map(v => v.empName)).join('、')
res.data['_empNames'] = res.data.pxEmployeeList && res.data.pxEmployeeList.length && (res.data.pxEmployeeList.filter(v => v.empPosition == 'coach')).map(e => e.empName).join('、') || ''
}
that.setData({detail:res.data})
})
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-15 19:42:49
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-16 09:38:29
* @LastEditTime: 2022-06-22 14:35:45
*/
var API = require("../../../utils/request.js");
Page({
......@@ -30,6 +30,7 @@ Page({
onShow: function () {
this.setData({page:0,list:[],loading:false,finish:false},()=>{
this.queryCourseList()
wx.stopPullDownRefresh()
})
},
......@@ -38,6 +39,10 @@ Page({
this.queryCourseList()
},
onPullDownRefresh: function () {
this.onShow()
},
queryCourseList(){
let that = this
this.data.page ++
......@@ -48,7 +53,8 @@ Page({
}, (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('、') || ''
// item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.map(v => v.empName)).join('、') || ''
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.filter(v => v.empPosition == 'coach')).map(e => e.empName).join('、') || ''
})
}
that.data.loading = true
......
......@@ -2,5 +2,6 @@
"usingComponents": {
"empty":"/components/empty/empty"
},
"navigationBarTitleText": "班课报名"
"navigationBarTitleText": "班课报名",
"enablePullDownRefresh":true
}
\ No newline at end of file
......@@ -80,7 +80,7 @@
color: #267ACA !important;
}
.course-teachers{
margin-top: 62rpx;
margin-top: 24rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-11 17:38:58
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-15 08:57:52
* @LastEditTime: 2022-06-22 14:38:29
*/
var API = require("../../../utils/request.js");
Page({
......@@ -33,6 +33,7 @@ Page({
//1正式课 2体验课
this.setData({type:this.options.type || 1,page:0,list:[],loading:false,finish:false},()=>{
this.queryCourseList()
wx.stopPullDownRefresh()
})
},
......@@ -41,6 +42,12 @@ Page({
this.queryCourseList()
},
onPullDownRefresh: function () {
this.onShow()
},
queryCourseList(){
let that = this
this.data.page ++
......@@ -52,7 +59,7 @@ Page({
}, (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('、') || ''
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.filter(v => v.empPosition == 'coach')).map(e => e.empName).join('、') || ''
})
}
that.data.loading = true
......
......@@ -2,5 +2,6 @@
"usingComponents": {
"empty":"/components/empty/empty"
},
"navigationBarTitleText": "小奔运动"
"navigationBarTitleText": "小奔体育",
"enablePullDownRefresh":true
}
\ No newline at end of file
.page-bg{
min-height: 100vh;
width: 100%;
background-color: #f5f5f5;
background-color: #fff;
}
.list{
margin: 0px 30rpx;
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-14 17:37:06
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-21 10:39:25
* @LastEditTime: 2022-06-22 10:20:03
*/
var API = require("../../../utils/request.js");
Page({
......@@ -61,7 +61,7 @@ Page({
API.getData('/px/course/getMobileCourseInfo', {id:id}, (res) => {
if(res.data && res.data.detail){
res.data.detail = res.data.detail.replace(/<img/g, '<img class="rich-img" ');
res.data['_empNames'] = (res.data.pxEmployeeList.map(v => v.empName)).join('、')
res.data['_empNames'] = res.data.pxEmployeeList && res.data.pxEmployeeList.length && (res.data.pxEmployeeList.filter(v => v.empPosition == 'coach')).map(e => e.empName).join('、') || ''
}
that.setData({detail:res.data})
})
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-15 19:42:49
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-16 10:40:51
* @LastEditTime: 2022-06-22 14:36:32
*/
var API = require("../../../utils/request.js");
Page({
......@@ -30,6 +30,7 @@ Page({
onShow: function () {
this.setData({page:0,list:[],loading:false,finish:false},()=>{
this.queryCourseList()
wx.stopPullDownRefresh()
})
},
......@@ -38,6 +39,10 @@ Page({
this.queryCourseList()
},
onPullDownRefresh: function () {
this.onShow()
},
queryCourseList(){
let that = this
this.data.page ++
......@@ -48,7 +53,7 @@ Page({
}, (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('、') || ''
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.filter(v => v.empPosition == 'coach')).map(e => e.empName).join('、') || ''
})
}
that.data.loading = true
......
......@@ -2,5 +2,6 @@
"usingComponents": {
"empty":"/components/empty/empty"
},
"navigationBarTitleText": "消课记录"
"navigationBarTitleText": "消课记录",
"enablePullDownRefresh":true
}
\ No newline at end of file
......@@ -80,7 +80,7 @@
color: #267ACA !important;
}
.course-teachers{
margin-top: 62rpx;
margin-top: 24rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 15:52:31
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-21 10:33:45
* @LastEditTime: 2022-06-22 09:50:40
*/
var API = require("../../../utils/request.js");
var postData = {};
......@@ -47,11 +47,11 @@ Page({
//获取用户微信相关的详细信息
that.wxGetUserInfo()
if(res.data.peopleType == 'employ'){
wx.reLaunch({
wx.switchTab({
url: '/pages/organ-index/organ-index'
})
}else {
wx.reLaunch({
wx.switchTab({
url: '/pages/index/index'
})
}
......@@ -152,11 +152,11 @@ Page({
//获取用户微信相关的详细信息
_this.wxGetUserInfo()
if(res.data.peopleType == 'employ'){
wx.reLaunch({
wx.switchTab({
url: '/pages/organ-index/organ-index'
})
}else {
wx.reLaunch({
wx.switchTab({
url: '/pages/index/index'
})
}
......
......@@ -113,18 +113,13 @@ Page({
//根据用户类型来判断跳转页面
//employ机构职员 parent家长 visitor游客 Unknown未知
_this.wxGetUserInfo()
if(res.data.peopleType == 'Unknown'){
}else if(res.data.peopleType == 'parent'){
wx.reLaunch({
url: '/pages/index/index'
})
}else if(res.data.peopleType == 'employ'){
wx.reLaunch({
url: '/pages/index/index'
if(res.data.peopleType == 'employ'){
wx.switchTab({
url: '/pages/organ-index/organ-index'
})
}else if(res.data.peopleType == 'visitor'){
wx.reLaunch({
}else {
wx.switchTab({
url: '/pages/index/index'
})
}
......
{
"usingComponents": {},
"navigationBarTitleText":"小奔运动"
"navigationBarTitleText":"小奔体育"
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-14 08:36:57
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-21 10:28:22
* @LastEditTime: 2022-06-22 09:26:57
*/
var API = require("../../../utils/request.js");
......@@ -53,11 +53,11 @@ Page({
API.getData('/px/user/switchRole', data, function (res) {
if (res.code == 200) {
that.onShow();
that.wxGetUserInfo()
wx.showToast({
title: '切换成功',
icon: 'none'
})
that.wxGetUserInfo()
} else {
wx.showToast({
icon: "none",
......@@ -76,6 +76,12 @@ Page({
}
wx.setStorageSync('peopleType',res.data.peopleType)
wx.setStorageSync('userInfo',res.data)
if(res.data.peopleType == 'employ'){
wx.switchTab({url:'/pages/organ-index/organ-index'})
}else{
wx.switchTab({url:'/pages/index/index'})
}
}
}, function () {
// wx.hideLoading()
......
......@@ -10,7 +10,7 @@
color: #888888;
}
.type-item{
margin-bottom: 20rpx;
margin-top: 20rpx;
border-radius: 20rpx;
background-color: #fff;
}
......
......@@ -56,7 +56,13 @@ Page({
this.queryCourseList()
this.getExpCourseCount()
})
wx.stopPullDownRefresh()
},
onPullDownRefresh: function () {
this.onShow()
},
//学校列表
getCommonSchool(){
let that = this
......@@ -153,7 +159,8 @@ Page({
API.getData(url,param, (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('、') || ''
// item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.map(v => v.empName)).join('、') || ''
item['_empNames'] = item.pxEmployeeList && item.pxEmployeeList.length && (item.pxEmployeeList.filter(v => v.empPosition == 'coach')).map(e => e.empName).join('、') || ''
})
}
that.data.loading = true
......
{
"enablePullDownRefresh":true,
"usingComponents": {
"t-popup":"/components/t-popup/index",
"xb-icon":"/components/t-icon/t-icon",
......
/*
* @Author: tangjiale
* @eMail: 932055106@qq.com
* @Date: 2022-06-22 10:56:10
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-22 15:46:50
*/
var API = require("../../../utils/request");
Page({
/**
* 页面的初始数据
*/
data: {
detail:{},
active:'',
list:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
onShow: function (){
//17094 17095
let that = this
API.getData('/px/course/getXkStudentList', {courseId:this.options.courseId,schId:this.options.schId || ''},function(res){
if(res.data && res.data.xkStudentVoList && res.data.xkStudentVoList.length){
res.data.xkStudentVoList.forEach(v =>{
v._check = false
})
}
that.setData({
detail:res.data && res.data.pxCourse || {},
list:res.data && res.data.xkStudentVoList || [],
peopleNum:that.options.peopleNum || 0})
})
},
acticeIdx(e){
let {index} = e.currentTarget.dataset
this.setData({active:index})
},
selectStu(e){
let {index} = e.currentTarget.dataset
let check = this.data.list[index]._check
this.data.list[index]._check = !check
this.setData({list:this.data.list})
},
//提交销课记录
submitXkResult(){
if(!this.data.active){
wx.showToast({title: '请选择课次',icon: 'none',});
return
}
let idx = this.data.list.findIndex(v => v._check)
if(idx == -1){
wx.showToast({title: '请选择学生',icon: 'none',});
return
}
let param = []
let list = this.data.list.filter(v => v._check)
list.forEach(item => {
param.push({
bmId:item.bmId,
courseId:item.courseId,
stuId:item.stuId,
stuStatId:item.stuStatId,
usedHour:this.data.active,
xmNum:this.data.active,
})
})
// API.requestAll('/px/course/submitXkResult',param,function(res){
// })
let that = this
API.request('/px/course/submitXkResult', {
paramVoList:param
},function(res){
wx.showToast({title: '销课成功',icon: 'none',});
setTimeout(() =>{
that.onShow()
},1000)
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "销课详情",
"usingComponents": {
}
}
\ No newline at end of file
<!-- 按课程销课详情 -->
<view class="page-bg" wx:if="{{detail}}">
<view class="course-card">
<image class="course-img" src="{{detail.poster}}" mode="aspectFill" />
<view class="course-info">
<view class="course-title">{{detail.name}}</view>
<view class="text-line">课时:{{detail.classHour}}</view>
<view class="text-line">人数:{{peopleNum}}</view>
</view>
</view>
<view class="com-title">选择课次</view>
<view class="num-flex">
<view class="num-item {{active == index+1?'num-active':''}}" wx:for="{{detail.classHour}}"
data-index="{{index + 1}}" bindtap="acticeIdx">
{{index + 1}}
</view>
</view>
<view class="com-title">选择学生</view>
<view class="num-flex" wx:if="{{list && list.length}}">
<view class="stu-item {{item._check?'stu-item-a':''}}" wx:for="{{list}}"
data-index="{{index}}" bindtap="selectStu">
<view class="stu-item-info">
<image class="stu-img" wx:if="{{item.gender == 1}}" src="https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/boy_default.png"></image>
<image class="stu-img" wx:elif="{{item.gender == 2}}" src="https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/girl_default.png"></image>
<view class="stu-text">
<view class="sut-name">{{item.stuName}}</view>
<view class="sut-use">已销{{item.usedHour}}课时</view>
</view>
</view>
<view class="stu-hours">{{item.classHour}}</view>
</view>
</view>
<view class="btm-btn" wx:if="{{list && list.length}}" bindtap="submitXkResult">提交</view>
</view>
\ No newline at end of file
.page-bg{
min-height: calc(100vh - 140rpx);
width: 100%;
padding-bottom: 140rpx;
background-color: #fff;
}
.course-card{
display: flex;
padding: 20rpx 30rpx 30rpx 30rpx;
background-color: #f5f5f5;
}
.course-img{
position: relative;
height: 186rpx;
width: 300rpx;
border-radius: 24rpx;
}
.course-info{
margin-left: 20rpx;
width: calc(100% - 320rpx);
}
.course-title{
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #000000;
}
.text-line{
margin-top: 10rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.com-title{
margin-top: 30rpx;
margin-left: 30rpx;
font-size: 34rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #000000;
}
.num-flex{
margin: 0rpx 30rpx;
width: calc(100% - 60rpx);
display: flex;
flex-wrap: wrap;
}
.num-flex .num-item:nth-child(5n){margin-right: 0px !important;}
.num-item{
margin-top: 24rpx;
width: calc((100% - 88rpx) / 5);
height: 76rpx;
line-height: 76rpx;
font-size: 40rpx;
font-family: 'Number';
font-weight: bold;
text-align: center;
color: rgba(0, 0, 0, 0.9);
margin-right: 22rpx;
background: #FAF8F6;
border-radius: 16rpx;
}
.num-flex .stu-item:nth-child(2n){margin-right: 0px !important;}
.stu-item{
margin-top: 24rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin-right: 22rpx;
width: calc((100% - 158rpx) / 2);
background: #FAF8F6;
border-radius: 24rpx;
border: 4rpx solid #FAF8F6;
padding: 30rpx;
}
.stu-item-info{
display: flex;
align-items: center;
}
.stu-img{
height: 80rpx;
width: 80rpx;
}
.stu-text{
margin-left: 10rpx;
}
.sut-name{
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #000000;
}
.sut-use{
font-size: 24rpx;
margin-top: 4rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.3);
}
.stu-hours{
font-size: 40rpx;
font-family: 'Number';
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.num-active{
background: #FF811E !important;
color: #fff !important;
}
.stu-item-a{
border: 4rpx solid #FF811E !important;
}
.stu-item-a .sut-name{
color: #FF811E !important;
}
.stu-item-a .stu-hours{
color: #FF811E !important;
}
.btm-btn{
position: fixed;
bottom: 30rpx;
left: 0rpx;
margin: 0rpx 30rpx;
width: calc(100% - 60rpx);
line-height: 90rpx;
height: 90rpx;
text-align: center;
background: #FF811E;
box-shadow: 0px 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.08);
border-radius: 50rpx;
font-size: 34rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #FFFFFF;
}
\ No newline at end of file
/*
* @Author: tangjiale
* @eMail: 932055106@qq.com
* @Date: 2022-06-22 15:55:26
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-22 17:15:13
*/
var API = require("../../../utils/request");
Page({
/**
* 页面的初始数据
*/
data: {
detail:{},
list:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let that = this
API.getData('/px/course/getXkCourseStuInfo', {stuId:this.options.stuId,schId:this.options.schId || ''},function(res){
//累计销课
let totalHours = 0
if(res.data && res.data.xkCourseStuVoList && res.data.xkCourseStuVoList.length){
res.data.xkCourseStuVoList.forEach(v =>{
v._check = false
totalHours += v.usedHour
})
}
that.setData({
detail:{
totalHours:totalHours,
stuId:res.data.stuId,
stuName:res.data.stuName
},
list:res.data && res.data.xkCourseStuVoList || []
})
})
},
selectIdx(e){
let {index,idx} = e.currentTarget.dataset
if(this.data.list[index]._check == idx){
this.data.list[index]._check = false
}else{
this.data.list[index]._check = idx
}
this.setData({list:this.data.list})
},
//提交销课记录
submitXkResult(){
let idx = this.data.list.findIndex(v => v._check)
if(idx == -1){
wx.showToast({title: '请选择课时',icon: 'none',});
return
}
let param = []
let list = this.data.list.filter(v => v._check)
list.forEach(item => {
param.push({
bmId:item.bmId,
courseId:item.courseId,
stuId:item.stuId,
stuStatId:item.stuStatId,
usedHour:item._check,
xmNum:item._check,
})
})
let that = this
API.request('/px/course/submitXkResult', {
paramVoList:param
},function(res){
wx.showToast({title: '销课成功',icon: 'none',});
setTimeout(() =>{
that.onShow()
},1000)
})
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "销课详情",
"usingComponents": {}
}
\ No newline at end of file
<!-- 按课程销课详情 -->
<view class="page-bg" wx:if="{{detail}}">
<view class="user-card">
<image class="stu-img" wx:if="{{detail.gender == 1}}" src="https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/boy_default.png"></image>
<image class="stu-img" wx:elif="{{detail.gender == 2}}" src="https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/girl_default.png"></image>
<view class="stu-name">{{detail.stuName}}</view>
<view class="stu-hours">累计已销{{detail.totalHours || 0}}课时</view>
</view>
<view class="course-card" wx:for="{{list}}">
<view class="course-bg">
<view class="course-img">
<image class="course-img" src="{{item.poster}}" mode="aspectFill" />
<view class="course-type {{item.type==2?'y-color':'b-color'}}">{{item.type==2?'体验课':'正式班课'}}</view>
</view>
<view class="course-info">
<view class="course-title">{{item.courseName}}</view>
<view class="course-hour">课时:{{item.classHour || 0}}</view>
<view class="course-use">已消课: {{item.usedHour || 0}}课时</view>
</view>
</view>
<view class="hour-flex">
<view class="hour-item {{idx+1 <= item.usedHour?'grey-c':''}} {{item._check == idx+1?'hour-active':''}}"
wx:for="{{item.classHour}}" wx:for-item="data" wx:for-index="idx" data-index="{{index}}" data-idx="{{idx+1}}" bindtap="selectIdx">
{{idx + 1}}
</view>
</view>
</view>
<view class="btm-btn" wx:if="{{list && list.length}}" bindtap="submitXkResult">提交</view>
</view>
\ No newline at end of file
.page-bg{
min-height: calc(100vh - 140rpx);
width: 100%;
padding-bottom: 140rpx;
background-color: #fff;
}
.user-card{
padding: 30rpx 24rpx;
display: flex;
align-items: center;
background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);
}
.stu-img{
height: 48rpx;
width: 48rpx;
}
.stu-name{
margin-left: 20rpx;
font-size: 34rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #000000;
}
.stu-hours{
margin-left: 20rpx;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.3);
}
.course-card{
margin: 0rpx 30rpx;
width: calc(100% - 60rpx);
padding: 30rpx 0rpx 40rpx 0rpx;
border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
}
.course-bg{
display: flex;
}
.course-img{
position: relative;
height: 186rpx;
width: 300rpx;
border-radius: 24rpx;
}
.course-info{
margin-left: 20rpx;
width: calc(100% - 320rpx);
}
.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-type{
position: absolute;
left: 10rpx;top: 10rpx;
padding: 2rpx 10rpx;
border-radius: 8rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
}
.course-hour{
margin-top: 10rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.course-use{
margin-top: 16rpx;
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.y-color{
background: linear-gradient(136deg, #FF811E 0%, #F3C100 100%);
}
.b-color{
background: linear-gradient(132deg, #2D89FF 0%, #72B0FF 100%);
}
.hour-flex{
display: flex;
flex-wrap: wrap;
}
.hour-flex .hour-item:nth-child(5n){
margin-right: 0rpx !important;
}
.hour-item{
margin-top: 24rpx;
height: 76rpx;
line-height: 76rpx;
text-align: center;
width: calc((100% - 88rpx) / 5);
margin-right: 22rpx;
background: #FAF8F6;
border-radius: 16rpx;
font-size: 40rpx;
font-family: 'Number';
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.grey-c{
background: #F5F5F5 !important;
color: rgba(0, 0, 0, 0.1) !important;
}
.hour-active{
background: #FF811E !important;
color: #fff !important;
}
.btm-btn{
position: fixed;
bottom: 30rpx;
left: 0rpx;
margin: 0rpx 30rpx;
width: calc(100% - 60rpx);
line-height: 90rpx;
height: 90rpx;
text-align: center;
background: #FF811E;
box-shadow: 0px 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.08);
border-radius: 50rpx;
font-size: 34rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #FFFFFF;
}
\ No newline at end of file
......@@ -3,9 +3,10 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-20 11:16:04
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-21 11:14:57
* @LastEditTime: 2022-06-22 16:46:44
*/
var API = require("../../../utils/request");
var tool = require("../../../utils/util.js")
Page({
/**
......@@ -19,7 +20,7 @@ Page({
areaList:[], //所属校区列表
popupShow:false,
listActive:2, //1课程 2学生
listActive:1, //1课程 2学生
list:[],
page:0,
......@@ -40,7 +41,26 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getCommonSchool()
this.setData({page:0,list:[],loading:false,finish:false},()=>{
this.getCommonSchool()
this.queryCourseList()
})
wx.stopPullDownRefresh()
},
gotoDetails(e){
let {data} = e.currentTarget.dataset
wx.navigateTo({
url: '/subPages/organ/early-warning/early-warning?courseId=' + data.courseId+ '&peopleNum=' + data.peopleNum+'&schId=' + (this.data.areaActive != 0 ? this.data.areaList[this.data.areaActive].value : '')
});
},
gotoSudDetail(e){
let {data} = e.currentTarget.dataset
wx.navigateTo({
url: '/subPages/organ/destory-student/destory-student?stuId=' + data.stuId+'&schId=' + (this.data.areaActive != 0 ? this.data.areaList[this.data.areaActive].value : '')
});
},
onPullDownRefresh: function () {
this.onShow()
},
changePopup(){
this.setData({popupShow:!this.data.popupShow})
......@@ -48,20 +68,22 @@ Page({
changeArea(e){
let {index,data} = e.currentTarget.dataset
let that = this
this.setData({areaActive:index,popupShow:false},()=> {
this.setData({areaActive:index,popupShow:false,page:0,list:[],loading:false,finish:false},()=> {
this.queryCourseList()
})
},
changeList(e){
let {type} = e.currentTarget.dataset
this.setData({listActive:type,page:0,list:[],loading:false,finish:false},()=>{
// this.queryCourseList()
this.setData({listActive:type,page:0,list:[],loading:false,finish:false,value:''},()=>{
this.queryCourseList()
})
},
inputValue(e){
let value = e.detail
this.setData({value:value})
},
inputValue:tool.debounce(function(e){
let value = e[0].detail
this.setData({value:value,page:0,list:[],loading:false,finish:false},() => {
this.queryCourseList()
})
}),
//学校列表
getCommonSchool(){
let that = this
......@@ -77,25 +99,46 @@ Page({
})
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
//获取课程列表
queryCourseList(){
let that = this
this.data.page ++
this.data.loading = true
let url = this.data.listActive == 1 ? '/px/course/getXkCourseList' : '/px/course/getXkCourseStuList'
let param = {
page:that.data.page,
size:10,
schId:this.data.areaList[this.data.areaActive] && this.data.areaList[this.data.areaActive].value || '', //学校id
}
if(this.data.listActive == 1){
Object.assign(param,{
courseName:this.data.value
})
}else{
Object.assign(param,{
stuName:this.data.value
})
}
API.getData(url,param, (res) => {
that.data.loading = true
that.data.finish = res.data && 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()
},
goBack(){
wx.navigateBack()
......
{
"navigationStyle": "custom",
"enablePullDownRefresh":true,
"usingComponents": {
"t-popup":"/components/t-popup/index",
"xb-icon":"/components/t-icon/t-icon",
"empty":"/components/empty/empty"
}
}
\ No newline at end of file
<view class="pgae-bg">
<view class="page-bg">
<van-sticky z-index="99">
<view class="nav-bg flex-s" style="padding-top:{{navT}}px">
<van-icon bindtap="goBack" name="arrow-left" size="40rpx"/>
<view class="flex-c" style="height:{{navH}}px" bindtap="changePopup">
......@@ -15,17 +15,18 @@
<view class="list-tabs {{listActive==1?'list-tabs-active':''}}" data-type="1" bindtap="changeList">按课程</view>
<view class="list-tabs {{listActive==2?'list-tabs-active':''}}" data-type="2" bindtap="changeList">按学生</view>
</view>
</view>
<view class="input-bg flex-c">
<view class="input-bg flex-c">
<xb-icon type="icon-icon_search" size="40" color="#C3CAD3"></xb-icon>
<van-field style="width:100%"
<van-field style="width:100%" clearable
value="{{ value }}"
placeholder="{{listActive==1?'请输入课程名称':'请输入学生姓名'}}"
border="{{ false }}"
bind:change="inputValue"
/>
</view>
</view>
<!-- 头部校区切换弹窗 -->
<t-popup show="{{popupShow}}" closeOnClickOverlay="{{false}}" type="top">
<view class="popup-bg" style="padding-top:{{navT + navH + 7}}px">
......@@ -33,34 +34,36 @@
data-index="{{index}}" data-data="{{item}}" wx:for="{{areaList}}">{{item.name}}</view>
</view>
</t-popup>
</van-sticky>
<!-- 按课程 -->
<block wx:if="{{listActive == 1}}">
<view class="pubu-list">
<view class="pubu-list" wx:if="{{list && list.length}}">
<view class="pubu-bg">
<view wx:for="{{['','']}}">
<view wx:for="{{list}}" data-data="{{item}}" bindtap="gotoDetails" wx:if="{{index%2 == 0}}">
<view class="pubu-image">
<view class="pubu-tag {{true?'blue-c':'yellow-c'}}">{{true?'正式课班':'体验课'}}</view>
<image class="pubu-images" src="{{item.poster}}" mode="aspectFill" />
<view class="pubu-tag {{item.type == 1?'blue-c':'yellow-c'}}">{{item.type == 1?'正式课班':'体验课'}}</view>
</view>
<view class="pubu-title">控球如欧文运球强化控 球如欧文运球强化球阿斯顿爱思啊</view>
<view class="hour-nums">
课时: 4 人数: 4
</view>
<view class="user-hour">已销课:2课时</view>
<view class="pubu-title">{{item.courseName}} </view>
<view class="hour-nums">
课时: {{item.classHour || 0}} 人数: {{item.peopleNum || 0}}
</view>
<view class="user-hour">已销课:{{item.usedHour || 0}}课时</view>
</view>
</view>
<view class="pubu-bg">
<view wx:for="{{['','','']}}">
<view class="pubu-bg">
<view wx:for="{{list}}" data-data="{{item}}" bindtap="gotoDetails" wx:if="{{index%2 == 1}}">
<view class="pubu-image">
<view class="pubu-tag {{false?'blue-c':'yellow-c'}}">{{false?'正式课班':'体验课'}}</view>
<image class="pubu-images" src="{{item.poster}}" mode="aspectFill" />
<view class="pubu-tag {{item.type == 1?'blue-c':'yellow-c'}}">{{item.type == 1?'正式课班':'体验课'}}</view>
</view>
<view class="pubu-title">控球如欧文运球强化控 </view>
<view class="pubu-title">{{item.courseName}} </view>
<view class="hour-nums">
课时: 4 人数: 4
课时: {{item.classHour || 0}} 人数: {{item.peopleNum || 0}}
</view>
<view class="user-hour">已销课:2课时</view>
<view class="user-hour">已销课:{{item.usedHour || 0}}课时</view>
</view>
</view>
</view>
......@@ -69,19 +72,22 @@
<!-- 按学生 -->
<block wx:if="{{listActive == 2}}">
<view class="stu-list">
<view class="stu-item" wx:for="{{['','','','','']}}">
<view class="stu-list" wx:if="{{list && list.length}}">
<view class="stu-item" wx:for="{{list}}" data-data="{{item}}" bindtap="gotoSudDetail">
<view style="display:flex">
<image class="stu-avatar" wx:if="{{true}}" src="https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/boy_default.png"></image>
<image class="stu-avatar" wx:if="{{item.gender == 1}}" src="https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/boy_default.png"></image>
<image class="stu-avatar" wx:else src="https://ttxs01-10066525.cos.ap-shanghai.myqcloud.com/headImgs/girl_default.png"></image>
<view class="stu-info">
<view class="stu-name">霍华德</view>
<view class="stu-user">已销3课时</view>
<view class="stu-name">{{item.stuName}}</view>
<view class="stu-user">已销{{item.usedHour}}课时</view>
</view>
</view>
<view class="courst-time">总课时:24课时</view>
<view class="courst-time">总课时:{{item.classHour}}</view>
</view>
</view>
</block>
<block wx:if="{{!list.length && finish}}">
<empty></empty>
</block>
</view>
\ No newline at end of file
.page-bg{
overflow: hidden;
min-height: calc(100vh - 122rpx);
min-height: calc(100vh - 30rpx);
width: 100%;
background-color: #fff;
padding-bottom: calc(122rpx + env(safe-area-inset-bottom));
padding-bottom: calc(30rpx + env(safe-area-inset-bottom));
}
.flex-c{
display: flex;
......@@ -42,7 +42,7 @@
}
.btm-tabs-bg{
padding: 0rpx 30rpx;
padding: 0rpx 30rpx 30rpx 30rpx;
background-color: #fff;
}
.list-flex{
......@@ -61,11 +61,11 @@
border-color: #FF811E !important;
}
.input-bg{
margin: 20rpx 30rpx 0rpx 30rpx;
margin: 20rpx 0rpx 0rpx 0rpx;
background: #F4F5F7;
border-radius: 20rpx;
padding: 18rpx 30rpx;
width: calc(100% - 120rpx);
width: calc(100% - 60rpx);
}
.input-bg .van-cell{
margin-left: 10rpx;
......@@ -90,10 +90,16 @@
}
.pubu-image{
position: relative;
margin: 30rpx 0rpx 10rpx 0rpx;
margin: 0rpx 0rpx 10rpx 0rpx;
height: 208rpx;
width: 100%;
border-radius: 24rpx;
object-fit: cover;
object-position: center;
}
.pubu-images{
height: 208rpx;
width: 100%;
background-color: red;
border-radius: 24rpx;
object-fit: cover;
object-position: center;
......@@ -137,6 +143,7 @@
}
.user-hour{
margin-top: 20rpx;
margin-bottom: 30rpx;
font-size: 28rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
......@@ -151,7 +158,7 @@
}
.stu-list .stu-item:nth-child(2n){margin-right:0px !important;}
.stu-item{
margin-top: 22rpx;
margin-bottom: 24rpx;
padding: 30rpx;
width: calc((100% - 142rpx) / 2);
margin-right: 22rpx;
......
var API = require("../../../utils/request");
var tool = require("../../../utils/util.js")
Page({
/**
* 页面的初始数据
*/
data: {
navT: wx.getMenuButtonBoundingClientRect().top,
navH:wx.getMenuButtonBoundingClientRect().bottom - wx.getMenuButtonBoundingClientRect().top,
areaActive:0,
areaList:[], //所属校区列表
popupShow:false,
listActive:2, //1正式班课 2体验订单
list:[],
page:0,
loading:false,
finish:false,
type:0,
typeList:[{name:'学生',value:1},{name:'课程',value:2}],
typeShow:false,
value:'',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({listActive:2,type:0,page:0,list:[],loading:false,finish:false},()=>{
this.getCommonSchool()
this.queryCourseList()
})
},
changeTypePopup(){
this.setData({typeShow:!this.data.typeShow})
},
changePopup(){
this.setData({popupShow:!this.data.popupShow})
},
changeArea(e){
let {index,data} = e.currentTarget.dataset
let that = this
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()
})
},
changeType(e){
let {data,index} = e.currentTarget.dataset
this.setData({
type:index,
typeShow:false,
value:''
})
},
inputValue:tool.debounce(function(e){
let value = e[0].detail
this.setData({value:value,page:0,list:[],loading:false,finish:false},() => {
this.queryCourseList()
})
}),
//学校列表
getCommonSchool(){
let that = this
API.getData('/px/common/getUserSchList', {},function(res){
let list = []
if(res && res.data && res.data.length){
res.data.forEach(item =>{
list.push({name:item.name,value:item.id})
})
}
list.unshift({name:'全部校区',value:''})
that.setData({areaList:list})
})
},
//获取课程列表
queryCourseList(){
let that = this
this.data.page ++
this.data.loading = true
let param = {
page:that.data.page,
size:10,
type:this.data.listActive, //课程类型(1:正式课,2:体验课)
schId:this.data.areaList[this.data.areaActive] && this.data.areaList[this.data.areaActive].value || '', //学校id
}
if(this.data.type == 0){
Object.assign(param,{
stuName:this.data.value
})
}else{
Object.assign(param,{
name:this.data.value
})
}
if(!param.schId){
delete param.schId
}
API.getData('/px/course/getYjList',param, (res) => {
if(res && res.data && res.data.length){
res.data.forEach(item => {
item['_mangers'] = item.pxEmployeeList && item.pxEmployeeList.length && ((item.pxEmployeeList.filter(v => v.empPosition == 'manger')).map(v => v.empName)).join('、') || ''
item['_coachs'] = item.pxEmployeeList && item.pxEmployeeList.length && ((item.pxEmployeeList.filter(v => v.empPosition == 'coach')).map(v => v.empName)).join('、') || ''
})
}
that.data.loading = true
that.data.finish = res.data && 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
})
});
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
goBack(){
wx.navigateBack()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
......@@ -2,7 +2,8 @@
"navigationStyle": "custom",
"usingComponents": {
"t-popup":"/components/t-popup/index",
"xb-icon":"/components/t-icon/t-icon"
"xb-icon":"/components/t-icon/t-icon",
"empty":"/components/empty/empty"
},
"enablePullDownRefresh": false,
"disableScroll":true
......
<view class="page-bg">
<view class="nav-bg flex-s" style="padding-top:{{navT}}px">
<van-icon bindtap="goBack" name="arrow-left" size="40rpx"/>
<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>
<van-icon name="arrow-left" size="32rpx" color="#fff"/>
</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>
<!-- 学生 / 课程 筛选 -->
<view class="search-ctn-bg">
<view class="search-ctn flex-c">
<view class="input-type flex-s" bindtap="changeTypePopup">
{{typeList[type].name}}<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="{{type==0?'请输入学生姓名':'请输入课程名称'}}"
center="{{true}}"
border="{{ false }}"
bind:change="inputValue"
/>
</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>
<block wx:if="{{list && list.length}}">
<view class="course" wx:for="{{list}}">
<view class="flex-s">
<view class="buy-name">
{{item.bmStuName}}<text class="age-c">{{item.age || 1}}岁</text>{{item.bmPhone || ''}}
</view>
<view class="course-state red-c">预警</view>
</view>
<view class="title-price">
<view class="course-title">{{item.name}}</view>
<view class="price">¥{{item.cost ? item.cost / 100 : 0}}</view>
</view>
<view class="text-item">
<view class="course-type {{item.type==1?'banke-c':''}}">{{item.type == 1 ? '正式课' : '体验课'}}</view>
<view class="coachs" wx:if="{{item._coachs}}">授课教练:{{item._coachs}}</view>
<view class="teachers" wx:if="{{item._mangers}}">班主任:{{item._mangers}}</view>
</view>
<view class="course-time">
<view class="time-item red-f-c">剩余课时:<text class="blod-c red-f-c">{{item.syKs || 0}}</text></view>
<view class="time-item">已销课时:<text class="blod-c">{{item.yxKs || 0}}</text></view>
<view class="time-item">总课时:<text class="blod-c">{{item.totalKs || 0}}</text></view>
</view>
</view>
</block>
<block wx:if="{{!list.length && finish}}">
<empty></empty>
</block>
</view>
\ No newline at end of file
.page-bg{
overflow: hidden;
min-height: calc(100vh - 122rpx);
width: 100%;
background-color: #f5f5f5;
padding-bottom: calc(122rpx + env(safe-area-inset-bottom));
}
.flex-c{
display: flex;
align-items: center;
}
.flex-s{
display: flex;
align-items: center;
justify-content: space-between;
}
.nav-bg{
position: relative;
z-index: 9999;
width: calc(100% - 60rpx);
background-color: #fff;
padding: 0rpx 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;
}
.tab-icon{
height: 36rpx;width: 36rpx;
}
.btm-tabs-bg{
padding: 0rpx 30rpx;
background-color: #fff;
}
.list-flex{
display: flex;
justify-content: space-between;
}
.list-tabs{
color: rgba(0, 0, 0, 0.5);
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;
}
.search-ctn-bg{
padding: 20rpx 30rpx 30rpx 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: 90rpx;
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;
}
/* -------------------------- */
.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;
}
.course{
margin-top: 20rpx;
padding: 30rpx;
background-color: #fff;
}
.buy-name{
font-size: 28rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.age-c{
margin: 0rpx 20rpx;
font-size: 24rpx !important;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400 !important;
color: rgba(0, 0, 0, 0.5);
}
.course-state{
padding: 4rpx 10rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
border-radius: 8rpx;
}
.red-c{background: #FF4E4E;color: #fff;}
.gree-c{background: #00BB68;color: #fff;}
.yell-c{background: #DDC200;color: #fff;}
.grey-c{background: rgba(0, 0, 0, 0.08);color: rgba(0, 0, 0, 0.3);}
.course-ctn{
margin-top: 20rpx;
}
.course-img{
position: relative;
height: 186rpx;
width: 300rpx;
border-radius: 24rpx;
}
.course-info{
height: 186rpx;
margin-left: 20rpx;
width: calc(100% - 320rpx);
}
.title-price{
display: flex;
justify-content: space-between;
margin-top: 20rpx;
}
.price{
font-size: 30rpx;
font-family: 'Number';
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
width: 118rpx;
text-align: right;
}
.course-title{
width: calc(100% - 118rpx);
position: relative;
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;
}
.text-item{
margin-top: 20rpx;
display: flex;
align-items: center;
}
.banke-c{
background: linear-gradient(132deg, #2D89FF 0%, #72B0FF 100%) !important;
}
.course-type{
padding: 2rpx 10rpx;
background: linear-gradient(136deg, #FF811E 0%, #F3C100 100%);
border-radius: 8rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
flex: none;
}
.coachs{
margin-left: 10rpx;
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: 1;
-webkit-box-orient: vertical;
}
.teachers{
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
margin-left: 20rpx;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.course-time{
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 32rpx;
}
.time-item{
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.blod-c{
font-size: 30rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.red-f-c{
color: #FF4E4E !important;
}
\ No newline at end of file
......@@ -95,7 +95,7 @@ Page({
if(that.data.share == 1){
console.log('当前是分享进来的')
that.setData({
content: res.data.peopleName + '在“小奔运动”'
content: res.data.peopleName + '在“小奔体育”'
})
}
if(res.data.scoreLevel == 1){
......@@ -264,7 +264,7 @@ Page({
return{
title:name + '在“小奔运动”小程序中完成了一次' + ai + project +'训练,邀请您也一起参与!',
title:name + '在“小奔体育”小程序中完成了一次' + ai + project +'训练,邀请您也一起参与!',
path:'packageA/sitUp/share/share?id=' + that.data.id + '&share=1&showMedal=0&sportTime='+that.data.sportTime,
imageUrl:imageUrl
}
......
......@@ -66,14 +66,6 @@
</view>
</view>
<view class="time">{{sportInfo.createTime}} 完成</view>
<view class="share-content" wx:if="{{share == 1}}">
<view class="line"></view>
<view class="share-text">
<view class="share-yq">邀请你也一起来运动</view>
<view class="share-sm">扫码关注“小奔运动”公众号,了解更多</view>
</view>
<image class="share-img" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/gzh-ewm.png"></image>
</view>
</view>
<view class="foot" wx:if="{{share == 0}}">
......
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