import Magix from 'magix' import View from '../../../../../view' Magix.applyStyle('@../index.less') Magix.applyStyle('@./crowd-diagnose.less') export default View.extend({ tmpl: '@crowd-diagnose.html', init (options) { this.options = options }, async render () { const { currentWeekly } = this.options const diagnose = await this.getCrowdDiagnose() const diagnoseText = { new: { 1: '消耗量级新增上榜,注意关注人群的详细效果提升最终转化。', 2: '点击效果新增上榜,新人群CTR不错,看看触达人群的优质特征进一步强化吧。' }, up: { 1: '消耗增速最快,拿量能力不错,注意关注人群的详细效果提升最终转化。', 2: '点击效果增速最快,点击效果会影响后续定向的流量获取能力,看看诊断中哪些特质会影响点击。' }, down: { 1: '消耗下滑最快,拿量能力下滑,注意关注人群的详细效果提升最终转化。', 2: '点击效果下滑最快,点击效果会影响后续定向的流量获取能力,看看诊断中哪些特质会影响点击。' }, flat: { 1: '消耗是本周排行TOP1,注意关注人群的详细效果提升最终转化。', 2: '是本周点击率排行TOP1,点击效果会影响后续定向的流量获取能力,看看诊断中哪些特质会影响点击。' } } this.updater.digest({ diagnoseText, diagnose, currentWeekly }) }, async getCrowdDiagnose () { try { const { currentWeekly } = this.options const params = { weeklyReportId: currentWeekly.id } const models = [{ name: 'api_weekly_report_old_crowd_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) } } })