Commit 55d01334 by tangjiale

更新代码

parent be116cd8
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 16:44:43
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-21 10:11:43
* @LastEditTime: 2022-06-21 10:32:17
*/
var app = getApp();
var API = require("../../utils/request.js");
......@@ -96,20 +96,11 @@ Page({
}
API.getData('/px/user/switchRole', data, function (res) {
if (res.code == 200) {
wx.showToast({
title: '切换成功',
icon: 'none'
})
wx.login({
success: res => {
API.getData('/wx/user/wx7d7fbc0e6746baf5/auth', {
code: res.code
}, function(res) {
that.onShow();
})
}
})
that.onShow();
wx.showToast({
title: '切换成功',
icon: 'none'
})
} else {
wx.showToast({
icon: "none",
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 14:15:22
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-20 15:23:34
* @LastEditTime: 2022-06-21 11:43:52
*/
var API = require("../../utils/request");
Page({
......@@ -42,6 +42,7 @@ Page({
this.getCommonSchool()
//获取学校统计数据
this.querySchoolNums()
wx.stopPullDownRefresh()
},
/**
......@@ -158,7 +159,7 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.onShow()
this.onLoad()
},
/**
......
{
"navigationStyle": "custom",
"enablePullDownRefresh":true,
"usingComponents": {
"t-popup":"../../components/t-popup/index"
}
......
<!-- 机构 我的页面 -->
<view class="page-bg">
<van-sticky z-index="99">
<!-- <van-sticky z-index="99"> -->
<view class="nav-bg" style="padding-top:{{navT}}px">
<view class="flex-c" style="height:{{navH}}px" bindtap="changePopup">
<view class="head-tabs">{{areaList[areaActive].name}}</view>
......@@ -65,7 +65,7 @@
data-index="{{index}}" data-data="{{item}}" wx:for="{{areaList}}">{{item.name}}</view>
</view>
</t-popup>
</van-sticky>
<!-- </van-sticky> -->
<view class="list-bg">
<block wx:if="{{list && list.length}}">
......
......@@ -50,9 +50,9 @@
{
"name": "机构-体验课订单",
"pathName": "subPages/organ/course-list/course-list",
"query": "courseType=2",
"launchMode": "default",
"scene": null
"query": "courseType=1",
"scene": null,
"launchMode": "default"
},
{
"name": "",
......@@ -72,8 +72,8 @@
"name": "个人资料",
"pathName": "subPages/login/organ-info/organ-info",
"query": "",
"scene": null,
"launchMode": "default"
"launchMode": "default",
"scene": null
}
]
}
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-14 17:37:06
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-20 16:29:50
* @LastEditTime: 2022-06-21 10:39:25
*/
var API = require("../../../utils/request.js");
Page({
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 15:52:31
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-21 10:26:57
* @LastEditTime: 2022-06-21 10:33:45
*/
var API = require("../../../utils/request.js");
var postData = {};
......@@ -69,7 +69,7 @@ Page({
API.getData('/px/user/getUserInfo', { }, function (res) {
if(res.code == 200){
if(res.data.birthday && res.data.birthday.length){
res.data.birthday = ress.data.birthday.slice(0,10)
res.data.birthday = res.data.birthday.slice(0,10)
}
//TODO 开发阶段写死身份
// res.data.peopleType = 'employ'
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-20 11:16:04
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-20 15:24:11
* @LastEditTime: 2022-06-21 11:14:57
*/
var API = require("../../../utils/request");
Page({
......@@ -19,7 +19,7 @@ Page({
areaList:[], //所属校区列表
popupShow:false,
listActive:1, //1课程 2学生
listActive:2, //1课程 2学生
list:[],
page:0,
......
......@@ -19,7 +19,6 @@
<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?'请输入课程名称':'请输入学生姓名'}}"
......@@ -27,9 +26,6 @@
bind:change="inputValue"
/>
</view>
<!-- 头部校区切换弹窗 -->
<t-popup show="{{popupShow}}" closeOnClickOverlay="{{false}}" type="top">
<view class="popup-bg" style="padding-top:{{navT + navH + 7}}px">
......@@ -37,4 +33,55 @@
data-index="{{index}}" data-data="{{item}}" wx:for="{{areaList}}">{{item.name}}</view>
</view>
</t-popup>
<!-- 按课程 -->
<block wx:if="{{listActive == 1}}">
<view class="pubu-list">
<view class="pubu-bg">
<view wx:for="{{['','']}}">
<view class="pubu-image">
<view class="pubu-tag {{true?'blue-c':'yellow-c'}}">{{true?'正式课班':'体验课'}}</view>
</view>
<view class="pubu-title">控球如欧文运球强化控 球如欧文运球强化球阿斯顿爱思啊</view>
<view class="hour-nums">
课时: 4 人数: 4
</view>
<view class="user-hour">已销课:2课时</view>
</view>
</view>
<view class="pubu-bg">
<view wx:for="{{['','','']}}">
<view class="pubu-image">
<view class="pubu-tag {{false?'blue-c':'yellow-c'}}">{{false?'正式课班':'体验课'}}</view>
</view>
<view class="pubu-title">控球如欧文运球强化控 </view>
<view class="hour-nums">
课时: 4 人数: 4
</view>
<view class="user-hour">已销课:2课时</view>
</view>
</view>
</view>
</block>
<!-- 按学生 -->
<block wx:if="{{listActive == 2}}">
<view class="stu-list">
<view class="stu-item" wx:for="{{['','','','','']}}">
<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: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>
</view>
<view class="courst-time">总课时:24课时</view>
</view>
</view>
</block>
</view>
\ No newline at end of file
......@@ -78,6 +78,112 @@
color: rgba(0, 0, 0, 0.9) !important;
}
.pubu-list{
margin: 0rpx 30rpx;
width: calc(100% - 60rpx);
display: flex;
justify-content: space-between;
}
.pubu-bg{
position: relative;
width: calc((100% - 22rpx) / 2);
}
.pubu-image{
position: relative;
margin: 30rpx 0rpx 10rpx 0rpx;
height: 208rpx;
width: 100%;
background-color: red;
border-radius: 24rpx;
object-fit: cover;
object-position: center;
}
.pubu-tag{
position: absolute;
left: 10rpx;top: 10rpx;
padding: 4rpx 10rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
border-radius: 8rpx;
}
.blue-c{
background: linear-gradient(132deg, #2D89FF 0%, #72B0FF 100%);
}
.yellow-c{
background: linear-gradient(136deg, #FF811E 0%, #F3C100 100%);
}
.pubu-title{
margin-top: 20rpx;
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.hour-nums{
margin-top: 10rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.user-hour{
margin-top: 20rpx;
font-size: 28rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.stu-list{
margin: 8rpx 30rpx 0rpx 30rpx;
width: calc(100% - 60rpx);
display: flex;
flex-wrap: wrap;
}
.stu-list .stu-item:nth-child(2n){margin-right:0px !important;}
.stu-item{
margin-top: 22rpx;
padding: 30rpx;
width: calc((100% - 142rpx) / 2);
margin-right: 22rpx;
background: #FAF8F6;
border-radius: 24rpx;
}
.stu-avatar{
height: 80rpx;width: 80rpx;
}
.stu-info{margin-left: 10rpx;}
.stu-name{
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #000000;
}
.stu-user{
margin-top: 4rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.3);
}
.courst-time{
margin-top: 32rpx;
text-align: center;
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
/* -------------------------- */
.popup-bg{
......
......@@ -14,10 +14,7 @@ Page({
areaShow:false,
stateActive:0,
stateList:[
{name:'全部',value:''},{name:'待支付',value:1},{name:'已订购',value:2},{name:'待退款',value:3},
{name:'已退款',value:4},{name:'已关闭',value:5}
], //所属校区列表
stateList:[], //所属校区列表
stateShow:false,
type:0,
......@@ -47,7 +44,9 @@ Page({
onShow: function () {
//1正式课 2体验课
let courseType = this.options.courseType || 1
this.setData({courseType:courseType})
let stateList = courseType == 1 ? [{name:'全部',value:''},{name:'待确认',value:0},{name:'已报名',value:1},{name:'待取消',value:2},{name:'已取消',value:3}] : [{name:'全部',value:''},{name:'待支付',value:0},{name:'已订购',value:1},{name:'待退款',value:2},
{name:'已退款',value:3},{name:'已关闭',value:4}]
this.setData({courseType:courseType,stateList:stateList})
wx.setNavigationBarTitle({
title: courseType== 1? '班课报名' : '体验课订单'
});
......@@ -116,13 +115,15 @@ Page({
})
},
//员工体验课订单统计
//订单统计
getExpCourseCount(){
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) => {
// 1:员工班课 2:员工体验课
let url = this.data.courseType == 1 ? '/px/course/getNorCourseCount' : '/px/course/getExpCourseCount'
API.getData(url,param, (res) => {
that.setData({orderCount:res.data})
})
},
......@@ -133,13 +134,13 @@ Page({
this.data.page ++
this.data.loading = true
let url = this.data.courseType == 1 ? '' : '/px/course/getExpCourseOrderList'
let url = this.data.courseType == 1 ? '/px/course/getNorCourseList' : '/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 || '', //订单状态
}
param[this.data.courseType == 1?'bmStatus':'orderStatus'] = this.data.stateList[this.data.stateActive].value
if(this.data.type == 0){
Object.assign(param,{
stuName:this.data.value
......@@ -202,6 +203,50 @@ Page({
}
})
},
//bmStatus 1:确认报名,2:不同意取消报名,3:同意取消报名
updateBmStatus(e){
let that = this
let {data,event} = e.currentTarget.dataset
let url = this.data.courseType == 1 ? '/px/course/updateBmStatus' : '/px/course/doRefund'
let param = {}
if(this.data.courseType == 1){
param = {
bmId:data.bmId,
bmStatus:event
}
}else{
param = {
orderId:data.orderId,
refundStatus:event
}
}
wx.showModal({
title: '提示',
content: event == 1 ? '你确定要同意报名吗': event == 2 ? '你确定要不同意取消报名吗':'你确定要同意取消报名吗',
success(res) {
if (res.confirm) {
API.getData(url, param, (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){
},
......
......@@ -42,9 +42,9 @@
<!-- 统计数据 -->
<view class="nums-ctn">
<block wx:if="{{courseType == 1}}">
<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">{{orderCount.cancelWaitNum || 0}}</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">{{orderCount.stuBmNum || 0}}</text></view>
<view class="nums-item"><text class="nums-t">已确认</text><text class="nums-v">{{orderCount.sureNum || 0}}</text></view>
<view class="nums-item"><text class="nums-t">待确认</text><text class="nums-v">{{orderCount.waitSureNum || 0}}</text></view>
</block>
<block wx:if="{{courseType == 2}}">
<view class="nums-item"><text class="nums-t">订单数量</text><text class="nums-v">{{orderCount.orderNum || 0}}</text></view>
......@@ -78,7 +78,8 @@
{{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 wx:if="{{courseType==2}}" class="course-state {{['red-c','gree-c','yell-c','grey-c','grey-c'][item.orderStatus]}}">{{['待支付','已订购','待退款','已退款','已关闭'][item.orderStatus]}}</view>
<view class="course-state {{['yell-c','gree-c','red-c','grey-c'][item.bmStatus]}}" wx:else>{{['待确认','已报名','待取消','已取消'][item.bmStatus]}}</view>
</view>
<view class="course-title">{{item.courseName}}</view>
......@@ -94,10 +95,10 @@
</view>
<view class="course-time flex-c">
订购时间:<view class="course-time-v">{{item.orderTime}}</view>
{{courseType == 1 ? '报名时间:' : '订购时间:'}}<view class="course-time-v">{{courseType==1? item.bmTime : item.orderTime}}</view>
</view>
<view class="course-time flex-c">
课程金额:<view class="course-time-v">¥{{item.orderAmt ? item.orderAmt / 100 : 0}}</view>
课程金额:<view class="course-time-v">¥{{courseType==1? (item.cost?item.cost / 100:0) : (item.orderAmt ? item.orderAmt / 100 : 0)}}</view>
</view>
<view class="course-btm" wx:if="{{item.orderStatus == 2}}">
......@@ -106,6 +107,14 @@
<view class="pay-btn" data-data="{{item}}" data-event='1' bindtap="doRefund">同意退款</view>
</view>
<view class="course-btm" wx:if="{{courseType == 1}}">
<!-- bmStatus (0:待确认报名,1:已确认报名,2:待取消报名,3:已取消报名) -->
<!-- <view class="cannal-btn" data-data="{{item}}" data-event='2' bindtap="doRefund">拒绝退款</view> -->
<view class="pay-btn" wx:if="{{item.bmStatus == 0}}" data-data="{{item}}" data-event='1' bindtap="updateBmStatus">确认报名</view>
<view class="cannal-btn" wx:if="{{item.bmStatus == 2}}" data-data="{{item}}" data-event='2' bindtap="updateBmStatus">不同意取消</view>
<view class="pay-btn" wx:if="{{item.bmStatus == 2}}" data-data="{{item}}" data-event='3' bindtap="updateBmStatus">同意取消</view>
</view>
</view>
</block>
......
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