import Magix from 'magix' import View from '../../../../view' Magix.applyStyle('@./analysis.less') export default View.extend({ tmpl: '@analysis.html', init (options) { this.options = options this.observeLocation(['sceneType', 'analysisSelected']) }, render () { const loc = Magix.Router.parse() const { date, period, brandId, brandsMap } = this.options const memberTabs = [{ text: '会员招募拉新', value: '1' }, { text: '会员首购引导', value: '2' }] const analysisTabs = [{ text: '分层人群收割机会', value: 'crowd-classify', tips: '路过原则。统计周期内,用户出现在层级内即计算相关人群规模。例如:一个用户在所选时间段内层级由D变为E再变为P,那么在D、E、P三个层级中都会计算此用户,所以层级间可能存在用户重复的情况。' }, { text: '营销渠道效率贡献分析', value: 'channel-contribute' }] const { sceneType = memberTabs[0].value, analysisSelected = analysisTabs[0].value } = loc.params this.updater.digest({ memberTabs, sceneType, analysisTabs, analysisSelected, date, period, brandId, brandsMap }) }, 'changeAnalysisTag' (e) { const { analysisSelected } = this.updater.get() Magix.Router.to({ analysisSelected }) }, 'changeMemberType' (e) { const { sceneType } = this.updater.get() Magix.Router.to({ sceneType }) }, 'createCrowd' (e) { const { date, period, brandId, brandsMap } = this.options const { sceneType } = this.updater.get() const viewPath = '@./create-crowd' const viewOptions = { date, period, brandId, brandsMap, sceneType } const dialogOptions = { width: 700, header: { title: '圈选DEEPLINK会员资产人群' }, footer: { enter: false, cancel: false } } this.mxModal(viewPath, viewOptions, dialogOptions) } })