为何实现不了以下功能?
功能是:在加载这个
页面的时候,当你已经认证过了,此处
会变为
已认证。
相关功能代码:
wxml
<view class="subtitle" id="shenfen" bindtap="wrtusermsg">
{{renzheng}}
<!-- {{certificationOk == 2?"已认证":"未认证"}} -->
</view>
n那个三元表达式我不清楚为何用不了,所以换了个变量。
js
data: {
userInfo: null,
certificationOk: null,
avatarUrl: '',
userInfo: {},
logged: false,
takeSession: false,
requestResult: '',
username:'',
renzheng:"未认证"
},
onload:function(options){
usermsg.where({
upload:"1",
}).get({
success:function(res){
console.log(res);
this.setData({
renzheng:"已认证",
})
console.log(certificationOk);
}
})//此处是用上传参数时的所附带的upload字段来判断是否已经认证(上传过数据了)
}
d但在此处数据库查询成功后该页面却仍然显示

