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

Merge branch 'master' into 'shipanpan'

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