const Magix = require('magix'); const View = require('dmp-new/view') Magix.applyStyle('@./lbs.less') module.exports = View.extend({ tmpl: '@complete.html', init(options) { this.options = options }, render() { let seconds = 3 const me = this const loc = Magix.Router.parse() const { all, user } = this.updater.get() let isIsv = all.isvOperType == user.loginUser.operType this.updater.digest({ isIsv, seconds, crowdName: this.options.viewData.crowdName, isEdit: !!loc.get('id') }); this.ok = false function recur() { setTimeout(() => { seconds-- if (seconds === 0 && !me.ok) { return Magix.Router.to(isIsv ? '/crowds-isv/list' : '/crowds-new/list') } me.updater.digest({ seconds }) recur() }, 1000) } recur() }, 'iknow'() { this.ok = true Magix.Router.to(this.updater.get('isIsv') ? '/crowds-isv/list' : '/crowds-new/list') } });