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

日历,审核通过页面增加判断

parent e2501c95
......@@ -7,9 +7,10 @@
.elegant_today {
color: #000;
background: url('https://wdty.xueyoubangedu.com/wandou/today.png') no-repeat;
background: #FFFFFF;
/* background: url('https://wdty.xueyoubangedu.com/wandou/today.png') no-repeat;
background-size: 62rpx 62rpx;
background-color: transparent;
background-color: transparent; */
}
.elegant_choosed {
......
const app = getApp()
import {
Base
} from '../../../utils/base.js';
const base = new Base()
Page({
/**
* 页面的初始数据
*/
data: {
success : true,
type: '1',
curImage: 'https://wdty.xueyoubangedu.com/wandou/pic_02.png'
success: true,
status: '0',
curImage: 'https://wdty.xueyoubangedu.com/wandou/pic_02.png',
role_type: '2',
telPhone: ''
},
/**
......@@ -14,7 +18,7 @@ Page({
*/
onLoad: function (options) {
this.setData({
type: options.type
status: options.status ? options.status : '0'
})
},
copy: function (e) {
......@@ -33,5 +37,26 @@ Page({
wx.previewImage({
urls: [this.data.curImage]
})
},
save() {
let params = {
url: 'apply',
type: 'POST',
data: {
role_type: this.data.role_type,
mobile: wx.getStorageSync('userTel')
},
callback: (data) => {
wx.redirectTo({
url: '/pages/sign/applyResult/applyResult?status=0',
})
},
confirmback: () => {
wx.redirectTo({
url: '/pages/sign/applyResult/applyResult?status=2',
})
}
}
base.newRequest(params)
}
})
\ No newline at end of file
......@@ -13,7 +13,7 @@
</view>
</view> -->
<view>
<view class="one" wx:if="{{ success }}">
<view class="one" wx:if="{{ status == 0 }}">
<image src="/images/loading.png"></image>
<view>您的申请正在审核中</view>
</view>
......
......@@ -20,11 +20,12 @@ Page({
callback: (data) => {
let status;
if (data.length == 0) { // 没有申请过
status = 1
} else if (data.status_display == '待审核') {
status = 2
} else {
status = 3
status = 3
} else if (data.status == 2 || data.status == 0) { // 待审核或者审核失败
status = data.status
} else if (data.status == 1){ // 通过
app.globalData.coach_id = data.wxuser.coach.id
status = 1
}
this.getLogin(status)
}
......@@ -32,15 +33,15 @@ Page({
base.newRequest(params)
},
getLogin(status) {
if (status == 3) {
if (status == 1) {
wx.switchTab({
url: '/pages/tabbar/index/index',
})
} else if (status == 2) {
} else if (status == 2 || status == 0) {
wx.redirectTo({
url: '/pages/sign/applyResult/applyResult',
url: '/pages/sign/applyResult/applyResult?status=' + status,
})
} else if (status == 1) {
} else if (status == 3) {
wx.redirectTo({
url: '/pages/sign/apply/apply',
})
......
......@@ -11,7 +11,7 @@ Page({
*/
data: {
coach_id: '',
isOpen: false,
// isOpen: false,
daysColor: [],
today: '', // 今天日期
curDate: '',
......@@ -89,6 +89,16 @@ Page({
afterCalendarRender(e) {
const calendar = this.selectComponent('#calendar').calendar;
const toSet = [
{
year: this.data.curDate.split('-')[0],
month: this.data.curDate.split('-')[1],
date: this.data.curDate.split('-')[2],
}
]
calendar.setDateStyle(toSet)
calendar.setSelectedDates(toSet)
let daysColor = [];
this.data.allList.forEach(function (el) {
daysColor.push({
......@@ -98,7 +108,7 @@ Page({
class: 'circle_data'
})
})
const calendar = this.selectComponent('#calendar').calendar
// const calendar = this.selectComponent('#calendar').calendar;
calendar.setDateStyle(daysColor)
},
afterTapDate(e) {
......@@ -176,11 +186,11 @@ Page({
}
},
// 日历展开与否
open() {
this.setData({
isOpen: !this.data.isOpen
})
},
// open() {
// this.setData({
// isOpen: !this.data.isOpen
// })
// },
goclassManagement: function (e) {
let item = e.currentTarget.dataset.item
let classTime = this.data.curDate + ' ' + item.start_time + '' + item.end_time
......
<view class="tabContent">
<view class="rili">
<view class="board {{isOpen? 'heightBoard' : ''}}">
<view class="board">
<calendar
id="calendar"
config="{{calendarConfig}}"
......@@ -9,12 +9,12 @@
bind:whenChangeMonth="whenChangeMonth"
/>
</view>
<view class="riliShow">
<!-- <view class="riliShow">
<view class="flex-h flex-vc flex-hc" catchtap="open">
<text>{{isOpen ? '收起':'更多日期'}}</text>
<text class="iconfont icongengduo {{isOpen ? 'up': 'down'}}"></text>
</view>
</view>
</view> -->
</view>
<wxs module="util">
var time = function() {
......
......@@ -23,7 +23,8 @@
background: #FFFFFF;
border-radius: 0;
overflow: hidden;
height: 220rpx;
/* height: 220rpx; */
height: 560rpx;
}
.heightBoard {
height: auto;
......
......@@ -18,9 +18,9 @@ Page({
let status;
if (data.length == 0) { // 没有申请过
status = 3
} else if (data.status == 2) {
status = 2
} else { // 通过
} else if (data.status == 2 || data.status == 0) { // 待审核或者审核失败
status = data.status
} else if (data.status == 1){ // 通过
app.globalData.coach_id = data.wxuser.coach.id
status = 1
}
......@@ -37,9 +37,9 @@ Page({
wx.switchTab({
url: '/pages/tabbar/index/index',
})
} else if (status == 2) {
} else if (status == 2 || status == 0) {
wx.redirectTo({
url: '/pages/sign/applyResult/applyResult',
url: '/pages/sign/applyResult/applyResult?status=' + status,
})
} else if (status == 3) {
wx.redirectTo({
......
......@@ -111,7 +111,7 @@
}
function getQiniuToken(callback) {
var that = this
// var that = this
wx.request({
url: config.qiniuUploadTokenURL,
data: {
......@@ -127,7 +127,7 @@
}
} else if (res.data.meta.code == 400) {
app.getSessionKey(function () {
that.getQiniuToken(callback)
getQiniuToken(callback)
})
}
},
......
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