新增许愿之星

This commit is contained in:
Dragon
2024-02-26 10:25:02 +08:00
parent 62b59ca91a
commit 81d1f8e918
42 changed files with 2222 additions and 12 deletions

View File

@@ -270,7 +270,7 @@ body {
.page1 ul li .line .line_in img {
display: block;
height: 100%;
width: 10%;
width: 0%;
}
.page1 ul li .line p {
@@ -303,3 +303,793 @@ body {
bottom: 0.44rem;
right: 0.48rem;
}
.page2 {
display: none;
width: 9.36rem;
height: 11.94667rem;
background: #804030;
border-radius: 0.42667rem;
border: 0.02667rem solid #FFE478;
box-sizing: border-box;
margin: 0.66667rem auto 2.06667rem;
position: relative;
}
.page2 .listTab {
width: 5.94667rem;
height: 1.12rem;
position: absolute;
top: -0.56rem;
left: 50%;
transform: translateX(-50%);
display: flex;
justify-content: space-between;
}
.page2 .listTab div {
width: 50%;
height: 100%;
}
.page2 .tab1 {
background: url(../images/listTab1.png) no-repeat;
background-size: 100% 100%;
}
.page2 .tab2 {
background: url(../images/listTab2.png) no-repeat;
background-size: 100% 100%;
}
.page2 .listBox {
width: 9.33333rem;
height: 10.7rem;
margin: 1.09333rem auto 0;
overflow-y: scroll;
}
.page2 .listBox::-webkit-scrollbar {
display: none;
}
.page2 .listBox li {
width: 100%;
height: 2.13333rem;
background: #804030;
overflow: hidden;
}
.page2 .listBox li .num {
width: 0.97333rem;
height: 100%;
line-height: 2.13333rem;
text-align: center;
color: #FFFBE3;
font-size: 0.42667rem;
font-weight: 500;
margin-right: 0.18667rem;
float: left;
}
.page2 .listBox li .num1 {
width: 0.64rem;
height: 0.64rem;
background: url(../images/no1.png) no-repeat;
background-size: 100% 100%;
margin-right: 0.32rem;
}
.page2 .listBox li .num2 {
width: 0.64rem;
height: 0.64rem;
background: url(../images/no2.png) no-repeat;
background-size: 100% 100%;
margin-right: 0.32rem;
}
.page2 .listBox li .num3 {
width: 0.64rem;
height: 0.64rem;
background: url(../images/no3.png) no-repeat;
background-size: 100% 100%;
margin-right: 0.32rem;
}
.page2 .listBox li .tx {
display: block;
width: 1.28rem;
height: 1.28rem;
border-radius: 50%;
margin-top: 0.42667rem;
margin-right: 0.32rem;
float: left;
}
.page2 .listBox li .name {
width: 2.98667rem;
height: 100%;
line-height: 2.13333rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #FFFFFF;
font-size: 0.37333rem;
font-weight: 500;
float: left;
}
.page2 .listBox li .right {
width: 1.8rem;
text-align: center;
float: right;
margin-right: 0.64rem;
}
.page2 .listBox li .right p {
height: 0.58667rem;
line-height: 0.58667rem;
color: #FFFFFF;
font-size: 0.42667rem;
font-weight: 600;
margin-top: 0.50667rem;
margin-bottom: 0.10667rem;
}
.page2 .listBox li .right b {
color: #E6E2DC;
font-size: 0.29333rem;
font-weight: 400;
}
.page2 .listBox .li1 {
background: linear-gradient(270deg, rgba(255, 204, 0, 0) 0%, #FFD82C 100%);
}
.page2 .listBox .li2 {
background: linear-gradient(270deg, rgba(109, 139, 209, 0) 0%, #83CCFF 100%);
}
.page2 .listBox .li3 {
background: linear-gradient(270deg, rgba(163, 102, 46, 0) 0%, #DF893F 100%);
}
.page2 .my {
position: fixed;
bottom: 0;
left: 50%;
transform: translateX(-50%);
background: url(../images/myBg.png) no-repeat;
background-size: 100% 100%;
width: 10rem;
height: 2.02667rem;
}
.page2 .my .num {
width: 0.97333rem;
height: 100%;
line-height: 2.13333rem;
text-align: center;
color: #FFFBE3;
font-size: 0.42667rem;
font-weight: 500;
margin-right: 0.18667rem;
float: left;
}
.page2 .my .tx {
display: block;
width: 1.28rem;
height: 1.28rem;
border-radius: 50%;
margin-top: 0.42667rem;
margin-right: 0.32rem;
float: left;
}
.page2 .my .name {
width: 2.98667rem;
height: 100%;
line-height: 2.13333rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #FFFFFF;
font-size: 0.37333rem;
font-weight: 500;
float: left;
}
.page2 .my .right {
width: 1.8rem;
text-align: center;
float: right;
margin-right: 0.64rem;
}
.page2 .my .right p {
height: 0.58667rem;
line-height: 0.58667rem;
color: #FFFFFF;
font-size: 0.42667rem;
font-weight: 600;
margin-top: 0.50667rem;
margin-bottom: 0.10667rem;
}
.page2 .my .right b {
color: #E6E2DC;
font-size: 0.29333rem;
font-weight: 400;
}
.wishingPop {
display: none;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 999;
}
.wishingPop .wishingPop_in {
width: 7.92rem;
height: 7.73333rem;
position: relative;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #804030;
border-radius: 0.53333rem;
border: 0.02667rem solid #FFE478;
}
.wishingPop .wishingPop_in .wishIngtitle {
width: 4rem;
height: 1.12rem;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: -1.12rem;
}
.wishingPop .wishingPop_in h3 {
width: 100%;
text-align: center;
color: #E6E2DC;
font-size: 0.29333rem;
position: absolute;
top: 0.64rem;
left: 0;
}
.wishingPop .wishingPop_in .decrease {
width: 0.85333rem;
height: 0.85333rem;
position: absolute;
top: 1.38667rem;
left: 0.56rem;
}
.wishingPop .wishingPop_in input {
background: url(../images/wishingIput.png) no-repeat;
background-size: 100% 100%;
outline: none;
border: none;
position: absolute;
width: 4.88rem;
height: 0.85333rem;
left: 50%;
transform: translateX(-50%);
top: 1.38667rem;
text-align: center;
color: #8F392E;
font-size: 0.42667rem;
font-weight: 500;
}
.wishingPop .wishingPop_in .add {
width: 0.85333rem;
height: 0.85333rem;
position: absolute;
top: 1.38667rem;
right: 0.56rem;
}
.wishingPop .wishingPop_in .quickAddition {
width: 6.82667rem;
height: 0.8rem;
line-height: 0.8rem;
display: flex;
justify-content: space-between;
position: absolute;
top: 2.88rem;
left: 50%;
transform: translateX(-50%);
}
.wishingPop .wishingPop_in .quickAddition div {
width: 1.62667rem;
border-radius: 0.8rem;
text-align: center;
color: #8F392E;
font-size: 0.32rem;
background: #FFF3DB;
font-weight: 500;
}
.wishingPop .wishingPop_in .magicSticks {
width: 100%;
position: absolute;
top: 4.48rem;
left: 50%;
transform: translateX(-50%);
height: 0.58667rem;
line-height: 0.58667rem;
text-align: center;
color: #E6E2DC;
font-size: 0.29333rem;
font-weight: 400;
vertical-align: middle;
}
.wishingPop .wishingPop_in .magicSticks img {
display: inline-block;
width: 0.48rem;
height: 0.48rem;
vertical-align: middle;
}
.wishingPop .wishingPop_in .magicSticks b {
color: #fff;
font-size: 0.42667rem;
font-weight: 600;
vertical-align: middle;
}
.wishingPop .wishingPop_in .but {
width: 5.46667rem;
height: 1.28rem;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 0.85333rem;
}
.magicStick {
display: none;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 999;
}
.magicStick .magicStick_in {
width: 7.92rem;
height: 7.73333rem;
position: relative;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #804030;
border-radius: 0.53333rem;
border: 0.02667rem solid #FFE478;
}
.magicStick .magicStick_in .magicSticktitle {
width: 4rem;
height: 1.12rem;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: -1.12rem;
}
.magicStick .magicStick_in h3 {
width: 100%;
text-align: center;
color: #FFD4A6;
font-size: 0.42667rem;
position: absolute;
top: 0.64rem;
left: 0;
}
.magicStick .magicStick_in .decrease {
width: 0.85333rem;
height: 0.85333rem;
position: absolute;
top: 1.76rem;
left: 0.56rem;
}
.magicStick .magicStick_in input {
background: url(../images/wishingIput.png) no-repeat;
background-size: 100% 100%;
outline: none;
border: none;
position: absolute;
width: 4.88rem;
height: 0.85333rem;
left: 50%;
transform: translateX(-50%);
top: 1.76rem;
text-align: center;
color: #8F392E;
font-size: 0.42667rem;
font-weight: 500;
}
.magicStick .magicStick_in .add {
width: 0.85333rem;
height: 0.85333rem;
position: absolute;
top: 1.76rem;
right: 0.56rem;
}
.magicStick .magicStick_in .quickAddition {
width: 5.33333rem;
height: 0.8rem;
line-height: 0.8rem;
display: flex;
justify-content: space-between;
position: absolute;
top: 3.25333rem;
left: 50%;
transform: translateX(-50%);
}
.magicStick .magicStick_in .quickAddition div {
width: 1.62667rem;
border-radius: 0.8rem;
text-align: center;
color: #8F392E;
font-size: 0.32rem;
background: #FFF3DB;
font-weight: 500;
}
.magicStick .magicStick_in .magicSticks {
width: 100%;
position: absolute;
top: 4.6rem;
left: 50%;
transform: translateX(-50%);
height: 0.58667rem;
line-height: 0.58667rem;
text-align: center;
color: #E6E2DC;
font-size: 0.29333rem;
font-weight: 400;
vertical-align: middle;
}
.magicStick .magicStick_in .magicSticks img {
display: inline-block;
width: 0.48rem;
height: 0.48rem;
vertical-align: middle;
}
.magicStick .magicStick_in .magicSticks b {
color: #fff;
font-size: 0.42667rem;
font-weight: 600;
vertical-align: middle;
}
.magicStick .magicStick_in .but {
width: 5.46667rem;
height: 1.28rem;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 1.06667rem;
}
.magicStick .magicStick_in i {
font-style: normal;
width: 100%;
text-align: center;
color: #E6E2DC;
font-size: 0.29333rem;
font-weight: 400;
position: absolute;
left: 0;
bottom: 0.53333rem;
}
.rule {
display: none;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 999;
}
.rule .rule_in {
width: 8.4rem;
height: 9.33333rem;
position: relative;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #804030;
border-radius: 0.53333rem;
border: 0.02667rem solid #FFE478;
}
.rule .rule_in .ruleTitle {
width: 4rem;
height: 1.12rem;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: -1.12rem;
}
.rule .rule_in .ruleText {
width: 7.06667rem;
height: 8.3rem;
margin: 0.74667rem auto 0;
overflow-y: scroll;
color: #fff;
font-size: 0.32rem;
font-weight: 400;
}
.rule .rule_in .ruleText::-webkit-scrollbar {
display: none;
}
.record {
display: none;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 999;
}
.record .record_in {
width: 8.4rem;
height: 9.33333rem;
position: relative;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #804030;
border-radius: 0.53333rem;
border: 0.02667rem solid #FFE478;
}
.record .record_in .recordTitl {
width: 4rem;
height: 1.12rem;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: -1.12rem;
}
.record .record_in .recordtab {
width: 6.42667rem;
height: 0.90667rem;
display: flex;
justify-content: space-between;
margin: 0.50667rem auto 0.34667rem;
}
.record .record_in .recordtab div {
width: 2.8rem;
height: 100%;
}
.record .record_in .recordtab .tab1 {
background: url(../images/record2.png) no-repeat;
background-size: 100% 100%;
}
.record .record_in .recordtab .tab2 {
background: url(../images/record1.png) no-repeat;
background-size: 100% 100%;
}
.record .record_in .recordtab .act1 {
background: url(../images/recordAct1.png) no-repeat;
background-size: 100% 100%;
}
.record .record_in .recordtab .act2 {
background: url(../images/recordAct2.png) no-repeat;
background-size: 100% 100%;
}
.record .record_in .ul1 {
width: 8.4rem;
height: 7rem;
margin: 0 auto;
overflow-y: scroll;
}
.record .record_in .ul1::-webkit-scrollbar {
display: none;
}
.record .record_in .ul1 li {
width: 100%;
height: 1.2rem;
margin-bottom: 0.05333rem;
background: #8D4937;
display: flex;
justify-content: space-between;
overflow: hidden;
}
.record .record_in .ul1 li div {
width: 50%;
text-align: center;
color: #FFFFFF;
font-weight: 400;
text-align: center;
}
.record .record_in .ul1 li div p {
font-size: 0.32rem;
margin-top: 0.2rem;
margin-bottom: 0.06667rem;
}
.record .record_in .ul1 li div i {
font-style: normal;
font-size: 0.26667rem;
}
.record .record_in .ul1 .liAct {
background: #A65C46;
}
.record .record_in .ul2 {
display: none;
width: 8.4rem;
height: 7rem;
margin: 0 auto;
overflow-y: scroll;
}
.record .record_in .ul2::-webkit-scrollbar {
display: none;
}
.record .record_in .ul2 li {
width: 100%;
height: 1.2rem;
margin-bottom: 0.05333rem;
background: #8D4937;
display: flex;
justify-content: space-between;
overflow: hidden;
}
.record .record_in .ul2 li div {
width: 33.33333333%;
text-align: center;
color: #FFFFFF;
font-weight: 400;
text-align: center;
}
.record .record_in .ul2 li div p {
width: 100%;
font-size: 0.32rem;
margin-top: 0.24rem;
margin-bottom: 0.06667rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.record .record_in .ul2 li div i {
font-style: normal;
font-size: 0.26667rem;
}
.record .record_in .ul2 .liAct {
background: #A65C46;
}
.goToPay {
display: none;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 999;
}
.goToPay .goToPay_in {
width: 7.86667rem;
height: 4.96rem;
position: relative;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: url(../images/goToPay.png) no-repeat;
background-size: 100% 100%;
}
.goToPay .goToPay_in .but {
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 3.2rem;
width: 5.5rem;
height: 1.1rem;
}
.buySuccess {
display: none;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 999;
}
.buySuccess .buySuccess_in {
width: 7.86667rem;
height: 4.96rem;
position: relative;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #FFE3C7;
border-radius: 0.53333rem;
border: 0.02667rem solid #FFE478;
}
.buySuccess .buySuccess_in h3 {
position: absolute;
left: 0;
top: 0.53333rem;
color: #B52E1C;
font-size: 0.42667rem;
font-weight: 600;
text-align: center;
width: 100%;
}
.buySuccess .buySuccess_in p {
position: absolute;
left: 0;
top: 1.86667rem;
color: #FF5426;
font-size: 0.37333rem;
font-weight: 500;
text-align: center;
width: 100%;
}
.buySuccess .buySuccess_in .buySuccessBut {
position: absolute;
left: 50%;
transform: translateX(-50%);
width: 5.46667rem;
height: 1.28rem;
top: 3.14667rem;
}

View File

@@ -97,7 +97,9 @@ body {
}
}
// 页面一
.page1 {
// display: none;
width: px2rem(750);
height: px2rem(1007);
background: url(../images/page1Bg.png) no-repeat;
@@ -272,7 +274,7 @@ body {
img {
display: block;
height: 100%;
width: 10%;
width: 0%;
}
}
@@ -309,4 +311,807 @@ body {
}
}
}
}
// 页面二
.page2 {
display: none;
width: px2rem(702);
height: px2rem(896);
background: #804030;
border-radius: px2rem(32);
border: px2rem(2) solid #FFE478;
box-sizing: border-box;
margin: px2rem(50) auto px2rem(155);
position: relative;
// overflow: hidden;
.listTab {
width: px2rem(446);
height: px2rem(84);
position: absolute;
top: px2rem(-42);
left: 50%;
transform: translateX(-50%);
display: flex;
justify-content: space-between;
div {
width: 50%;
height: 100%;
}
}
.tab1 {
background: url(../images/listTab1.png) no-repeat;
background-size: 100% 100%;
}
.tab2 {
background: url(../images/listTab2.png) no-repeat;
background-size: 100% 100%;
}
.listBox {
width: px2rem(700);
height: 10.7rem;
margin: px2rem(82) auto 0;
overflow-y: scroll;
&::-webkit-scrollbar {
display: none;
}
li {
width: 100%;
height: px2rem(160);
background: #804030;
overflow: hidden;
.num {
width: px2rem(73);
height: 100%;
line-height: px2rem(160);
text-align: center;
color: #FFFBE3;
font-size: px2rem(32);
font-weight: 500;
margin-right: px2rem(14);
float: left;
}
.num1 {
width: px2rem(48);
height: px2rem(48);
background: url(../images/no1.png) no-repeat;
background-size: 100% 100%;
margin-right: px2rem(24);
}
.num2 {
width: px2rem(48);
height: px2rem(48);
background: url(../images/no2.png) no-repeat;
background-size: 100% 100%;
margin-right: px2rem(24);
}
.num3 {
width: px2rem(48);
height: px2rem(48);
background: url(../images/no3.png) no-repeat;
background-size: 100% 100%;
margin-right: px2rem(24);
}
.tx {
display: block;
width: px2rem(96);
height: px2rem(96);
border-radius: 50%;
margin-top: px2rem(32);
margin-right: px2rem(24);
float: left;
}
.name {
width: px2rem(224);
height: 100%;
line-height: px2rem(160);
//超出省略号
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #FFFFFF;
font-size: px2rem(28);
font-weight: 500;
float: left;
}
.right {
width: px2rem(135);
text-align: center;
float: right;
margin-right: px2rem(48);
p {
height: px2rem(44);
line-height: px2rem(44);
color: #FFFFFF;
font-size: px2rem(32);
font-weight: 600;
margin-top: px2rem(38);
margin-bottom: px2rem(8);
}
b {
color: #E6E2DC;
font-size: px2rem(22);
font-weight: 400;
}
}
}
.li1 {
background: linear-gradient(270deg, rgba(255, 204, 0, 0) 0%, #FFD82C 100%);
}
.li2 {
background: linear-gradient(270deg, rgba(109, 139, 209, 0) 0%, #83CCFF 100%);
}
.li3 {
background: linear-gradient(270deg, rgba(163, 102, 46, 0) 0%, #DF893F 100%);
}
}
.my {
position: fixed;
bottom: 0;
left: 50%;
transform: translateX(-50%);
background: url(../images/myBg.png) no-repeat;
background-size: 100% 100%;
width: px2rem(750);
height: px2rem(152);
.num {
width: px2rem(73);
height: 100%;
line-height: px2rem(160);
text-align: center;
color: #FFFBE3;
font-size: px2rem(32);
font-weight: 500;
margin-right: px2rem(14);
float: left;
}
.tx {
display: block;
width: px2rem(96);
height: px2rem(96);
border-radius: 50%;
margin-top: px2rem(32);
margin-right: px2rem(24);
float: left;
}
.name {
width: px2rem(224);
height: 100%;
line-height: px2rem(160);
//超出省略号
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #FFFFFF;
font-size: px2rem(28);
font-weight: 500;
float: left;
}
.right {
width: px2rem(135);
text-align: center;
float: right;
margin-right: px2rem(48);
p {
height: px2rem(44);
line-height: px2rem(44);
color: #FFFFFF;
font-size: px2rem(32);
font-weight: 600;
margin-top: px2rem(38);
margin-bottom: px2rem(8);
}
b {
color: #E6E2DC;
font-size: px2rem(22);
font-weight: 400;
}
}
}
}
// 许愿弹窗
.wishingPop {
display: none;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, .6);
z-index: 999;
.wishingPop_in {
width: px2rem(594);
height: px2rem(580);
position: relative;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #804030;
border-radius: px2rem(40);
border: px2rem(2) solid #FFE478;
.wishIngtitle {
width: px2rem(300);
height: px2rem(84);
position: absolute;
left: 50%;
transform: translateX(-50%);
top: px2rem(-84);
}
h3 {
width: 100%;
text-align: center;
color: #E6E2DC;
font-size: px2rem(22);
position: absolute;
top: px2rem(48);
left: 0;
}
.decrease {
width: px2rem(64);
height: px2rem(64);
position: absolute;
top: px2rem(104);
left: px2rem(42);
}
input {
background: url(../images/wishingIput.png) no-repeat;
background-size: 100% 100%;
outline: none;
border: none;
position: absolute;
width: px2rem(366);
height: px2rem(64);
left: 50%;
transform: translateX(-50%);
top: px2rem(104);
text-align: center;
color: #8F392E;
font-size: px2rem(32);
font-weight: 500;
}
.add {
width: px2rem(64);
height: px2rem(64);
position: absolute;
top: px2rem(104);
right: px2rem(42);
}
.quickAddition {
width: px2rem(512);
height: px2rem(60);
line-height: px2rem(60);
display: flex;
justify-content: space-between;
position: absolute;
top: px2rem(216);
left: 50%;
transform: translateX(-50%);
div {
width: px2rem(122);
border-radius: px2rem(60);
text-align: center;
color: #8F392E;
font-size: px2rem(24);
background: #FFF3DB;
font-weight: 500;
}
}
.magicSticks {
width: 100%;
position: absolute;
top: px2rem(336);
left: 50%;
transform: translateX(-50%);
height: px2rem(44);
line-height: px2rem(44);
text-align: center;
color: #E6E2DC;
font-size: px2rem(22);
font-weight: 400;
vertical-align: middle;
img {
display: inline-block;
width: px2rem(36);
height: px2rem(36);
vertical-align: middle;
}
b {
color: #fff;
font-size: px2rem(32);
font-weight: 600;
vertical-align: middle;
}
}
.but {
width: px2rem(410);
height: px2rem(96);
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: px2rem(64);
}
}
}
// 购买弹窗
.magicStick {
display: none;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, .6);
z-index: 999;
.magicStick_in {
width: px2rem(594);
height: px2rem(580);
position: relative;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #804030;
border-radius: px2rem(40);
border: px2rem(2) solid #FFE478;
.magicSticktitle {
width: px2rem(300);
height: px2rem(84);
position: absolute;
left: 50%;
transform: translateX(-50%);
top: px2rem(-84);
}
h3 {
width: 100%;
text-align: center;
color: #FFD4A6;
font-size: px2rem(32);
position: absolute;
top: px2rem(48);
left: 0;
}
.decrease {
width: px2rem(64);
height: px2rem(64);
position: absolute;
top: px2rem(132);
left: px2rem(42);
}
input {
background: url(../images/wishingIput.png) no-repeat;
background-size: 100% 100%;
outline: none;
border: none;
position: absolute;
width: px2rem(366);
height: px2rem(64);
left: 50%;
transform: translateX(-50%);
top: px2rem(132);
text-align: center;
color: #8F392E;
font-size: px2rem(32);
font-weight: 500;
}
.add {
width: px2rem(64);
height: px2rem(64);
position: absolute;
top: px2rem(132);
right: px2rem(42);
}
.quickAddition {
width: px2rem(400);
height: px2rem(60);
line-height: px2rem(60);
display: flex;
justify-content: space-between;
position: absolute;
top: px2rem(244);
left: 50%;
transform: translateX(-50%);
div {
width: px2rem(122);
border-radius: px2rem(60);
text-align: center;
color: #8F392E;
font-size: px2rem(24);
background: #FFF3DB;
font-weight: 500;
}
}
.magicSticks {
width: 100%;
position: absolute;
top: px2rem(345);
left: 50%;
transform: translateX(-50%);
height: px2rem(44);
line-height: px2rem(44);
text-align: center;
color: #E6E2DC;
font-size: px2rem(22);
font-weight: 400;
vertical-align: middle;
img {
display: inline-block;
width: px2rem(36);
height: px2rem(36);
vertical-align: middle;
}
b {
color: #fff;
font-size: px2rem(32);
font-weight: 600;
vertical-align: middle;
}
}
.but {
width: px2rem(410);
height: px2rem(96);
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: px2rem(80);
}
i {
font-style: normal;
width: 100%;
text-align: center;
color: #E6E2DC;
font-size: px2rem(22);
font-weight: 400;
position: absolute;
left: 0;
bottom: px2rem(40);
}
}
}
// 规则
.rule {
display: none;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, .6);
z-index: 999;
.rule_in {
width: px2rem(630);
height: px2rem(700);
position: relative;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #804030;
border-radius: px2rem(40);
border: px2rem(2) solid #FFE478;
.ruleTitle {
width: px2rem(300);
height: px2rem(84);
position: absolute;
left: 50%;
transform: translateX(-50%);
top: px2rem(-84);
}
.ruleText {
width: px2rem(530);
height: 8.3rem;
margin: px2rem(56) auto 0;
overflow-y: scroll;
color: #fff;
font-size: px2rem(24);
font-weight: 400;
&::-webkit-scrollbar {
display: none;
}
}
}
}
// 参与记录
.record {
display: none;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, .6);
z-index: 999;
.record_in {
width: px2rem(630);
height: px2rem(700);
position: relative;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #804030;
border-radius: px2rem(40);
border: px2rem(2) solid #FFE478;
.recordTitl {
width: px2rem(300);
height: px2rem(84);
position: absolute;
left: 50%;
transform: translateX(-50%);
top: px2rem(-84);
}
.recordtab {
width: px2rem(482);
height: px2rem(68);
display: flex;
justify-content: space-between;
margin: px2rem(38) auto px2rem(26);
div {
width: px2rem(210);
height: 100%;
}
.tab1 {
background: url(../images/record2.png) no-repeat;
background-size: 100% 100%;
}
.tab2 {
background: url(../images/record1.png) no-repeat;
background-size: 100% 100%;
}
.act1 {
background: url(../images/recordAct1.png) no-repeat;
background-size: 100% 100%;
}
.act2 {
background: url(../images/recordAct2.png) no-repeat;
background-size: 100% 100%;
}
}
.ul1 {
// display: none;
width: px2rem(630);
height: 7rem;
margin: 0 auto;
overflow-y: scroll;
&::-webkit-scrollbar {
display: none;
}
li {
width: 100%;
height: px2rem(90);
margin-bottom: px2rem(4);
background: #8D4937;
display: flex;
justify-content: space-between;
overflow: hidden;
div {
width: 50%;
text-align: center;
color: #FFFFFF;
font-weight: 400;
text-align: center;
p {
font-size: px2rem(24);
margin-top: px2rem(15);
margin-bottom: px2rem(5);
}
i {
font-style: normal;
font-size: px2rem(20);
}
}
}
.liAct {
background: #A65C46;
}
}
.ul2 {
display: none;
width: px2rem(630);
height: 7rem;
margin: 0 auto;
overflow-y: scroll;
&::-webkit-scrollbar {
display: none;
}
li {
width: 100%;
height: px2rem(90);
margin-bottom: px2rem(4);
background: #8D4937;
display: flex;
justify-content: space-between;
overflow: hidden;
div {
width: 33.33333333%;
text-align: center;
color: #FFFFFF;
font-weight: 400;
text-align: center;
p {
width: 100%;
font-size: px2rem(24);
margin-top: px2rem(18);
margin-bottom: px2rem(5);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
i {
font-style: normal;
font-size: px2rem(20);
}
}
}
.liAct {
background: #A65C46;
}
}
}
}
// 充值
.goToPay {
display: none;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, .6);
z-index: 999;
.goToPay_in {
width: px2rem(590);
height: px2rem(372);
position: relative;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: url(../images/goToPay.png) no-repeat;
background-size: 100% 100%;
.but {
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 3.2rem;
width: 5.5rem;
height: 1.1rem;
}
}
}
// 购买成功
.buySuccess {
display: none;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, .6);
z-index: 999;
.buySuccess_in {
width: px2rem(590);
height: px2rem(372);
position: relative;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #FFE3C7;
border-radius: px2rem(40);
border: px2rem(2) solid #FFE478;
h3 {
position: absolute;
left: 0;
top: px2rem(40);
color: #B52E1C;
font-size: px2rem(32);
font-weight: 600;
text-align: center;
width: 100%;
}
p {
position: absolute;
left: 0;
top: px2rem(140);
color: #FF5426;
font-size: px2rem(28);
font-weight: 500;
text-align: center;
width: 100%;
}
.buySuccessBut {
position: absolute;
left: 50%;
transform: translateX(-50%);
width: px2rem(410);
height: px2rem(96);
top: px2rem(236);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 562 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -26,7 +26,7 @@
<div class="tab2"></div>
</div>
</div>
<!-- 页面 -->
<!-- 页面1 -->
<div class="page1">
<!-- 我的魔法棒 -->
<div class="top">
@@ -54,13 +54,182 @@
<div class="line_in">
<img src="./images/line.png" alt="">
</div>
<p>1234/8888</p>
<p>0/0</p>
</div>
<div class="wishIng">已許願12</div>
<div class="wishIng">已許願0</div>
<img src="./images/wishIngBut.png" alt="" class="wishIngBut">
</li>
</ul>
</div>
<!-- 页面2 -->
<div class="page2">
<div class="listTab tab1">
<div></div>
<div></div>
</div>
<ul class="listBox">
<li>
<div class="num">1</div>
<img src="./images/logo.png" alt="" class="tx">
<div class="name">用户昵称</div>
<div class="right">
<p>0次</p>
<b>许愿获奖次数</b>
</div>
</li>
</ul>
<div class="my">
<div class="num">未上榜</div>
<img src="./images/logo.png" alt="" class="tx">
<div class="name">用户昵称</div>
<div class="right">
<p>0次</p>
<b>许愿获奖次数</b>
</div>
</div>
</div>
<!-- 参与许愿弹窗 -->
<div class="wishingPop">
<div class="wishingPop_in">
<!-- 标题 -->
<img src="./images/wishIngtitle.png" alt="" class="wishIngtitle">
<!-- h3 -->
<h3>参与许愿次数</h3>
<!---->
<img src="./images/decrease.png" alt="" class="decrease">
<!-- 输入框 -->
<input type="number" value="1">
<!---->
<img src="./images/add.png" alt="" class="add">
<!-- 快捷添加 -->
<div class="quickAddition">
<div num="1">+1次</div>
<div num="10">+10次</div>
<div num="100">+100次</div>
<div num="200">+200次</div>
</div>
<!-- 剩余魔法棒 -->
<div class="magicSticks">
我的魔法棒:
<img src="./images/star.png" alt="" class="star">
<b>0</b>
</div>
<img src="./images/wishIngOk.png" alt="" class="but">
</div>
</div>
<!-- 购买魔法棒弹窗 -->
<div class="magicStick">
<div class="magicStick_in">
<!-- 标题 -->
<img src="./images/magicSticktitle.png" alt="" class="magicSticktitle">
<!-- h3 -->
<h3>可用魔法棒不足,请购买/购买数量</h3>
<!---->
<img src="./images/decrease.png" alt="" class="decrease">
<!-- 输入框 -->
<input type="number" value="1">
<!---->
<img src="./images/add.png" alt="" class="add">
<!-- 快捷添加 -->
<div class="quickAddition">
<div num="1">+1次</div>
<div num="10">+10次</div>
<div num="100">+100次</div>
</div>
<!-- 剩余魔法棒 -->
<div class="magicSticks">
消耗:
<img src="./images/diamond.png" alt="" class="star">
<b>100</b>
</div>
<img src="./images/magicStickOk.png" alt="" class="but">
<i>1魔法棒=100鉆</i>
</div>
</div>
<!-- 活动规则弹窗 -->
<div class="rule">
<div class="rule_in">
<img src="./images/ruleTitle.png" alt="" class="ruleTitle">
<div class="ruleText">
规则
</div>
</div>
</div>
<!-- 参与记录 -->
<div class="record">
<div class="record_in">
<img src="./images/recordTitl.png" alt="" class="recordTitl">
<div class="recordtab">
<div class="tab1 act1"></div>
<div class="tab2"></div>
</div>
<ul class="ul1">
<li class="liAct">
<div class="left">
<p>00:00:00</p>
<i>2024-02-23</i>
</div>
<div class="right">
<p>獲得:禮物名稱</p>
<i>8888鉆石</i>
</div>
</li>
<li></li>
</ul>
<ul class="ul2">
<li class="liAct">
<div class="left">
<p>00:00:00</p>
<i>2024-02-23</i>
</div>
<div class="center">
<p>许愿:礼物名称</p>
<i>进行中</i>
</div>
<div class="right">
<p>我是用户昵</p>
<i>获得</i>
</div>
</li>
<li>
<div class="left">
<p>00:00:00</p>
<i>2024-02-23</i>
</div>
<div class="center">
<p>许愿:礼物名称</p>
<i>进行中</i>
</div>
<div class="right">
<p>我是用户昵</p>
<i>获得</i>
</div>
</li>
</ul>
</div>
</div>
<!-- 去充值弹窗 -->
<div class="goToPay">
<div class="goToPay_in">
<div class="but"></div>
</div>
</div>
<!-- 购买成功弹窗 -->
<div class="buySuccess">
<div class="buySuccess_in">
<h3>購買成功</h3>
<p>魔法棒+1</p>
<img src="./images/buySuccessBut.png" alt="" class="buySuccessBut">
</div>
</div>
</body>
</html>

View File

@@ -26,7 +26,8 @@ const toastMsg = (content = '操作完成', time = 2) => {
skin: 'msg'
})
}
var mymagicStickNum = 0;//魔法棒数量
var getRankType = 1;//1=今日奖励榜2=次数总榜
// 初始化函數
$(function () {
getInfoFromClient()
@@ -47,18 +48,81 @@ $(function () {
window.webkit.messageHandlers.closeWebView.postMessage(null)
}
})
// getConfig();
}, 100)
})
// 接口
function get () {
// 配置接口
function getConfig () {
$('.page1 ul li').remove()
// showLoading()
networkRequest({
type: 'get',
url: urlPrefix + '/promiseStar/getConfig',
success (res) {
if (res.code === 200) {
mymagicStickNum = res.data.userStickNum;
var str = '';
res.data.roundList.forEach(res => {
str += `
<li>
<div class="giftBox">
<img src="${res.giftImg}" alt="" class="giftImg">
</div>
<div class="giftInfo">
<b>${res.giftName}</b>
<img src="./images/diamond.png" alt="" class="diamond">
<i>${res.giftPrice}</i>
</div>
<div class="inventory">庫存${res.stockNum}</div>
<div class="schedule">許願進度</div>
<div class="line">
<div class="line_in">
<img style="width: ${res.process / res.max * 100 >= 100 ? '100' : res.process / res.max}%;" src="./images/line.png" alt="">
</div>
<p>${res.process}/${res.max}</p>
</div>
<div class="wishIng">已許願${res.userInputNum}次</div>
<img src="./images/wishIngBut.png" alt="" class="wishIngBut" roundId=${res.roundId} stockNum=${res.stockNum}>
</li>
`
});
$('.page1 ul').append(src);
} else {
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error (err) {
hideLoading(layerIndex)
toastMsg('網路錯誤,請退出重進')
}
})
}
// 购买魔法棒接口
function getRank (type) {
$('.page2 .listBox li').remove()
showLoading()
networkRequest({
type: 'get',
url: urlPrefix + '',
url: urlPrefix + '/promiseStar/getRank',
data: { type },
success (res) {
if (res.code === 200) {
var str = '';
res.data.rankList.forEach((res, i) => {
str += `
<li class='li1${i + 1}'>
<div class="num num${i + 1}">${i + 1 > 3 ? res.ranking : ''}</div>
<img src="${res.avatar}" alt="" class="tx">
<div class="name">${res.nick}</div>
<div class="right">
<p>${res.score}次</p>
<b>許願獲獎次數</b>
</div>
</li>
`
})
$('.page2 .listBox').append(str);
} else {
toastMsg(res.message)
}
@@ -75,4 +139,386 @@ $('.header .tabBox').on('click', ' div', function () {
var i = $(this).index() + 1;
$('.header .tabBox div').removeClass('act1').removeClass('act2');
$(this).addClass(`act${i}`);
})
$('.page1,.page2').hide();
$(`.page${i}`).show();
if (i == 2) {
getRank(getRankType);
}
})
// 榜单切换
$('.page2 .listTab div').click(function () {
var i = $(this).index() + 1;
$(this).parent('.listTab').removeClass('tab1').removeClass('tab2');
$(this).parent('.listTab').addClass(`tab${i}`)
getRankType = i;
getRank(getRankType);
})
// 打开活动规则弹窗
$('.header .rule_icon').click(function () {
$('.rule').show();
bodyScroolFun(true);
})
// 关闭活动规则弹窗
$('.rule').click(function () {
$('.rule').hide();
bodyScroolFun(false);
})
// 切换参与记录按钮
$('.record .record_in .recordtab div').click(function () {
var i = $(this).index() + 1;
$('.record .record_in .recordtab div').removeClass('act1').removeClass('act2');
$(this).addClass(`act${i}`);
$('.record .record_in .ul2,.record .record_in .ul1').hide();
$(`.record .record_in .ul${i}`).show();
return false;
})
var page = 1;
var isLock = true;
// 中奖记录接口
function listLuckyRecord (page) {
$('.record .record_in .ul1 li').remove();
networkRequest({
type: 'get',
url: urlPrefix + '/promiseStar/listLuckyRecord',
data: { page, pageSize: 10 },
success (res) {
if (res.code === 200) {
if (res.data.length == 0) {
isLock = false;
}
var str = '';
res.data.forEach((res, i) => {
str += `
<li class="${i % 2 == 0 ? '' : 'liAct'}">
<div class="left">
<p>${dateFormat(res.createTime, 'hh:mm:ss')}</p>
<i>${dateFormat(res.createTime, 'yyyy-MM-dd')}</i>
</div>
<div class="right">
<p>獲得:${res.gift.giftName}</p>
<i>${res.gift.goldPrice}鉆石)</i>
</div>
</li>
`
})
$('.record .record_in .ul1').append(str);
isLock = true;
} else {
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error (err) {
isLock = true;
hideLoading(layerIndex)
toastMsg('網路錯誤,請退出重進')
}
})
}
// 参与记录
function listRoundRecord (page) {
$('.record .record_in .ul2 li').remove();
networkRequest({
type: 'get',
url: urlPrefix + '/promiseStar/listRoundRecord',
data: { page, pageSize: 10 },
success (res) {
if (res.code === 200) {
if (res.data.length == 0) {
isLock = false;
}
var str = '';
res.data.forEach((res, i) => {
str += `
<li class="liAct">
<div class="left">
<p>${dateFormat(res.createTime, 'hh:mm:ss')}</p>
<i>${dateFormat(res.createTime, 'yyyy-MM-dd')}</i>
</div>
<div class="center">
<p>許願:${res.gift.giftName}</p>
<i>${res.luckyUser ? '已结束' : '進行中'}</i>
</div>
<div class="right">
<p>${res.luckyUser ? res.luckyUser.nick : ''}</p>
<i>${res.luckyUser ? '獲得' : ''}</i>
</div>
</li>
`
})
$('.record .record_in .ul2').append(str);
isLock = true;
} else {
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error (err) {
isLock = true;
hideLoading(layerIndex)
toastMsg('網路錯誤,請退出重進')
}
})
}
// 打开参与记录按钮
$('.header .record_icon').click(function () {
page = 1;
isLock = true;
showLoading();
listLuckyRecord(page);
$('.record').show();
bodyScroolFun(true);
})
// 监听滚动1
$('.record .record_in .ul1').scroll(function () {
let scrollTop = $(this).scrollTop()
let scrollHeight = $('.record .record_in .ul1')[0].scrollHeight
let ulHeight = $(this).innerHeight()
if (scrollTop + ulHeight + 100 >= scrollHeight) {
if (isLock) {
// 请求下一页
if (canNext) {
listLuckyRecord(page++)
isLock = false;
}
}
}
})
// 监听滚动2
$('.record .record_in .ul2').scroll(function () {
let scrollTop = $(this).scrollTop()
let scrollHeight = $('.record .record_in .ul2')[0].scrollHeight
let ulHeight = $(this).innerHeight()
if (scrollTop + ulHeight + 100 >= scrollHeight) {
if (isLock) {
// 请求下一页
if (canNext) {
listRoundRecord(page++)
isLock = false;
}
}
}
})
// 关闭参与记录按钮
$('.record').click(function () {
$('.record').hide();
bodyScroolFun(false);
})
// 关闭去充值弹窗
$('.goToPay').click(function () {
$('.goToPay').hide();
bodyScroolFun(false);
})
// 关闭购买成功按钮
$('.buySuccess .buySuccess_in .buySuccessBut').click(function () {
$('.buySuccess').hide();
bodyScroolFun(false);
})
// 去充值按钮
$('.goToPay .goToPay_in .but').click(function () {
if (browser.app) {
if (browser.android) {
let channel = pubInfo.deviceInfo.channel;
console.log(pubInfo.deviceInfo);
if (channel == "google") {
window.androidJsObj.openChargePage(6);
} else {
window.androidJsObj.openChargePage(6);
window.location.href = urlPrefix + '/peko/modules/pay/index.html?channelType=4';
}
} else if (browser.ios) {
let channel = pubInfo.deviceInfo.channel;
if (channel == "appstore") {
window.webkit.messageHandlers.openChargePage.postMessage(null);
} else {
window.webkit.messageHandlers.chargePayClickPage.postMessage(6);
window.location.href = urlPrefix + '/peko/modules/pay/index.html?channelType=4';
}
}
} else {
toastMsg('請在app內打開')
}
$('.goToPay').hide();
bodyScroolFun(false);
return false;
})
var magicStickNum = 1;
function magicStick (type, num) {
magicStickNum = Number($('.magicStick .magicStick_in input').val());
if (type == 1) {
// 加
magicStickNum++;
} else if (type == 2) {
// 减
magicStickNum--;
} else if (type == 3) {
// 快捷购买
magicStickNum += num;
} else {
}
magicStickNum <= 1 ? magicStickNum = 1 : magicStickNum = magicStickNum;
magicStickNum >= 99999999 ? magicStickNum = 99999999 : magicStickNum = magicStickNum;
$('.magicStick .magicStick_in .magicSticks b').text(magicStickNum * 100);
$('.magicStick .magicStick_in input').val(magicStickNum);
}
// 打开购买魔法棒弹窗
$('.page1 .top .but').click(function () {
$('.magicStick .magicStick_in h3').text('購買數量');
$('.magicStick').show();
bodyScroolFun(true);
})
// 魔法棒加弹窗
$('.magicStick .magicStick_in .add').click(function () {
magicStick(1)
return false;
})
// 魔法棒减弹窗
$('.magicStick .magicStick_in .decrease').click(function () {
magicStick(2)
return false;
})
// 魔法棒快捷购买弹窗
$('.magicStick .magicStick_in .quickAddition div').click(function () {
var num = Number($(this).attr('num'));
magicStick(3, num)
return false;
})
// 监听输入框的变化
$('.magicStick .magicStick_in input').on('input', function () {
magicStick();
})
// 魔法棒输入框弹窗
$('.magicStick .magicStick_in input').click(function () {
return false;
})
// 关闭购买魔法棒弹窗
$('.magicStick').click(function () {
$('.magicStick').hide();
bodyScroolFun(false);
})
// 确认购买魔法棒按钮
$('.magicStick .magicStick_in .but').click(function () {
buyStick(magicStickNum)
bodyScroolFun(false);
})
// 购买魔法棒
function buyStick (num) {
showLoading()
networkRequest({
type: 'get',
url: urlPrefix + '/promiseStar/buyStick',
data: { num },
success (res) {
if (res.code === 200) {
getConfig();
$('.buySuccess p').tetx(`魔法棒${num}`);
$('.buySuccess').show();
bodyScroolFun(true);
magicStickNum = 1;
$('.magicStick .magicStick_in .magicSticks b').text(0);
} else if (res.code === 31005) {
$('.goToPay').show();
bodyScroolFun(true);
} else {
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error (err) {
hideLoading(layerIndex)
toastMsg('網路錯誤,請退出重進')
}
})
}
var wishingNum = 1;
function wishing (type, num) {
wishingNum = Number($('.wishingPop .wishingPop_in input').val());
if (type == 1) {
// 加
wishingNum++;
} else if (type == 2) {
// 减
wishingNum--;
} else if (type == 3) {
// 快捷购买
wishingNum += num;
} else {
}
wishingNum <= 1 ? wishingNum = 1 : wishingNum = wishingNum;
wishingNum >= 99999999 ? wishingNum = 99999999 : wishingNum = wishingNum;
$('.wishingPop .wishingPop_in input').val(wishingNum);
}
// 许愿加弹窗
$('.wishingPop .wishingPop_in .add').click(function () {
wishing(1)
return false;
})
// 许愿减弹窗
$('.wishingPop .wishingPop_in .decrease').click(function () {
wishing(2)
return false;
})
// 许愿快捷购买弹窗
$('.wishingPop .wishingPop_in .quickAddition div').click(function () {
var num = Number($(this).attr('num'));
wishing(3, num)
return false;
})
// 监听输入框的变化
$('.wishingPop .wishingPop_in input').on('input', function () {
wishing();
})
// 许愿输入框弹窗
$('.wishingPop .wishingPop_in input').click(function () {
return false;
})
// 关闭许愿弹窗
$('.wishingPop').click(function () {
$('.wishingPop').hide();
bodyScroolFun(false);
})
// 许愿按钮
var roundId;
$('.page1 ul li').on('click', '.wishIngBut', function () {
var stockNum = $(this).attr('stockNum');
roundId = $(this).attr('roundId');
if (stockNum == 0) {
toastMsg('该礼物库存不足,无法进行许愿');
return;
}
$('.wishingPop').show();
})
// 确认许愿按钮
$('.wishingPop .wishingPop_in .but').click(function () {
console.log(wishingNum < mymagicStickNum);
if (wishingNum > mymagicStickNum) {
$('.magicStick .magicStick_in h3').text('可用魔法棒不足,请购买');
$('.magicStick').show();
bodyScroolFun(true);
} else {
promise(wishingNum, roundId);
bodyScroolFun(false);
}
})
// 许愿接口
function promise (num, roundId) {
showLoading()
networkRequest({
type: 'post',
url: urlPrefix + '/promiseStar/promise',
data: { num, roundId },
success (res) {
if (res.code === 200) {
toastMsg('参与许愿成功')
} else {
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error (err) {
hideLoading(layerIndex)
toastMsg('網路錯誤,請退出重進')
}
})
}