check.page.js 799 Bytes
require('3party/check.page.css');
require('../common');
// 图片验证码
let ImgCheck = require('plugin/img-check');

let imgCheck = new ImgCheck('#js-img-check', {
    useREM: {
        rootFontSize: 40,
        picWidth: 150
    }
});

imgCheck.init();

$(function() {
    $('.submit').on('click', function() {
        $.ajax({
            method: 'POST',
            url: '/3party/check/submit',
            data: {
                captcha: $.trim(imgCheck.getResults())
            },
            success: function(ret) {
                if (ret.code === 200) {
                    window.location.href = decodeURIComponent(window.queryString.refer) || '//m.yohobuy.com';
                } else {
                    imgCheck.refresh();
                }
            }
        });
    });
});