import Magix from 'magix' import * as View from '../../../view' Magix.applyStyle('@./index.less') export default View.extend({ tmpl: '@join_dialog.html', init (options) { this.options = options }, render () { this.updater.digest({ }) }, 'close': function (e) { this.options.dialog.close() }, async 'submit' (event) { event.preventDefault() const { user, reason } = this.updater.get() if (!this.isValid()) { return }; try { const models = [{ name: 'api_setup_save_post', params: { csrfId: user.csrfId, reason } }] await this.fetch(models) this.alert('提示', '您的申请已提交,审核结果请关注联系人旺旺弹窗。', () => { window.location.reload() }) } catch (error) { this.alert('错误提示', error.msg || error.message || error, null, { mask: true }) } } })