Commit bea76c16 authored by 吴颖's avatar 吴颖

Merge branch 'wuying' into 'master'

Wuying

See merge request !22
parents e6e94808 1856b420
App({
onLaunch: function () {
this.isReload() // 小程序是否有新版本
this.getLogin()
this.getToken()
},
// 小程序是否有新版本
......@@ -38,23 +36,9 @@ App({
})
}
},
getLogin() {
let userInfo = wx.getStorageSync('userInfo')
if (userInfo) {
this.globalData.userInfo = 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 {
......
{
"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",
......
......@@ -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>
......
......@@ -15,29 +15,34 @@ Page({
}
},
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,
})
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 {
wx.redirectTo({
url: app.globalData.backurl
})
status = 3
}
} else {
this.getLogin(status)
}
}
base.newRequest(params)
},
getLogin(status) {
if (status == 3) {
wx.switchTab({
url: '/pages/tabbar/personal/personal',
url: '/pages/tabbar/index/index',
})
}
}, 800)
} else {
wx.navigateTo({
url: '../bindTel/bindTel',
} else if (status == 2) {
wx.redirectTo({
url: '/pages/sign/applyResult/applyResult',
})
} else if (status == 1) {
wx.redirectTo({
url: '/pages/sign/apply/apply',
})
}
},
......
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