| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- <!DOCTYPE html>
- <html class="" lang="zh-cmn-Hans">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="renderer" content="webkit">
- <meta name="referrer" content="always">
- <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
- <meta name="HandheldFriendly" content="True">
- <meta name="MobileOptimized" content="320">
- <meta name="format-detection" content="telephone=no">
- <meta http-equiv="cleartype" content="on">
- <meta name="keywords" content="">
- <meta name="description" content="">
- <title>刮刮乐</title>
- <link rel="stylesheet" href="/css/gua/lucky-card.css?v=5">
- <link rel="stylesheet" href="/css/gua/base.css" media="screen">
- <link rel="stylesheet" href="/css/gua/common.css" media="screen">
- <link rel="stylesheet" href="/css/gua/global-sales-card-icon.css" media="screen">
- <link rel="stylesheet" href="/css/gua/cards.css?v=5" media="screen">
- <style>
- .copyright, .footer {
- text-align: center;
- line-height: 16px
- }
- a {
- text-decoration: none
- }
- .copyright {
- background-color: #f8f8f8;
- color: #999;
- font-size: 0
- }
- .copyright .ft-links {
- padding: 30px 15px 10px
- }
- .copyright .ft-links a {
- padding: 0 6px;
- color: #666;
- font-size: 12px
- }
- .copyright .ft-links a:not(:last-child) {
- border-right: 1px solid #e5e5e5
- }
- .copyright .ft-copyright {
- padding: 20px 0 24px;
- margin: 0 15px;
- font-size: 12px;
- background-size: 110px 30px
- }
- .ft-copyright a {
- padding-top: 45px;
- color: #bfbfc3
- }
- .ft-copyright .yz-logo {
- padding-left: 14px;
- position: relative
- }
- .ft-copyright .yz-logo::before {
- content: '';
- background-size: 10px 12px;
- width: 10px;
- height: 12px;
- position: absolute;
- bottom: 1px;
- left: 0
- }
- .footer {
- padding: 0;
- min-height: 1px;
- background-color: #f8f8f8;
- margin: 0 auto
- }
- .customer-tips {
- margin-top: 30px;
- }
- .customer-tips-a {
- margin-top: 13px;
- }
- .xhCenterModal {
- background-color: #8dc63f;
- border-color: #8dc63f;
- color: #ffffff;
- position: fixed;
- width: 20%;
- font-size: 12px;
- height: auto;
- padding: 15px;
- z-index: 9999;
- display: none;
- width: 180px;
- text-align: center;
- }
- </style>
- </head>
- <body>
- <div name="xhCenterModal" class="xhCenterModal"></div>
- <div class="page-content" style="min-height: 812px; min-height: 100vh;">
- <div class="cards">
- <div class="cards-scratch">
- <div id="scratch">
- <div id="card">
- <div class="not_hit">
- <span>没有中奖</span>
- </div>
- <div class="hit">
- <p class="bless">恭喜你获得</p><span id="winPrize" class="win_prize"></span>
- <?php if (isset($userInfo['mobile']) && !empty($userInfo['mobile'])) { ?>
- <p class="look">可到“我的奖品”查看</p>
- <?php } else { ?>
- <p class="look">到店填写手机号即可领取</p>
- <?php } ?>
- </div>
- </div>
- </div>
- <div class="guide"><p class="guide-tips">刮开试试手气</p>
- <?php if ($this->context->isLogin == false) { ?>
- <button onclick="goLogin()" class="guide-btn">一键登陆</button>
- <?php } else { ?>
- <button onclick="gua(this)" class="guide-btn">点我刮奖</button>
- <?php } ?>
- </div>
- </div>
- <p class="cards-count">
- <?php if ($this->context->isLogin == false) { ?>
- 请点击上面一键登陆
- <?php } else { ?>
- 你还有 <em class="cards-count__number"><?= $remainNum ?></em> 次刮奖机会
- <?php } ?>
- </p>
- <?php if ($card['showWin'] == 1) { if(!empty($winUser)){ ?>
- <div style="text-align:center;font-size:1rem;color:white;margin-top:1rem;">幸运用户</div>
- <style>
- .box {
- height: 10px;
- padding: 8px;
- overflow: hidden;
- margin: 9px 24px 0 24px;
- line-height: 32px;
- background: hsla(0, 0%, 100%, .16);
- font-size: 14px;
- color: #fff;
- }
- .box li {
- list-style: none;
- }
- .box ul li {
- line-height: 20px;
- }
- </style>
- <div class="box">
- <ul>
- <?php foreach($winUser as $winner){ ?>
- <li>
- <span style="width:2.5rem;display:inline-block;margin-left:4rem;"><?= "<img style='width:1rem;border-radius:.4rem;' src='".$winner['avatar']."' />"?></span>
- <span style="width:4rem;display:inline-block;"><?= $winner['userName'] ?></span>
- <span style="width:6rem;display:inline-block;"><?= $winner['prizeName'] ?></span>
- </li>
- <?php } ?>
- </ul>
- </div>
- <?php } } ?>
- <section class="apps-rules-wrap cards-rules"><h3 class="title">活动规则</h3>
- <div class="rules-list"><label class="label">· 活动时间:</label>
- <p class="rules"><?= date("Y-m-d", $card['startTime']) ?> 至 <?= date("Y-m-d", $card['endTime']) ?></p>
- </div>
- <div class="rules-list description"><label class="label">· 活动说明:</label>
- <p class="rules description-rules"><?php echo $card['introduce']; ?></p></div>
- <div class="rules-list"><label class="label">· 发行方:</label>
- <p class="rules"><?php echo $this->context->merchantName; ?></p></div>
- </section>
- <div class="apps-footer-btns">
- <button class="btn home-btn" onclick="window.location.href='/mobile/index?account=<?= $this->context->merchantId ?>'">
- 进店逛逛
- </button>
- <button class="btn prize-btn" <?php if ($this->context->isLogin){ ?>onclick="window.location.href='./my-prize?account=<?= $this->context->merchantId ?>&id=<?= $card['id'] ?>'" <?php } ?>>
- 我的奖品
- </button>
- </div>
- </div>
- </div>
- <div class="footer">
- <div class="copyright">
- <div class="ft-copyright" style="">
- <a class="" href=""> 花卉宝 </a><br/><a href="javascript:void(0);"> 提供技术支持 </a>
- </div>
- </div>
- </div>
- <script src="/js/jquery-1.11.1.min.js"></script>
- <script src="/js/util.js"></script>
- <script src="/js/gua/lucky-card.min.js"></script>
- <script>
- (function ($) {
- $.fn.scrollTop = function (options) {
- var defaults = {
- speed: 30
- }
- var opts = $.extend(defaults, options);
- this.each(function () {
- var $timer;
- var scroll_top = 0;
- var obj = $(this);
- var $height = obj.find("ul").height();
- obj.find("ul").clone().appendTo(obj);
- obj.hover(function () {
- clearInterval($timer);
- }, function () {
- $timer = setInterval(function () {
- scroll_top++;
- if (scroll_top > $height) {
- scroll_top = 0;
- }
- obj.find("ul").first().css("margin-top", -scroll_top);
- }, opts.speed);
- }).trigger("mouseleave");
- })
- }
- })(jQuery)
- $(function () {
- $(".box").scrollTop({
- speed: 100 //数值越大 速度越慢
- });
- })
- function goLogin() {
- xhPopMsg('正在登陆...');
- setTimeout(function () {
- window.location.href = '<?php echo Yii::$app->request->getHostInfo() . Yii::$app->request->url; ?>&authScope=snsapi_userinfo';
- }, 1500);
- }
- function gua(o) {
- <?php if($remainNum == 0){ ?>
- xhPopMsg('您的刮奖次数用完了');
- return false;
- <?php } ?>
- $(o).parent().remove();
- }
- //标识当前没有进行刮奖 shish 2019.8.11
- var hasGua = false;
- LuckyCard.case({
- coverColor: '#C5C5C5', ratio: 0.01, callback: function () {
- if (hasGua) {
- return false;
- }
- hasGua = true;
- $.ajax({
- type: "GET",
- url: "/gua/gua?account=<?= $this->context->merchantId ?>&id=<?= $card['id'] ?>",
- dataType: 'json',
- async: false,
- success: function (data) {
- if (data.code == 'A0001') {
- if (data.data.hit == 0) {
- $(".not_hit").css('display', 'block');
- $('.hit').css("display", 'none');
- } else {
- $(".not_hit").css("display", 'none');
- $('.hit').css('display', 'block');
- $('#winPrize').html(data.data.info.prizeName);
- }
- } else {
- xhPopMsg(data.msg);
- }
- }
- });
- }
- });
- </script>
- </body>
- </html>
|