var salesInfo = { /*template: `
返回
首页
avatar

{{loginType}}

昵 称:{{wxInfo.nickname}}
游戏ID:{{salesInfo.player_id}}
推广账号:{{salesInfo.salesid}}
可赠卡数:{{assets.roomcard}}
{{lang.starName}}数:{{parseFloat(assets.bean)}}
钻石数:{{assets.diamond}}
`,*/ template: '
返回
首页
avatar

{{loginType}}

昵 称:{{wxInfo.nickname}}
游戏ID:{{salesInfo.player_id}}
推广账号:{{salesInfo.salesid}}
可赠卡数:{{assets.roomcard}}
{{lang.starName}}数:{{parseFloat(assets.bean)}}
钻石数:{{assets.diamond}}
', data: function () { return { params: {}, lang: {}, salesInfo: {}, wxInfo: {}, agentInfo: {}, assets: {} } }, computed: { loginType: function () { var type = this.salesInfo.logintype; if (type == 1) return '账号登录'; else if (type == 0) return '微信登录'; else if (type == 2) return '手机号登录'; else return ''; }, personCenter: function () { return './my.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid; }, indexUrl: function () { return './index.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid; } }, methods: { goProductCenter: function () { window.location.href = './your_purchase_new.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid; }, goShortRoom: function () { window.location.href = './short_room.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid; }, goWhiteList: function () { var url = './white_list.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid; if (this.params.unionid) url = url + "&unionid=" + this.params.unionid; if (this.params.unionid) url = url + "&playerid=" + this.params.playerid; window.location.href = url; }, goSettle: function () { window.location.href = $.SETTLE_URL + 'login.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid + '&salesid=' + this.salesInfo.salesid; }, /** * 走马灯 * @param target */ move:function (target) { var box = document.getElementById(target+"-box"); // 文本的宽度 var text = document.getElementById(target+"-text"); var textWidth = text.clientWidth || text.offsetWidth; // 容器 var wrap = document.getElementById(target+"-wrap"); // 容器的宽度 var wrapWidth = wrap.clientWidth || wrap.offsetWidth; console.log('text-width:', textWidth, ', wrap-width:', wrapWidth); // 初始偏移距离:容器的宽度 + 常量 var distance = wrapWidth + 30; var max_distance = textWidth + 30; setInterval(function () { distance--; // 如果位移超过文字宽度,则回到起点 if (-distance >= max_distance) { distance = wrapWidth; } box.style.transform = 'translateX(' + distance + 'px)' }, 20) } }, created: function () { this.params = $.getQueryObj(); this.lang = lang[this.params.agentid] ? lang[this.params.agentid] : lang.default; var that = this; $.getAgentInfo(function (agentInfo) { that.agentInfo = agentInfo; $.getWxInfo(function (wxInfo) { that.wxInfo = wxInfo; $.getUserInfo(function (res) { that.salesInfo = res; $.getUserAssets(function (assets) { that.assets = assets; if(that.salesInfo.agent_announcement) that.move('marquee'); if(that.salesInfo.sales_announcement) that.move('zhouma'); }, 1); }) }) }) } }