扫码考试bug
This commit is contained in:
parent
a3250d97f4
commit
3a2e0ce1f7
|
@ -7,7 +7,9 @@ Page({
|
|||
data: {
|
||||
username:'',
|
||||
password:'',
|
||||
mpopenid:''
|
||||
mpopenid:'',
|
||||
isExists:false,
|
||||
msg:''
|
||||
},
|
||||
usernameChange: function (e) {
|
||||
this.data.username = e.detail.value
|
||||
|
@ -54,6 +56,30 @@ Page({
|
|||
}
|
||||
});
|
||||
},
|
||||
getUserbasic:function(){
|
||||
var that = this
|
||||
wx.request({
|
||||
url: getApp().globalData.serverUrl + 'api/user?a=get_user_from_username&username='+that.data.username,
|
||||
header: {
|
||||
'content-type': 'application/json', //
|
||||
},
|
||||
method: 'GET',
|
||||
success: res => {
|
||||
if (res.data.code == 1) {
|
||||
that.setData({
|
||||
isExists:true
|
||||
})
|
||||
that.setData(res.data.data)
|
||||
} else {
|
||||
that.setData({
|
||||
isExists: false,
|
||||
msg:'未查到该账户信息,是否账户有误'
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
onGetInfo:function(e){
|
||||
this.setData({
|
||||
userInfo:e.detail.userInfo
|
||||
|
|
|
@ -7,10 +7,18 @@
|
|||
</view>
|
||||
<view class="page__bd">
|
||||
<view class="weui-cells__title">登陆</view>
|
||||
<view class="weui-cells_desc" wx:if="{{!isExists}}" style="color:red">{{msg}}</view>
|
||||
<view class="weui-cells_desc" wx:if="{{isExists}}" style="text-align:center">
|
||||
<span style="color:orange;font-weight:bold">{{name}}</span>
|
||||
--
|
||||
<span style="color:darkblue;font-weight:bold">{{ubelongpart__partname}}</span>
|
||||
--
|
||||
<span style="color:darkblue;font-weight:bold">{{usecomp__partname}}</span>
|
||||
</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<view class="weui-cell weui-cell_input">
|
||||
<view class="weui-cell__bd">
|
||||
<input class="weui-input" placeholder="请输入账号" bindinput="usernameChange"/>
|
||||
<input class="weui-input" placeholder="请输入账号" bindinput="usernameChange" bindblur="getUserbasic"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_input">
|
||||
|
|
|
@ -21,9 +21,14 @@ Page({
|
|||
let q = decodeURIComponent(options.q)
|
||||
if (q) {
|
||||
examtestid = util.getQueryString(q, 'id')
|
||||
this.setData({
|
||||
fromWx: true
|
||||
})
|
||||
if (wx.getStorageSync('sessionid').indexOf('sessinid') != -1) {
|
||||
this.setData({
|
||||
fromWx: true
|
||||
})
|
||||
}else{
|
||||
getApp().onLaunch()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
wx.request({
|
||||
|
|
Loading…
Reference in New Issue