import Magix from 'magix' import View from '../../../view' Magix.applyStyle('@./pm-login.less') export default View.extend({ tmpl: '@pm-login.html', init (options) { this.options = options }, render () { // 登录成功回跳页面 const forward = Magix.toUrl(`${window.location.origin}/login.html?timeStamp=${Math.random().toString().slice(2)}#!/login/pm-deeplink`) const params = [ 'redirectURL=' + encodeURIComponent(forward), 'style=mini', 'css_style=mdmp', // css_style为主站那边给定的样式约定值 'full_redirect=false', 'newMini2=true', 'sub=true', 'enup=0', 'qrlogin=1', 'keyLogin=true' ] const taobaoHost = ~window.location.host.indexOf('daily') ? 'login.daily.taobao.net' : 'login.taobao.com' const src = 'https://' + taobaoHost + '/member/login.jhtml?' + params.join('&') // 'https://login.taobao.com/member/login.jhtml?style=mini&css_style=mdmp&full_redirect=true&from=mdmp&sub=true&tpl_redirect_url=' this.updater.digest({ src }) } })