Commit e522a63c authored by 吴颖's avatar 吴颖

'教练端课表接口对接,财务对接,课程管理详情接口对接'

parent c545fb1b
import {
Base
} from './utils/base.js';
const base = new Base()
App({ App({
onLaunch: function () { onLaunch: function () {
this.isReload() // 小程序是否有新版本 this.isReload() // 小程序是否有新版本
this.getSessionKey() // 获取token this.getToken()
}, },
// 小程序是否有新版本 // 小程序是否有新版本
isReload: function () { isReload: function () {
...@@ -40,7 +37,15 @@ App({ ...@@ -40,7 +37,15 @@ App({
}) })
} }
}, },
getToken() {
var that = this
try {
var token = wx.getStorageSync('token')
if (token) {
that.globalData.token = token
}
} catch (e) {}
},
// 获取sessionkey 提交后台换取基本openid unionid // 获取sessionkey 提交后台换取基本openid unionid
getSessionKey: function (cb) { getSessionKey: function (cb) {
let that = this let that = this
...@@ -95,10 +100,18 @@ App({ ...@@ -95,10 +100,18 @@ App({
method: 'POST', method: 'POST',
success: function (res) { success: function (res) {
if (res.data.meta.code == 200) { if (res.data.meta.code == 200) {
wx.showToast({
title: '授权成功',
icon: 'none',
duration: 2000
})
that.globalData.hasTel = res.data.data.hasTel
that.globalData.userInfo = res.data.data; that.globalData.userInfo = res.data.data;
wx.setStorageSync('userInfo', res.data.data) wx.setStorageSync('userInfo', res.data.data)
if (res.data.data.userTel) {
wx.setStorageSync('userTel', res.data.data.userTel)
}
} else { } else {
console.log(res.data.meta.message)
wx.showToast({ wx.showToast({
title: res.data.meta.message, title: res.data.meta.message,
icon: 'none', icon: 'none',
......
// pages/index/classManagement/classManagement.js const app = getApp()
import {
Base
} from '../../../utils/base.js';
const base = new Base()
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
showView : true, coach_id: '5',
class_id: '16',
}, lesson_id: '69',
classTime: '', // 上课时间
/** showView: true,
* 生命周期函数--监听页面加载 list: [],
*/ locked: false,
onLoad: function (options) {
}, },
showButton : function () {
var that = this; /**
that.setData({ * 生命周期函数--监听页面加载
showView : (!that.data.showView) */
}) onLoad: function (options) {
}, this.setData({
gocourseInstant:function(){ // coach_id: '5',
wx.navigateTo({ class_id: options.class_id,
url: '../../index/courseInstant/courseInstant', lesson_id: options.lesson_id,
}) classTime: options.classTime, // 上课时间
}, })
goevaluation:function(){ this.getDetail()
wx.navigateTo({ },
url: '../../index/evaluation/evaluation', getDetail() {
}) let params = {
}, url: 'coach/manage_lesson',
data: {
/** coach_id: this.data.coach_id,
* 生命周期函数--监听页面初次渲染完成 class_id: this.data.class_id,
*/ lesson_id: this.data.lesson_id
onReady: function () { },
callback:(data)=>{
}, this.setData({
list: data,
/** locked: false
* 生命周期函数--监听页面显示 })
*/ console.log(data)
onShow: function () { }
}
}, base.newRequest(params)
},
/** showButton: function (e) {
* 生命周期函数--监听页面隐藏 let index = e.currentTarget.dataset.index
*/ let list = this.data.list
onHide: function () { let params = {
url: '',
}, data: {
/** },
* 生命周期函数--监听页面卸载 callback:(data)=>{
*/ base.toast('签到成功')
onUnload: function () { list[index].sign_status = 1
this.setData({
}, list: list
})
/** },
* 页面相关事件处理函数--监听用户下拉动作 }
*/ base.newRequest(params)
onPullDownRefresh: function () { },
gocourseInstant: function () {
}, wx.navigateTo({
url: '../../index/courseInstant/courseInstant',
/** })
* 页面上拉触底事件的处理函数 },
*/ goevaluation: function () {
onReachBottom: function () { wx.navigateTo({
url: '../../index/evaluation/evaluation',
}, })
},
/** onPullDownRefresh() {
* 用户点击右上角分享 this.setData({
*/ list: [],
onShareAppMessage: function () { locked: false,
})
} if (!this.data.locked) {
this.setData({
locked: true
})
this.getDetail()
}
wx.stopPullDownRefresh()
}
}) })
\ No newline at end of file
{ {
"usingComponents": {}, "usingComponents": {},
"navigationBarTitleText": "课程管理" "navigationBarTitleText": "课程管理",
"enablePullDownRefresh": true
} }
\ No newline at end of file
<view class="top flex-h flex-vc flex-hb"> <view class="top flex-h flex-vc flex-hb">
<view> <view>
<view class="time">15:00~16:00</view> <view class="time">{{classTime}}</view>
<view class="time_text">上课时间</view> <view class="time_text">上课时间</view>
</view> </view>
<view> <view>
<view class="instant" catchtap="gocourseInstant"> <view class="instant flex-h flex-vc flex-hc" catchtap="gocourseInstant">
课程瞬间 课程瞬间
<image src="../../../images/camera.png"></image> <image src="/images/camera.png"></image>
</view> </view>
</view> </view>
</view> </view>
<view class="cont"> <view class="cont">
<view class="item flex-h flex-vc flex-hb"> <block wx:for="{{list}}" wx:key='index'>
<view class="flex-h flex-vc"> <view class="item flex-h flex-vc flex-hb">
<image src="../../../images/photo.png"></image> <view class="flex-h flex-vc">
<view> <image src="{{item.child.thumb !=null ? item.child.thumb: '/images/default_head.png'}}"></image>
<view class="name">西西</view> <view>
<view class="big_name">大名:王梓西</view> <view class="name">{{item.child.nick_name != null ? item.child.nick_name: ''}}</view>
<view class="big_name">大名:{{item.child.child_name}}</view>
</view>
</view> </view>
</view> <view wx:if="{{item.is_leave == 1}}" class="leave">已请假</view>
<view> <view wx:if="{{item.is_leave == 0}}">
<view class="sign {{showView?'show':'hide'}}" bindtap="showButton">已签到</view> <!-- 未请假状态 -->
<view class="evaluation {{showView?'hide':'show'}}" catchtap="goevaluation">运动评价</view> <view wx:if="{{item.sign_status == 1}}">
</view> <view class="sign">已签到</view>
</view> <view class="evaluation1" wx:if='{{item.class_comment!=""}}'>已评价</view>
<view class="item flex-h flex-vc flex-hb"> <view wx:if='{{item.class_comment==""}}' catchtap="goSport">运动评价</view>
<view class="flex-h flex-vc"> </view>
<image src="../../../images/photo.png"></image> <view wx:if="{{item.sign_status == 0}}">
<view> <view class="sign1" bindtap="showButton" data-index="{{index}}">签到</view>
<view class="name">西西</view> </view>
<view class="big_name">大名:王梓甜</view>
</view>
</view>
<view>
<view class="sign">已签到</view>
<view class="evaluation1">已评价</view>
</view>
</view>
<view class="item flex-h flex-vc flex-hb">
<view class="flex-h flex-vc">
<image src="../../../images/photo.png"></image>
<view>
<view class="name">西西</view>
<view class="big_name">大名:王梓甜</view>
</view> </view>
</view> </view>
<view> </block>
<!-- <view class="sign1">签到</view> -->
<view class="sign1 {{showView?'show':'hide'}}" bindtap="showButton">签到</view>
<view class="evaluation {{showView?'hide':'show'}}" catchtap="goevaluation">运动评价</view>
</view>
</view>
<view class="item flex-h flex-vc flex-hb">
<view class="flex-h flex-vc">
<image src="../../../images/photo.png"></image>
<view>
<view class="name">西西</view>
<view class="big_name">大名:王梓甜</view>
</view>
</view>
<view>
<view class="leave">已请假</view>
</view>
</view>
</view> </view>
<view class="button"> <view class="button">
......
page {
padding-bottom: 120rpx;
}
.top{ .top{
width: 100%; width: 100%;
height: 220rpx; height: 220rpx;
......
const app = getApp() const app = getApp()
import { Base } from '../../../utils/base.js'; import {
Base
} from '../../../utils/base.js';
const base = new Base() const base = new Base()
Page({ Page({
data: { data: {
...@@ -7,8 +9,8 @@ Page({ ...@@ -7,8 +9,8 @@ Page({
}, },
onLoad: function (options) { onLoad: function (options) {
}, },
getPhoneNumber: function (e) { getPhoneNumber: function (e) {
if (e.detail.errMsg == 'getPhoneNumber:ok') { if (e.detail.errMsg == 'getPhoneNumber:ok') {
let params = { let params = {
data: { data: {
...@@ -19,9 +21,9 @@ Page({ ...@@ -19,9 +21,9 @@ Page({
type: "POST", type: "POST",
callback: (data) => { callback: (data) => {
base.toast('授权成功') base.toast('授权成功')
app.globalData.userTel = data.phoneNumber app.globalData.userTel = data.phoneNumber
wx.setStorageSync('userTel', data.phoneNumber) wx.setStorageSync('userTel', data.phoneNumber)
if(app.globalData.backurl) { if (app.globalData.backurl) {
if (app.globalData.backurl.indexOf('/pages/tabbar') != -1) { if (app.globalData.backurl.indexOf('/pages/tabbar') != -1) {
wx.switchTab({ wx.switchTab({
url: app.globalData.backurl, url: app.globalData.backurl,
...@@ -35,12 +37,12 @@ Page({ ...@@ -35,12 +37,12 @@ Page({
wx.switchTab({ wx.switchTab({
url: '/pages/personal/personal', url: '/pages/personal/personal',
}) })
} }
}, },
} }
base.newRequest(params) base.newRequest(params)
} else { } else {
base.toast('授权失败,无法查看') base.toast('授权失败,无法查看')
} }
} }
}) })
\ No newline at end of file
...@@ -6,39 +6,16 @@ const base = new Base() ...@@ -6,39 +6,16 @@ const base = new Base()
Page({ Page({
data: { data: {
die: false, die: false,
isBindTel: false
},
onLoad: function (options) {
// this.checkPhone()
},
checkPhone() {
let params = {
// url: 'xcx/v2.0/checkphone',
data: {},
callback: (data) => {
wx.setStorageSync('userTel', data.tel)
this.setData({
isBindTel: true
})
},
errorback: (res) => {
base.toast('')
this.setData({
isBindTel: false
})
}
}
base.newRequest(params)
}, },
userInfoHandler: function (e) { userInfoHandler: function (e) {
if (e.detail.errMsg == 'getUserInfo:ok') { if (e.detail.errMsg == 'getUserInfo:ok') {
app.saveUserInfo(e.detail, this.showUserInfo) app.saveUserInfo(e.detail, this.showUserInfo)
} else { } else {
base.toast('请先授权,才能验证身份') base.toast('请先授权,才能验证身份')
} }
}, },
showUserInfo: function () { showUserInfo: function () {
if (this.data.isBindTel) { if (app.globalData.hasTel) {
base.toast('登录成功') base.toast('登录成功')
setTimeout(() => { setTimeout(() => {
if (app.globalData.backurl) { if (app.globalData.backurl) {
......
// pages/financial/financial.js
Page({
/**
* 页面的初始数据
*/
data: {
activeIndex: 1,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
changeTab(e) {
let index = e.currentTarget.dataset.index
if (this.data.activeIndex != index) {
this.setData({
activeIndex: index
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/** const app = getApp()
* 生命周期函数--监听页面隐藏 import {
*/ Base
onHide: function () { } from '../../../utils/base.js';
const base = new Base()
}, Page({
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
} data: {
activeIndex: 1,
coach_id: '5',
detail: '',
type: '1', // 1:收益 2:提现 3:预存储
profitList: [], // 上课记录
profitPage: 1,
profitMore: true,
profitLocked: false,
withdrawList: [], // 提现
withdrawPage: 1,
withdrawMore: true,
withdrawLocked: false,
},
onLoad: function (options) {
this.getMoney()
this.getList(1)
this.getList(2)
},
changeTab(e) {
let index = e.currentTarget.dataset.index
if (this.data.activeIndex != index) {
this.setData({
activeIndex: index
})
}
},
getList(type) {
let params = {
url: 'commission/list',
data: {
wx_user_id: this.data.coach_id,
type: type,
pageSize: '15',
page: this.data.profitPage
},
callback: (data) => {
if (type == 1) {
this.setData({
profitList: this.data.profitList.concat(data.data.data),
profitPage: data.data.current_page + 1,
profitMore: data.hasMorePage,
profitLocked: false
})
console.log(this.data.profitList)
} else if (type == 2) {
this.setData({
withdrawList: this.data.withdrawList.concat(data.data.data),
withdrawPage: data.data.current_page + 1,
withdrawMore: data.hasMorePage,
withdrawLocked: false
})
}
}
}
base.newRequest(params)
},
getMoney() {
let params = {
url: 'commission',
data: {
wx_user_id: this.data.coach_id
},
callback: (data) => {
this.setData({
detail: data
})
}
}
base.newRequest(params)
},
onPullDownRefresh: function () {
if (this.data.currentTabIndex==1) {
this.init2()
} else if (this.data.currentTabIndex==2) {
this.init3()
}
wx.stopPullDownRefresh()
},
init2() {
this.setData({
profitList: [], // 收益列表
profitPage: 1,
profitMore: true,
profitLocked: false
})
if (!this.data.profitLocked) {
this.setData({
profitLocked: true
})
this.getList(1)
}
},
init3() {
this.setData({
withdrawList: [], // 提现
withdrawPage: 1,
withdrawMore: true,
withdrawLocked: false
})
if (!this.data.withdrawLocked) {
this.setData({
withdrawLocked: true
})
this.getList(2)
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if (!this.data.locked && this.data.hasMore) {
this.setData({
locked: true
})
this.getStudent()
}
if (!this.data.profitLocked && this.data.profitMore) {
this.setData({
profitLocked: true
})
this.getList(1)
}
if (!this.data.withdrawLocked && this.data.withdrawMore) {
this.setData({
withdrawLocked: true
})
this.getList(2)
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return {
title: '3-12岁儿童家门口的体育课,新人立享超级优惠!',
imageUrl: this.data.detail.course.img,
path: '/pages/index/index?parent_id=' + this.data.user_id
}
},
withdrawClick() { // 提现
console.log(this.data.detail)
console.log(this.data.detail && this.data.detail.unrealized_revenue <= 0)
if (this.data.detail == '' || this.data.detail.unrealized_revenue <= 0) {
base.toast('提现金额不能小于0')
return
}
wx.showModal({
title: '提示',
content: '您确定要提现所有金额',
success:(res)=>{
if (res.confirm) {
let params = {
url: 'take_money',
type: 'POST',
data: {
wx_user_id: this.data.coach_id,
amount: this.data.detail.unrealized_revenue
},
callback:(data)=>{
base.toast('您的提现申请已提交')
}
}
base.newRequest(params)
} else if (res.cancel) {
console.log('取消')
}
}
})
}
}) })
\ No newline at end of file
{ {
"usingComponents": {}, "usingComponents": {
"navigationBarTitleText": "财务" "van-empty": "/components/vant/empty/index"
},
"navigationBarTitleText": "财务",
"enablePullDownRefresh": true
} }
\ No newline at end of file
...@@ -4,120 +4,91 @@ ...@@ -4,120 +4,91 @@
<text class="{{activeIndex == 2 ? 'active': ''}}" catchtap="changeTab" data-index="2">提现记录</text> <text class="{{activeIndex == 2 ? 'active': ''}}" catchtap="changeTab" data-index="2">提现记录</text>
</view> </view>
<view class="item_detail"> <view class="item_detail">
<view hidden="{{activeIndex == 1}}"> <wxs module="time">
<view class="detailed flex-h"> var time = function(str){
var newstr = str.split(' ');
return newstr[0];
}
module.exports = {
time:time
}
</wxs>
<view hidden="{{activeIndex != 1}}">
<view class="detailed flex-h flex-vc flex-hc">
<view class="item-one"> <view class="item-one">
<view class="num">500</view> <view class="num">{{detail ? detail.estimated_revenue: 0}}</view>
<view class="small">预计收益</view> <view class="small">预计收益</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="item-two"> <view class="item-one">
<view class="num">300</view> <view class="num">{{detail ? detail.total_revenue: 0}}</view>
<view class="small">已结算</view> <view class="small">已结算</view>
</view> </view>
<van-icon class="question_icon" name="question-o" />
</view> </view>
<van-icon class="question_icon" name="question-o" />
<view class="tx">全部提现</view> <view class="content1" wx:if="{{profitList.length > 0}}">
<view class="tip">提示:每周二为提现日!其他日不支持提现</view> <view class="content1_head flex-h flex-vc">
<view class="table"> <view style="width:30%">日期</view>
<view class="table-tr"> <view style="width:30%">结算金额</view>
<view class="table-th">日期</view> <view style="width:40%">说明</view>
<view class="table-th">提现金额</view> </view>
</view> <view class="content1_body">
<view class="table-tr"> <block wx:for="{{profitList}}" wx:key='index'>
<view class="table-td">2020-10-28</view> <view class="content1_body_th flex-h flex-vc">
<view class="table-td">10</view> <view style="width:30%">{{time.time(item.created_at)}}</view>
</view> <view style="width:30%">{{item.amount}}</view>
<view class="table-tr"> <view class="text-line-one" style="width:40%">{{item.remark}}</view>
<view class="table-td">2020-10-28</view> </view>
<view class="table-td">10</view> </block>
</view>
<view class="table-tr">
<view class="table-td">2020-10-28</view>
<view class="table-td">10</view>
</view>
<view class="table-tr">
<view class="table-td">2020-10-28</view>
<view class="table-td">10</view>
</view>
<view class="table-tr">
<view class="table-td">2020-10-28</view>
<view class="table-td">10</view>
</view>
<view class="table-tr">
<view class="table-td">2020-10-28</view>
<view class="table-td">10</view>
</view>
<view class="table-tr">
<view class="table-td">2020-10-28</view>
<view class="table-td">10</view>
</view>
<view class="table-tr">
<view class="table-td">2020-10-28</view>
<view class="table-td">10</view>
</view> </view>
</view> </view>
<view wx:else class="empty">
<van-empty
class="custom-image"
image="/images/without.png"
description="暂无上课记录"
/>
</view>
</view> </view>
<view hidden="{{activeIndex == 2}}"> <view hidden="{{activeIndex != 2}}">
<view class="detailed flex-h"> <view class="detailed flex-h flex-hc flex-vc">
<view class="item-one"> <view class="item-one">
<view class="num">2000</view> <view class="num">{{detail? detail.unrealized_revenue: 0}}</view>
<view class="small">预计收益</view> <view class="small">余额</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="item-two"> <view class="item-one">
<view class="num">1520</view> <view class="num">{{detail? detail.sales_revenue: 0}}</view>
<view class="small">已结算</view> <view class="small">已结算</view>
</view> </view>
<van-icon class="question_icon" name="question-o" />
<view class="share" catchtap="withdrawClick">全部提现</view>
</view> </view>
<van-icon class="question_icon" name="question-o" />
<view class="table"> <view class="tip">提示:每周二为提现日!其他日不支持提现</view>
<view class="table-tr"> <view class="content1" wx:if='{{withdrawList.length > 0}}'>
<view class="table-th">日期</view> <view class="content1_head flex-h flex-vc">
<view class="table-th">结算金额</view> <view style="width:50%">日期</view>
<view class="table-th">说明</view> <view style="width:50%">提现金额</view>
</view> </view>
<view class="table-tr"> <view class="content1_body">
<view class="table-td">2020-10-28</view> <block wx:for="{{withdrawList}}" wx:key='index'>
<view class="table-td">10</view> <view class="content1_body_th flex-h flex-vc">
<view class="table-td">用户"西西"第一节课</view> <view style="width:50%">{{time.time(item.created_at)}}</view>
</view> <view style="width:50%">{{item.amount}}</view>
<view class="table-tr"> </view>
<view class="table-td">2020-10-28</view> </block>
<view class="table-td">10</view>
<view class="table-td">用户"西西"第一节课</view>
</view>
<view class="table-tr">
<view class="table-td">2020-10-28</view>
<view class="table-td">10</view>
<view class="table-td">用户"西西"第一节课</view>
</view>
<view class="table-tr">
<view class="table-td">2020-10-28</view>
<view class="table-td">10</view>
<view class="table-td">用户"西西"第一节课</view>
</view>
<view class="table-tr">
<view class="table-td">2020-10-28</view>
<view class="table-td">10</view>
<view class="table-td">用户"西西"第一节课</view>
</view>
<view class="table-tr">
<view class="table-td">2020-10-28</view>
<view class="table-td">10</view>
<view class="table-td">用户"西西"第一节课</view>
</view>
<view class="table-tr">
<view class="table-td">2020-10-28</view>
<view class="table-td">10</view>
<view class="table-td">用户"西西"第一节课</view>
</view>
<view class="table-tr">
<view class="table-td">2020-10-28</view>
<view class="table-td">10</view>
<view class="table-td">用户"西西"第一节课</view>
</view> </view>
</view> </view>
<view wx:else class="empty">
<van-empty
class="custom-image"
image="/images/without.png"
description="暂无提现记录"
/>
</view>
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file
.tablist { .tablist {
width: 690rpx; width: 690rpx;
height: 68rpx; height: 68rpx;
line-height: 68rpx; line-height: 68rpx;
background: #FFFFFF; background: #FFFFFF;
border: 1px solid #FFC600; border: 1px solid #FFC600;
border-radius: 15rpx; border-radius: 15rpx;
text-align: center; text-align: center;
margin: 56rpx auto 30rpx; margin: 56rpx auto 30rpx;
overflow: hidden; overflow: hidden;
} }
.tablist text{
width: 50%; .tablist text {
font-size: 26rpx; width: 50%;
color: #000000; font-size: 26rpx;
color: #000000;
} }
.tablist text.active { .tablist text.active {
background: #FFC600; background: #FFC600;
} }
.number{
width: 690rpx; .number {
height: 180rpx; width: 690rpx;
background: #FFFFFF; height: 180rpx;
border-radius: 15px; background: #FFFFFF;
margin: 30rpx auto; border-radius: 15px;
box-shadow: 0 10rpx 20rpx 10rpx rgba(239, 240, 241, 0.72); margin: 30rpx auto;
position: relative; box-shadow: 0 10rpx 20rpx 10rpx rgba(239, 240, 241, 0.72);
} position: relative;
.number .item-one{ }
position: absolute;
top: 32rpx; .number .item-one {
left: 100rpx; position: absolute;
} top: 32rpx;
.number .item-one .num{ left: 100rpx;
color: #000000; }
font-size: 50rpx;
} .number .item-one .num {
.number .item-one .small{ color: #000000;
color: #B3B3B3; font-size: 50rpx;
font-size: 24rpx; }
text-align: center;
} .number .item-one .small {
.number .line{ color: #B3B3B3;
width: 2rpx; font-size: 24rpx;
height: 80rpx; text-align: center;
background:#EBEBEB; }
position: absolute;
top: 46rpx; .number .line {
left: 344rpx; width: 2rpx;
} height: 80rpx;
.number .item-two{ background: #EBEBEB;
position: absolute; position: absolute;
top: 32rpx; top: 46rpx;
right: 142rpx; left: 344rpx;
} }
.number .item-two .num{
color: #000000; .number .item-two {
font-size: 50rpx; position: absolute;
} top: 32rpx;
.number .item-two .small{ right: 142rpx;
color: #B3B3B3; }
font-size: 24rpx;
text-align: center; .number .item-two .num {
} color: #000000;
.number .question_icon{ font-size: 50rpx;
position: absolute; }
right: 30rpx;
top: 40rpx; .number .item-two .small {
font-size: 30rpx; color: #B3B3B3;
color: #999999; font-size: 24rpx;
} text-align: center;
.number .share{ }
width: 105rpx;
height: 40rpx; .number .question_icon {
background: linear-gradient(-62deg, #FF7800 0%, #FF9D1F 100%); position: absolute;
border-radius: 20px 0px 0px 20px; right: 30rpx;
color: #FFFFFF; top: 40rpx;
font-size: 26rpx; font-size: 30rpx;
text-align: center; color: #999999;
line-height: 40rpx; }
position: absolute;
top: 100rpx; .number .share {
right: 0; width: 105rpx;
} height: 40rpx;
.detailed{ background: linear-gradient(-62deg, #FF7800 0%, #FF9D1F 100%);
width: 690rpx; border-radius: 20px 0px 0px 20px;
height: 180rpx; color: #FFFFFF;
background: linear-gradient(25deg, #212121 0%, #3B3B3B 100%); font-size: 26rpx;
border-radius: 15px; text-align: center;
margin: 30rpx auto; line-height: 40rpx;
box-shadow: 0 10rpx 20rpx 10rpx rgba(239, 240, 241, 0.72); position: absolute;
position: relative; top: 100rpx;
} right: 0;
.detailed .item-one{
position: absolute;
top: 32rpx;
left: 100rpx;
}
.detailed .item-one .num{
color: #FFDEAA;
font-size: 50rpx;
}
.detailed .item-one .small{
color: #999999;
font-size: 24rpx;
text-align: center;
}
.detailed .line{
width: 2rpx;
height: 80rpx;
background:#EBEBEB;
position: absolute;
top: 46rpx;
left: 344rpx;
}
.detailed .item-two{
position: absolute;
top: 32rpx;
right: 142rpx;
}
.detailed .item-two .num{
color: #FFDEAA;
font-size: 50rpx;
}
.detailed .item-two .small{
color: #999999;
font-size: 24rpx;
text-align: center;
}
.question_icon{
position: absolute;
right: 60rpx;
top: 180rpx;
font-size: 30rpx;
color: #999999;
}
.tx{
width: 116rpx;
height: 40rpx;
background: linear-gradient(-62deg, #FF7800 0%, #FF9D1F 100%);
border-radius: 20px 0px 0px 20px;
color: #FFFFFF;
font-size: 26rpx;
text-align: center;
line-height: 40rpx;
position: absolute;
top: 234rpx;
right: 32rpx;
padding-left: 10rpx;
padding-right: 4rpx;
}
.tip{
width: 690rpx;
height: 53rpx;
background: #FFF2DD;
color: #7F5C37;
font-size: 24rpx;
line-height: 53rpx;
text-align: left;
padding-left: 12rpx;
margin-left: 30rpx;
} }
.detailed {
width: 690rpx;
height: 180rpx;
background: url('https://wdty.xueyoubangedu.com/wandou/moneybg.png') no-repeat;
background-size: 100% 100%;
border-radius: 15px;
margin: 30rpx auto;
box-shadow: 0 10rpx 20rpx 10rpx rgba(239, 240, 241, 0.72);
position: relative;
}
.detailed .item-one {
text-align: center;
width: 50%;
}
.detailed .item-one .num {
color: #FFDEAA;
font-size: 50rpx;
}
.detailed .item-one .small {
color: #999999;
font-size: 24rpx;
}
.detailed .line {
width: 2rpx;
height: 80rpx;
background: #EBEBEB;
position: absolute;
top: 46rpx;
left: 344rpx;
}
.question_icon {
position: absolute;
right: 30rpx;
top: 20rpx;
font-size: 30rpx;
color: #999999;
}
.share {
padding: 0 15rpx;
height: 40rpx;
background: linear-gradient(-62deg, #FF7800 0%, #FF9D1F 100%);
border-radius: 20px 0px 0px 20px;
color: #FFFFFF;
font-size: 26rpx;
text-align: center;
line-height: 40rpx;
position: absolute;
top: 90rpx;
right: 0;
}
.tip {
width: 690rpx;
height: 53rpx;
background: #FFF2DD;
color: #7F5C37;
font-size: 24rpx;
line-height: 53rpx;
text-align: left;
padding-left: 12rpx;
margin-left: 30rpx;
}
/* table表格 */ /* table表格 */
.table{ .content1 {
width: 690rpx; width: 690rpx;
height: 750rpx; background: #FFFFFF;
background: #FFFFFF; border-radius: 15px;
border-radius: 15px; box-shadow: 0 10rpx 20rpx 10rpx rgba(239, 240, 241, 0.72);
box-shadow: 0 10rpx 20rpx 10rpx rgba(239, 240, 241, 0.72); }
margin-bottom: 20rpx;
display: table; .content1_head {
border-collapse: collapse; height: 80rpx;
box-sizing: border-box; border-bottom: 1px solid #EBEBEB;
display: table; line-height: 80rpx;
text-align: center; font-size: 24rpx;
} color: #333333;
.table, .table div { padding: 0 10rpx;
margin: 30rpx auto; }
}
.table-tr { .content1_body {
display: table-row; padding: 0 10rpx;
height: 92rpx; }
border-bottom: 1px solid #EBEBEB;
} .content1_body_th {
.table-tr:last-child{ height: 80rpx;
border-bottom: none; line-height: 80rpx;
} font-size: 24rpx;
.table-tr:nth-child(2n){ color: #B3B3B3;
background: #F7F8FA; }
}
.table-th{ .content1_body_th view:nth-child(1) {
display: table-cell; color: #666;
font-weight: bold; }
text-align: center;
vertical-align: middle; .content1_body_th:nth-child(2n) {
color: #333333; background: #F7F8FA;
} }
.table-td{ \ No newline at end of file
display: table-cell;
text-align: center;
vertical-align: middle;
color: #B3B3B3;
}
\ No newline at end of file
...@@ -13,25 +13,8 @@ Page({ ...@@ -13,25 +13,8 @@ Page({
data: { data: {
coach_id: '5', coach_id: '5',
isOpen: false, isOpen: false,
daysColor: [{ daysColor: [],
month: 'current', today: '', // 今天日期
day: '12',
color: '#fff',
background: '#FF6E00'
},
{
month: 'current',
day: '10',
color: '#fff',
background: 'linear-gradient(#5791FE 0%, #3E63F8 100%);'
},
{
month: 'current',
day: '8',
color: '#fff',
background: 'linear-gradient(#5791FE 0%, #3E63F8 100%);'
}
],
curDate: '', curDate: '',
list: [], list: [],
allList: [] allList: []
...@@ -45,8 +28,10 @@ Page({ ...@@ -45,8 +28,10 @@ Page({
title: '加载中...', title: '加载中...',
}) })
this.setData({ this.setData({
today: util.formatTime(new Date()),
curDate: util.formatTime(new Date()) curDate: util.formatTime(new Date())
}) })
console.log(this.data.today == this.data.curDate)
this.getAllList() this.getAllList()
this.getList() this.getList()
}, },
...@@ -146,21 +131,23 @@ Page({ ...@@ -146,21 +131,23 @@ Page({
isOpen: !this.data.isOpen isOpen: !this.data.isOpen
}) })
}, },
goclassManagement: function () { goclassManagement: function (e) {
wx.navigateTo({ let item = e.currentTarget.dataset.item
url: '../../index/classManagement/classManagement', let classTime = item.start_time + '' + item.end_time
})
},
goclassDetail: function () {
wx.navigateTo({ wx.navigateTo({
url: '../../index/classDetail/classDetail', url: '/pages/index/classManagement/classManagement?classTime=' + classTime + '&class_id=' + item.class_id + '&lesson_id=' + item.id,
}) })
}, },
goDetail(e) { goDetail(e) {
let item = e.currentTarget.dataset.item let item = e.currentTarget.dataset.item
console.log(item) console.log(item)
let classTime = item.start_time + '' + item.end_time
// console.log(item)
// wx.navigateTo({
// url: '/pages/index/classDetail/classDetail',
// })
wx.navigateTo({ wx.navigateTo({
url: '/pages/index/classDetail/classDetail', url: '/pages/index/classManagement/classManagement?classTime=' + classTime + '&class_id=' + item.class_id + '&lesson_id=' + item.id,
}) })
}, },
}) })
\ No newline at end of file
...@@ -10,27 +10,44 @@ ...@@ -10,27 +10,44 @@
</view> </view>
</view> </view>
</view> </view>
<wxs module="util">
var time = function() {
var hour = getDate().getHours()
var minute = getDate().getMinutes()
var time = hour + ':' + minute
console.log(hour)
console.log(minute)
return time
}
module.exports = {
time: time
}
</wxs>
<view wx:if='{{list.length > 0}}'> <view wx:if='{{list.length > 0}}'>
<block wx:for="{{list}}" wx:key='index' > <block wx:for="{{list}}" wx:key='index' >
<view class="cont flex-v flex-hb" catchtap="goclassDetail"> <view class="cont flex-v flex-hb" catchtap="goclassDetail">
<view class="top"> <view class="top">
<view class="time_title">{{item.course.name}}</view> <view class="time_title">{{item.course.name}}</view>
<view class="over" wx:if="{{item.class_status_display == '已结束'}}">{{item.class_status_display}}</view> <view wx:if='{{today != curDate}}'>
<view class="over" wx:if="{{item.class_status_display == '已结束'}}">{{item.class_status_display}}</view>
<view class="state" wx:if="{{item.class_status_display == '即将开课'}}">{{item.class_status_display}}</view>
</view>
<view wx:else> <view wx:else>
<view class="state">{{item.class_status_display}}</view> <view class="state" wx:if='{{util.time() < item.start_time}}'>即将开课</view>
<view class="inclass">上课中</view> <view class="inclass" wx:if='{{util.time() > item.start_time && util.time()< end_time}}'>开课中</view>
<view class="over" wx:if='{{util.time() > item.end_time }}'>已结束</view>
</view> </view>
</view> </view>
<view class="time">上课时间:{{item.class_date}} {{item.start_time}}-{{item.end_time}} </view> <view class="time">上课时间:{{item.class_date}} {{item.start_time}}-{{item.end_time}} </view>
<view class="place">上课地点:{{item.stadium.name}}</view> <view class="place">上课地点:{{item.stadium.name}}</view>
<view> <view>
<view class="manage1" catchtap="goDetail" wx:if="{{item.class_status_display == '已结束'}}" data-item='{{item}}'>查看详情</view> <view class="manage1" catchtap="goDetail" wx:if="{{item.lesson_status == 1}}" data-item='{{item}}'>查看详情</view>
<view wx:else class="manage" catchtap="goclassManagement">管理</view> <view wx:else class="manage" catchtap="goclassManagement" data-item="{{item}}">管理</view>
</view> </view>
</view> </view>
</block> </block>
</view> </view>
<view wx:else class="empty"> <view wx:else class="empty">
<van-empty <van-empty
......
{ {
"description": "项目配置文件", "description": "项目配置文件",
"packOptions": { "packOptions": {
"ignore": [] "ignore": []
}, },
"setting": { "setting": {
"urlCheck": false, "urlCheck": false,
"es6": true, "es6": true,
"enhance": false, "enhance": false,
"postcss": true, "postcss": true,
"preloadBackgroundData": false, "preloadBackgroundData": false,
"minified": true, "minified": true,
"newFeature": false, "newFeature": false,
"coverView": true, "coverView": true,
"nodeModules": false, "nodeModules": false,
"autoAudits": false, "autoAudits": false,
"showShadowRootInWxmlPanel": true, "showShadowRootInWxmlPanel": true,
"scopeDataCheck": false, "scopeDataCheck": false,
"uglifyFileName": false, "uglifyFileName": false,
"checkInvalidKey": true, "checkInvalidKey": true,
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"babelSetting": { "babelSetting": {
"ignore": [], "ignore": [],
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"useIsolateContext": true, "useIsolateContext": true,
"useCompilerModule": false, "useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false "userConfirmedUseCompilerModuleSwitch": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.14.0", "libVersion": "2.14.0",
"appid": "wx6e6eaca9cc1c406d", "appid": "wx6e6eaca9cc1c406d",
"projectname": "wandouchengzhang_coach", "projectname": "wandouchengzhang_coach",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
}, },
"scripts": {}, "scripts": {},
"isGameTourist": false, "isGameTourist": false,
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
"condition": { "condition": {
"search": { "plugin": {
"list": [] "list": []
}, },
"conversation": { "game": {
"list": [] "list": []
}, },
"plugin": { "gamePlugin": {
"list": [] "list": []
}, },
"game": { "miniprogram": {
"list": [] "list": [
}, {
"gamePlugin": { "id": -1,
"list": [] "name": "pages/tabbar/personal/personal",
}, "pathName": "pages/tabbar/personal/personal",
"miniprogram": { "query": "",
"list": [ "scene": null
{ },
"id": -1, {
"name": "pages/tabbar/personal/personal", "id": -1,
"pathName": "pages/tabbar/personal/personal", "name": "pages/tabbar/personal/personal",
"query": "", "pathName": "pages/tabbar/personal/personal",
"scene": null "query": "",
}, "scene": null
{ },
"id": -1, {
"name": "pages/tabbar/personal/personal", "id": -1,
"pathName": "pages/tabbar/personal/personal", "name": "pages/my/parents/parents",
"query": "", "pathName": "pages/my/parents/parents",
"scene": null "query": "",
}, "scene": null
{ },
"id": -1, {
"name": "pages/my/parents/parents", "id": -1,
"pathName": "pages/my/parents/parents", "name": "pages/tabbar/personal/personal",
"query": "", "pathName": "pages/tabbar/personal/personal",
"scene": null "query": "",
}, "scene": null
{ },
"id": -1, {
"name": "pages/tabbar/personal/personal", "id": -1,
"pathName": "pages/tabbar/personal/personal", "name": "pages/my/teachingArea/teachingArea",
"query": "", "pathName": "pages/my/teachingArea/teachingArea",
"scene": null "query": "",
}, "scene": null
{ },
"id": -1, {
"name": "pages/my/teachingArea/teachingArea", "id": -1,
"pathName": "pages/my/teachingArea/teachingArea", "name": "pages/index/classManagement/classManagement",
"query": "", "pathName": "pages/index/classManagement/classManagement",
"scene": null "query": "",
}, "scene": null
{ },
"id": -1, {
"name": "pages/index/classManagement/classManagement", "id": -1,
"pathName": "pages/index/classManagement/classManagement", "name": "pages/index/courseInstant/courseInstant",
"query": "", "pathName": "pages/index/courseInstant/courseInstant",
"scene": null "query": "",
}, "scene": null
{ },
"id": -1, {
"name": "pages/index/courseInstant/courseInstant", "id": 7,
"pathName": "pages/index/courseInstant/courseInstant", "name": "pages/index/classDetail/classDetail",
"query": "", "pathName": "pages/index/classDetail/classDetail",
"scene": null "query": "",
}, "scene": null
{ },
"id": 7, {
"name": "pages/index/classDetail/classDetail", "id": -1,
"pathName": "pages/index/classDetail/classDetail", "name": "pages/team/teamDetail/teamDetail",
"query": "", "pathName": "pages/team/teamDetail/teamDetail",
"scene": null "query": "",
}, "scene": null
{ },
"id": -1, {
"name": "pages/team/teamDetail/teamDetail", "id": -1,
"pathName": "pages/team/teamDetail/teamDetail", "name": "pages/index/performance/performance",
"query": "", "pathName": "pages/index/performance/performance",
"scene": null "query": "",
}, "scene": null
{ },
"id": -1, {
"name": "pages/index/performance/performance", "id": -1,
"pathName": "pages/index/performance/performance", "name": "pages/index/evaluation/evaluation",
"query": "", "pathName": "pages/index/evaluation/evaluation",
"scene": null "query": "",
}, "scene": null
{ },
"id": -1, {
"name": "pages/index/evaluation/evaluation", "id": -1,
"pathName": "pages/index/evaluation/evaluation", "name": "个人中心",
"query": "", "pathName": "pages/tabbar/personal/personal",
"scene": null "query": "",
}, "scene": null
{ },
"id": -1, {
"name": "个人中心", "id": -1,
"pathName": "pages/tabbar/personal/personal", "name": "pages/tabbar/class/class",
"query": "", "pathName": "pages/tabbar/class/class",
"scene": null "query": "",
}, "scene": null
{ },
"id": -1, {
"name": "pages/tabbar/class/class", "id": -1,
"pathName": "pages/tabbar/class/class", "name": "pages/team/teamDetail/teamDetail",
"query": "", "pathName": "pages/team/teamDetail/teamDetail",
"scene": null "query": "",
}, "scene": null
{ },
"id": -1, {
"name": "pages/team/teamDetail/teamDetail", "name": "财务",
"pathName": "pages/team/teamDetail/teamDetail", "pathName": "pages/tabbar/financial/financial",
"scene": null "query": "",
} "scene": null
] },
} {
} "name": "课程管理详情页面",
"pathName": "pages/index/classManagement/classManagement",
"scene": null
}
]
}
}
} }
\ No newline at end of file
...@@ -12,22 +12,15 @@ class Base { ...@@ -12,22 +12,15 @@ class Base {
params.type = 'GET' params.type = 'GET'
} }
var cur_url = that.baseUrl + params.url var cur_url = that.baseUrl + params.url
// if (flag) {
// params.url = params.url;
// } else {
// params.url = that.baseUrl + params.url;
// }
console.log(cur_url)
wx.request({ wx.request({
url: cur_url, url: cur_url,
data: params.data, data: params.data,
method: params.type, method: params.type,
header: { header: {
'token': wx.getStorageSync('token'), 'token': app.globalData.token,
'app': 'coach' 'app': 'coach'
}, },
success: function (res) { success: function (res) {
console.log(res)
params.ischeckedCallback && params.ischeckedCallback() //防止用户多次点击,请求完成后让用户可点 params.ischeckedCallback && params.ischeckedCallback() //防止用户多次点击,请求完成后让用户可点
if (wx.showLoading()) { if (wx.showLoading()) {
wx.hideLoading() //隐藏加载动画 wx.hideLoading() //隐藏加载动画
...@@ -35,11 +28,11 @@ class Base { ...@@ -35,11 +28,11 @@ class Base {
if (res.statusCode == 200) { if (res.statusCode == 200) {
let rstcode = res.data.meta.code.toString() //接口返回的错误码 let rstcode = res.data.meta.code.toString() //接口返回的错误码
if (rstcode == '200') { if (rstcode == '200') {
params.callback && params.callback(res.data.data) params.callback && params.callback(res.data.data, res) // 请求成功
} else if (rstcode == '400') { } else if (rstcode == '400') {
if (!flag) { // 400 token过期 if (!flag) {
app.getSessionKey(function () { app.getSessionKey(function () {
that.newRequest(params, true) that.newRequest(params, true, tips)
}) })
} }
} else if (rstcode == '404') { } else if (rstcode == '404') {
...@@ -56,8 +49,12 @@ class Base { ...@@ -56,8 +49,12 @@ class Base {
duration: 2000 duration: 2000
}) })
} }
} }
} else { } else {
if (wx.showLoading()) {
wx.hideLoading() //隐藏加载动画
}
wx.showModal({ wx.showModal({
title: '错误', title: '错误',
content: '网络请求失败' content: '网络请求失败'
...@@ -66,6 +63,7 @@ class Base { ...@@ -66,6 +63,7 @@ class Base {
} }
}) })
} }
//富文本 //富文本
richText(detail) { richText(detail) {
if (detail != '' && detail != null && detail != undefined) { if (detail != '' && detail != null && detail != undefined) {
......
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