html
<button type="button" onclick="wxpay.config()" class="btn">创建二维码</button>
js
var $;
layui.use(['jquery'], function () {
$ = layui.jquery;
});
var wxpay = {
config: function () {
//自由发挥
alert($("#username").val());
}
};