Compare commits

...

2 Commits

Author SHA1 Message Date
Dragon
c366781143 新增超出提醒 2024-01-11 19:14:17 +08:00
Dragon
0d1261e87c 优化合成礼物超出提示以及投入交互 2024-01-11 12:01:22 +08:00
4 changed files with 310 additions and 161 deletions

View File

@@ -502,6 +502,10 @@ body {
font-size: 0.34667rem;
}
.speed_rogress .speed_rogress_top .spanAct {
color: #00ffea;
}
.speed_rogress .speed_rogress_top .speed {
width: 4.66667rem;
height: 0.44rem;
@@ -521,6 +525,7 @@ body {
.speed_rogress .speed_rogress_top .speed div img {
width: 0;
height: 0.33333rem;
border-radius: 0.33333rem;
display: block;
}
@@ -719,6 +724,10 @@ body {
font-style: normal;
}
.bottom .swiper .swiper-slide div strong .iAct {
color: #00ffea;
}
.bottom .swiper .swiper-slide div strong b {
color: #7962A7;
font-size: 0.26667rem;
@@ -730,6 +739,11 @@ body {
}
.bottom .swiper .swiper-slide .div_active {
background-size: 100% 100%;
border: none;
}
.bottom .swiper .swiper-slide .div_active1 {
background: url(../images/div_active.png) no-repeat;
background-size: 100% 100%;
border: none;
@@ -770,10 +784,16 @@ body {
.refining .refining_in p {
margin-top: 0.98667rem;
width: 100%;
width: 90%;
text-align: center;
color: #fff;
font-size: 0.32rem;
margin: 0.98667rem auto 0;
line-height: 0.45rem;
}
.refining .refining_in p b {
color: #00E5F9;
}
.refining .refining_in div {
@@ -781,7 +801,7 @@ body {
display: flex;
justify-content: space-between;
box-sizing: border-box;
margin-top: 0.74667rem;
margin-top: 0.53333rem;
padding: 0 0.73333rem;
}
@@ -967,6 +987,61 @@ body {
margin: 0 auto;
}
.investment2 {
display: none;
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 88;
}
.investment2 .investment_in {
width: 6.88rem;
height: 5.57333rem;
background: url(../images/add_put.png) no-repeat;
background-size: 100% 100%;
position: relative;
left: 50%;
top: 40%;
transform: translate(-50%, -50%);
box-sizing: border-box;
padding-top: 0.38667rem;
}
.investment2 .investment_in p {
text-align: center;
color: #fff;
font-size: 0.32rem;
width: 85%;
position: absolute;
top: 1.5rem;
left: 50%;
transform: translateX(-50%);
line-height: 0.45rem;
}
.investment2 .investment_in p b {
color: #00ffea;
}
.investment2 .investment_in img {
position: absolute;
width: 2.50667rem;
height: 1rem;
top: 3.5rem;
}
.investment2 .investment_in .close {
left: 0.6rem;
}
.investment2 .investment_in .ok {
right: 0.6rem;
}
.record {
display: none;
position: fixed;

View File

@@ -17,6 +17,7 @@
url('../../../common/fonts/PingFang-Regular.ttf') format('truetype'),
url('../../../common/fonts/PingFang-Regular.ttf') format('svg');
}
.back {
position: fixed;
top: px2rem(50);
@@ -52,7 +53,8 @@ body {
.step1 {
display: none;
.step_tips{
.step_tips {
width: px2rem(684);
height: px2rem(328);
// margin: px2rem(553) px2rem(30) 0;
@@ -61,6 +63,7 @@ body {
left: px2rem(30);
z-index: 999;
}
.step_but {
width: px2rem(108);
height: px2rem(121);
@@ -71,9 +74,11 @@ body {
z-index: 999;
}
}
.step2 {
display: none;
.step_tips{
.step_tips {
width: px2rem(684);
height: px2rem(328);
// margin: px2rem(1043) px2rem(30) 0;
@@ -82,6 +87,7 @@ body {
left: px2rem(30);
z-index: 999;
}
.xuxian_qp {
width: px2rem(126);
height: px2rem(75);
@@ -90,6 +96,7 @@ body {
left: px2rem(374);
z-index: 999;
}
.xuxian_bar {
width: 1.8rem;
height: 1.3rem;
@@ -98,6 +105,7 @@ body {
right: 0.85rem;
z-index: 999;
}
.step_but {
width: px2rem(108);
height: px2rem(121);
@@ -108,9 +116,11 @@ body {
z-index: 999;
}
}
.step3 {
display: none;
.step_tips{
.step_tips {
width: px2rem(684);
height: px2rem(328);
position: absolute;
@@ -118,6 +128,7 @@ body {
left: px2rem(30);
z-index: 999;
}
.xuxian_c {
width: px2rem(708);
height: px2rem(295);
@@ -126,6 +137,7 @@ body {
left: px2rem(21);
z-index: 999;
}
.step_but {
width: px2rem(108);
height: px2rem(121);
@@ -135,9 +147,11 @@ body {
z-index: 999;
}
}
.step4 {
display: none;
.step_tips{
.step_tips {
width: px2rem(684);
height: px2rem(328);
position: absolute;
@@ -145,7 +159,8 @@ body {
left: px2rem(30);
z-index: 999;
}
.xuxian_c{
.xuxian_c {
width: px2rem(690);
height: px2rem(690);
position: absolute;
@@ -153,6 +168,7 @@ body {
left: px2rem(30);
z-index: 999;
}
.success_wrap {
display: none;
z-index: 999;
@@ -176,15 +192,18 @@ body {
background: url(../images/qipao3.png) no-repeat;
background-size: 100% 100%;
}
span {
margin-top: px2rem(22);
font-family: 'pingfang-regular';
font-size: px2rem(24);
color: #fff;
b {
color: #FDD411;
}
}
p {
margin-top: px2rem(14);
font-family: 'pingfang-regular';
@@ -192,6 +211,7 @@ body {
color: #fff;
}
}
.bad_wrap {
display: none;
z-index: 999;
@@ -214,15 +234,18 @@ body {
background: url(../images/qipao_bad.png) no-repeat;
background-size: 100% 100%;
}
span {
margin-top: px2rem(22);
font-family: 'pingfang-regular';
font-size: px2rem(24);
color: #fff;
b {
color: #FDD411;
}
}
p {
margin-top: px2rem(14);
font-family: 'pingfang-regular';
@@ -230,12 +253,13 @@ body {
color: #fff;
}
}
}
.head_wrap {
height: px2rem(1139);
}
.header {
width: 100%;
height: px2rem(1018);
@@ -253,7 +277,7 @@ body {
left: 50%;
transform: translateX(-50%);
}
.record_icon {
width: px2rem(48);
height: px2rem(123);
@@ -377,9 +401,11 @@ body {
width: 100%;
display: flex;
justify-content: space-evenly;
.tab_item {
width: px2rem(188);
height: px2rem(60);
img {
width: 100%;
height: 100%;
@@ -460,6 +486,7 @@ body {
background: url(../images/but_active.png) no-repeat;
background-size: 100% 100%;
}
.xs_but_active {
background: url(../images/xs_but_active.png) no-repeat;
background-size: 100% 100%;
@@ -482,6 +509,7 @@ body {
color: #fff;
font-size: px2rem(22);
text-align: center;
span {
color: #FBE5B5;
}
@@ -511,6 +539,10 @@ body {
font-size: px2rem(26);
}
.spanAct {
color: #00ffea;
}
.speed {
width: px2rem(350);
height: px2rem(33);
@@ -530,6 +562,7 @@ body {
width: 0;
// width: px2rem(342);
height: px2rem(25);
border-radius: px2rem(25);
display: block;
}
}
@@ -679,24 +712,6 @@ body {
margin-right: 0.6rem;
transform: translateX(42%);
// .div_active {
// background: url(../images/div_active.png) no-repeat;
// background-size: 100% 100%;
// border: none;
// width: px2rem(120);
// height: px2rem(120);
// border-radius: px2rem(12);
// float: left;
// position: relative;
// margin-bottom: px2rem(67);
// box-sizing: border-box;
// margin-right: 0.6rem;
// transform: translateX(42%);
// position: absolute;
// left: -0.1rem;
// top: 0;
// }
img {
position: absolute;
width: px2rem(101);
@@ -749,6 +764,10 @@ body {
font-style: normal;
}
.iAct {
color: #00ffea;
}
b {
color: #7962A7;
font-size: px2rem(20);
@@ -762,6 +781,12 @@ body {
}
.div_active {
// background: url(../images/div_active.png) no-repeat;
background-size: 100% 100%;
border: none;
}
.div_active1 {
background: url(../images/div_active.png) no-repeat;
background-size: 100% 100%;
border: none;
@@ -803,10 +828,16 @@ body {
p {
margin-top: px2rem(74);
width: 100%;
width: 90%;
text-align: center;
color: #fff;
font-size: px2rem(24);
margin: px2rem(74) auto 0;
line-height: 0.45rem;
b {
color: #00E5F9;
}
}
div {
@@ -814,7 +845,7 @@ body {
display: flex;
justify-content: space-between;
box-sizing: border-box;
margin-top: px2rem(56);
margin-top: px2rem(40);
padding: 0 px2rem(55);
img {
@@ -1003,6 +1034,59 @@ body {
}
}
.investment2 {
display: none;
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 88;
.investment_in {
width: px2rem(516);
height: px2rem(418);
background: url(../images/add_put.png) no-repeat;
background-size: 100% 100%;
position: relative;
left: 50%;
top: 40%;
transform: translate(-50%, -50%);
// overflow: hidden;
box-sizing: border-box;
padding-top: px2rem(29);
p {
text-align: center;
color: #fff;
font-size: 0.32rem;
width: 85%;
position: absolute;
top: 1.5rem;
left: 50%;
transform: translateX(-50%);
line-height: 0.45rem;
b{
color: #00ffea;
}
}
img {
position: absolute;
width: 2.50667rem;
height: 1rem;
top: 3.5rem;
}
.close{
left: 0.6rem;
}
.ok{
right: 0.6rem;
}
}
}
.record {
display: none;
position: fixed;
@@ -1050,6 +1134,7 @@ body {
border-radius: 50%;
border: 1px solid #C6ADFF;
}
.no_tx {
display: block;
width: px2rem(73);
@@ -1239,15 +1324,18 @@ body {
background: url(../images/qipao3.png) no-repeat;
background-size: 100% 100%;
}
span {
margin-top: px2rem(22);
font-family: 'pingfang-regular';
font-size: px2rem(24);
color: #fff;
b {
color: #FDD411;
}
}
p {
margin-top: px2rem(14);
font-family: 'pingfang-regular';
@@ -1296,15 +1384,18 @@ body {
background: url(../images/qipao3.png) no-repeat;
background-size: 100% 100%;
}
span {
margin-top: px2rem(22);
font-family: 'pingfang-regular';
font-size: px2rem(24);
color: #fff;
b {
color: #FDD411;
}
}
p {
margin-top: px2rem(14);
font-family: 'pingfang-regular';
@@ -1353,15 +1444,18 @@ body {
background: url(../images/qipao_bad.png) no-repeat;
background-size: 100% 100%;
}
span {
margin-top: px2rem(22);
font-family: 'pingfang-regular';
font-size: px2rem(24);
color: #fff;
b {
color: #FDD411;
}
}
p {
margin-top: px2rem(14);
font-family: 'pingfang-regular';
@@ -1378,4 +1472,4 @@ body {
transform: translateX(-50%);
top: 56%;
}
}
}

View File

@@ -8,7 +8,7 @@
<title>魔法小屋</title>
<link rel="stylesheet" href="../../common/css/reset.css">
<link rel="stylesheet" href="./css/swiper-bundle.min.css">
<link rel="stylesheet" href="./css/index.css?v=1.2">
<link rel="stylesheet" href="./css/index.css?v=1.20">
</head>
<body>
@@ -150,7 +150,7 @@
</div>
</div>
<!-- 添加減少彈框 -->
<div class="investment">
<div class="investment" style="z-index: 99;">
<div class="investment_in">
<!-- <img src="./images/del.png" alt="" class="closeBut"> -->
<p class="title">選擇投入:</p>
@@ -166,6 +166,14 @@
<div class="but"></div>
</div>
</div>
<!-- 超出弹窗提醒 -->
<div class="investment2" style="z-index: 100;">
<div class="investment_in">
<p>投入禮物的價值將<b>高於</b>合成所需價值,確認繼續投入嗎?</p>
<img class="close" src="./images/refining_close.png" alt="">
<img class="ok" src="./images/refining_ok.png" alt="">
</div>
</div>
<!-- 規則寶典 -->
<div class="rule">
@@ -245,4 +253,4 @@
<script src="../../common/js/vconsole.min.js"></script>
<script src="../../common/js/route-constant.js"></script>
<script src="./js/swiper-bundle.min.js"></script>
<script src="./js/index.js?v=1.2"></script>
<script src="./js/index.js?v=1.20"></script>

View File

@@ -7,7 +7,7 @@ const showLoading = (content = '加載中...') => {
type: 2,
shadeClose: false,
content,
success(e) {
success (e) {
layerIndex = $(e).attr('index')
}
})
@@ -25,7 +25,7 @@ const toastMsg = (content = '操作完成', time = 2) => {
var mySwiper
function swiperFun(mySwiper) {
function swiperFun (mySwiper) {
mySwiper = new Swiper('.swiper', {
loop: false, // 循環模式選項
// 如果需要分頁器
@@ -80,31 +80,31 @@ $(function () {
window.webkit.messageHandlers.initShowNav.postMessage(0)
}
}
document.addEventListener('touchstart', function (event) {
// document.addEventListener('touchstart', function (event) {
if (event.touches.length > 1) {
// if (event.touches.length > 1) {
event.preventDefault();
// event.preventDefault();
}
// }
})
// })
var lastTouchEnd = 0;
// var lastTouchEnd = 0;
document.addEventListener('touchend', function (event) {
// document.addEventListener('touchend', function (event) {
var now = (new Date()).getTime();
// var now = (new Date()).getTime();
if (now - lastTouchEnd <= 300) {
// if (now - lastTouchEnd <= 300) {
event.preventDefault();
// event.preventDefault();
}
// }
lastTouchEnd = now;
// lastTouchEnd = now;
}, false)
// }, false)
changeTab(tabIndex)
noticeFun();
getXsDataFun();
@@ -113,7 +113,7 @@ $(function () {
}, 100);
})
// 播放svg
function svgaFun() {
function svgaFun () {
player1 = new SVGA.Player('.luzis');
parser1 = new SVGA.Parser('.luzis');
parser1.load('./images/luzi.svga', function (videoItem) {
@@ -132,7 +132,7 @@ function svgaFun() {
})
})
}
function xsSvgaFun() {
function xsSvgaFun () {
player1 = new SVGA.Player('.luzis');
parser1 = new SVGA.Parser('.luzis');
parser1.load('./images/xs_luzi.svga', function (videoItem) {
@@ -150,9 +150,18 @@ function xsSvgaFun() {
// 練造按鈕
$('.header .but').click(function () {
var ifs = $(this).attr('ifckick') == undefined ? 0 : 1;
if (ifs == 1) {
var valArr = $('.speed_rogress .speed_rogress_top p').text().match(/\d+(\.\d+)?/g);
if (ifs == 1 && valArr[0] >= valArr[1]) {
if (headerBut) {
headerBut = false;
// console.log(valArr[0])
// console.log(valArr[1] * 0.5)
// console.log((valArr[0] - valArr[1])>= valArr[1]* 0.5 ? '超过百分之五十了':'合理范围内');
if ((valArr[0] - valArr[1]) > 1000) {
$('.refining .refining_in p').html('當前投入禮物值<b>已超過</b>煉制進度值,確認繼續煉制嗎?')
} else {
$('.refining .refining_in p').html('確認選擇這些背包禮物進行煉制嗎?')
}
$('.refining').show();
}
} else {
@@ -160,7 +169,7 @@ $('.header .but').click(function () {
}
})
//公告欄
function guangGao() {
function guangGao () {
clearInterval(timeInterval);
timeInterval = setInterval(function () {
$('.header .notice ul').animate({
@@ -173,12 +182,12 @@ function guangGao() {
}, 2000);
}
// 輪播
function noticeFun() {
function noticeFun () {
showLoading();
networkRequest({
type: 'GET',
url: urlPrefix + '/gift/compound/record/top',
success(res) {
success (res) {
if (res.code === 200) {
var str = ``;
res.data.forEach(res => {
@@ -193,18 +202,18 @@ function noticeFun() {
}
hideLoading(layerIndex);
},
error(err) {
error (err) {
toastMsg('網絡錯誤,請退出重進');
}
})
}
// 合成禮物列錶
function getDataFun() {
function getDataFun () {
showLoading();
networkRequest({
type: 'GET',
url: urlPrefix + '/gift/compound/giftList',
success(res) {
success (res) {
if (res.code === 200) {
getDataArr = res.data;
getDataArr.forEach((res, index) => {
@@ -217,18 +226,18 @@ function getDataFun() {
}
hideLoading(layerIndex);
},
error(err) {
error (err) {
toastMsg('網絡錯誤,請退出重進');
}
})
}
// 限時合成禮物列錶
function getXsDataFun() {
function getXsDataFun () {
showLoading();
networkRequest({
type: 'GET',
url: urlPrefix + '/gift/compound/limit/giftList',
success(res) {
success (res) {
if (res.code === 200) {
if (tabIndex == 1) {
console.log('渲染限時合成禮物');
@@ -241,32 +250,31 @@ function getXsDataFun() {
}
xsOpen = true;
$(".header .tab_wrap").show();
} else if(res.code === 26001){
} else if (res.code === 26001) {
xsOpen = false;
$(".header .tab_wrap").hide();
}else if(res.code === 26002){
} else if (res.code === 26002) {
$(".header .tab_wrap").show();
xsOpen = false;
}else {
} else {
toastMsg(res.message);
// console.log(res);
}
hideLoading(layerIndex);
},
error(err) {
error (err) {
toastMsg('網絡錯誤,請退出重進');
}
})
}
// 初始化渲染合成禮物
function dataRendering(getDataArrIndex) {
function dataRendering (getDataArrIndex) {
// console.log('getDataArrIndex',getDataArr);
$('.header .qipao img').attr('src', getDataArr[getDataArrIndex].giftUrl);
$('.header .qipao img').attr('RewardId', getDataArr[getDataArrIndex].compoundRewardId);
$('.header .qipao img').attr('giftId', getDataArr[getDataArrIndex].giftId);
$('.header .qipao p').html(`<span>${getDataArr[getDataArrIndex].giftName}</span>${getDataArr[getDataArrIndex].goldPrice}鉆)`);
$('.speed_rogress .speed_rogress_top p').html(`<span>${getDataArr[0].fraction}</span>/${getDataArr[getDataArrIndex].expendValue}`);
// console.log(Number($('.speed_rogress .speed_rogress_top p span').text()) / getDataArr[getDataArrIndex].goldPrice * 100)
$('.speed_rogress .speed_rogress_top p').html(`<span class='span'>${getDataArr[0].fraction}</span>/${getDataArr[getDataArrIndex].expendValue}`);
let percent = Number($('.speed_rogress .speed_rogress_top p span').text()) / getDataArr[getDataArrIndex].expendValue * 100
if (percent > 100) {
$('.speed_rogress .speed_rogress_top .bar_wrap .line').css({ 'width': '100%' })
@@ -334,29 +342,16 @@ $('.header .right_but').click(function () {
}
})
// 獲取背包禮物
function listUserBackpackFun() {
function listUserBackpackFun () {
showLoading();
networkRequest({
type: 'GET',
url: urlPrefix + '/backpack/listUserBackpack',
data: { uid: pubInfo.uid },
success(res) {
success (res) {
if (res.code === 200) {
if (res.data.length == 0) {
// $('.bottom .b_Top').after(`
// <div class="swiper">
// <div class="swiper-wrapper">
// <div class="not">
// <div>
// <p>當前暫無多余背包禮物,</p>
// <p>無法煉制合成禮物哦~</p>
// </div>
// </div>
// </div>
// </div>
// `);
$('.bottom .swiper .not').show();
// $('.bottom .swiper .swiper-slide').hide();
} else {
// 為了解決tab切換時swiper插件重復初始化導致分頁原點錯亂問題每次都重新創建swiper的盒子
$('.bottom .swiper').remove();
@@ -408,7 +403,7 @@ function listUserBackpackFun() {
// 點擊背包禮物列錶
$('.bottom .swiper .swiper-slide div').click(function () {
// 防止合成時點擊繼續添加
if(headerBut){
if (headerBut) {
// console.log('防止合成時點擊繼續添加');
$(this).parent().siblings().children().removeClass('div_active');
$(this).addClass('div_active').siblings().removeClass('div_active');
@@ -418,7 +413,6 @@ function listUserBackpackFun() {
$('.investment .investment_in .num input').val(objs[Number($('.bottom .swiper .swiper-slide .div_active').attr('giftid'))].num);
var srcs = $('.bottom .swiper .swiper-slide .div_active img').attr('src');
$('.investment .investment_in .qipao img').attr("src", srcs);
// $('.bottom .swiper .swiper-slide div strong i')
$(this).children('strong').children('i').text(objs[Number($(this).attr('giftid'))].num);
$('.investment').show();
size1 = Number($('.investment .investment_in .num input').val());
@@ -432,19 +426,19 @@ function listUserBackpackFun() {
}
hideLoading(layerIndex);
},
error(err) {
error (err) {
toastMsg('網絡錯誤,請退出重進');
}
})
}
//合成記錄
function recordFun(pageNum) {
function recordFun (pageNum) {
showLoading();
networkRequest({
type: 'GET',
url: urlPrefix + '/gift/compound/record',
data: { pageNum, pageSize: 10 },
success(res) {
success (res) {
if (res.code === 200) {
if (res.data.length == 0 && pageNum == 1) {
$('.record').hide();
@@ -487,7 +481,7 @@ function recordFun(pageNum) {
}
hideLoading(layerIndex);
},
error(err) {
error (err) {
isLock = true;
toastMsg('網絡錯誤,請退出重進');
}
@@ -496,7 +490,7 @@ function recordFun(pageNum) {
var isJL = false;
// 確認投入按鈕
$('.investment .investment_in .but').click(function () {
// $('.bottom .swiper .swiper-slide .div_active strong').show();
var valArr = $('.speed_rogress .speed_rogress_top p').text().match(/\d+(\.\d+)?/g);
var giftIds = $('.bottom .swiper .swiper-slide .div_active').attr('giftId');
var val = $('.investment .investment_in .num input').val();
objs[Number($('.bottom .swiper .swiper-slide .div_active').attr('giftid'))].num = val;
@@ -504,19 +498,11 @@ $('.investment .investment_in .but').click(function () {
var goldprice = Number($('.bottom .swiper .swiper-slide .div_active').attr(`goldprice`))
compoundParam.compoundList.push({ giftId: Number(giftIds), num: giftNum })
size2 = Number($('.investment .investment_in .num input').val());
console.log('isJL', isJL);
console.log('size1', size1);
console.log('size2', size2);
if (isJL) {
if (size1 < size2) {
console.log('增加了');
//++
// if ($('.speed_rogress .speed_rogress_top p span').text() == 0) {
// Number($('.speed_rogress .speed_rogress_top p span').text())
// getDataArr[0].fraction = Number($('.bottom .swiper .swiper-slide .div_active').attr(`ad`)) + goldprice * val;
// }
var goldprice = Number($('.bottom .swiper .swiper-slide .div_active').attr(`goldprice`));
var num = $('.bottom .swiper .swiper-slide .div_active').attr(`num`);
getDataArr[0].fraction = Number($('.bottom .swiper .swiper-slide .div_active').attr(`ad`)) + goldprice * (val - num);
@@ -526,27 +512,47 @@ $('.investment .investment_in .but').click(function () {
} else {
console.log('減少了');
//--
// getDataArr[0].fraction = Number($('.speed_rogress .speed_rogress_top p span').text()) - ($('.bottom .swiper .swiper-slide .div_active strong i').text() - val) * goldprice;
var goldprice = Number($('.bottom .swiper .swiper-slide .div_active').attr(`goldprice`));
var num = $('.bottom .swiper .swiper-slide .div_active').attr(`num`);
getDataArr[0].fraction = Number($('.bottom .swiper .swiper-slide .div_active').attr(`ad`)) + goldprice * (val - num);
}
$('.bottom .swiper .swiper-slide .div_active strong i').text(val)
}
// else {
// if (isAdd) {
// // getDataArr[0].fraction = Number($('.speed_rogress .speed_rogress_top p span').text()) + goldprice;
// getDataArr[0].fraction = Number($('.speed_rogress .speed_rogress_top p span').text()) + goldprice * val;
// } else {
// // getDataArr[0].fraction = Number($('.speed_rogress .speed_rogress_top p span').text()) - goldprice;
// getDataArr[0].fraction = Number($('.speed_rogress .speed_rogress_top p span').text()) - ($('.bottom .swiper .swiper-slide .div_active strong i').text() - val) * goldprice;
// }
// }
$('.bottom .swiper .swiper-slide div').removeClass('div_active');
$('.investment').hide();
dataRendering(getDataArrIndex);
lastNum = $('.speed_rogress .speed_rogress_top p span').text();
isJL = false;
console.log($('.bottom .swiper .swiper-slide .div_active').index());
if (giftNum > 0) {
$('.bottom .swiper .swiper-slide .div_active strong i').addClass('iAct');
$('.bottom .swiper .swiper-slide .div_active').addClass('div_active1');
} else {
$('.bottom .swiper .swiper-slide .div_active strong i').removeClass('iAct');
$('.bottom .swiper .swiper-slide .div_active').removeClass('div_active1');
}
if (Number(lastNum) > Number(valArr[1])) {
$('.speed_rogress .speed_rogress_top p .span').addClass('spanAct');
} else {
$('.speed_rogress .speed_rogress_top p .span').removeClass('spanAct');
}
if (Number(lastNum) - Number(valArr[1]) > 1000) {
$('.investment2').show();
} else {
$('.investment').hide();
$('.bottom .swiper .swiper-slide div').removeClass('div_active');
}
})
// 取消提醒超出弹窗
$('.investment2 .investment_in .close').click(function () {
// $('.investment2').show();
$('.investment2').hide();
})
// 确认提醒超出弹窗
$('.investment2 .investment_in .ok').click(function () {
$('.bottom .swiper .swiper-slide div').removeClass('div_active');
$('.investment2').hide();
$('.investment').hide();
})
// 關閉投入
$('.investment .investment_in .closeBut').click(function () {
@@ -562,7 +568,6 @@ $('.investment .investment_in .closeBut').click(function () {
$('.investment .investment_in .num input').val(val);
$('.bottom .swiper .swiper-slide .div_active strong i').text(val);
dataRendering(getDataArrIndex);
// $('.bottom .swiper .swiper-slide div strong').hide();
$('.investment').hide();
})
@@ -577,40 +582,17 @@ $(".investment .investment_in .num input").on("input", function () {
var val = $(this).val();
var goldprice = Number($('.bottom .swiper .swiper-slide .div_active').attr(`goldprice`));
var num = $('.speed_rogress .speed_rogress_top p span').text();
// $('.bottom .swiper .swiper-slide .div_active strong i').text(val);
if (val > Number($('.bottom .swiper .swiper-slide .div_active strong b').text())) {
val = 0;
$(this).val(0);
toastMsg('超出已擁有數量');
toastMsg('背包庫存數量不足');
getDataArr[0].fraction = lastNum;
// $('.bottom .swiper .swiper-slide .div_active strong i').text("0");
} else if (val == '') {
val = 0;
$(this).val(0);
getDataArr[0].fraction = lastNum;
// $('.bottom .swiper .swiper-slide .div_active strong i').text(0);
}
// if (Number($('.speed_rogress .speed_rogress_top p span').text()) == 0 || Number($('.investment .investment_in .num input').val()) == 0) {
// if (Number($('.speed_rogress .speed_rogress_top p span').text()) == 0) {
// getDataArr[0].fraction = 123123123;
// } else {
// getDataArr[0].fraction = num;
// }
// } else {
// getDataArr[0].fraction = $(this).val() * goldprice + Number($('.speed_rogress .speed_rogress_top p span').text());
// }
// if ($('.speed_rogress .speed_rogress_top p span').text() == 0) {
// getDataArr[0].fraction = $(this).val() * goldprice + Number($('.speed_rogress .speed_rogress_top p span').text());
// } else if ($('.speed_rogress .speed_rogress_top p span').text() != 0) {
// getDataArr[0].fraction = Number($('.speed_rogress .speed_rogress_top p span').text()) + Number($(this).val())
// }
// if ($('.bottom .swiper .swiper-slide div strong i').text() == 00) {
// $('.bottom .swiper .swiper-slide div strong i').text(0)
// }
$(this).val(val);
// dataRendering(getDataArrIndex);
})
// 增加煉制按鈕
var number = 0;
@@ -630,23 +612,11 @@ $('.investment .investment_in .num .add').click(function (event) {
console.log(indes);
arrs[indes].goldprice = goldprice;
if (val > num) {
toastMsg('已超出現有數量');
toastMsg('背包庫存數量不足');
val = val - 1;
$('.bottom .swiper .swiper-slide .div_active').attr(`nums`, val);
arrs[indes].num = Number($('.bottom .swiper .swiper-slide .div_active').attr('nums'));
} else {//Number($('.speed_rogress .speed_rogress_top p span').text())
// getDataArr[0].fraction = Number($('.bottom .swiper .swiper-slide .div_active').attr(`ad`)) + goldprice * val;
// $('.bottom .swiper .swiper-slide .div_active').attr(`ad`, getDataArr[0].fraction);
// $('.bottom .swiper .swiper-slide .div_active').attr(`nums`, val);
// arrs[indes].num = Number($('.bottom .swiper .swiper-slide .div_active').attr('nums'));
// // if (isAdd) {
// arrs.forEach((res, index) => {
// number += res.num * res.goldprice;
// })
// getDataArr[0].fraction = number;
// console.log(arrs);
// console.log(number);
// }
} else {
var goldprice = Number($('.bottom .swiper .swiper-slide .div_active').attr(`goldprice`));
var num = $('.bottom .swiper .swiper-slide .div_active').attr(`num`);
getDataArr[0].fraction = Number($('.bottom .swiper .swiper-slide .div_active').attr(`ad`)) + goldprice * (val - num);
@@ -669,7 +639,6 @@ $('.investment .investment_in .num .reduce').click(function (event) {
} else {
var giftNum = objs[Number($('.bottom .swiper .swiper-slide .div_active').attr('giftid'))].num;
var goldprice = Number($('.bottom .swiper .swiper-slide .div_active').attr(`goldprice`));
//Number($('.speed_rogress .speed_rogress_top p span').text())
var num = $('.bottom .swiper .swiper-slide .div_active').attr(`num`);
//
console.log(Number($('.bottom .swiper .swiper-slide .div_active').attr(`ad`)));
@@ -678,7 +647,6 @@ $('.investment .investment_in .num .reduce').click(function (event) {
console.log(goldprice * (val - num));
getDataArr[0].fraction = Number($('.bottom .swiper .swiper-slide .div_active').attr(`ad`)) + goldprice * (val - num);
// $('.bottom .swiper .swiper-slide .div_active').attr(`ad`, getDataArr[0].fraction);
}
$('.bottom .swiper .swiper-slide .div_active').attr(`nums`, val);
// dataRendering(getDataArrIndex)
@@ -701,9 +669,9 @@ $('.refining .refining_in div .ok').click(function () {
}
})
// console.log('arr22222',arr2);
arr2.map((item,index)=>{
if(item.num !=''){
if(parseInt(item.num) != 0){
arr2.map((item, index) => {
if (item.num != '') {
if (parseInt(item.num) != 0) {
// console.log(item,index);
arr3.push(item)
}
@@ -715,7 +683,7 @@ $('.refining .refining_in div .ok').click(function () {
setTimeout(() => {
$('.header .luzi').css({ "background": "none" });
}, 120);
console.log('compoundParam',compoundParam);
console.log('compoundParam', compoundParam);
$('.refining').hide();
if (tabIndex == 0) {
svgaFun();
@@ -730,13 +698,13 @@ $('.refining .refining_in div .ok').click(function () {
contentType: 'application/json;charset=UTF-8',
url: urlPrefix + '/gift/compound',
data: JSON.stringify(compoundParam),
success(res) {
success (res) {
if (res.code === 200) {
$('.speed_rogress .speed_rogress_top p span').text(0)
$('.investment .investment_in .num input').val(0)
if (tabIndex == 0) {
$('.gxn .gxn_in .qb img').attr('src',res.data.picUrl);
$('.gxn .gxn_in .qb img').attr('src', res.data.picUrl);
$('.gxn .gxn_in p b').text(res.data.giftName);
changeTab(0)
noticeFun();
@@ -773,7 +741,7 @@ $('.refining .refining_in div .ok').click(function () {
}
hideLoading(layerIndex);
},
error(err) {
error (err) {
toastMsg('網絡錯誤,請退出重進');
}
})
@@ -851,14 +819,18 @@ $('.bottom .b_Top img').click(function () {
$('.bottom .swiper .swiper-slide').remove();
$('.investment .investment_in .num input').val(0)
$('.investment').hide();
$('.speed_rogress .speed_rogress_top .spanAct').removeClass('spanAct')
listUserBackpackFun();
changeTab(tabIndex)
noticeFun();
getXsDataFun();
getDataFun();
listUserBackpackFun();
})
// tab切換
var tabIndex = 0;
function changeTab(tabIndex) {
function changeTab (tabIndex) {
if (tabIndex == 0) {
$("body").css('background', '#462978');
$('.tab_wrap .tab_item').eq(0).find('img').attr('src', "./images/pt_tab_active.png");
@@ -965,7 +937,7 @@ $('.tab_wrap .tab_item').click(function () {
})
// 用戶首次進入限時爐引導
function firstEnterFun() {
function firstEnterFun () {
$('.step_wrap .step1').show();
$('.guide_mask').show();
}