Commit cb491479 authored by 石盼盼's avatar 石盼盼

Merge branch 'master' into 'shipanpan'

# Conflicts:
#   pages/index/classDetail/classDetail.wxml
parents 5849d048 bea76c16
App({ App({
onLaunch: function () { onLaunch: function () {
console.log('222222222')
this.isReload() // 小程序是否有新版本 this.isReload() // 小程序是否有新版本
// this.getLogin()
this.getToken() this.getToken()
}, },
// 小程序是否有新版本 // 小程序是否有新版本
...@@ -39,24 +36,9 @@ App({ ...@@ -39,24 +36,9 @@ App({
}) })
} }
}, },
getLogin() {
let userInfo = wx.getStorageSync('userInfo')
if (userInfo) {
this.globalData.userInfo = userInfo
}
console.log(userInfo)
if (userInfo) {
wx.switchTab({
url: '/pages/tabbar/index/index',
})
} else {
if (userInfo) { // 判断有没有申请教练
wx.redirectTo({
url: '/pages/sign/apply/apply',
})
}
}
},
getToken() { getToken() {
var that = this var that = this
try { try {
...@@ -143,14 +125,12 @@ App({ ...@@ -143,14 +125,12 @@ App({
fail: function () {} fail: function () {}
}) })
}, },
fail() {// session_key 已经失效,需要重新执行登录流程 fail() { // session_key 已经失效,需要重新执行登录流程
that.getSessionKey(() => that.saveUserInfo(info, cb)) that.getSessionKey(() => that.saveUserInfo(info, cb))
} }
}) })
}, },
globalData: { globalData: {
extAppid: 'wx6e6eaca9cc1c406d', // 当前appid extAppid: 'wx6e6eaca9cc1c406d', // 当前appid
userInfo: '', //微信user信息 userInfo: '', //微信user信息
......
{ {
"pages":[ "pages":[
"pages/tabbar/index/index", "pages/transalte/transalte",
"pages/sign/login/login", "pages/sign/login/login",
"pages/sign/bindTel/bindTel", "pages/sign/bindTel/bindTel",
"pages/sign/apply/apply", "pages/sign/apply/apply",
"pages/sign/applyResult/applyResult", "pages/sign/applyResult/applyResult",
"pages/tabbar/index/index",
"pages/tabbar/class/class", "pages/tabbar/class/class",
"pages/tabbar/financial/financial", "pages/tabbar/financial/financial",
"pages/tabbar/personal/personal", "pages/tabbar/personal/personal",
......
...@@ -58,7 +58,7 @@ Page({ ...@@ -58,7 +58,7 @@ Page({
}, },
gocourseinstant: function () { gocourseinstant: function () {
wx.navigateTo({ wx.navigateTo({
url: '../../index/courseInstant/courseInstant', url: '../../index/courseInstant/courseInstant?type=check&lesson_id=' + this.data.lesson_id,
}) })
}, },
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<view class="item flex-h flex-vc flex-hb" wx:for="{{stuList}}" wx:key="index" data-id="{{item.id}}"> <view class="item flex-h flex-vc flex-hb" wx:for="{{stuList}}" wx:key="index" data-id="{{item.id}}">
<view class="flex-h flex-vc"> <view class="flex-h flex-vc">
<image src="/images/default_head.png" wx:if="{{item.child.thumb == null}}"></image> <image src="/images/default_head.png" wx:if="{{item.child.thumb == null}}"></image>
<image src="{{item.child.thumb}}" wx:else></image> <image src="{{item.child.thumb}}" wx:else></image>
<view> <view>
<view class="name">{{item.child.nick_name !=null ? item.child.nick_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 class="big_name">{{item.child.child_name}}</view>
......
...@@ -8,6 +8,7 @@ var qiniuUploader = require("../../../utils/qiniuUploader"); ...@@ -8,6 +8,7 @@ var qiniuUploader = require("../../../utils/qiniuUploader");
Page({ Page({
data: { data: {
lesson_id: '', lesson_id: '',
type: '', // 查看还是修改
videoBox: [], videoBox: [],
videoShow: true, videoShow: true,
imgBox: [], imgBox: [],
...@@ -20,12 +21,12 @@ Page({ ...@@ -20,12 +21,12 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({ this.setData({
lesson_id: options.lesson_id ? options.lesson_id : '' lesson_id: options.lesson_id ? options.lesson_id : '',
type: options.type ? options.type : '',
}) })
if (this.data.lesson_id) { if (this.data.lesson_id) {
this.getDetail() this.getDetail()
} }
}, },
getDetail() { getDetail() {
let params = { let params = {
...@@ -34,6 +35,22 @@ Page({ ...@@ -34,6 +35,22 @@ Page({
lesson_id: this.data.lesson_id lesson_id: this.data.lesson_id
}, },
callback:(data)=>{ callback:(data)=>{
console.log(JSON.parse(data.class_moment))
let class_moment = JSON.parse(data.class_moment)
let arr1 = [], arr2 = []
for(var i=0; i< class_moment.length; i++) {
if (class_moment[i].type == 'video') {
arr1.push(class_moment[i])
} else {
arr2.push(class_moment[i])
}
}
this.setData({
videoBox: arr1,
imgBox: arr2
})
console.log(arr1)
console.log(arr2)
console.log(data) console.log(data)
} }
} }
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
<view class="imgBox flex-h"> <view class="imgBox flex-h">
<view class="img videoBox" wx:for="{{videoBox}}" wx:for-item="item" wx:key="idx"> <view class="img videoBox" wx:for="{{videoBox}}" wx:for-item="item" wx:key="idx">
<video src="{{item.url}}" data-index="{{index}}"></video> <video src="{{item.url}}" data-index="{{index}}"></video>
<view class="delete-btn" data-index="{{index}}" catchtap="deleteVideo"> <view class="delete-btn" data-index="{{index}}" catchtap="deleteVideo" wx:if="{{type != 'check'}}">
<text class='iconfont iconguanbi'></text> <text class='iconfont iconguanbi'></text>
</view> </view>
</view> </view>
<view class='addBox flex-h flex-vc flex-hc' bindtap="chooseVideo" wx:if="{{videoShow}}"> <view class='addBox flex-h flex-vc flex-hc' bindtap="chooseVideo" wx:if="{{imgBox.length < 1}}">
<text class='iconfont iconshipin'></text> <text class='iconfont iconshipin'></text>
</view> </view>
</view> </view>
...@@ -23,15 +23,15 @@ ...@@ -23,15 +23,15 @@
<view class="imgBox flex-h flex-hw"> <view class="imgBox flex-h flex-hw">
<view class="img" wx:for="{{imgBox}}" wx:for-item="item" wx:key="idx"> <view class="img" wx:for="{{imgBox}}" wx:for-item="item" wx:key="idx">
<image src="{{item.url}}" data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image> <image src="{{item.url}}" data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image>
<view class="delete-btn" data-index="{{index}}" catchtap="deleteImg"> <view class="delete-btn" data-index="{{index}}" catchtap="deleteImg" wx:if="{{type != 'check'}}">
<text class='iconfont iconguanbi'></text> <text class='iconfont iconguanbi'></text>
</view> </view>
</view> </view>
<view class='addBox flex-h flex-vc flex-hc' bindtap="chooseImg" wx:if="{{imgBox.length < 9}}"> <view class='addBox flex-h flex-vc flex-hc' bindtap="chooseImg" wx:if="{{imgBox.length < 9 && type != 'check' }}">
<text class='iconfont iconxiangji'></text> <text class='iconfont iconxiangji'></text>
</view> </view>
</view> </view>
</view> </view>
<view class="button"> <view class="button" wx:if="{{type != 'check'}}">
<view class="submit" catchtap="save">提交</view> <view class="submit" catchtap="save">提交</view>
</view> </view>
\ No newline at end of file
...@@ -27,7 +27,6 @@ page { ...@@ -27,7 +27,6 @@ page {
.img { .img {
width: 210rpx; width: 210rpx;
height: 210rpx; height: 210rpx;
border: 1px solid #EBEBEB;
border-radius: 5rpx; border-radius: 5rpx;
margin-right: 30rpx; margin-right: 30rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
......
...@@ -12,20 +12,53 @@ Page({ ...@@ -12,20 +12,53 @@ Page({
}, },
onLoad: function (options) { onLoad: function (options) {
this.setData({
user_id: wx.getStorageSync('userInfo').id
})
console.log(this.data.user_id)
}, },
getPhoneNumber: function (e) {
var that = this
if (e.detail.errMsg == 'getPhoneNumber:ok') {
let params = {
url: 'user/switchPhone',
data: {
encryptedData: e.detail.encryptedData,
iv: e.detail.iv
},
type: "POST",
callback: (data) => {
this.setData({
telPhone: data.phoneNumber
})
app.globalData.userTel = data.phoneNumber
wx.setStorageSync('userTel', data.phoneNumber)
that.apply()
},
}
base.newRequest(params)
} else {
base.toast('授权失败,无法查看')
}
},
apply() { apply() {
let params = { let params = {
url: 'apply', url: 'apply',
type: 'POST', type: 'POST',
data: { data: {
wx_user_id: this.data.user_id,
role_type: this.data.role_type, role_type: this.data.role_type,
mobile: this.data.telPhone mobile: this.data.telPhone
}, },
callback:(data)=>{ callback:(data)=>{
console.log(data) wx.redirectTo({
url: '/pages/sign/applyResult/applyResult?type=success',
})
},
confirmback:()=>{
wx.redirectTo({
url: '/pages/sign/applyResult/applyResult?type=fail',
})
} }
} }
base.newRequest(params) base.newRequest(params)
......
<view> <view>
<view class="save" catchtap="apply">申请成为教练</view> <button class="save" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">申请成为教练</button>
</view> </view>
\ No newline at end of file
...@@ -3,12 +3,13 @@ ...@@ -3,12 +3,13 @@
bottom: 33rpx; bottom: 33rpx;
left: 50rpx; left: 50rpx;
right: 50rpx; right: 50rpx;
width: 650rpx; width: 650rpx !important;
height: 80rpx; height: 80rpx !important;
line-height: 80rpx; line-height: 80rpx !important;
text-align: center; text-align: center;
background: linear-gradient(-70deg, #FFC600 0%, #FFD400 100%); background: linear-gradient(-70deg, #FFC600 0%, #FFD400 100%);
border-radius: 40rpx; border-radius: 40rpx;
font-size: 30rpx; font-size: 30rpx;
color: #000000; color: #000000;
padding: 0 !important;
} }
\ No newline at end of file
...@@ -4,9 +4,7 @@ ...@@ -4,9 +4,7 @@
</view> </view>
<view class="text">申请成功</view> <view class="text">申请成功</view>
<view class="cont"> <view class="cont">
<view class="title" wx:if='{{type == 1}}'>添加审核人员,更快成为团长!</view> <view class="title">添加审核人员,更快管理场馆!</view>
<view class="title" wx:if='{{type == 2}}'>添加审核人员,更快成为教练!</view>
<view class="title" wx:if='{{type == 3}}'>添加审核人员,更快管理场馆!</view>
<view class="code" catchtap="prevImage"> <view class="code" catchtap="prevImage">
<image src="{{curImage}}"></image> <image src="{{curImage}}"></image>
</view> </view>
......
...@@ -11,36 +11,41 @@ Page({ ...@@ -11,36 +11,41 @@ Page({
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 (app.globalData.hasTel) { let params = {
base.toast('登录成功') url: 'apply/get_coach_apply',
setTimeout(() => { callback: (data) => {
if (app.globalData.backurl) { let status;
if (app.globalData.backurl.indexOf('/pages/tabbar') != -1) { if (data.length == 0) { // 没有申请过
wx.switchTab({ status = 1
url: app.globalData.backurl, } else if (data.status_display == '待审核') {
}) status = 2
} else { } else {
wx.redirectTo({ status = 3
url: app.globalData.backurl }
}) this.getLogin(status)
} }
} else { }
wx.switchTab({ base.newRequest(params)
url: '/pages/tabbar/personal/personal', },
}) getLogin(status) {
} if (status == 3) {
}, 800) wx.switchTab({
url: '/pages/tabbar/index/index',
} else { })
wx.navigateTo({ } else if (status == 2) {
url: '../bindTel/bindTel', wx.redirectTo({
url: '/pages/sign/applyResult/applyResult',
})
} else if (status == 1) {
wx.redirectTo({
url: '/pages/sign/apply/apply',
}) })
} }
}, },
checkVisions: function () { checkVisions: function () {
if (wx.canIUse !== undefined && wx.canIUse('button.open-type.getUserInfo')) { if (wx.canIUse !== undefined && wx.canIUse('button.open-type.getUserInfo')) {
this.setData({ this.setData({
......
...@@ -74,6 +74,7 @@ Page({ ...@@ -74,6 +74,7 @@ Page({
callback : (data) => { callback : (data) => {
base.toast('抢班成功') base.toast('抢班成功')
console.log(data) console.log(data)
console.log('1111111111111')
this.setData({ this.setData({
datalList: [] datalList: []
......
...@@ -17,7 +17,8 @@ Page({ ...@@ -17,7 +17,8 @@ Page({
today: '', // 今天日期 today: '', // 今天日期
curDate: '', curDate: '',
list: [], list: [],
allList: [] allList: [],
month: ''
}, },
/** /**
...@@ -27,21 +28,26 @@ Page({ ...@@ -27,21 +28,26 @@ Page({
wx.showLoading({ wx.showLoading({
title: '加载中...', title: '加载中...',
}) })
console.log(app.globalData) let year = new Date().getFullYear()
let month = util.formatNumber(new Date().getMonth() + 1)
this.setData({ this.setData({
// coach_id: app.globalData.userInfo.id, // coach_id: app.globalData.userInfo.id,
today: util.formatTime(new Date()), today: util.formatTime(new Date()),
curDate: util.formatTime(new Date()) curDate: util.formatTime(new Date()),
month: year + month
}) })
console.log(this.data.today == this.data.curDate)
this.getAllList() this.getAllList()
this.getList() this.getList()
}, },
getAllList() { getAllList() {
wx.showLoading({
title: '加载中...',
})
let params = { let params = {
url: 'coach/timetable', url: 'coach/timetable',
data: { data: {
coach_id: this.data.coach_id, coach_id: this.data.coach_id,
month: this.data.month
}, },
callback: (data) => { callback: (data) => {
console.log(data) console.log(data)
...@@ -80,20 +86,19 @@ Page({ ...@@ -80,20 +86,19 @@ Page({
} }
} }
base.newRequest(params) base.newRequest(params)
}, },
prev: function (event) { prev: function (event) {
let currentMonth = util.formatNumber(event.detail.currentMonth) let currentMonth = util.formatNumber(event.detail.currentMonth)
this.setData({ this.setData({
month: event.detail.currentYear + '-' + currentMonth month: event.detail.currentYear + currentMonth
}) })
this.getAllList(); this.getAllList();
}, },
next: function (event) { next: function (event) {
let currentMonth = util.formatNumber(event.detail.currentMonth) let currentMonth = util.formatNumber(event.detail.currentMonth)
this.setData({ this.setData({
month: event.detail.currentYear + '-' + currentMonth month: event.detail.currentYear + currentMonth
}) })
this.getAllList(); this.getAllList();
}, },
......
...@@ -15,9 +15,6 @@ ...@@ -15,9 +15,6 @@
var hour = getDate().getHours() var hour = getDate().getHours()
var minute = getDate().getMinutes() var minute = getDate().getMinutes()
var time = hour + ':' + minute var time = hour + ':' + minute
console.log(hour)
console.log(minute)
return time return time
} }
module.exports = { module.exports = {
......
const app = getApp()
import { Base } from '../../utils/base.js';
const base = new Base()
Page({
data: {
},
onLoad: function (options) {
this.getAuthor()
},
getAuthor() {
var that = this
let params = {
url: 'apply/get_coach_apply',
callback:(data)=>{
let status;
if (data.length == 0) { // 没有申请过
status = 3
} else if (data.status == 2) {
status = 2
} else { // 通过
status = 1
}
that.getLogin(status)
}
}
base.newRequest(params)
},
getLogin(status) {
let userInfo = wx.getStorageSync('userInfo')
if (userInfo) {
if (status == 1) {
wx.switchTab({
url: '/pages/tabbar/index/index',
})
} else if (status == 2) {
wx.redirectTo({
url: '/pages/sign/applyResult/applyResult',
})
} else if (status == 3) {
wx.redirectTo({
url: '/pages/sign/apply/apply',
})
}
} else {
wx.redirectTo({
url: '/pages/sign/login/login',
})
}
},
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="box flex-v flex-hc flex-vc">
<image src="/images/course_login.png"></image>
<view>豌豆成长</view>
</view>
\ No newline at end of file
page {
height: 100%;
}
.box{
height: 100%;
font-size: 32rpx;
}
.box image{
width: 204rpx;
height: 204rpx;
margin-bottom: 40rpx;
}
\ 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