Commit be116cd8 by tangjiale

1

parent 2e3dab1c
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
"root": "subPages/organ", "root": "subPages/organ",
"name": "organ", "name": "organ",
"pages": [ "pages": [
"course-list/course-list" "course-list/course-list",
"course-destroy/course-destroy"
] ]
}, },
{ {
...@@ -65,7 +66,8 @@ ...@@ -65,7 +66,8 @@
"login/index", "login/index",
"mobile-login/mobile-login", "mobile-login/mobile-login",
"privacy/privacy", "privacy/privacy",
"role-list/role-list" "role-list/role-list",
"organ-info/organ-info"
] ]
} }
], ],
...@@ -95,7 +97,8 @@ ...@@ -95,7 +97,8 @@
"usingComponents": { "usingComponents": {
"van-swipe-cell": "@vant/weapp/swipe-cell/index", "van-swipe-cell": "@vant/weapp/swipe-cell/index",
"van-field": "@vant/weapp/field/index", "van-field": "@vant/weapp/field/index",
"van-sticky": "@vant/weapp/sticky/index" "van-sticky": "@vant/weapp/sticky/index",
"van-icon": "@vant/weapp/icon/index"
}, },
"requiredBackgroundModes": [ "requiredBackgroundModes": [
"audio" "audio"
......
...@@ -106,6 +106,9 @@ Component({ ...@@ -106,6 +106,9 @@ Component({
if(res.code == 200){ if(res.code == 200){
API.getData('/px/user/getUserInfo', { }, function (ress) { API.getData('/px/user/getUserInfo', { }, function (ress) {
if(ress.code == 200){ if(ress.code == 200){
if(ress.data.birthday && ress.data.birthday.length){
ress.data.birthday = ress.data.birthday.slice(0,10)
}
wx.setStorageSync('userInfo',ress.data) wx.setStorageSync('userInfo',ress.data)
} }
}, function () { }, function () {
......
images/course/call-icon.png

1020 Bytes | W: | H:

images/course/call-icon.png

1.2 KB | W: | H:

images/course/call-icon.png
images/course/call-icon.png
images/course/call-icon.png
images/course/call-icon.png
  • 2-up
  • Swipe
  • Onion skin
images/organ/btm-arror.png

276 Bytes | W: | H:

images/organ/btm-arror.png

415 Bytes | W: | H:

images/organ/btm-arror.png
images/organ/btm-arror.png
images/organ/btm-arror.png
images/organ/btm-arror.png
  • 2-up
  • Swipe
  • Onion skin
images/organ/index-tab1.png

1.43 KB | W: | H:

images/organ/index-tab1.png

2.82 KB | W: | H:

images/organ/index-tab1.png
images/organ/index-tab1.png
images/organ/index-tab1.png
images/organ/index-tab1.png
  • 2-up
  • Swipe
  • Onion skin
images/organ/index-tab2.png

1.58 KB | W: | H:

images/organ/index-tab2.png

3.12 KB | W: | H:

images/organ/index-tab2.png
images/organ/index-tab2.png
images/organ/index-tab2.png
images/organ/index-tab2.png
  • 2-up
  • Swipe
  • Onion skin
images/organ/index-tab3.png

1.5 KB | W: | H:

images/organ/index-tab3.png

2.92 KB | W: | H:

images/organ/index-tab3.png
images/organ/index-tab3.png
images/organ/index-tab3.png
images/organ/index-tab3.png
  • 2-up
  • Swipe
  • Onion skin
images/organ/index-tab4.png

1.64 KB | W: | H:

images/organ/index-tab4.png

3.16 KB | W: | H:

images/organ/index-tab4.png
images/organ/index-tab4.png
images/organ/index-tab4.png
images/organ/index-tab4.png
  • 2-up
  • Swipe
  • Onion skin
images/organ/top-arror.png

269 Bytes | W: | H:

images/organ/top-arror.png

412 Bytes | W: | H:

images/organ/top-arror.png
images/organ/top-arror.png
images/organ/top-arror.png
images/organ/top-arror.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-06 16:44:43 * @Date: 2022-06-06 16:44:43
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-17 17:14:41 * @LastEditTime: 2022-06-21 10:11:43
*/ */
var app = getApp(); var app = getApp();
var API = require("../../utils/request.js"); var API = require("../../utils/request.js");
...@@ -27,10 +27,10 @@ Page({ ...@@ -27,10 +27,10 @@ Page({
'employ':[ 'employ':[
{ {
title:'个人资料',event:'info', title:'个人资料',event:'info',
icon:'https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_question.png' icon:'/images/course/grzl-icon.png'
},{ },{
title:'客服电话',event:'call', title:'客服电话',event:'call',
icon:'https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_question.png' icon:'/images/course/call-icon.png'
},{ },{
title:'切换身份',event:'change', title:'切换身份',event:'change',
icon:'/images/course/sf-icon.png' icon:'/images/course/sf-icon.png'
...@@ -96,11 +96,20 @@ Page({ ...@@ -96,11 +96,20 @@ Page({
} }
API.getData('/px/user/switchRole', data, function (res) { API.getData('/px/user/switchRole', data, function (res) {
if (res.code == 200) { if (res.code == 200) {
that.onShow(); wx.showToast({
wx.showToast({ title: '切换成功',
title: '切换成功', icon: 'none'
icon: 'none' })
}) wx.login({
success: res => {
API.getData('/wx/user/wx7d7fbc0e6746baf5/auth', {
code: res.code
}, function(res) {
that.onShow();
})
}
})
} else { } else {
wx.showToast({ wx.showToast({
icon: "none", icon: "none",
...@@ -116,7 +125,9 @@ Page({ ...@@ -116,7 +125,9 @@ Page({
let that = this let that = this
switch(type){ switch(type){
case 'info': //个人资料 case 'info': //个人资料
wx.navigateTo({
url: '/subPages/login/organ-info/organ-info'
})
break break
case 'call': //客服电话 case 'call': //客服电话
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<view class="mine-main management-bg" wx:else></view> <view class="mine-main management-bg" wx:else></view>
<!-- 功能菜单 --> <!-- 功能菜单 -->
<view class="menu"> <view class="menu" wx:if="{{userInfo.peopleType}}">
<view class="menu-list"> <view class="menu-list">
<view wx:for="{{userInfo.peopleType=='employ'?optionTab['employ']:optionTab['parent']}}" <view wx:for="{{userInfo.peopleType=='employ'?optionTab['employ']:optionTab['parent']}}"
class="menu-item" data-type="{{item.event}}" bindtap="handleTab"> class="menu-item" data-type="{{item.event}}" bindtap="handleTab">
......
...@@ -236,6 +236,7 @@ page { ...@@ -236,6 +236,7 @@ page {
} }
.all-child { .all-child {
flex: none;
float: right; float: right;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-06 14:15:22 * @Date: 2022-06-06 14:15:22
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-18 17:30:37 * @LastEditTime: 2022-06-20 15:23:34
*/ */
var API = require("../../utils/request"); var API = require("../../utils/request");
Page({ Page({
...@@ -16,9 +16,7 @@ Page({ ...@@ -16,9 +16,7 @@ Page({
navH:wx.getMenuButtonBoundingClientRect().bottom - wx.getMenuButtonBoundingClientRect().top, navH:wx.getMenuButtonBoundingClientRect().bottom - wx.getMenuButtonBoundingClientRect().top,
areaActive:0, areaActive:0,
areaList:[ areaList:[], //所属校区列表
{name:'全部校区',value:''},{name:'湖南校区',value:'32'},{name:'长沙星沙体育飞跃机构',value:'32'},{name:'霍华德篮球迅雷',value:'32'}
], //所属校区列表
popupShow:false, popupShow:false,
listActive:2, //1正式课 2体验课 listActive:2, //1正式课 2体验课
...@@ -26,7 +24,9 @@ Page({ ...@@ -26,7 +24,9 @@ Page({
list:[], list:[],
page:0, page:0,
loading:false, loading:false,
finish:false finish:false,
courseNums:{}
}, },
/** /**
...@@ -37,6 +37,11 @@ Page({ ...@@ -37,6 +37,11 @@ Page({
this.setData({listActive:2,page:0,list:[],loading:false,finish:false},()=>{ this.setData({listActive:2,page:0,list:[],loading:false,finish:false},()=>{
this.queryCourseList() this.queryCourseList()
}) })
//获取公共校区列表
this.getCommonSchool()
//获取学校统计数据
this.querySchoolNums()
}, },
/** /**
...@@ -50,6 +55,27 @@ Page({ ...@@ -50,6 +55,27 @@ Page({
}) })
} }
}, },
//学校列表
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})
})
},
//员工首页统计信息
querySchoolNums(){
let that = this
API.getData('/px/course/getEmpIndexInfo', {schId:that.data.areaList[that.data.areaActive] && that.data.areaList[that.data.areaActive].value || ''},function(res){
that.setData({courseNums:res.data || {}})
})
},
goJump(e){ goJump(e){
let {link} = e.currentTarget.dataset let {link} = e.currentTarget.dataset
switch (Number(link)){ switch (Number(link)){
...@@ -64,6 +90,9 @@ Page({ ...@@ -64,6 +90,9 @@ Page({
}) })
break break
case 3: //教练消课 case 3: //教练消课
wx.navigateTo({
url: '/subPages/organ/course-destroy/course-destroy'
})
break break
case 3: //课时预警 case 3: //课时预警
break break
...@@ -74,8 +103,14 @@ Page({ ...@@ -74,8 +103,14 @@ Page({
}, },
changeArea(e){ changeArea(e){
let {index,data} = e.currentTarget.dataset let {index,data} = e.currentTarget.dataset
let that = this
this.setData({areaActive:index,popupShow:false},()=> {
that.querySchoolNums()
this.setData({areaActive:index,popupShow:false}) this.setData({listActive:2,page:0,list:[],loading:false,finish:false},()=>{
this.queryCourseList()
})
})
}, },
changeList(e){ changeList(e){
let {type} = e.currentTarget.dataset let {type} = e.currentTarget.dataset
...@@ -87,8 +122,9 @@ Page({ ...@@ -87,8 +122,9 @@ Page({
let that = this let that = this
this.data.page ++ this.data.page ++
this.data.loading = true this.data.loading = true
API.getData('/px/course/getMobileCourseList', { API.getData('/px/course/getEmpCourseList', {
page:that.data.page, page:that.data.page,
schId:that.data.areaList[that.data.areaActive] && that.data.areaList[that.data.areaActive].value || '',
size:10, size:10,
type:that.data.listActive, //课程类型(1:正式课,2:体验课) type:that.data.listActive, //课程类型(1:正式课,2:体验课)
}, (res) => { }, (res) => {
......
...@@ -34,19 +34,19 @@ ...@@ -34,19 +34,19 @@
<view class="count-flex"> <view class="count-flex">
<view class="count-item"> <view class="count-item">
<view class="count-title">体验课订购</view> <view class="count-title">体验课订购</view>
<view class="count-value">20</view> <view class="count-value">{{courseNums.expNum || 0}}</view>
</view> </view>
<view class="count-item"> <view class="count-item">
<view class="count-title">班课报名</view> <view class="count-title">班课报名</view>
<view class="count-value">20</view> <view class="count-value">{{courseNums.normalNum || 0}}</view>
</view> </view>
<view class="count-item"> <view class="count-item">
<view class="count-title">预警学生</view> <view class="count-title">预警学生</view>
<view class="count-value">20</view> <view class="count-value">{{courseNums.warnNum || 0}}</view>
</view> </view>
<view class="count-item"> <view class="count-item">
<view class="count-title">昨日新增</view> <view class="count-title">昨日新增</view>
<view class="count-value">20</view> <view class="count-value">{{courseNums.addNum || 0}}</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -50,6 +50,27 @@ ...@@ -50,6 +50,27 @@
{ {
"name": "机构-体验课订单", "name": "机构-体验课订单",
"pathName": "subPages/organ/course-list/course-list", "pathName": "subPages/organ/course-list/course-list",
"query": "courseType=2",
"launchMode": "default",
"scene": null
},
{
"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": "", "query": "",
"scene": null, "scene": null,
"launchMode": "default" "launchMode": "default"
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
color: #267ACA !important; color: #267ACA !important;
} }
.course-teachers{ .course-teachers{
margin-top: 62rpx; margin-top: 20rpx;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC; font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
......
...@@ -66,12 +66,12 @@ ...@@ -66,12 +66,12 @@
font-weight: bold; font-weight: bold;
color: #000000; color: #000000;
display: -webkit-box; display: -webkit-box;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
word-wrap: break-word; word-wrap: break-word;
white-space: normal !important; white-space: normal !important;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.course-info-h{ .course-info-h{
height: 155rpx; height: 155rpx;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-14 17:37:06 * @Date: 2022-06-14 17:37:06
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-18 14:02:50 * @LastEditTime: 2022-06-20 16:29:50
*/ */
var API = require("../../../utils/request.js"); var API = require("../../../utils/request.js");
Page({ Page({
...@@ -230,6 +230,9 @@ Page({ ...@@ -230,6 +230,9 @@ Page({
}, function(res) { }, function(res) {
API.getData('/px/user/getUserInfo', { }, function (ress) { API.getData('/px/user/getUserInfo', { }, function (ress) {
if(ress.code == 200){ if(ress.code == 200){
if(ress.data.birthday && ress.data.birthday.length){
ress.data.birthday = ress.data.birthday.slice(0,10)
}
wx.setStorageSync('peopleType',ress.data.peopleType) wx.setStorageSync('peopleType',ress.data.peopleType)
wx.setStorageSync('userInfo',ress.data) wx.setStorageSync('userInfo',ress.data)
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-06 15:52:31 * @Date: 2022-06-06 15:52:31
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-18 14:18:31 * @LastEditTime: 2022-06-21 10:26:57
*/ */
var API = require("../../../utils/request.js"); var API = require("../../../utils/request.js");
var postData = {}; var postData = {};
...@@ -68,6 +68,9 @@ Page({ ...@@ -68,6 +68,9 @@ Page({
wxGetUserInfo(){ wxGetUserInfo(){
API.getData('/px/user/getUserInfo', { }, function (res) { API.getData('/px/user/getUserInfo', { }, function (res) {
if(res.code == 200){ if(res.code == 200){
if(res.data.birthday && res.data.birthday.length){
res.data.birthday = ress.data.birthday.slice(0,10)
}
//TODO 开发阶段写死身份 //TODO 开发阶段写死身份
// res.data.peopleType = 'employ' // res.data.peopleType = 'employ'
wx.setStorageSync('userInfo',res.data) wx.setStorageSync('userInfo',res.data)
......
...@@ -144,6 +144,9 @@ Page({ ...@@ -144,6 +144,9 @@ Page({
wxGetUserInfo(){ wxGetUserInfo(){
API.getData('/px/user/getUserInfo', { }, function (res) { API.getData('/px/user/getUserInfo', { }, function (res) {
if(res.code == 200){ if(res.code == 200){
if(res.data.birthday && res.data.birthday.length){
res.data.birthday = res.data.birthday.slice(0,10)
}
wx.setStorageSync('userInfo',res.data) wx.setStorageSync('userInfo',res.data)
} }
}, function () { }, function () {
......
/*
* @Author: tangjiale
* @eMail: 932055106@qq.com
* @Date: 2022-06-20 15:04:19
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-20 15:22:41
*/
// subPages/login/organ-info/organ-info.js
Page({
/**
* 页面的初始数据
*/
data: {
navT: wx.getMenuButtonBoundingClientRect().top,
navH:wx.getMenuButtonBoundingClientRect().bottom - wx.getMenuButtonBoundingClientRect().top,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let userInfo = wx.getStorageSync('userInfo')
this.setData({userInfo:userInfo})
},
goBack(){
wx.navigateBack()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"navigationStyle": "custom",
"navigationBarTitleText": "个人资料",
"usingComponents": {}
}
\ No newline at end of file
<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">
<text>个人资料</text>
</view>
<van-icon name="arrow-left" size="32rpx" color="#f5f5f5"/>
</view>
<view class="info-card">
<view class="card-item">
<view class="card-item-title">姓名</view>
<view class="card-item-value">{{userInfo.name}}</view>
</view>
<view class="card-item">
<view class="card-item-title">联系电话</view>
<view class="card-item-value">{{userInfo.phone}}</view>
</view>
<view class="card-item">
<view class="card-item-title">部门</view>
<view class="card-item-value">{{userInfo.dptNames || ''}}</view>
</view>
<view class="card-item">
<view class="card-item-title">岗位</view>
<view class="card-item-value">{{userInfo.posNames || ''}}</view>
</view>
</view>
</view>
\ No newline at end of file
.page-bg{
min-height: 100vh;
width: 100%;
background-color: #F5F5F5;
overflow: hidden;
}
.flex-s{
display: flex;
align-items: center;
justify-content: space-between;
}
.flex-c{display: flex;align-items: center;}
.nav-bg{
position: relative;
z-index: 9999;
width: calc(100% - 60rpx);
padding: 0rpx 30rpx;
}
.info-card{
margin: 20rpx 30rpx 0rpx 30rpx;
width: calc(100% - 140rpx);
background: #FFFFFF;
border-radius: 24rpx;
padding: 0rpx 40rpx;
}
.info-card .card-item:last-child{
border: none !important;
}
.card-item{
border-bottom: 1rpx solid #EEEEEE;
height: 100rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.card-item-title{
font-size: 34rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #353535;
}
.card-item-value{
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #888888;
}
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-14 08:36:57 * @Date: 2022-06-14 08:36:57
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-15 19:02:26 * @LastEditTime: 2022-06-21 10:28:22
*/ */
var API = require("../../../utils/request.js"); var API = require("../../../utils/request.js");
...@@ -71,6 +71,9 @@ Page({ ...@@ -71,6 +71,9 @@ Page({
wxGetUserInfo(){ wxGetUserInfo(){
API.getData('/px/user/getUserInfo', { }, function (res) { API.getData('/px/user/getUserInfo', { }, function (res) {
if(res.code == 200){ if(res.code == 200){
if(res.data.birthday && res.data.birthday.length){
res.data.birthday = res.data.birthday.slice(0,10)
}
wx.setStorageSync('peopleType',res.data.peopleType) wx.setStorageSync('peopleType',res.data.peopleType)
wx.setStorageSync('userInfo',res.data) wx.setStorageSync('userInfo',res.data)
} }
......
/*
* @Author: tangjiale
* @eMail: 932055106@qq.com
* @Date: 2022-06-20 11:16:04
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-20 15:24:11
*/
var API = require("../../../utils/request");
Page({
/**
* 页面的初始数据
*/
data: {
navT: wx.getMenuButtonBoundingClientRect().top,
navH:wx.getMenuButtonBoundingClientRect().bottom - wx.getMenuButtonBoundingClientRect().top,
areaActive:0,
areaList:[], //所属校区列表
popupShow:false,
listActive:1, //1课程 2学生
list:[],
page:0,
loading:false,
finish:false,
value:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getCommonSchool()
},
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()
})
},
inputValue(e){
let value = e.detail
this.setData({value:value})
},
//学校列表
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})
})
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
goBack(){
wx.navigateBack()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"navigationStyle": "custom",
"usingComponents": {
"t-popup":"/components/t-popup/index",
"xb-icon":"/components/t-icon/t-icon"
},
"enablePullDownRefresh": false,
"disableScroll":true
}
\ No newline at end of file
<view class="pgae-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==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">
<xb-icon type="icon-icon_search" size="40" color="#C3CAD3"></xb-icon>
<van-field style="width:100%"
value="{{ value }}"
placeholder="{{listActive==1?'请输入课程名称':'请输入学生姓名'}}"
border="{{ false }}"
bind:change="inputValue"
/>
</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>
</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;
}
.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{
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;
}
.input-bg{
margin: 20rpx 30rpx 0rpx 30rpx;
background: #F4F5F7;
border-radius: 20rpx;
padding: 18rpx 30rpx;
width: calc(100% - 120rpx);
}
.input-bg .van-cell{
margin-left: 10rpx;
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;
}
\ No newline at end of file
// subPages/organ/experience-list/experience-list.js
var API = require("../../../utils/request.js");
var tool = require("../../../utils/util.js")
Page({ Page({
/** /**
...@@ -8,9 +10,7 @@ Page({ ...@@ -8,9 +10,7 @@ Page({
courseType:'', //1正式课 2体验课 courseType:'', //1正式课 2体验课
areaActive:0, areaActive:0,
areaList:[ areaList:[], //所属校区列表
{name:'全部校区',value:''},{name:'湖南校区',value:'32'},{name:'长沙星沙体育飞跃机构',value:'32'},{name:'霍华德篮球迅雷',value:'32'}
], //所属校区列表
areaShow:false, areaShow:false,
stateActive:0, stateActive:0,
...@@ -24,13 +24,21 @@ Page({ ...@@ -24,13 +24,21 @@ Page({
typeList:[{name:'学生',value:1},{name:'课程',value:2}], typeList:[{name:'学生',value:1},{name:'课程',value:2}],
typeShow:false, typeShow:false,
value:'', value:'',
page:0,
list:[],
loading:false,
finish:false,
orderCount:{}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
//获取公共校区列表
this.getCommonSchool()
}, },
/** /**
...@@ -43,12 +51,33 @@ Page({ ...@@ -43,12 +51,33 @@ Page({
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: courseType== 1? '班课报名' : '体验课订单' title: courseType== 1? '班课报名' : '体验课订单'
}); });
},
inputValue(e){ //1正式课 2体验课
let value = e.detail this.setData({page:0,list:[],loading:false,finish:false},()=>{
this.setData({value:value}) this.queryCourseList()
this.getExpCourseCount()
})
},
//学校列表
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})
})
}, },
inputValue:tool.debounce(function(e){
let value = e[0].detail
this.setData({value:value,page:0,list:[],loading:false,finish:false},() => {
this.queryCourseList()
})
}),
changeTypePopup(){ changeTypePopup(){
this.setData({typeShow:!this.data.typeShow}) this.setData({typeShow:!this.data.typeShow})
}, },
...@@ -56,7 +85,8 @@ Page({ ...@@ -56,7 +85,8 @@ Page({
let {data,index} = e.currentTarget.dataset let {data,index} = e.currentTarget.dataset
this.setData({ this.setData({
type:index, type:index,
typeShow:false typeShow:false,
value:''
}) })
}, },
changeStatePopup(){ changeStatePopup(){
...@@ -70,31 +100,111 @@ Page({ ...@@ -70,31 +100,111 @@ Page({
this.setData({ this.setData({
areaActive:index, areaActive:index,
areaShow:false areaShow:false,page:0,list:[],loading:false,finish:false
},() => {
this.queryCourseList()
this.getExpCourseCount()
}) })
}, },
changeState(e){ changeState(e){
let {data,index} = e.currentTarget.dataset let {data,index} = e.currentTarget.dataset
this.setData({ this.setData({
stateActive:index, stateActive:index,
stateShow:false stateShow:false,page:0,list:[],loading:false,finish:false
},() => {
this.queryCourseList()
}) })
}, },
/**
* 页面相关事件处理函数--监听用户下拉动作 //员工体验课订单统计
*/ getExpCourseCount(){
onPullDownRefresh: function () { let that = this
let param = {
schId:this.data.areaList[this.data.areaActive] && this.data.areaList[this.data.areaActive].value || ''
}
API.getData('/px/course/getExpCourseCount',param, (res) => {
that.setData({orderCount:res.data})
})
}, },
/** //获取课程列表
* 页面上拉触底事件的处理函数 queryCourseList(){
*/ let that = this
onReachBottom: function () { this.data.page ++
this.data.loading = true
let url = this.data.courseType == 1 ? '' : '/px/course/getExpCourseOrderList'
let param = {
page:that.data.page,
size:10,
schId:this.data.areaList[this.data.areaActive] && this.data.areaList[this.data.areaActive].value || '', //学校id
orderStatus:this.data.stateList[this.data.stateActive].value || '', //订单状态
}
if(this.data.type == 0){
Object.assign(param,{
stuName:this.data.value
})
}else{
Object.assign(param,{
courseName:this.data.value
})
}
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('、') || ''
})
}
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()
},
//退款操作(1:同意退款,2:拒绝退款)
doRefund(e){
let {data,event} = e.currentTarget.dataset
let that = this
wx.showModal({
title: '提示',
content: event == 1 ? '你确定要同意退款吗':'你确定要拒绝退款吗',
success(res) {
if (res.confirm) {
API.getData('/px/course/doRefund', {orderId:data.orderId,refundStatus:event}, (res) => {
if(res.code == 200){
wx.showToast({
title: '操作成功',
icon: 'success',
duration: 2000
});
setTimeout(() =>{
//1正式课 2体验课
that.setData({page:0,list:[],loading:false,finish:false},()=>{
that.queryCourseList()
that.getExpCourseCount()
})
},1500)
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}, },
payCourse(e){
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
......
{ {
"usingComponents": { "usingComponents": {
"t-popup":"/components/t-popup/index", "t-popup":"/components/t-popup/index",
"xb-icon":"/components/t-icon/t-icon" "xb-icon":"/components/t-icon/t-icon",
"empty":"/components/empty/empty"
} }
} }
\ No newline at end of file
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<view class="search-ctn-bg"> <view class="search-ctn-bg">
<view class="search-ctn flex-c"> <view class="search-ctn flex-c">
<view class="input-type flex-s" bindtap="changeTypePopup"> <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> {{typeList[type].name}}<xb-icon type="icon-icon_pull-down" size="32"></xb-icon>
</view> </view>
<view class="type-popup" wx:if="{{typeShow}}"> <view class="type-popup" wx:if="{{typeShow}}">
<view class="type-item {{type==index?'active-c':''}}" data-data="{{item}}" data-index="{{index}}" <view class="type-item {{type==index?'active-c':''}}" data-data="{{item}}" data-index="{{index}}"
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<view class="input-bg flex-c"> <view class="input-bg flex-c">
<van-field clearable style="width:100%" <van-field clearable style="width:100%"
value="{{ value }}" value="{{ value }}"
placeholder="请输入用户名" placeholder="{{type==0?'请输入学生姓名':'请输入课程名称'}}"
center="{{true}}" center="{{true}}"
border="{{ false }}" border="{{ false }}"
bind:change="inputValue" bind:change="inputValue"
...@@ -42,14 +42,14 @@ ...@@ -42,14 +42,14 @@
<!-- 统计数据 --> <!-- 统计数据 -->
<view class="nums-ctn"> <view class="nums-ctn">
<block wx:if="{{courseType == 1}}"> <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">{{orderCount.cancelWaitNum || 0}}</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">{{orderCount.cancelWaitNum || 0}}</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">{{orderCount.cancelWaitNum || 0}}</text></view>
</block> </block>
<block wx:if="{{courseType == 2}}"> <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">{{orderCount.orderNum || 0}}</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">{{orderCount.sucOrderNum || 0}}</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">{{orderCount.cancelWaitNum || 0}}</text></view>
</block> </block>
</view> </view>
</view> </view>
...@@ -71,5 +71,46 @@ ...@@ -71,5 +71,46 @@
</t-popup> </t-popup>
</van-sticky> </van-sticky>
<block wx:if="{{list && list.length}}">
<view class="course" wx:for="{{list}}" wx:key="{{index}}">
<view class="flex-s">
<view class="buy-name">
{{item.stuName}}<text class="age-c">{{item.age || 1}}岁</text>{{item.phone || ''}}
</view>
<!-- 0:待支付,1:已订购,2:待退款,3:已退款,4:已关闭) -->
<view class="course-state {{['red-c','gree-c','yell-c','grey-c','grey-c'][item.orderStatus]}}">{{['待支付','已订购','待退款','已退款','已关闭'][item.orderStatus]}}</view>
</view>
<view class="course-title">{{item.courseName}}</view>
<view class="flex-s course-tags">
<view class="flex-c">
<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 class="course-teachers">
授课教练:{{item._empNames}}
</view>
</view>
<view class="course-time flex-c">
订购时间:<view class="course-time-v">{{item.orderTime}}</view>
</view>
<view class="course-time flex-c">
课程金额:<view class="course-time-v">¥{{item.orderAmt ? item.orderAmt / 100 : 0}}</view>
</view>
<view class="course-btm" wx:if="{{item.orderStatus == 2}}">
<!-- orderStatus (0:待支付,1:已订购,2:待退款,3:已退款,4:已关闭) -->
<view class="cannal-btn" data-data="{{item}}" data-event='2' bindtap="doRefund">拒绝退款</view>
<view class="pay-btn" data-data="{{item}}" data-event='1' bindtap="doRefund">同意退款</view>
</view>
</view>
</block>
<block wx:if="{{!list.length && finish}}">
<empty></empty>
</block>
</view> </view>
\ No newline at end of file
.page-bg{ .page-bg{
min-height: 100vh; min-height: 100vh;
width: 100%; width: 100%;
padding-bottom: 960rpx;
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.active-c{ .active-c{
...@@ -76,7 +75,7 @@ ...@@ -76,7 +75,7 @@
color: rgba(0, 0, 0, 0.9); color: rgba(0, 0, 0, 0.9);
} }
.type-popup{ .type-popup{
top: 105rpx; top: 90rpx;
left: 0rpx; left: 0rpx;
position: absolute; position: absolute;
height: 152rpx; height: 152rpx;
...@@ -163,4 +162,167 @@ ...@@ -163,4 +162,167 @@
background: #FAF8F6; background: #FAF8F6;
font-weight: bold !important; font-weight: bold !important;
color: #FF811E !important; color: #FF811E !important;
}
.flex-s{
display: flex;
align-items: center;
justify-content: space-between;
}
.flex-c{
display: flex;align-items: center;
}
.course{
margin-top: 20rpx;
padding: 30rpx;
background-color: #fff;
}
.course-time{
margin-top: 20rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.course-time-v{
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.9) !important;
}
.course-btm{
display: flex;
align-items: center;
justify-content: flex-end;
}
.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);
}
.course-title{
margin-top: 20rpx;
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;
}
.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;
}
.course-tags{
margin-top: 10rpx;
}
.course-teachers{
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 332rpx;
}
.btm-line{
margin-top: 30rpx;
}
.t1{
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.t2{
font-size: 30rpx;
font-family: D-DIN DIN-Bold, D-DIN DIN;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.course-price{
margin-left: 10rpx;
font-size: 44rpx;
font-family: 'Number';
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.cannal-btn{
padding: 10rpx 30rpx;
font-size: 28rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
border-radius: 32rpx;
opacity: 1;
border: 2rpx solid rgba(0, 0, 0, 0.1);
}
.pay-btn{
font-size: 28rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #FFFFFF;
background: #FF811E;
border-radius: 32rpx;
padding: 10rpx 30rpx;
margin-left: 20rpx;
} }
\ No newline at end of file
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