183 lines
7.8 KiB
JavaScript
183 lines
7.8 KiB
JavaScript
var salesInfo = {
|
||
/*template: `
|
||
<section>
|
||
<header class="header header-pos-fix">
|
||
<div onclick="history.back(-1)">
|
||
<img src="img/fahui.png" class="img">
|
||
<span class="text_wen">返回</span>
|
||
</div>
|
||
<a :href="indexUrl" class="home-sy"><span><span></span>首页</a>
|
||
</header>
|
||
|
||
<div style="width:100%;height:45px;display:block"></div>
|
||
|
||
<section class="container" style="background-color:#fff; border-radius: 6px; margin: 10px; padding: 8px;">
|
||
<div class="row">
|
||
<div class="col-xs-3" style="padding-top: 20px;">
|
||
<a :href="personCenter">
|
||
<img :src="wxInfo.headimgurl" class="header_img" alt="avatar" style="border-radius: 50%;width: 50px;height: 50px;">
|
||
</a>
|
||
<p style="font-size: 12px">{{loginType}}</p>
|
||
</div>
|
||
|
||
<div class="col-xs-5 pl0 pr0">
|
||
<div>昵 称:{{wxInfo.nickname}}</div>
|
||
<div>游戏ID:<span>{{salesInfo.player_id}}</span></div>
|
||
<div>推广账号:<span>{{salesInfo.salesid}}</span></div>
|
||
<div>可赠卡数:<span>{{assets.roomcard}}</span></div>
|
||
<div v-if="salesInfo.salestype == 11 || agentInfo.is_show_recharge_star == 1">{{lang.starName}}数:<span>{{parseFloat(assets.bean)}}</span>
|
||
</div>
|
||
<div v-if="true">钻石数:<span>{{assets.diamond}}</span></div>
|
||
</div>
|
||
|
||
<div class="col-xs-4 pl0">
|
||
<div class="text-right">
|
||
|
||
<div v-if="assets.is_vip == '1'">
|
||
<div><button type="button" class="btn btn-primary btn-sm" @click="goShortRoom">配置 VIP</button></div>
|
||
<div class="pt3"><button type="button" class="btn btn-info btn-sm" @click="goWhiteList">管理好友</button></div>
|
||
</div>
|
||
|
||
<div v-else>
|
||
<button type="button" class="btn btn-warning btn-sm" @click="goProductCenter">成为 VIP</button>
|
||
</div>
|
||
|
||
<div class="pt3">
|
||
<a type="button" class="btn btn-warning btn-sm" :href="personCenter">安全密码</a>
|
||
</div>
|
||
<div class="pt3">
|
||
<button type="button" class="btn btn-warning btn-sm" @click="goSettle">我的佣金</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="row marquee" v-if="salesInfo.agent_announcement">
|
||
<div class="col-xs-12">
|
||
<div style="overflow: hidden;" id="marquee-wrap">
|
||
<div style="width:8000%">
|
||
<div id="marquee-box"><span id="marquee-text" v-html="salesInfo.agent_announcement"></span></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row zhouma" v-if="salesInfo.sales_announcement">
|
||
<div class="col-xs-12">
|
||
<div style="overflow: hidden;" id="zhouma-wrap">
|
||
<div style="width:8000%">
|
||
<div id="zhouma-box"><span id="zhouma-text" v-html="salesInfo.sales_announcement"></span></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
</section>
|
||
`,*/
|
||
template: '<section><header class="header header-pos-fix"><div onclick="history.back(-1)"><img src="img/fahui.png" class="img"><span class="text_wen">返回</span></div><a :href="indexUrl" class="home-sy"><span><span></span>首页</a></header><div style="width:100%;height:45px;display:block"></div><section class="container" style="background-color:#fff; border-radius: 6px; margin: 10px; padding: 8px;"><div class="row"><div class="col-xs-3" style="padding-top: 20px;"><a :href="personCenter"><img :src="wxInfo.headimgurl" class="header_img" alt="avatar" style="border-radius: 50%;width: 50px;height: 50px;"></a><p style="font-size: 12px">{{loginType}}</p></div><div class="col-xs-5 pl0 pr0"><div>昵 称:{{wxInfo.nickname}}</div><div>游戏ID:<span>{{salesInfo.player_id}}</span></div><div>推广账号:<span>{{salesInfo.salesid}}</span></div><div>可赠卡数:<span>{{assets.roomcard}}</span></div><div v-if="salesInfo.salestype == 11 || agentInfo.is_show_recharge_star == 1">{{lang.starName}}数:<span>{{parseFloat(assets.bean)}}</span></div><div v-if="true">钻石数:<span>{{assets.diamond}}</span></div></div><div class="col-xs-4 pl0"><div class="text-right"><div v-if="assets.is_vip == \'1\'"><div><button type="button" class="btn btn-primary btn-sm" @click="goShortRoom">配置 VIP</button></div><div class="pt3"><button type="button" class="btn btn-info btn-sm" @click="goWhiteList">管理好友</button></div></div><div v-else><button type="button" class="btn btn-warning btn-sm" @click="goProductCenter">成为 VIP</button></div><div class="pt3"><a type="button" class="btn btn-warning btn-sm" :href="personCenter">安全密码</a></div><div class="pt3"><button type="button" class="btn btn-warning btn-sm" @click="goSettle">我的佣金</button></div></div></div></div><div class="row marquee" v-if="salesInfo.agent_announcement"><div class="col-xs-12"><div style="overflow: hidden;" id="marquee-wrap"><div style="width:8000%"><div id="marquee-box"><span id="marquee-text" v-html="salesInfo.agent_announcement"></span></div></div></div></div></div><div class="row zhouma" v-if="salesInfo.sales_announcement"><div class="col-xs-12"><div style="overflow: hidden;" id="zhouma-wrap"><div style="width:8000%"><div id="zhouma-box"><span id="zhouma-text" v-html="salesInfo.sales_announcement"></span></div></div></div></div></div></section></section>',
|
||
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);
|
||
})
|
||
})
|
||
|
||
})
|
||
|
||
}
|
||
} |