scan-count-controller.js 1.04 KB
/**
 * 校验控制器
 */
define(
    "check/scan-count-controller",
    [
        'mk7/controller',
        'mk7/url',
        'mk7/utils',
        'mk7/modals',
        'mk7/jweixin'
    ],
    function (ctrl, url, utils, modals, jweixin) {
        var ctrl = new ctrl();
        var $$ = Dom7;
        var t7 = Template7;
        var scancount = 0;
        var uuid = "";

        ctrl.run = function () {
            var me = this;
            scancount = parseInt(me.params.scancount);
            uuid = me.params.uuid;
            me.setPageTitle("验证标签");
            me.render();
            $$(".count-num").html(scancount);
        };

        ctrl.bindEvents = function () {
            var me = this;
            $$(".scan-button").click(function () {
                if (uuid != "" && uuid != undefined) {
                    window.location.href = url.to('check#submit/' + uuid);
                } else {
                    window.location.href = url.to('check#index');
                }
            });
        };

        return ctrl;
    }
);