check.checkIdNull is not a function;at "pages/query/query" page bindIdcardVerify function
在query.js中也引进了var check = require("../../utils/check.js")
query.wxml
<view class="weui-cell weui-cell_input">
<input class="weui-input" name="idno" type="idcard" placeholder="请输入身份证号" maxlength="18" bindblur="bindIdcardVerify" />
</view>
query.js
bindIdcardVerify: function (e) {//身份证号验证
if (!check.checkIdNull(e.detail.value)) {
//if (!check.checkPhoneNum(e.detail.value)) {
return false
}
}
check.js
function checkIdNull(content) {
return (content && content != null)
}
check.js
都没有对外暴露方法,当然不会成功调用了
明白了 是在check.js中 没加
module.exports= {
checkIsNotNull: checkIsNotNull,
checkPhoneNum: checkPhoneNum,
isContentEqual: isContentEqual,
checkIdcard: checkIdcard
}
什么意思?暴露方法?