123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>我的勋章</title>
- <!--#include virtual="/h5v2/htm2/head.htm" -->
- <style type="text/css">
- body {
- background-image: url(img/medalPopup.jpg);
- }
-
- .btn_focus_btn {
- border: 3px solid #fff;
- border-radius: 20px;
- box-shadow: 0px 0px 10px #3794e2;
- }
- </style>
- </head>
- <body>
- <div id="medalDiv"></div>
- <div id="buttonDiv"></div>
- <!--#include virtual="/h5v2/htm2/foot.htm" -->
- <!--#include virtual="activity_cfg.htm" -->
- <script type="text/javascript">
- var linkImage = CONFIG.SPACER; //透明图片
- var buttons = []; //按钮数组
- var prize; //奖品信息
- var phoneFlag = 0; //0表示未中奖,1表示中奖留了号码,2表示中奖没留号码
- var prizeImg = ''; //奖品图片
- var prizeCount = 0;
- var dataJson = [];
- var act_id = ACTIVITY_CFG.ACT_ID,
- act_code = ACTIVITY_CFG.ACT_CODE; //活动id及code
- var dudu_is_vip = PageH5.cookie.get('activity_is_vip');
- var uid = PageH5.cookie.get('activity_userid');
- function init() {
- var html = '';
- html += '<div style="position:absolute;left:421px;top:644px;"><img id="btn0" src="./img/btn_back.png"/></div>';
- html += '<div style="position:absolute;left:711px;top:644px;"><img id="btn1" src="./img/btn_getPrize.png"/></div>';
- G('buttonDiv').innerHTML = html;
- var _html = "";
- _html += '<div style="position:absolute;left:410px;top:210px;"><img id="title_0" src="./img/title_0_no.png"/></div>';
- _html += '<div style="position:absolute;left:660px;top:210px;"><img id="title_1" src="./img/title_1_no.png"/></div>';
- _html += '<div style="position:absolute;left:290px;top:390px;"><img id="title_2" src="./img/title_2_no.png"/></div>';
- _html += '<div style="position:absolute;left:535px;top:390px;"><img id="title_3" src="./img/title_3_no.png"/></div>';
- _html += '<div style="position:absolute;left:780px;top:390px;"><img id="title_4" src="./img/title_4_no.png"/></div>';
- G('medalDiv').innerHTML = _html;
- for (var i = 0; i < 2; i++) {
- var obj = {
- id: 'btn' + i,
- action: goAction,
- index: i,
- left: 'btn' + (i - 1),
- right: 'btn' + (i + 1),
- up: '',
- down: '',
- focusClass: 'btn',
- };
- buttons.push(obj);
- }
- PageH5.btn.init('btn1', buttons, '', true);
- }
- function goAction(button) {
- if (button.index == 1) {
- if (phoneFlag == 1) {
- ajax({
- url: webUrl + "index.php?m=Home&c=Activityv2&a=prize",
- data: {
- uid: uid,
- act_code: act_id,
- is_vip: dudu_is_vip,
- run: 'complate',
- },
- success: function(res) {
- if (res.code == 0) {
- if (res.data.yes.prize_status == "none") { //没中奖
- } else if (res.data.yes.prize_status == "real") { //中实物
- location.href = './prize.html?from=medalInfo';
- } else if (res.data.yes.prize_status == "vitual") { //虚拟
- location.href = './noPrize.html?from=medalInfo';
- }
- } else {
- PageH5.tip(res.msg);
- // back()
- }
- },
- error: function() {
- // back()
- }
- })
- } else {
- PageH5.tip('您还集齐5个勋章,继续加油噢!');
- }
- } else if (button.index == 0) {
- back();
- }
- }
- function back() {
- location.href = './index.html?f=medal';
- }
- function getUserCollects(fn) {
- ajax({
- url: webUrl + "index.php?c=Home&c=Activityv2&a=getUserCollects",
- data: {
- uid: uid,
- act_code: act_id,
- is_vip: dudu_is_vip
- },
- success: function(res) {
- if (res.code == 0) {
- for (var i = 0; i < res.data.collect.length; i++) {
- if (res.data.collect[i].num > 0)
- G('title_' + (res.data.collect[i].collect_id * 1 - 1)).src = './img/title_' + (res.data.collect[i].collect_id * 1 - 1) + '.png'
- }
- if (res.data.complate.length > 0) {
- phoneFlag = 1;
- } else {
- phoneFlag = 2;
- }
- }
- fn && fn(res);
- }
- })
- }
- window.onload = function() {
- init();
- getUserCollects()
- }
- </script>
- </body>
- </html>
|