|
@@ -1,253 +0,0 @@
|
|
|
-<!doctype html>
|
|
|
-<html lang="zh">
|
|
|
-<head>
|
|
|
- <meta charset="utf-8">
|
|
|
- <title>{$vo.title|default=''}</title>
|
|
|
- <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
|
|
|
- <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width">
|
|
|
- <link rel="stylesheet" href="__ROOT__/static/luckdraw/css/style.css">
|
|
|
- <link rel="stylesheet" href="__ROOT__/static/luckdraw/lib/swiper/swiper.min.css">
|
|
|
- <script src="__ROOT__/static/plugs/jquery/jquery.min.js"></script>
|
|
|
- <script src="__ROOT__/static/luckdraw/layer.mobile/layer.js"></script>
|
|
|
- <script src="__ROOT__/static/luckdraw/lib/swiper/swiper.min.js"></script>
|
|
|
- <script src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
|
|
- <script>
|
|
|
- window.onresize = function () {
|
|
|
- this.deviceWidth = document.documentElement.clientWidth;
|
|
|
- if (this.deviceWidth > 640) this.deviceWidth = 640;
|
|
|
- document.documentElement.style.fontSize = this.deviceWidth / 7.5 + 'px';
|
|
|
- };
|
|
|
- window.onresize();
|
|
|
-
|
|
|
- let ApiFun = new function () {
|
|
|
- this.doDraw = function () {
|
|
|
- /* {if empty($member)} */
|
|
|
- document.querySelector('#mask1').className = 'mask show';
|
|
|
- document.querySelector('.info-dialog').className = 'info-dialog show';
|
|
|
- /* {else} */
|
|
|
- let index = layer.open({type: 2, content: '抽奖中...'});
|
|
|
- $.post('{:url("@data/app.luckdraw/prize/code/".$vo.code)}', {}, function (ret) {
|
|
|
- layer.close(index), location.reload();
|
|
|
- });
|
|
|
- /* {/if} */
|
|
|
- };
|
|
|
- /*! 补充用户数据 */
|
|
|
- this.doInfo = function () {
|
|
|
- let phone = $('#phone').val() || '', username = $('#username').val() || '';
|
|
|
- if (!/.{1}/.test(username)) return layer.open({content: '请输入您的姓名!', skin: 'msg', time: 2, shade: true});
|
|
|
- if (!/^1\d{10}$/.test(phone)) return layer.open({content: '请输入正确的手机号!', skin: 'msg', time: 2, shade: true});
|
|
|
- let index = layer.open({type: 2, content: '提交中...', shade: true});
|
|
|
- $.post('{:url("@data/app.luckdraw/info/code/".$vo.code)}', {phone: phone, username: username}, function (ret) {
|
|
|
- layer.close(index);
|
|
|
- if (ret.code > 0) return window.location.reload();
|
|
|
- return layer.open({content: ret.info, skin: 'msg', time: 2, shade: true});
|
|
|
- });
|
|
|
- };
|
|
|
- /*! 奖品核销码 */
|
|
|
- this.doUsed = function () {
|
|
|
- let uncode = $('#uncode').val() || '';
|
|
|
- if (!uncode) return layer.open({content: '请输入核销码再操作!', skin: 'msg', time: 2, shade: true});
|
|
|
- let index = layer.open({type: 2, content: '正在核销奖品...', shade: true});
|
|
|
- $.post('{:url("@data/app.luckdraw/used/code/".$vo.code)}', {uncode: uncode}, function (ret) {
|
|
|
- layer.close(index);
|
|
|
- if (ret.code > 0) return location.reload();
|
|
|
- return layer.open({content: ret.info, skin: 'msg', time: 2, shade: true});
|
|
|
- });
|
|
|
- }
|
|
|
- /*! 填写收货地址 */
|
|
|
- this.doExpress = function () {
|
|
|
- let data = {
|
|
|
- city: $('[name=city]').val() || '',
|
|
|
- area: $('[name=area]').val() || '',
|
|
|
- address: $('[name=address]').val() || '',
|
|
|
- province: $('[name=province]').val() || '',
|
|
|
- };
|
|
|
- if (!data.address) return layer.open({content: '收货地址不能为空!', skin: 'msg', time: 2, shade: true});
|
|
|
- let index = layer.open({type: 2, content: '正在提交收货地址...', shade: true});
|
|
|
- $.post('{:url("@data/app.luckdraw/express/code/".$vo.code)}', data, function (ret) {
|
|
|
- layer.close(index);
|
|
|
- if (ret.code > 0) return location.reload();
|
|
|
- return layer.open({content: ret.info, skin: 'msg', time: 2, shade: true});
|
|
|
- });
|
|
|
- };
|
|
|
- };
|
|
|
- (function () {
|
|
|
- wx.config(JSON.parse('{$jsoptin|raw}'));
|
|
|
- wx.ready(function () {
|
|
|
- wx.hideAllNonBaseMenuItem();
|
|
|
- wx.hideMenuItems({
|
|
|
- menuList: ['updateAppMessageShareData', 'updateTimelineShareData']
|
|
|
- });
|
|
|
- });
|
|
|
- })();
|
|
|
- </script>
|
|
|
-</head>
|
|
|
-<body>
|
|
|
-<div class="page index-page">
|
|
|
- {if !empty($vo.status) and empty($vo.is_deleted)}
|
|
|
- <img src="__ROOT__/static/luckdraw/images/bg2.jpg" alt="一尚美术">
|
|
|
- <div class="page-body">
|
|
|
- <img onclick="showRule()" class="rule" src="__ROOT__/static/luckdraw/images/rule.png" alt="活动规则">
|
|
|
- <!-- 抽奖按钮 -->
|
|
|
- {empty name='record'}
|
|
|
- <img class="btn" src="__ROOT__/static/luckdraw/images/yu.png" alt="点我抽奖" onclick="ApiFun.doDraw()">
|
|
|
- {else}
|
|
|
- <!-- 已中奖的点击按钮变成 查看奖品 -->
|
|
|
- <img class="btn" src="__ROOT__/static/luckdraw/images/yu1.png" alt="查看奖品" onclick="ApiFun.doDraw()">
|
|
|
- {/empty}
|
|
|
- <!-- 中奖明细 -->
|
|
|
- <div class="detail">
|
|
|
- <img class="title" src="__ROOT__/static/luckdraw/images/t1.png" alt="中奖明细">
|
|
|
- <div class="swiper-container ls-box">
|
|
|
- <img class="icon1" src="__ROOT__/static/luckdraw/images/icon1.png" alt="一尚美术">
|
|
|
- <img class="icon1 icon2" src="__ROOT__/static/luckdraw/images/icon1.png" alt="一尚美术">
|
|
|
- <ul class="swiper-wrapper">
|
|
|
- {foreach $records as $vo}
|
|
|
- <li class="swiper-slide">
|
|
|
- <div class="ls-title">
|
|
|
- <span>{$vo.username|default=''}</span>
|
|
|
- <span>{$vo.prize_level|default='特等奖'}</span>
|
|
|
- </div>
|
|
|
- <div class="ls-text">{$vo.prize_name|default=''}</div>
|
|
|
- </li>
|
|
|
- {/foreach}
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-</div>
|
|
|
-
|
|
|
-<!-- 填写信息 -->
|
|
|
-{if empty($member)}
|
|
|
-<div id="mask1" class="mask show" onclick="hideDraw()"></div>
|
|
|
-<div class="info-dialog show">
|
|
|
- <h2>填写信息即可参与抽奖哦~</h2>
|
|
|
- <div class="form">
|
|
|
- <label>
|
|
|
- <span>您的姓名:</span>
|
|
|
- <input id="username" type="text" maxlength="20">
|
|
|
- </label>
|
|
|
- <label>
|
|
|
- <span>手机号码:</span>
|
|
|
- <input id="phone" type="tel" maxlength="11">
|
|
|
- </label>
|
|
|
- </div>
|
|
|
- <div class="btns">
|
|
|
- <span onclick="hideDraw()">取消</span>
|
|
|
- <span onclick="ApiFun.doInfo()">确认</span>
|
|
|
- </div>
|
|
|
-</div>
|
|
|
-{elseif !empty($record)}
|
|
|
-<!-- 中奖弹窗 -->
|
|
|
-<div class="luck-mask show">
|
|
|
- <img onclick="this.parentNode.className='luck-mask'" class="close" src="__ROOT__/static/luckdraw/images/close.png" alt="关闭">
|
|
|
- <img src="__ROOT__/static/luckdraw/images/luck.png" alt="中奖了">
|
|
|
- <script src="__ROOT__/static/plugs/jquery/pcasunzips.js"></script>
|
|
|
- <div class="luck-dialog">
|
|
|
- {if $record.prize_code neq ''}
|
|
|
- <h1>{$record.prize_level|default='特等奖'}</h1>
|
|
|
- <h3>{$record.prize_name|default='未中奖'}</h3>
|
|
|
- {if empty($record.uncode_status) && empty($record.express_province)}
|
|
|
- <div>
|
|
|
- {if empty($record.prize_express)}
|
|
|
- <label><input id="uncode" type="text" placeholder="请输入核销码"></label>
|
|
|
- <div onclick="ApiFun.doUsed()" class="dialog-btn">确认核销</div>
|
|
|
- {else}
|
|
|
- <label>
|
|
|
- <select name="province"></select>
|
|
|
- <select name="city"></select>
|
|
|
- <select name="area"></select>
|
|
|
- <input name="address" value="{$record.express_address|default=''}" placeholder="请输入详情地址">
|
|
|
- </label>
|
|
|
- <script>new PCAS('province', 'city', 'area', '{$record.express_province|default=""}', '{$record.express_city|default=""}', '{$record.express_area|default=""}')</script>
|
|
|
- <div onclick="ApiFun.doExpress()" class="dialog-btn">提交收货地址</div>
|
|
|
- {/if}
|
|
|
- </div>
|
|
|
- {else}
|
|
|
- <!--{if empty($record.prize_express)}-->
|
|
|
- <div class="dialog-btn btn1">奖品已核销</div>
|
|
|
- <!--{else}-->
|
|
|
- <div>
|
|
|
- <label>
|
|
|
- <select disabled style="background:#ddd">
|
|
|
- <option>{$record.express_province|default=''}</option>
|
|
|
- </select>
|
|
|
- <select disabled style="background:#ddd">
|
|
|
- <option>{$record.express_city|default=''}</option>
|
|
|
- </select>
|
|
|
- <select disabled style="background:#ddd">
|
|
|
- <option>{$record.express_area|default=''}</option>
|
|
|
- </select>
|
|
|
- <input disabled style="background:#ddd" value="{$record.express_address}" placeholder="请输入详情地址">
|
|
|
- </label>
|
|
|
- <div class="dialog-btn btn1">已提交收货地址</div>
|
|
|
- </div>
|
|
|
- <!--{/if}-->
|
|
|
- {/if}
|
|
|
- {else}
|
|
|
- <div class="dialog-btn btn1">未中奖</div>
|
|
|
- {/if}
|
|
|
- </div>
|
|
|
-</div>
|
|
|
-{/if}
|
|
|
-
|
|
|
-<!-- 规则说明 -->
|
|
|
-<div class="rule-mask">
|
|
|
- <img onclick="this.parentNode.className='rule-mask'" class="close" src="__ROOT__/static/luckdraw/images/close.png" alt="关闭">
|
|
|
- <div class="rule-dialog">
|
|
|
- <h1 class="dialog-title">活动规则</h1>
|
|
|
- <div class="rule-content">{foreach $rules as $rule}<p>{$rule}</p>{/foreach}</div>
|
|
|
- </div>
|
|
|
-</div>
|
|
|
-{else}
|
|
|
-<script>
|
|
|
- alert('活动已经结束');
|
|
|
- wx.ready(function () {
|
|
|
- wx.closeWindow();
|
|
|
- });
|
|
|
-</script>
|
|
|
-{/if}
|
|
|
-
|
|
|
-<script>
|
|
|
- /*! 显示活动规则 */
|
|
|
- function showRule() {
|
|
|
- document.querySelector('.rule-mask').className = 'rule-mask show';
|
|
|
- }
|
|
|
-
|
|
|
- /*! 显示信息弹窗 */
|
|
|
- function showDraw() {
|
|
|
- document.querySelector('#mask1').className = 'mask show';
|
|
|
- document.querySelector('.info-dialog').className = 'info-dialog show';
|
|
|
- }
|
|
|
-
|
|
|
- /*! 隐藏信息弹窗 */
|
|
|
- function hideDraw() {
|
|
|
- document.querySelector('#mask1').className = 'mask';
|
|
|
- document.querySelector('.info-dialog').className = 'info-dialog';
|
|
|
- }
|
|
|
-
|
|
|
- /*! 显示中奖弹窗 */
|
|
|
- function showLuck() {
|
|
|
- document.querySelector('.luck-mask').className = 'luck-mask show';
|
|
|
- }
|
|
|
-
|
|
|
- window.onload = function () {
|
|
|
- let number = 4; /* 列表默认个数 */
|
|
|
- let winH = document.body.clientHeight || 720;
|
|
|
- /*! 不同屏幕高度改变列表高度 + 数据个数 */
|
|
|
- if (winH > 720) {
|
|
|
- document.querySelector('.index-page .ls-box').style.height = (winH / 130 * 0.82).toFixed(2) + 'rem';
|
|
|
- }
|
|
|
- /*! 列表轮播默认参数,默认不自动轮播 */
|
|
|
- let option = {direction: 'vertical', slidesPerView: number};
|
|
|
- /*! 列表数量大于默认数量 循环 + 自动轮播 */
|
|
|
- if (document.querySelectorAll('.ls-box li').length > number) {
|
|
|
- option.loop = true;
|
|
|
- option.autoplay = {delay: 1500, disableOnInteraction: false}
|
|
|
- }
|
|
|
- /*! Swiper 轮播实例化 */
|
|
|
- new Swiper('.swiper-container', option);
|
|
|
- };
|
|
|
-</script>
|
|
|
-</body>
|
|
|
-</html>
|