添加后台代理代码
This commit is contained in:
35
codes/agent/game/dlweb/api/web2/components/agent-list.js
Normal file
35
codes/agent/game/dlweb/api/web2/components/agent-list.js
Normal file
@@ -0,0 +1,35 @@
|
||||
var agentList = {
|
||||
/*template: `
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">城市列表</div>
|
||||
<ul class="list-unstyled list-group">
|
||||
|
||||
<li v-for="(v,i) in agentList">
|
||||
<a class="list-group-item text-center" :href="'./index.html?agentid='+v.agentid+'&channelid='+v.channelid+'&__HTML_VERSION__=3'">{{v.name}}</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
`,*/
|
||||
template: '<div class="panel panel-default"><div class="panel-heading">城市列表</div><ul class="list-unstyled list-group"><li v-for="(v,i) in agentList"><a class="list-group-item text-center" :href="\'./index.html?agentid=\'+v.agentid+\'&channelid=\'+v.channelid+\'&__HTML_VERSION__=3\'">{{v.name}}</a></li></ul></div>',
|
||||
data: function () {
|
||||
return {
|
||||
agentList: []
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
var p = $.getQueryObj();
|
||||
|
||||
$.api(
|
||||
"agent.agent.cityList",
|
||||
{agentid: p.agentid, channelid: p.channelid},
|
||||
function (res) {
|
||||
|
||||
if(res.list && res.list.length === 1)
|
||||
window.location.href = './index.html?agentid='+res.list[0].agentid+'&channelid='+res.list[0].channelid+'&__HTML_VERSION__=3';
|
||||
|
||||
this.agentList = res.list;
|
||||
}.bind(this)
|
||||
)
|
||||
}
|
||||
}
|
||||
47
codes/agent/game/dlweb/api/web2/components/agent-nav.js
Normal file
47
codes/agent/game/dlweb/api/web2/components/agent-nav.js
Normal file
@@ -0,0 +1,47 @@
|
||||
var agentNav = {
|
||||
template: '<footer class="agent-nav"><ul class="nav"><li v-if="lang.isShow"><a :href="downloadUrl" :class="{ active: pageName == \'index.html\'}"><i class="fa fa-gamepad"></i> 游戏下载</a></li><li v-if="html_buyroomcard"><a :href="playerBuyUrl" :class="{ active: pageName == \'player_buy.html\'}"><i class="fa fa-cc-paypal"></i> 玩家充值</a></li><li v-if="isWechat"><a :href="whiteListUrl" :class="{ active: pageName == \'white_list.html\'}"><i class="fa fa-address-book-o"></i>好友</a></li><li><a :href="manageLoginUrl" style="color:red;" :class="{ active: pageName == \'manage_login.html\'}"><i class="fa fa-star"></i>后台</a></li></ul></footer>',
|
||||
data: function () {
|
||||
return {
|
||||
agentid: '',
|
||||
channelid: '',
|
||||
pageName: 'index.html',
|
||||
isWechat: false,
|
||||
isMinProgram: false,
|
||||
agentInfo: {},
|
||||
lang: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
html_buyroomcard: function() {
|
||||
/*var isBuy = this.agentInfo.html_buyroomcard;
|
||||
isBuy = parseInt(isBuy);
|
||||
|
||||
if(isBuy === 2)
|
||||
return true;*/
|
||||
|
||||
return false;
|
||||
},
|
||||
downloadUrl: function () { return './index.html?agentid='+this.agentid+'&channelid='+this.channelid+'&__HTML_VERSION__=3';},
|
||||
playerBuyUrl: function () { return './player_buy.html?agentid='+this.agentid+'&channelid='+this.channelid+'&__HTML_VERSION__=3';},
|
||||
manageLoginUrl: function () { return './manage_login.html?agentid='+this.agentid+'&channelid='+this.channelid+'&__HTML_VERSION__=3';},
|
||||
whiteListUrl: function () { return './white_list.html?agentid='+this.agentid+'&channelid='+this.channelid+'&__HTML_VERSION__=3';},
|
||||
},
|
||||
created: function () {
|
||||
var params = $.getQueryObj();
|
||||
this.lang = lang[params.agentid] ? lang[params.agentid] : lang.default;
|
||||
this.agentid = params.agentid;
|
||||
this.channelid = params.channelid;
|
||||
this.isWechat = $.isWeiXin();
|
||||
this.pageName = $.getPageName();
|
||||
|
||||
var el=this;
|
||||
wx.miniProgram.getEnv(function(res) {
|
||||
el.isMinProgram= res.miniprogram;
|
||||
});
|
||||
|
||||
$.getAgentInfo(function (res) {
|
||||
this.agentInfo = res;
|
||||
}.bind(this))
|
||||
|
||||
}
|
||||
};
|
||||
10
codes/agent/game/dlweb/api/web2/components/beta-header.js
Normal file
10
codes/agent/game/dlweb/api/web2/components/beta-header.js
Normal file
@@ -0,0 +1,10 @@
|
||||
var betaHeader = {
|
||||
//template: '<div class="row header-beta"><a href="javascript:;" class="home-sy"><span>(beta版)</span></a></div>',
|
||||
template: '',
|
||||
data: function () {
|
||||
|
||||
},
|
||||
created: function () {
|
||||
|
||||
}
|
||||
}
|
||||
108
codes/agent/game/dlweb/api/web2/components/common_mixin.js
Normal file
108
codes/agent/game/dlweb/api/web2/components/common_mixin.js
Normal file
@@ -0,0 +1,108 @@
|
||||
/**
|
||||
* 组件公共部分
|
||||
*/
|
||||
var commonMixin = {
|
||||
data: function () {
|
||||
return {
|
||||
params: {},
|
||||
wxInfo: {},
|
||||
userInfo: {},
|
||||
tel: '',
|
||||
captcha: '',
|
||||
btnMsg: '发送验证码',
|
||||
verity: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 使用手机号代替微信的openid、unionid,自动生成用户信息
|
||||
* @param func
|
||||
*/
|
||||
phoneToWechat: function (func) {
|
||||
|
||||
var that = this;
|
||||
$.api
|
||||
(
|
||||
'agent.user.login',
|
||||
{
|
||||
agentid: that.params.agentid,
|
||||
channelid: that.params.channelid,
|
||||
openid: that.tel,
|
||||
unionid: that.tel,
|
||||
nickname: ( that.wxInfo.nickname ? that.wxInfo.nickname : '代理'+$.randomString(4, '0123456789')),
|
||||
avatar: (that.wxInfo.headimgurl ? that.wxInfo.headimgurl : 'https://dlwebv3.tscce.cn/images/noavatar.png'),
|
||||
sex: (that.wxInfo.sex ? that.wxInfo.sex : 0),
|
||||
province: (that.wxInfo.province ? that.wxInfo.province : ''),
|
||||
islog: 0
|
||||
},
|
||||
function (res) {
|
||||
that.userInfo = res;
|
||||
func && func(res);
|
||||
}, true
|
||||
);
|
||||
},
|
||||
/**
|
||||
* 绑定手机号
|
||||
*/
|
||||
bindPhone: function (func) {
|
||||
|
||||
var param = {
|
||||
agentid: this.params.agentid,
|
||||
channelid: this.params.channelid,
|
||||
salesid: this.userInfo.salesid,
|
||||
phone: this.tel,
|
||||
msgcode: this.captcha
|
||||
};
|
||||
|
||||
$.api(
|
||||
"sms.sms.bindPhone",
|
||||
param,
|
||||
function (res) {
|
||||
func && func();
|
||||
}.bind(this), true
|
||||
);
|
||||
},
|
||||
/**
|
||||
* 发送手机验证码
|
||||
*/
|
||||
getCheckCode: function (r) {
|
||||
var that = this;
|
||||
|
||||
$.api(
|
||||
"sms.sms.sendBindCode",
|
||||
{
|
||||
agentid: this.params.agentid,
|
||||
channelid: this.params.channelid,
|
||||
salesid: '',
|
||||
isbind: 0,
|
||||
phone: this.tel
|
||||
},
|
||||
function (res) {
|
||||
if(res.code)
|
||||
that.verity = res.code;
|
||||
|
||||
that.disabled = true;
|
||||
that.timeout(60);
|
||||
|
||||
}.bind(this), true
|
||||
);
|
||||
},
|
||||
/**
|
||||
* 发送验证码后的倒计时
|
||||
* @param time 倒计时的时间(单位:秒)
|
||||
*/
|
||||
timeout: function (time) {
|
||||
time--;
|
||||
if(time > 0) {
|
||||
this.btnMsg=time;
|
||||
var that = this;
|
||||
setTimeout(function () {
|
||||
that.timeout(time);
|
||||
}, 1000);
|
||||
} else {
|
||||
this.btnMsg='发送验证码';
|
||||
this.disabled = false;
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
107
codes/agent/game/dlweb/api/web2/components/download-game.js
Normal file
107
codes/agent/game/dlweb/api/web2/components/download-game.js
Normal file
@@ -0,0 +1,107 @@
|
||||
var downloadGame = {
|
||||
//template: '<div class="row"><ul class="list-unstyled pt8"><li class="box" v-for="(v,i) in info.list"><div class="item col-xs-3 pr0"><img class="game-logo center" :src="v.image" alt="logo"></div><div class="col-xs-6 grow2"><h4>{{ v.name }}</h4><p>{{ v.memo }}</p><p>游戏包大小:{{ isIOS ? v.ios_size : v.android_size }}</p></div><div class="item col-xs-3 pl0"><button class="btn btn-primary" @click="download(i, v.ios_marketid)">下载</button></div></li></ul><div class="panel-img" v-show="isShow" @click="isShow = false"><template v-if="isIOS"><img :src="pics[0]" v-show="!isIOSImgShow" class="full-screen"><img :src="pics[1]" v-show="isIOSImgShow" class="full-screen"></template><template v-else><img :src="pics[2]" class="full-screen"></template></div><div class="game-notice"><span>抵制不良游戏</span><span>拒绝盗版游戏</span><span>注意自我保护</span><span>谨防受骗上当</span><br><span>适度游戏益脑</span><span>沉迷游戏伤身</span><span>合理安排时间</span><span>享受健康生活</span><br></div></div>',
|
||||
/*template: `
|
||||
<div class="row">
|
||||
<ul class="list-unstyled pt8">
|
||||
<li class="box" v-for="(v,i) in info.list">
|
||||
<div class="item col-xs-3 pr0 pl0"><img class="game-logo center" :src="v.image" alt="logo"></div>
|
||||
<div class="col-xs-6 grow2 pr5 pl0"><h4>{{ v.name }}</h4>
|
||||
<p>{{ v.memo }}</p>
|
||||
<p>游戏包大小:{{ isIOS ? v.ios_size : v.android_size }}</p></div>
|
||||
<div class="col-xs-3 pl0 pr0">
|
||||
<button class="btn btn-primary" @click="download(i, v.ios_marketid, 0)" style="font-size: 12px;"> 下载 </button>
|
||||
<button class="btn btn-info" @click="download(i, v.ios_marketid, 1)"
|
||||
v-if="v.ios_down_2 && v.android_down_2" style="margin-top: 5px;font-size: 12px;">
|
||||
备用下载
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="panel-img" v-show="isShow" @click="isShow = false">
|
||||
<template v-if="isIOS">
|
||||
<img :src="helpPic[0]" v-show="!isIOSImgShow" class="full-screen">
|
||||
<img :src="helpPic[1]" v-show="isIOSImgShow" class="full-screen">
|
||||
</template>
|
||||
<template v-else><img :src="helpPic[2]" class="full-screen"></template>
|
||||
</div>
|
||||
|
||||
<div class="game-notice">
|
||||
<span>抵制不良游戏</span><span>拒绝盗版游戏</span><span>注意自我保护</span><span>谨防受骗上当</span><br>
|
||||
<span>适度游戏益脑</span><span>沉迷游戏伤身</span><span>合理安排时间</span><span>享受健康生活</span><br>
|
||||
</div>
|
||||
</div>
|
||||
`,*/
|
||||
template: '<div class="row"><ul class="list-unstyled pt8"><li class="box" v-for="(v,i) in info.list"><div class="item col-xs-3 pr0 pl0"><img class="game-logo center" :src="v.image" alt="logo"></div><div class="col-xs-6 grow2 pr5 pl0"><h4>{{ v.name }}</h4><p>{{ v.memo }}</p><p>游戏包大小:{{ isIOS ? v.ios_size : v.android_size }}</p></div><div class="col-xs-3 pl0 pr0"><button class="btn btn-primary" @click="download(i, v.ios_marketid, 0)" style="font-size: 12px;"> 下载 </button><button class="btn btn-info" @click="download(i, v.ios_marketid, 1)" v-if="v.ios_down_2 && v.android_down_2" style="margin-top: 5px;font-size: 12px;">备用下载</button></div></li></ul><div class="panel-img" v-show="isShow" @click="isShow = false"><template v-if="isIOS"><img :src="helpPic[0]" v-show="!isIOSImgShow" class="full-screen"><img :src="helpPic[1]" v-show="isIOSImgShow" class="full-screen"></template><template v-else><img :src="helpPic[2]" class="full-screen"></template></div><div class="game-notice"><span>抵制不良游戏</span><span>拒绝盗版游戏</span><span>注意自我保护</span><span>谨防受骗上当</span><br><span>适度游戏益脑</span><span>沉迷游戏伤身</span><span>合理安排时间</span><span>享受健康生活</span><br></div></div>',
|
||||
data: function () {
|
||||
return {
|
||||
isIOS: false,
|
||||
isWechat: false,
|
||||
isShow: false,
|
||||
isIOSImgShow: false,
|
||||
info: {},
|
||||
helpPic: [
|
||||
'./images/ios.png',
|
||||
'./images/ios2.png',
|
||||
'./images/and.png'
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 下载链接
|
||||
* @param i
|
||||
* @param marketid
|
||||
* @param type
|
||||
*/
|
||||
download: function (i, marketid, type) {
|
||||
console.log(i, marketid);
|
||||
// 是否是微信端
|
||||
if (this.isWechat) {
|
||||
// 是否显示帮助图片
|
||||
this.isShow = true;
|
||||
if (this.isIOS) {
|
||||
if (marketid === '2')
|
||||
this.isIOSImgShow = true;
|
||||
else
|
||||
this.isIOSImgShow = false;
|
||||
}
|
||||
} else {
|
||||
// 是否显示帮助图片
|
||||
this.isShow = false;
|
||||
// 下载地址
|
||||
var url = '';
|
||||
if(type === 0) {
|
||||
// 常用下载链接
|
||||
if (this.isIOS)
|
||||
url = this.info.list[i].ios_down;
|
||||
else
|
||||
url = this.info.list[i].android_down;
|
||||
} else {
|
||||
// 备用下载链接
|
||||
if (this.isIOS)
|
||||
url = this.info.list[i].ios_down_2;
|
||||
else
|
||||
url = this.info.list[i].android_down_2;
|
||||
}
|
||||
|
||||
window.location.href = url;
|
||||
}
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.isIOS = $.whichSystem();
|
||||
this.isWechat = $.isWeiXin();
|
||||
|
||||
var p = $.getQueryObj();
|
||||
|
||||
$.api(
|
||||
"Youle.Youle.gameList",
|
||||
{agentid: p.agentid, channelid: p.channelid},
|
||||
function (res) {
|
||||
this.info = res;
|
||||
}.bind(this), true
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
42
codes/agent/game/dlweb/api/web2/components/home-nav.js
Normal file
42
codes/agent/game/dlweb/api/web2/components/home-nav.js
Normal file
@@ -0,0 +1,42 @@
|
||||
var homeNav = {
|
||||
template: '<footer class="footer"><ul class="footer_ul"><li :class="{ blue: pageName == \'invite.html\'}" v-if="shareMode"><a :href="inviteUrl"><i class="glyphicon glyphicon-qrcode"></i><p>邀请码</p></a></li><li :class="{ blue: pageName == \'Charge_card.html\'}"><a :href="managePlayerUrl"><i class="glyphicon glyphicon-plus"></i><p>玩家赠卡</p></a></li><li :class="{ blue: pageName == \'charge_star.html\'}" v-if="agentInfo.is_show_recharge_star == 1"><a :href="managePlayerUrlStar"><i class="glyphicon glyphicon-th-list"></i><p>玩家赠{{lang.singStarName}}</p></a></li><li v-if="userInfo.salestype == 11" :class="{ blue: pageName == \'SalesTransCard.html\'}"><a :href="manageSalesUrl"><i class="glyphicon glyphicon-th-list"></i><p>账户赠卡</p></a></li><li :class="{ blue: pageName == \'your_purchase_new.html\'}" v-if="lang.isShow"><a :href="manageAskUrl"><i class="glyphicon glyphicon-usd"></i><p>充值中心</p></a></li><li :class="{ blue: pageName == \'guanlitj.html\'}"><a :href="manageStatisticsUrl"><i class="glyphicon glyphicon-cog"></i><p>信息管理</p></a></li></ul></footer>',
|
||||
data: function () {
|
||||
return {
|
||||
params: {},
|
||||
userInfo: {},
|
||||
agentInfo: {},
|
||||
lang: {},
|
||||
pageName: 'Charge_card.html',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
shareMode: function () {
|
||||
var isWeiXin = $.isWeiXin();
|
||||
var mode = parseInt(this.agentInfo.agentmode);
|
||||
if(isWeiXin && mode === 2)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
},
|
||||
inviteUrl: function () { return './invite.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid+'&__HTML_VERSION__=3';},
|
||||
managePlayerUrl: function () { return './Charge_card.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid+'&__HTML_VERSION__=3';},
|
||||
managePlayerUrlStar: function () { return './charge_star.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid+'&__HTML_VERSION__=3';},
|
||||
manageSalesUrl: function () { return './SalesTransCard.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid+'&__HTML_VERSION__=3';},
|
||||
manageAskUrl: function () { return './your_purchase_new.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid+'&__HTML_VERSION__=3';},
|
||||
manageStatisticsUrl: function () { return './guanlitj.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid+'&__HTML_VERSION__=3';}
|
||||
},
|
||||
created: function () {
|
||||
this.params = $.getQueryObj();
|
||||
var params = this.params;
|
||||
this.lang = lang[params.agentid] ? lang[params.agentid] : lang.default;
|
||||
|
||||
this.pageName = $.getPageName();
|
||||
var that = this;
|
||||
$.getAgentInfo(function (agentInfo) {
|
||||
that.agentInfo = agentInfo;
|
||||
$.getUserInfo(function (userInfo) {
|
||||
that.userInfo = userInfo;
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
104
codes/agent/game/dlweb/api/web2/components/infinite-scroll.js
Normal file
104
codes/agent/game/dlweb/api/web2/components/infinite-scroll.js
Normal file
@@ -0,0 +1,104 @@
|
||||
var infiniteScroll = {
|
||||
/*template: `
|
||||
<section class="cha_time">
|
||||
<button class="btn btn-blue time_c" @click="loadMore(false)">查询</button>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr v-for="(item,i) in list">
|
||||
<td class="text-center">
|
||||
<img :src="item.avatar" class="header">
|
||||
</td>
|
||||
<td>
|
||||
<p>{{item.playerid}}</p>
|
||||
<p>{{item.name}}</p>
|
||||
<p>{{item.time.substr(5,11)}}</p>
|
||||
</td>
|
||||
<td class="num">{{item.amount}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot v-show="loadStateMsg"><tr class="text-center"><td colspan="3">{{loadStateMsg}}</td></tr></tfoot>
|
||||
</table>
|
||||
</section>
|
||||
`,*/
|
||||
template: '<section class="cha_time"><button class="btn btn-blue time_c" @click="loadMore(false)">查询</button><table class="table"><tbody><tr v-for="(item,i) in list"><td class="text-center"><img :src="item.avatar" class="header"></td><td><p>{{item.playerid}}</p><p>{{item.name}}</p><p>{{item.time.substr(5,11)}}</p></td><td class="num">{{item.amount}}</td></tr></tbody><tfoot v-show="loadStateMsg"><tr class="text-center"><td colspan="3">{{loadStateMsg}}</td></tr></tfoot></table></section>',
|
||||
data: function () {
|
||||
return {
|
||||
loadState: 1, // 0-禁止加载 1-可以加载,加载暂停 2-加载中 3-加载异常
|
||||
loadStateMsg: '',
|
||||
pageIndex: 0, // 页码
|
||||
wxInfo: {},
|
||||
list: []
|
||||
}
|
||||
},
|
||||
props: {
|
||||
func: String,
|
||||
startTime: String,
|
||||
endTime: String,
|
||||
params: Object,
|
||||
wxInfo: Object,
|
||||
userInfo: Object
|
||||
},
|
||||
created: function () {
|
||||
var that = this;
|
||||
var $doc = $(document);
|
||||
var $win = $(window);
|
||||
|
||||
window.addEventListener('scroll', function () {
|
||||
var docHeight = $doc.height();
|
||||
var winHeight = $win.height();
|
||||
var scrHeight = $doc.scrollTop();
|
||||
|
||||
//console.log(docHeight, winHeight, scrHeight);
|
||||
if (( docHeight > winHeight ) && scrHeight >= (docHeight - winHeight)) {
|
||||
that.loadMore(true);
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadMore: function (flag) {
|
||||
|
||||
if (!flag || this.loadState === 1) {
|
||||
this.loadState = 2;
|
||||
this.loadStateMsg = '加载中...';
|
||||
if (!flag)
|
||||
this.list = [];
|
||||
|
||||
setTimeout(function () {
|
||||
if (flag)
|
||||
this.pageIndex++;
|
||||
else
|
||||
this.pageIndex = 1;
|
||||
|
||||
this.loadState = 2;
|
||||
|
||||
var that = this;
|
||||
$.api(
|
||||
that.func,
|
||||
{
|
||||
agentid: that.params.agentid,
|
||||
channelid: that.params.channelid,
|
||||
openid: that.wxInfo.openid,
|
||||
begintime: that.startTime,
|
||||
endtime: that.endTime,
|
||||
page_index: that.pageIndex
|
||||
},
|
||||
function (res) {
|
||||
var listLength = res.detail.length;
|
||||
if (listLength > 0) {
|
||||
that.list = that.list.concat(res.detail);
|
||||
that.loadState = 1;
|
||||
}
|
||||
|
||||
if (listLength < parseInt(res.page_size)) {
|
||||
that.loadState = 3;
|
||||
that.loadStateMsg = '暂无记录';
|
||||
}
|
||||
}
|
||||
);
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
56
codes/agent/game/dlweb/api/web2/components/manage-nav.js
Normal file
56
codes/agent/game/dlweb/api/web2/components/manage-nav.js
Normal file
@@ -0,0 +1,56 @@
|
||||
var manageNav = {
|
||||
/*template: `
|
||||
<footer class="footer">
|
||||
<ul class="footer_ul">
|
||||
<li :class="{ blue: pageName == 'invite.html'}">
|
||||
<a :href="inviteUrl">
|
||||
<i class="glyphicon glyphicon-qrcode"></i>
|
||||
<p>邀请码</p>
|
||||
</a>
|
||||
</li>
|
||||
<li :class="{ blue: pageName == 'Charge_card.html'}">
|
||||
<a :href="managePlayerUrl">
|
||||
<i class="glyphicon glyphicon-plus"></i>
|
||||
<p :class="{ blue: pageName == 'Charge_card.html'}">玩家充卡</p>
|
||||
</a>
|
||||
</li>
|
||||
<li :class="{ blue: pageName == 'SalesTransCard.html'}">
|
||||
<a :href="manageSalesUrl">
|
||||
<i class="glyphicon glyphicon-th-list"></i>
|
||||
<p>代理转卡</p>
|
||||
</a>
|
||||
</li>
|
||||
<li :class="{ blue: pageName == 'Your_purchase_new.html'}">
|
||||
<a :href="manageAskUrl">
|
||||
<i class="glyphicon glyphicon-usd"></i>
|
||||
<p>自己购卡</p>
|
||||
</a>
|
||||
</li>
|
||||
<li :class="{ blue: pageName == 'guanlitj.html'}">
|
||||
<a :href="manageStatisticsUrl">
|
||||
<i class="glyphicon glyphicon-cog"></i>
|
||||
<p>管理统计</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</footer>
|
||||
`,*/
|
||||
template: '<footer class="footer"><ul class="footer_ul"><li :class="{ blue: pageName == \'invite.html\'}"><a :href="inviteUrl"><i class="glyphicon glyphicon-qrcode"></i><p>邀请码</p></a></li><li :class="{ blue: pageName == \'Charge_card.html\'}"><a :href="managePlayerUrl"><i class="glyphicon glyphicon-plus"></i><p :class="{ blue: pageName == \'Charge_card.html\'}">玩家充卡</p></a></li><li :class="{ blue: pageName == \'SalesTransCard.html\'}"><a :href="manageSalesUrl"><i class="glyphicon glyphicon-th-list"></i><p>代理转卡</p></a></li><li :class="{ blue: pageName == \'Your_purchase_new.html\'}"><a :href="manageAskUrl"><i class="glyphicon glyphicon-usd"></i><p>自己购卡</p></a></li><li :class="{ blue: pageName == \'guanlitj.html\'}"><a :href="manageStatisticsUrl"><i class="glyphicon glyphicon-cog"></i><p>管理统计</p></a></li></ul></footer>',
|
||||
data: function () {
|
||||
return {
|
||||
params: {},
|
||||
pageName: 'Charge_card.html',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
inviteUrl: function () { return './invite.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid+'&__HTML_VERSION__=3';},
|
||||
managePlayerUrl: function () { return './Charge_card.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid+'&__HTML_VERSION__=3';},
|
||||
manageSalesUrl: function () { return './SalesTransCard.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid+'&__HTML_VERSION__=3';},
|
||||
manageAskUrl: function () { return './Your_purchase_new.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid+'&__HTML_VERSION__=3';},
|
||||
manageStatisticsUrl: function () { return './guanlitj.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid+'&__HTML_VERSION__=3';}
|
||||
},
|
||||
created: function () {
|
||||
this.params = $.getQueryObj();
|
||||
this.pageName = $.getPageName();
|
||||
}
|
||||
}
|
||||
610
codes/agent/game/dlweb/api/web2/components/manage.js
Normal file
610
codes/agent/game/dlweb/api/web2/components/manage.js
Normal file
@@ -0,0 +1,610 @@
|
||||
/**
|
||||
* 非父子组件数据中转站
|
||||
*/
|
||||
var Bus = new Vue();
|
||||
|
||||
|
||||
/**
|
||||
* 缓存对象
|
||||
*/
|
||||
var Cache = {};
|
||||
|
||||
|
||||
/**
|
||||
* 组件公共部分
|
||||
*/
|
||||
var commonMixin = {
|
||||
data: function () {
|
||||
return {
|
||||
channelInfo: {}
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
var el = this;
|
||||
el.channelInfo = Cache.channelInfo;
|
||||
|
||||
Bus.$on('setChannelInfo', function (r) {
|
||||
console.log(r)
|
||||
el.channelInfo = r;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 代理信息
|
||||
*/
|
||||
var salesInfo = {
|
||||
mixins: [commonMixin],
|
||||
template: `
|
||||
<div class="container">
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">代理ID</label>
|
||||
<div class="col-xs-6 pr0">
|
||||
<input class="form-control" type="number" placeholder="请输入代理ID" v-model="salesid">
|
||||
</div>
|
||||
<div class="col-xs-3 text-right pl0">
|
||||
<button class="btn btn-primary" @click="querySalesInfo">查询</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">昵称</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.nickname" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">密码</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.password" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="parent" class="col-xs-3 control-label">父代理</label>
|
||||
<div class="col-xs-9">
|
||||
<input id="parent" class="form-control" type="text" v-model="result.parentid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">房卡数</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.roomcard">
|
||||
<p class="text-danger">此为直接设置,强烈建议只给自己增加,然后通过自己的账号给其他代理充值,方便统计</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">星星数</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.star">
|
||||
<p class="text-danger">此为直接设置,强烈建议只给自己增加,然后通过自己的账号给其他代理充值,方便统计</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">总代理</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="number" v-model="result.global_power">
|
||||
<p class="text-info">1-是总代理, 0-不是总代理</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row text-center">
|
||||
<button class="btn btn-primary w60" @click="save">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
data: function () {
|
||||
return {
|
||||
salesid: '20',
|
||||
result: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
querySalesInfo: function () {
|
||||
try {
|
||||
var el = this;
|
||||
if (!$.isRightId(el.salesid)) throw {code: 102, msg: '请输入正确的代理ID'};
|
||||
|
||||
$.api(
|
||||
{
|
||||
isLoading: true,
|
||||
data: {
|
||||
method: 'Admin.Admin.salesInfo',
|
||||
biz_content: {
|
||||
salesid: el.salesid,
|
||||
agentid: el.channelInfo.agentid,
|
||||
channelid: el.channelInfo.channelid
|
||||
}
|
||||
},
|
||||
success: function (r) {
|
||||
el.result = r;
|
||||
}
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
$.alert(e.msg);
|
||||
}
|
||||
},
|
||||
save: function () {
|
||||
var el = this;
|
||||
var tmp = $.extend({}, el.channelInfo, el.result);
|
||||
tmp.salesid = el.salesid;
|
||||
|
||||
$.confirm(function () {
|
||||
$.api(
|
||||
{
|
||||
isLoading: true,
|
||||
data: {
|
||||
method: 'Admin.Admin.changeSalesInfo',
|
||||
biz_content: tmp
|
||||
},
|
||||
success: function (r) {
|
||||
el.result = {};
|
||||
}
|
||||
}
|
||||
);
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var playerInfo = {
|
||||
mixins: [commonMixin],
|
||||
template: '<p>playerInfo|{{channelInfo.name}}</p>',
|
||||
|
||||
};
|
||||
|
||||
var createAgent = {
|
||||
template: `
|
||||
<div class="container">
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">代理商ID</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="agentid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">名称</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">默认权限</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="power">
|
||||
<p class="text-info">不明白这个,可以不管它</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row text-center">
|
||||
<button class="btn btn-primary w60" @click="save">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
data: function () {
|
||||
return {
|
||||
agentid: '',
|
||||
name: '',
|
||||
power: '11'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
save: function () {
|
||||
var el = this;
|
||||
$.api(
|
||||
{
|
||||
isLoading: true,
|
||||
data: {
|
||||
method: 'Admin.Admin.createAgent',
|
||||
biz_content: {
|
||||
agentid: el.agentid,
|
||||
name: el.name,
|
||||
power: el.power
|
||||
}
|
||||
},
|
||||
success: function (r) {
|
||||
$.alert('添加成功');
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 添加新渠道
|
||||
*/
|
||||
var createChannel = {
|
||||
template: `
|
||||
<div class="container">
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">代理商ID</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.agentid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">渠道ID</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.channelid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">关联<br>代理商ID</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.parentid">
|
||||
<p class="text-primary">没有可关联的,必须填自己的代理商ID</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">名称</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">logo</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.logo">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">QQ号</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.qq">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">微信号</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.wechat">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">成为代理</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.become_sales_mode">
|
||||
<p class="text-primary">2-免费 1-收费 0-收费</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">邀请码模式</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.invitation_model">
|
||||
<p class="text-primary">2-开启 1-禁止 0-禁止</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">玩家购卡</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.buy_card_mode">
|
||||
<p class="text-primary">2-可购买 1-不可购买 0-不可购买</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">是否开放</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.is_open">
|
||||
<p class="text-primary">1-开放 0-关闭</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row text-center">
|
||||
<p><button class="btn btn-default w60" @click="queryChannelInfo">查询本渠道信息</button></p>
|
||||
<p><button class="btn btn-primary w60" @click="changeChannelInfo">保存本渠道信息</button></p>
|
||||
<p><button class="btn btn-success w60" @click="createChannel">生成新渠道</button></p>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
mixins: [commonMixin],
|
||||
data: function () {
|
||||
return {
|
||||
result: {
|
||||
agentid: '',
|
||||
channelid: '',
|
||||
name: '',
|
||||
parentid: '',
|
||||
logo: '',
|
||||
qq: '',
|
||||
wechat: '',
|
||||
become_sales_mode: '2',
|
||||
invitation_model: '2',
|
||||
buy_card_mode: '2',
|
||||
is_open: '1',
|
||||
id:''
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
queryChannelInfo: function () {
|
||||
var el = this;
|
||||
$.api(
|
||||
{
|
||||
isLoading: true,
|
||||
data: {
|
||||
method: 'Admin.Admin.queryChannelInfo',
|
||||
biz_content: el.channelInfo,
|
||||
},
|
||||
success: function (r) {
|
||||
el.result = r;
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
changeChannelInfo: function () {
|
||||
var el = this;
|
||||
$.api(
|
||||
{
|
||||
isLoading: true,
|
||||
data: {
|
||||
method: 'Admin.Admin.changeChannelInfo',
|
||||
biz_content: el.result,
|
||||
},
|
||||
success: function (r) {
|
||||
$.alert('保存成功');
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
createChannel: function () {
|
||||
var el = this;
|
||||
$.confirm(function () {
|
||||
$.api(
|
||||
{
|
||||
isLoading: true,
|
||||
data: {
|
||||
method: 'Admin.Admin.createChannel',
|
||||
biz_content: el.result,
|
||||
},
|
||||
success: function (r) {
|
||||
$.alert('添加成功');
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 添加游戏
|
||||
*/
|
||||
var createGame = {
|
||||
template: `
|
||||
<div class="container">
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">渠道ID</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.channelid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">游戏ID</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.gameid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">名称</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.gamename">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">logo</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.logo">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">描述</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.description">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">苹果<br>下载地址</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.ios_download_url">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">苹果<br>下载类型</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.ios_market_type">
|
||||
<p class="text-primary">0-普通 2-企业签</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">苹果<br>app大小</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.ios_app_size">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">安卓<br>下载地址</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.android_download_url">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">安卓<br>app大小</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.android_app_size">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">是否开放</label>
|
||||
<div class="col-xs-9">
|
||||
<input class="form-control" type="text" v-model="result.is_open">
|
||||
<p class="text-primary">0-关闭 1-开放</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row text-center">
|
||||
<p><button class="btn btn-success w60" @click="createGame">添加游戏</button></p>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
data: function () {
|
||||
return {
|
||||
result: {
|
||||
channelid: '',
|
||||
gameid: '',
|
||||
gamename: '',
|
||||
logo: '',
|
||||
description: '',
|
||||
ios_download_url: '',
|
||||
ios_market_type: '2',
|
||||
ios_app_size: '',
|
||||
android_download_url: '',
|
||||
android_app_size: '',
|
||||
is_open: '1'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
createGame: function () {
|
||||
var el = this;
|
||||
$.confirm(function () {
|
||||
$.api(
|
||||
{
|
||||
isLoading: true,
|
||||
data: {
|
||||
method: 'Admin.Admin.createGame',
|
||||
biz_content: el.result
|
||||
},
|
||||
success: function (r) {
|
||||
$.alert('添加成功');
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 选择渠道
|
||||
*/
|
||||
var channelList = {
|
||||
template: `
|
||||
<div class="container pt15">
|
||||
<select v-model="channelInfo" class="form-control">
|
||||
<option v-for="(v,i) in channelList" :value="v">{{v.name}}</option>
|
||||
</select>
|
||||
<hr>
|
||||
</div>
|
||||
`,
|
||||
data: function () {
|
||||
return {
|
||||
channelInfo: {},
|
||||
channelList: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
channelInfo: function () {
|
||||
Bus.$emit('setChannelInfo', this.channelInfo);
|
||||
Cache.channelInfo = this.channelInfo;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getChannelList: function () {
|
||||
var el = this;
|
||||
$.api(
|
||||
{
|
||||
data: {
|
||||
method: 'Admin.Admin.channelList',
|
||||
biz_content: {a: 'a'}
|
||||
},
|
||||
success: function (r) {
|
||||
el.channelList = r;
|
||||
el.channelInfo = r[0];
|
||||
Cache.channelInfo = el.channelInfo;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.getChannelList();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单列表
|
||||
*/
|
||||
var menuList = {
|
||||
template: `
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-4"><router-link to="/salesInfo">代理信息</router-link></div>
|
||||
<div class="col-xs-4"><router-link to="/playerInfo">playerInfo</router-link></div>
|
||||
<div class="col-xs-4"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-4"><router-link to="/createAgent">添加代理商</router-link></div>
|
||||
<div class="col-xs-4"><router-link to="/createChannel">添加渠道</router-link></div>
|
||||
<div class="col-xs-4"><router-link to="/createGame">添加游戏</router-link></div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
||||
var routes = [
|
||||
{
|
||||
path: '/',
|
||||
components: {
|
||||
default: channelList,
|
||||
a: menuList
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/salesInfo',
|
||||
components: {
|
||||
default: channelList,
|
||||
a: salesInfo
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/playerInfo',
|
||||
components: {
|
||||
default: channelList,
|
||||
a: playerInfo
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/createAgent',
|
||||
components: {
|
||||
default: channelList,
|
||||
a: createAgent
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/createChannel',
|
||||
components: {
|
||||
default: channelList,
|
||||
a: createChannel
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/createGame',
|
||||
components: {
|
||||
default: channelList,
|
||||
a: createGame
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
var router = new VueRouter({routes: routes});
|
||||
|
||||
var app = new Vue({router: router}).$mount('#app');
|
||||
97
codes/agent/game/dlweb/api/web2/components/product-list.js
Normal file
97
codes/agent/game/dlweb/api/web2/components/product-list.js
Normal file
@@ -0,0 +1,97 @@
|
||||
var productList = {
|
||||
/*template: `
|
||||
<section class="products">
|
||||
<div class="clearfix">
|
||||
<div v-for="(v, i) in cardList" class="product-box" :class="[v.make_vip == 1 ? 'bg-warning' : '']">
|
||||
<label v-bind:class="[checkedProductId.productid == v.productid ? 'active' : '']">
|
||||
<h4 v-html="v.name"></h4>
|
||||
<h4 v-html="parseFloat(v.money)+'元'"></h4>
|
||||
<p v-html="v.memo"></p>
|
||||
<p v-html=" '将先充值'+ v.money*100 +'钻石<br>充值后自动转换' "></p>
|
||||
<input type="radio" :value="{productid: v.productid, index: 'card', money: v.money}" v-model="checkedProductId" class="hidden">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<hr style="margin-top: 0;margin-bottom: 15px;">
|
||||
<section class="clearfix">
|
||||
<div v-for="(v, i) in starList" class="product-box" :class="[v.make_vip == 1 ? 'bg-warning' : '']">
|
||||
<label v-bind:class="[checkedProductId.productid == v.productid ? 'active' : '']">
|
||||
<h4 v-html="v.name"></h4>
|
||||
<h4 v-html="parseFloat(v.money)+'元'"></h4>
|
||||
<p v-html="v.memo"></p>
|
||||
<p v-html=" '将先充值'+ v.money*100 +'钻石<br>充值后自动转换' "></p>
|
||||
<input type="radio" :value="{productid: v.productid, index: 'star', money: v.money}" v-model="checkedProductId" class="hidden">
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
<div v-show="diamondList[0]">
|
||||
<hr style="margin-top: 0;margin-bottom: 15px;">
|
||||
<section class="clearfix">
|
||||
<div v-for="(v, i) in diamondList" class="product-box" :class="[v.make_vip == 1 ? 'bg-warning' : '']">
|
||||
<label v-bind:class="[checkedProductId.productid == v.productid ? 'active' : '']">
|
||||
<h4 v-html="v.name"></h4>
|
||||
<h4 v-html="parseFloat(v.money)+'元'"></h4>
|
||||
<p v-html="v.memo"></p>
|
||||
<input type="radio" :value="{productid: v.productid, index: 'diamond', money: v.money}" v-model="checkedProductId" class="hidden">
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</section>`,*/
|
||||
template: '<section class="products"><div class="clearfix"><div v-for="(v, i) in cardList" class="product-box" :class="[v.make_vip == 1 ? \'bg-warning\' : \'\']"><label v-bind:class="[checkedProductId.productid == v.productid ? \'active\' : \'\']"><h4 v-html="v.name"></h4><h4 v-html="parseFloat(v.money)+\'元\'"></h4><p v-html="v.memo"></p><p v-html=" \'将先充值\'+ v.money*100 +\'钻石<br>充值后自动转换\' "></p><input type="radio" :value="{productid: v.productid, index: \'card\', money: v.money}" v-model="checkedProductId" class="hidden"></label></div></div><hr style="margin-top: 0;margin-bottom: 15px;"><section class="clearfix"><div v-for="(v, i) in starList" class="product-box" :class="[v.make_vip == 1 ? \'bg-warning\' : \'\']"><label v-bind:class="[checkedProductId.productid == v.productid ? \'active\' : \'\']"><h4 v-html="v.name"></h4><h4 v-html="parseFloat(v.money)+\'元\'"></h4><p v-html="v.memo"></p><p v-html=" \'将先充值\'+ v.money*100 +\'钻石<br>充值后自动转换\' "></p><input type="radio" :value="{productid: v.productid, index: \'star\', money: v.money}" v-model="checkedProductId" class="hidden"></label></div></section><div v-show="diamondList[0]"><hr style="margin-top: 0;margin-bottom: 15px;"><section class="clearfix"><div v-for="(v, i) in diamondList" class="product-box" :class="[v.make_vip == 1 ? \'bg-warning\' : \'\']"><label v-bind:class="[checkedProductId.productid == v.productid ? \'active\' : \'\']"><h4 v-html="v.name"></h4><h4 v-html="parseFloat(v.money)+\'元\'"></h4><p v-html="v.memo"></p><input type="radio" :value="{productid: v.productid, index: \'diamond\', money: v.money}" v-model="checkedProductId" class="hidden"></label></div></section></div></section>',
|
||||
data: function () {
|
||||
return {
|
||||
cardList: [],
|
||||
starList: [],
|
||||
diamondList: [],
|
||||
checkedProductId: {}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
type: {
|
||||
default: 0
|
||||
},
|
||||
ptype: {
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
checkedProductId: function() {
|
||||
//console.log('checkedProductId1', this.checkedProductId);
|
||||
this.$emit('update:change-product-id', this.checkedProductId);
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
var p = $.getQueryObj();
|
||||
|
||||
var that = this;
|
||||
$.getWxInfo(function (r) {
|
||||
|
||||
$.api(
|
||||
"Youle.Youle.productList",
|
||||
{agentid: p.agentid, type: 1, ptype: 0},
|
||||
function (card) {
|
||||
that.cardList = card.products;
|
||||
|
||||
$.api(
|
||||
"Youle.Youle.productList",
|
||||
{agentid: p.agentid, type: 0, ptype: 1},
|
||||
function (star) {
|
||||
that.starList = star.products;
|
||||
|
||||
$.api(
|
||||
"Youle.Youle.productList",
|
||||
{agentid: p.agentid, type: 1, ptype: 2},
|
||||
function (diamond) {
|
||||
that.diamondList = diamond.products;
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
55
codes/agent/game/dlweb/api/web2/components/sales-info-a.js
Normal file
55
codes/agent/game/dlweb/api/web2/components/sales-info-a.js
Normal file
@@ -0,0 +1,55 @@
|
||||
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></header><div style="width:100%;height:45px;display:block"></div><section class="buju"><div class="left"><a :href="personCenter" style="display:inline-flex"><img :src="wxInfo.headimgurl" class="header_img" alt="avatar"></a></div><div class="count"><p>昵 称:{{wxInfo.nickname}}</p><p>玩家ID:<span>{{salesInfo.player_id}}</span></p><p>账 号:<span>{{salesInfo.salesid}}</span></p><p>可赠送房卡数:<span>{{assets.roomcard}}</span></p><p v-if="false">{{lang.starName}}数:<span>{{assets.bean}}</span></p></div><div class="right"><a :href="indexUrl"><img :src="agentInfo.agentlogo" class="logo"></a></div><span class="dfs">{{loginType}}</span></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 'javascript:;'; },
|
||||
indexUrl: function () { return 'javascript:;'; }
|
||||
},
|
||||
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;
|
||||
$.api(
|
||||
'agent.user.getUserInfo',
|
||||
{
|
||||
idx: res.idx
|
||||
},
|
||||
function (assets) {
|
||||
that.assets = assets;
|
||||
}, 1
|
||||
);
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
var salesInfo = {
|
||||
/*template: `
|
||||
<ul class="sales-info">
|
||||
<li><img :src="wxInfo.headimgurl" alt="avatar" class="avatar"></li>
|
||||
<li>
|
||||
<div class="pd8">
|
||||
<p>昵 称:{{wxInfo.nickname}}</p>
|
||||
<p>代理ID:{{userInfo.salesid}}</p>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<img :src="agentInfo.agentlogo" alt="logo" class="logo">
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
`,*/
|
||||
template: '<ul class="sales-info"><li><img :src="wxInfo.headimgurl" alt="avatar" class="avatar"></li><li><div class="pd8"><p>昵 称:{{wxInfo.nickname}}</p><p>代理ID:{{userInfo.salesid}}</p></div></li><li><div><img :src="agentInfo.agentlogo" alt="logo" class="logo"></div></li></ul>',
|
||||
data: function () {
|
||||
return {
|
||||
salesInfo: {},
|
||||
wxInfo: {},
|
||||
agentInfo: {}
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
var that = this;
|
||||
$.getAgentInfo(function (agentInfo) {
|
||||
that.agentInfo = agentInfo;
|
||||
$.getWxInfo(function (wxInfo) {
|
||||
that.wxInfo = wxInfo;
|
||||
$.getUserInfo(function (res) {
|
||||
that.salesInfo = res;
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
183
codes/agent/game/dlweb/api/web2/components/sales-info.js
Normal file
183
codes/agent/game/dlweb/api/web2/components/sales-info.js
Normal file
@@ -0,0 +1,183 @@
|
||||
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);
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
10
codes/agent/game/dlweb/api/web2/components/template.js
Normal file
10
codes/agent/game/dlweb/api/web2/components/template.js
Normal file
@@ -0,0 +1,10 @@
|
||||
var templ = {
|
||||
template: `
|
||||
|
||||
`,
|
||||
data: function () {
|
||||
return {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
12
codes/agent/game/dlweb/api/web2/components/topbar.js
Normal file
12
codes/agent/game/dlweb/api/web2/components/topbar.js
Normal file
@@ -0,0 +1,12 @@
|
||||
var topbar = {
|
||||
template: '<header class="topbar"><div class="container"><div class="col-xs-3 topbar-back"><a href="javascript:history.back()"><span class="glyphicon glyphicon-menu-left"></span>返回</a></div><div class="col-xs-6 topbar-title text-center" v-html="title"></div><div class="col-xs-3 topbar-other text-right"></div></div></header>',
|
||||
props: ['title', 'href'],
|
||||
data: function () {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
|
||||
}
|
||||
}
|
||||
45
codes/agent/game/dlweb/api/web2/components/user-info.js
Normal file
45
codes/agent/game/dlweb/api/web2/components/user-info.js
Normal file
@@ -0,0 +1,45 @@
|
||||
var userInfo = {
|
||||
/*template: `
|
||||
<ul class="list-unstyled user-info">
|
||||
<li><img :src="userInfo.headimgurl" alt="" class="avatar"></li>
|
||||
<li><p class="nickname">{{userInfo.nickname}}</p></li>
|
||||
<li>
|
||||
<div>
|
||||
<p><img :src="agentInfo.agentlogo" alt="" class="logo"></p>
|
||||
<p><button class="btn btn-success" @click="goShortRoom">配置VIP</button></p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
`,*/
|
||||
template : '<ul class="list-unstyled user-info"><li><img :src="userInfo.headimgurl" alt="" class="avatar"></li><li><p class="nickname">{{userInfo.nickname}}</p></li><li><img :src="agentInfo.agentlogo" alt="" class="logo"></li></ul>',
|
||||
data: function () {
|
||||
return {
|
||||
userInfo: {},
|
||||
agentInfo: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goShortRoom: function () {
|
||||
var p = $.getQueryObj();
|
||||
var url = "short_room.html?agentid="+p.agentid+"&channelid="+p.channelid;
|
||||
|
||||
if(p.unionid)
|
||||
url = url + "&unionid=" + this.params.unionid;
|
||||
|
||||
if(p.unionid)
|
||||
url = url + "&playerid=" + this.params.playerid;
|
||||
|
||||
window.location.href = url;
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
var that = this;
|
||||
$.getAgentInfo(function (agentInfo) {
|
||||
that.agentInfo = agentInfo;
|
||||
$.getWxInfo(function (res) {
|
||||
that.userInfo = res;
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user