import Magix from 'magix' import View from '../../../view' Magix.applyStyle('@./diagnoses.less') export default View.extend({ tmpl: '@diagnoses.html', init (options) { this.options = options }, async render () { const { type, brandId } = this.options const diagnoses = await this.getDiagnoses(type, brandId) this.updater.digest({ diagnoses }) }, async getDiagnoses (type, brandId) { try { const params = { brandId, type } const models = [{ name: 'api_promotion_double11_diagnosis_get', params }] const [model] = await this.fetch(models) const data = model.get('data', []) return data } catch (error) { this.alert('错误提示', error.msg || error.message || error) } }, async 'highlightTmpl' (e) { const { crowdLabel } = e.params const crowdChoicenessVf = await this.waitVframeCreated(Magix.Vframe.get('promotionCrowdChoicenessVframe')) crowdChoicenessVf.invoke('setHighlight', [crowdLabel]) } })