diff --git a/Application/Admin/Controller/GiftbagController.class.php b/Application/Admin/Controller/GiftbagController.class.php
index 5d2abb4d6..1d0625061 100644
--- a/Application/Admin/Controller/GiftbagController.class.php
+++ b/Application/Admin/Controller/GiftbagController.class.php
@@ -102,9 +102,6 @@ class GiftbagController extends ThinkController {
public function add(){
if(IS_POST){
-
-
-
if ($_POST['giftbag_version'] == '3') {
$whereGift['giftbag_version'] = $_POST['giftbag_version'];
$whereGift['game_id'] = $_POST['game_id'];
diff --git a/Application/Admin/View/Giftbag/add.html b/Application/Admin/View/Giftbag/add.html
index ba05b766f..9f961abac 100644
--- a/Application/Admin/View/Giftbag/add.html
+++ b/Application/Admin/View/Giftbag/add.html
@@ -90,6 +90,9 @@
+
diff --git a/Application/Admin/View/Giftbag/edit.html b/Application/Admin/View/Giftbag/edit.html
index 27c924717..874fb27f5 100644
--- a/Application/Admin/View/Giftbag/edit.html
+++ b/Application/Admin/View/Giftbag/edit.html
@@ -86,9 +86,12 @@
-
+
+
diff --git a/Application/Admin/View/Giftbag/lists.html b/Application/Admin/View/Giftbag/lists.html
index 5f0476e1d..eae2a6e6d 100644
--- a/Application/Admin/View/Giftbag/lists.html
+++ b/Application/Admin/View/Giftbag/lists.html
@@ -144,7 +144,10 @@
|
{$data.game_name} |
{$data.giftbag_name} |
- {:get_systems_name($data['giftbag_version'])}超级签全部 |
+
+ {:get_systems_name($data['giftbag_version'])}
+ 超级签TF落地页礼包全部
+ |
{$data['novice_num']} |
{$data['novice']} |
diff --git a/Application/Home/View/default/Home/landingPage.html b/Application/Home/View/default/Home/landingPage.html
index e6c516b9f..cfefe1dd7 100644
--- a/Application/Home/View/default/Home/landingPage.html
+++ b/Application/Home/View/default/Home/landingPage.html
@@ -16,6 +16,7 @@
+
{$game['relation_game_name']}
@@ -104,7 +105,10 @@
{$game['features']}
@@ -341,6 +345,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂无礼包
+
+
+
+
+
+
+
+ {$game['relation_game_name']}
+ 礼包总数 0
+
+
+
+
+
+
+
+
@@ -568,7 +641,6 @@ background:rgba(0,0,0,0.6); z-index: 999;display: none;">
var curUserId = 0;
var gameId = parseInt("{$game.id}");
var promoteId = parseInt("{$promoteId}");
-console.log(promoteId)
var betaUrl = "{$game['beta_url']}";
curUserId = Cookies.get('landing_login_user') == undefined ? 0 : Cookies.get('landing_login_user');
var isLogin = (curUserId == 0 ? false : true);
@@ -712,6 +784,8 @@ var PhoneObj = {
$(".second").hide();
$(".register").hide();
$(".mode").hide();
+ $(".giftSecond").hide()
+ $(".giftStep").hide()
})
$(".commonCut").click(function(){
$(".commonWindow").hide();
@@ -1367,7 +1441,186 @@ var PhoneObj = {
});
});
}
+
+//
+
+
+ $(".giftSecond .getGift-heard>a").click(function(){
+ $(".giftSecond").hide()
+ $(".giftStep").show()
+ });
+
+ $(".giftStep .getGift-heard>a").click(function(){
+ $(".giftSecond").hide()
+ $(".giftStep").hide()
+ $('.mode').hide()
+ document.body.style.overflow = 'auto';
+ });
+
+ $(".getGift-info").on('click', '.show-giftbag', function() {
+ /* $(this).html('已领取');
+ $(this).css({
+ "background":"rgba(242,242,244,1)",
+ "color":"rgba(169,169,169,1)",
+ "border": "0"
+ }); */
+ var giftId = $(this).parents('.getGift-infoBox').eq(0).attr('data-id')
+ for (var key in giftbags) {
+ if (giftbags[key].id == giftId) {
+ if (giftbags[key].get_status == 1) {
+ $('.giftSecond .getGift-box').find('.get-novice').html('已领取')
+ $('.giftSecond .getGift-box').find('.get-novice').addClass('has-get')
+ } else {
+ $('.giftSecond .getGift-box').find('.get-novice').html('领取')
+ $('.giftSecond .getGift-box').find('.get-novice').removeClass('has-get')
+ }
+ $('.giftSecond .getGift-box').find('.get-novice').attr('data-gift-id', giftbags[key].id)
+ $('.giftSecond .getGift-box').find('.giftbag-name').html(giftbags[key].giftbag_name)
+ $('.giftSecond .getGift-box').find('.novice-count').html(giftbags[key].novice_num)
+ // $('.giftSecond .getGift-box').find('.novice-value').html()
+ $('.giftSecond .getGift-box').find('.useful-date').html(giftbags[key].useful_date)
+ $('.giftSecond .getGift-box').find('.desribe').html(giftbags[key].desribe)
+ $('.giftSecond .getGift-box').find('.digest').html(giftbags[key].digest)
+ break;
+ }
+ }
+ $(".giftStep").hide();
+ $(".giftSecond").show();
+ })
+
+ /* $(".getGift-infoBox .btn").click(function(){
+ $(this).html('已领取');
+ $(this).css({
+ "background":"rgba(242,242,244,1)",
+ "color":"rgba(169,169,169,1)",
+ "border": "0"
+ });
+ $(".giftStep").hide();
+ $(".giftSecond").show();
+ }); */
+
+ $(".getGift-second .btn").click(function() {
+ if ($(this).hasClass('has-get')) {
+ return layer.msg('您已经领取过该礼包');
+ }
+ if (!isLogin) {
+ layer.msg('请先登录');
+ goLogin()
+ return
+ }
+ var giftId = $(this).attr('data-gift-id')
+ var novice = getNovice(giftId)
+ if (novice !== '') {
+ $('.giftSecond .getGift-box').find('.novice-value').html(novice)
+ $(this).addClass('.has-get')
+ $(".getGift-activation").show();
+ $(".getGift-second").css({"height" : "1.26rem"});
+ $(".getGift-secondInfo").css({"height" : "1.93rem"})
+ }
+ });
+ // 复制
+ $(".copy").click(function(){
+ var qrcodeLink = $(".code>span").html()
+ var clipboard = new Clipboard('.copy', {
+ text: function() {
+ return qrcodeLink;
+ }
+ });
+ clipboard.on('success', function(e) {
+ $(".copy").html('已复制')
+ });
+
+ clipboard.on('error', function(e) {
+ $(".copy").html('未复制')
+ });
+ })
+
+ function getGiftbags(gameId) {
+ $.ajax({
+ url: '/mobile.php?s=/Gift/getTFGiftbags.html',
+ data: { game_id: gameId },
+ dataType: 'json',
+ type: 'post',
+ success: function(response) {
+ if (response.status) {
+ giftbags = response.data.records
+ if (giftbags.length == 0) {
+ $('.giftStep .getGiftNot').show()
+ $('.giftStep .getGift-box').hide()
+ return
+ }
+ $('.giftbag-count').html(giftbags.length)
+ var html = ''
+ for (var key in giftbags) {
+ var item = giftbags[key];
+ var btnHtml = ' 去领取 '
+ if (item.get_status == 1) {
+ btnHtml = ' 已领取 '
+ }
+ html += ' '
+ + ' '
+ + ' ' + item.giftbag_name + ' '
+ + ' ' + item.desribe + ' '
+ + ' '
+ + btnHtml
+ + ' ';
+ }
+ $('.getGift-info').html(html)
+ $('.giftStep .getGiftNot').hide()
+ $('.giftStep .getGift-box').show()
+ } else {
+ layer.msg(response.message);
+ }
+ }
+ })
+ }
+ function goLogin() {
+ $(".commonWindow").hide();
+ $(".giftStep").hide();
+ $(".giftSecond").hide();
+ $(".login").show();
+ }
+
+ function getNovice(giftId) {
+ var novice = ''
+ $.ajax({
+ url: '/mobile.php?s=/Gift/getNovice.html',
+ data: { gift_id: giftId},
+ dataType: 'json',
+ async: false,
+ type: 'post',
+ success: function(response) {
+ if (response.status) {
+ layer.msg(response.message);
+ novice = response.data.novice
+ } else {
+ if (response.code == '1001') {
+ goLogin()
+ }
+ layer.msg(response.message);
+ }
+ }
+ })
+ return novice
+ }
+ })
+
diff --git a/Application/Mobile/Controller/CommonController.class.php b/Application/Mobile/Controller/CommonController.class.php
index 4b529b08e..2300f5eb7 100644
--- a/Application/Mobile/Controller/CommonController.class.php
+++ b/Application/Mobile/Controller/CommonController.class.php
@@ -2,6 +2,7 @@
namespace Mobile\Controller;
use Org\Ipa365SDK\Ipa365;
use User\Api\MemberApi;
+use User\Api\SuserApi;
use Think\Log;
use Base\Service\ApplyService;
use Base\Tool\TaskClient;
@@ -60,8 +61,8 @@ class CommonController extends BaseController {
$promote = M('promote', 'tab_')->where(['id' => $promoteId])->find();
- $userApi = new MemberApi();
- $userId = $userApi->login($account, $password, 1); //调用登录
+ $suserApi = new SuserApi();
+ $userId = $suserApi->login($account, $password, 1); //调用登录
$resMsg = "登录成功";
if ($userId <= 0) {
switch ($userId) {
@@ -136,8 +137,8 @@ class CommonController extends BaseController {
}
//添加自动登录
- $userApi = new MemberApi();
- $userId = $userApi->login($params['account'], $params['password'], 1);
+ $suserApi = new SuserApi();
+ $userId = $suserApi->login($params['account'], $params['password'], 1);
$_SESSION['user_id'] = $userId;
$this->setData(['user_id' => $userId])->respondSuccess('添加成功');
}
@@ -182,8 +183,8 @@ class CommonController extends BaseController {
}
//添加自动登录
- $userApi = new MemberApi();
- $userId = $userApi->login($account, $password, 1);
+ $suserApi = new SuserApi();
+ $userId = $suserApi->login($account, $password, 1);
$_SESSION['user_id'] = $userId;
$this->setData(['user_id' => $userId])->respondSuccess('注册成功');
}
diff --git a/Application/Mobile/Controller/GiftController.class.php b/Application/Mobile/Controller/GiftController.class.php
index f767cd0ae..3c4109346 100644
--- a/Application/Mobile/Controller/GiftController.class.php
+++ b/Application/Mobile/Controller/GiftController.class.php
@@ -258,4 +258,76 @@ class GiftController extends BaseController {
$this->success("领取成功",$novice);
}
+ public function getTFGiftbags() {
+ $game_id = I('post.game_id');
+ $status = 0;
+ $row = C('LIST_ROWS');
+ $map['status'] = 1;
+ $time = NOW_TIME;
+ $map['game_id'] = $game_id;
+ $map['giftbag_version'] = 4;
+ $map['novice'] = array('neq','');
+ //$map['start_time'] = ['elt',$time];
+ $map['_string'] = "end_time > {$time} or end_time = 0";
+ $lists = D('Giftbag')
+ ->field("tab_giftbag.*,g.icon,g.relation_game_name")
+ ->join("left join tab_game g on g.id = tab_giftbag.game_id and g.game_status=1 and g.display_site like '%". DISPLAY_SITE ."%' ")
+ ->where($map)
+ ->select();
+
+ $existRecords = [];
+ if (count($lists) > 0 && $this->islogin()) {
+ $member = new SuserApi;
+ $logininfo = $member->login_info();
+ $conditions = [];
+ $conditions['user_id'] = $logininfo['user_id'];
+ $conditions['gift_id'] = ['in', array_column($lists, 'id')];
+ $existRecords = M("gift_record",'tab_')->field(['id', 'gift_id'])->where($conditions)->select();
+ $existRecords = index_by_column('gift_id', $existRecords);
+
+ }
+ $records = [];
+ foreach ($lists as $key => $val){
+ $novices = str2arr($val['novice'],',');
+ $noviceNum = count(array_filter($novices));
+ if (isset($existRecords[$val['id']])) {
+ $getStatus = 1;
+ } else {
+ $getStatus = 0;
+ }
+ $records[$key]['id'] = $val['id'];
+ $records[$key]['desribe'] = $val['desribe'];
+ $records[$key]['giftbag_name'] = $val['giftbag_name'];
+ $records[$key]['digest'] = $val['digest'];
+ $records[$key]['get_status'] = $getStatus;
+ $records[$key]['novice_num'] = $noviceNum;
+ $records[$key]['game_icon'] = get_cover($val['icon'],'path');
+ $records[$key]['game_name'] = $val['giftbag_name'];
+ $records[$key]['useful_date'] = set_show_time($val['start_time'],'date') . ' 至 '. set_show_time($val['end_time'],'date','forever');
+ }
+
+ echo json_encode(['status' => true, 'message' => '获取成功', 'data' => ['records' => $records]]);
+ }
+
+ public function getNovice($gift_id){
+ if(!$this->islogin()) {
+ echo json_encode(['status' => false, 'code' => '1001', 'message' => '请先登录']); exit();
+ }
+
+ $giftId = I('post.gift_id');
+ $member = new SuserApi;
+ $logininfo = $member->login_info();
+
+ $model = D("Giftbag");
+ $exist = $model->checkAccountGiftExist($logininfo['user_id'], $giftId);
+ if($exist){
+ echo json_encode(['status' => false, 'code' => '1000', 'message' => '您已经领取过该礼包!']); exit();
+ }
+ $novice = $model->getNovice($logininfo['user_id'], $logininfo['account'], $giftId);
+
+ if(empty($novice)){
+ echo json_encode(['status' => false, 'code' => '1000', 'message' => '暂无激活码']); exit();
+ }
+ echo json_encode(['status' => true, 'code' => '0000', 'message' => '领取成功', 'data' => ['novice' => $novice]]); exit();
+ }
}
diff --git a/Application/Mobile/Model/GiftbagModel.class.php b/Application/Mobile/Model/GiftbagModel.class.php
index c4b456590..4759cc4cb 100644
--- a/Application/Mobile/Model/GiftbagModel.class.php
+++ b/Application/Mobile/Model/GiftbagModel.class.php
@@ -237,6 +237,10 @@ class GiftbagModel extends Model{
$record['game_name'] = $data['game_name'];//get_game_name($data['game_id']);
$record['gift_id'] = $gift_id;
$record['gift_name'] = $data['giftbag_name'];
+
+ $record['server_id'] = $data['server_id'];
+ $record['server_name'] = $data['server_name'];
+
$record['status'] = 0;
$record['novice'] = $novice;
$record['user_id'] = $user_id;
diff --git a/Public/Home/css/giftbag.css b/Public/Home/css/giftbag.css
new file mode 100644
index 000000000..4aeb6ea5b
--- /dev/null
+++ b/Public/Home/css/giftbag.css
@@ -0,0 +1,283 @@
+body{
+ overflow: hidden;
+}
+.mode{
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0,0,0,0.4);
+ top: 0;
+ left: 0;
+ font-size: 0.2rem;
+}
+.giftBag_mode{
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0,0,0,0.4);
+ top: 0;
+ left: 0;
+ font-size: 0.2rem;
+}
+.giftBag_mode>div{
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ justify-content: flex-end;
+ padding-top: 6.47rem;
+ margin-right: 0.97rem;
+ font-size: 0.2rem;
+}
+.giftBag_mode>div>.img1{
+ width: 0.82rem;
+ height: 0.82rem;
+}
+.giftBag_mode>div>.img2{
+ width: 2.97rem;
+ height: 0.52rem;
+}
+.getGift{
+ position: fixed;
+ width: 5.5rem;
+ height: 4rem;
+ top: 50%;
+ margin-top: -2rem;
+ left: 50%;
+ margin-left: -2.75rem;
+ background-color: #fff;
+ border-radius: 0.3rem;
+ z-index: 1000;
+}
+.getGift-heard{
+ height: 0.8rem;
+ width: 100%;
+ text-align: center;
+ line-height: 0.8rem;
+ background-color: #489EF6;
+ font-size: 0.28rem;
+ color: #fff;
+ font-weight: 500;
+ border-top-left-radius: 0.3rem;
+ border-top-right-radius: 0.3rem;
+ position: relative;
+ border-top-left-radius:0.3rem;
+ border-top-right-radius:0.3rem;
+}
+.getGift-heard>a{
+ position: absolute;
+ left: 0.4rem;
+ top: 50%;
+ margin-top: -0.15rem;
+ width: 0.17rem;
+ height: 0.3rem;
+ background: url("../images/20191225/fanhui.png");
+ background-size: 100% 100%;
+}
+.getGift-box{
+ padding: 0 0.3rem;
+ border-bottom-right-radius: 0.3rem;
+ border-bottom-left-radius: 0.3rem;
+}
+.getGift-game{
+ width: 100%;
+ display: flex;
+ align-items: center;
+ height: 1.03rem;
+ border-bottom: 1px solid #E4E4E4;
+}
+.getGift-game>img{
+ width: 0.6rem;
+ height: 0.6rem;
+ margin-right: 0.2rem;
+}
+.getGift-game>div{
+ display: flex;
+ align-items: flex-start;
+ justify-content: center;
+ flex-direction: column;
+}
+.getGift-game>div .title{
+ font-size:0.24rem;
+ font-family:PingFang SC;
+ font-weight:500;
+ color:rgba(41,41,41,1);
+}
+.getGift-game>div .number{
+ font-size:0.16rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(169,169,169,1);
+}
+.getGift-info{
+ height: 2.16rem;
+ overflow-y: auto;
+}
+.getGift-infoBox{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 0.9rem;
+ border-bottom: 1px solid #E4E4E4;
+}
+.getGift-infoBox:last-child{
+ border: 0;
+}
+.getGift-infoBox .info-left{
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+}
+.getGift-infoBox .info-left .title{
+ font-size:0.2rem;
+ font-family:PingFang SC;
+ font-weight:500;
+ color:rgba(41,41,41,1);
+}
+.getGift-infoBox .info-left .del{
+ width: 2.91rem;
+ font-size:0.16rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(169,169,169,1);
+ overflow:hidden;
+ text-overflow:ellipsis;
+ white-space:nowrap;
+}
+.getGift-infoBox .btn,.getGift-second .btn{
+ width:1rem;
+ height:0.4rem;
+ background:rgba(169,169,169,0);
+ border:1px solid rgba(33, 177, 235, 1);
+ border-radius:0.16rem;
+ font-size:0.2rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(33,177,235,1);
+ text-align: center;
+ line-height: 0.4rem;
+}
+.getGift-second{
+ height: 0.86rem;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ border-bottom: 1px solid #E4E4E4;
+}
+.getGift-bag{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.getGift-second .second-left{
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+}
+.getGift-second .second-left .title{
+ font-size:0.24rem;
+ font-family:PingFang SC;
+ font-weight:500;
+ color:rgba(41,41,41,1);
+}
+.getGift-second .second-left .number{
+ font-size:0.16rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(169,169,169,1);
+}
+.getGift-second .second-left .number>span{
+ color: #262626;
+}
+.getGift-activation{
+ display: flex;
+ align-items: center;
+ margin-top: 0.12rem;
+}
+.getGift-activation .code{
+ width:3.9rem;
+ height:0.3rem;
+ background:rgba(242,242,244,1);
+ border-radius:0.1rem;
+ font-size:0.16rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(169,169,169,1);
+ text-align: center;
+ line-height: 0.3rem;
+}
+.getGift-activation .copy{
+ width:1rem;
+ height:0.4rem;
+ background:rgba(33,177,235,1);
+ border-radius:0.1rem;
+ font-size:0.16rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(254,254,254,1);
+ text-align: center;
+ line-height: 0.4rem;
+ margin-left: 0.2rem;
+}
+.getGift-secondInfo{
+ height: 2.33rem;
+ overflow-y: auto;
+}
+.getGift-secondInfo .infoBox{
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ margin-top: 0.23rem;
+}
+.getGift-secondInfo .infoBox .title{
+ font-size:0.2rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(41,41,41,1);
+}
+.getGift-secondInfo .infoBox .del{
+ width: 100%;
+ font-size:0.16rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(169,169,169,1);
+ margin-top: 0.1rem;
+}
+.getGiftNot{
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ height: 3.2rem;
+}
+.getGiftNot-img{
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ font-size:0.2rem;
+ font-family:PingFang SC;
+ font-weight:500;
+ color:rgba(41,41,41,1);
+}
+.getGiftNot-img>img{
+ width: 2.06rem;
+ height: 1.58rem;
+}
+.getGiftNot>.btn{
+ width:1.2rem;
+ height:0.4rem;
+ background:rgba(34,129,245,1);
+ border-radius:0.2rem;
+ font-size:0.24rem;
+ font-family:PingFang SC;
+ font-weight:400;
+ color:rgba(255,255,255,1);
+ text-align: center;
+ line-height: 0.4rem;
+ margin-top: 0.32rem;
+}
+.getGift-box .btn.has-get {
+ background:rgba(242,242,244,1);
+ color:rgba(169,169,169,1);
+ border:0
+}
\ No newline at end of file
diff --git a/Public/Home/images/libao.png b/Public/Home/images/libao.png
new file mode 100644
index 000000000..687c7916b
Binary files /dev/null and b/Public/Home/images/libao.png differ
diff --git a/Public/Home/images/libao2.png b/Public/Home/images/libao2.png
new file mode 100644
index 000000000..8551b8309
Binary files /dev/null and b/Public/Home/images/libao2.png differ
diff --git a/Public/Home/images/lingqu.png b/Public/Home/images/lingqu.png
new file mode 100644
index 000000000..c2105fff4
Binary files /dev/null and b/Public/Home/images/lingqu.png differ
diff --git a/Public/Home/images/wu.png b/Public/Home/images/wu.png
new file mode 100644
index 000000000..ca980f3dc
Binary files /dev/null and b/Public/Home/images/wu.png differ
|