next bug
This commit is contained in:
parent
fdee8192c2
commit
92b3bba694
|
@ -16,13 +16,14 @@ App({
|
||||||
success: res => {
|
success: res => {
|
||||||
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
||||||
api.request('/crm/consumer/mplogin/','POST', {code:res.code}).then(res=>{
|
api.request('/crm/consumer/mplogin/','POST', {code:res.code}).then(res=>{
|
||||||
wx.hideLoading()
|
|
||||||
if(res.code==200){
|
if(res.code==200){
|
||||||
this.globalData.token = res.data.token
|
this.globalData.token = res.data.token
|
||||||
this.globalData.userinfo = res.data.userinfo
|
this.globalData.userinfo = res.data.userinfo
|
||||||
|
wx.hideLoading()
|
||||||
var pages = getCurrentPages() //获取加载的页面
|
var pages = getCurrentPages() //获取加载的页面
|
||||||
var currentPage = pages[pages.length - 1] //获取当前页面的对象
|
var currentPage = pages[pages.length - 1] //获取当前页面的对象
|
||||||
currentPage.showExp()
|
currentPage.showExp()
|
||||||
|
|
||||||
if(res.data.userinfo.username == null){
|
if(res.data.userinfo.username == null){
|
||||||
//匿名用户
|
//匿名用户
|
||||||
wx.reLaunch({
|
wx.reLaunch({
|
||||||
|
|
|
@ -13,7 +13,7 @@ Page({
|
||||||
ctms: [],
|
ctms: [],
|
||||||
tm_index: 0,
|
tm_index: 0,
|
||||||
answerP: false,
|
answerP: false,
|
||||||
page:1
|
page:1,
|
||||||
},
|
},
|
||||||
radioChange: function(e) {
|
radioChange: function(e) {
|
||||||
var that = this
|
var that = this
|
||||||
|
@ -65,11 +65,13 @@ Page({
|
||||||
ydtms: wx.getStorageSync('cat' + that.data.questioncat.toString())
|
ydtms: wx.getStorageSync('cat' + that.data.questioncat.toString())
|
||||||
}
|
}
|
||||||
api.request('/question/question/exercise/?limit=10&page='+that.data.page, 'POST', query).then(res => {
|
api.request('/question/question/exercise/?limit=10&page='+that.data.page, 'POST', query).then(res => {
|
||||||
|
if(res.code>=200){
|
||||||
that.data.tms = that.data.tms.concat(res.data.results)
|
that.data.tms = that.data.tms.concat(res.data.results)
|
||||||
that.showTm(that.data.tm_index) //展示题目和答案
|
that.showTm(that.data.tm_index) //展示题目和答案
|
||||||
that.setData({
|
that.setData({
|
||||||
tmtotal: res.data.count,
|
tmtotal: res.data.count,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
@ -171,7 +173,14 @@ Page({
|
||||||
},
|
},
|
||||||
next: function() {
|
next: function() {
|
||||||
var that = this
|
var that = this
|
||||||
var tm_index = that.data.tm_index + 1
|
var tm_index = that.data.tm_index
|
||||||
|
if (tm_index+1==that.data.tmtotal){
|
||||||
|
wx.showToast({
|
||||||
|
title: '没有更多',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
tm_index = tm_index + 1
|
||||||
that.setData({
|
that.setData({
|
||||||
tm_index: tm_index,
|
tm_index: tm_index,
|
||||||
answerP: false
|
answerP: false
|
||||||
|
@ -182,6 +191,9 @@ Page({
|
||||||
} else {
|
} else {
|
||||||
that.showTm(tm_index)
|
that.showTm(tm_index)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
previous: function() {
|
previous: function() {
|
||||||
|
|
|
@ -130,7 +130,7 @@ Page({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isPhone: function(phone){
|
isPhone: function(phone){
|
||||||
var phoneReg = /^[1][3,4,5,7,8][0-9]{9}$/;
|
var phoneReg = /^[1][3,4,5,7,8,9][0-9]{9}$/;
|
||||||
if (phoneReg.test(phone)) {
|
if (phoneReg.test(phone)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -211,4 +211,16 @@ Page({
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
Baoming: function (){
|
||||||
|
wx.navigateToMiniProgram({
|
||||||
|
appId: 'wxdcf5bbfb50dbbac8',
|
||||||
|
path: '',
|
||||||
|
success(res) {
|
||||||
|
// 打开其他小程序成功同步触发
|
||||||
|
// wx.showToast({
|
||||||
|
// title: '跳转成功'
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
|
@ -57,7 +57,9 @@
|
||||||
</a>
|
</a>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view></view>
|
<view style="margin-top:6px">
|
||||||
|
<!-- <a class="weui-btn weui-btn_primary" bindtap="Baoming" >前往正式报名</a> -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
Loading…
Reference in New Issue