糖果树活动繁体化;解决分享房间跳转anan问题

This commit is contained in:
Dragon
2022-10-19 12:03:56 +08:00
parent da573576c3
commit f06130c08b
6 changed files with 34 additions and 34 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 KiB

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

@@ -5,7 +5,7 @@ if (env == 'test') {
new VConsole(); new VConsole();
} }
// 封layer消息提醒框 // 封layer消息提醒框
let layerIndex let layerIndex
const showLoading = (content = '加載中...') => { const showLoading = (content = '加載中...') => {
layer.open({ layer.open({
@@ -28,10 +28,10 @@ const toastMsg = (content = '操作完成', time = 2) => {
}) })
} }
// 取用信息 // 取用信息
let isGetUserInfoInterFace //是否取到人信息接口 let isGetUserInfoInterFace //是否取到人信息接口
const getUserInfo = (param) => { const getUserInfo = (param) => {
showLoading('获取个人信息中...') showLoading('獲取個人信息中...')
networkRequest({ networkRequest({
type: 'GET', type: 'GET',
url: urlPrefix + '/activities/draw/queryTicketNum', url: urlPrefix + '/activities/draw/queryTicketNum',
@@ -68,11 +68,11 @@ const getUserInfo = (param) => {
}) })
} }
// 获取礼包信息 // 獲取禮包信息
let isGetListPackInterFace //是否取到包接口 let isGetListPackInterFace //是否取到包接口
let listPack = [] let listPack = []
const getListPack = () => { const getListPack = () => {
showLoading('获取礼包信息中...') showLoading('獲取禮包信息中...')
networkRequest({ networkRequest({
type: 'POST', type: 'POST',
url: urlPrefix + '/activities/draw/getPackList', url: urlPrefix + '/activities/draw/getPackList',
@@ -97,18 +97,18 @@ const getListPack = () => {
}) })
} }
// 渲染 // 渲染
let arrTips = [ let arrTips = [
'送糖果1', '送糖果1',
'随机赠送糖果7-10', '隨機贈送糖果7-10',
'随机赠送糖果70-100', '隨機贈送糖果70-100',
'随机赠送糖果700-1000', '隨機贈送糖果700-1000',
] ]
const renderList = () => { const renderList = () => {
listPack.map((item, index) => { listPack.map((item, index) => {
let $li = $('ul.buy-area li').eq(index) let $li = $('ul.buy-area li').eq(index)
$li.find('.headwear-name').html(item.name) $li.find('.headwear-name').html(item.name)
$li.find('.headwear-price').html(item.sellingPrice + '石/天') $li.find('.headwear-price').html(item.sellingPrice + '石/天')
$li.find('.headwear-award').html(arrTips[index]) $li.find('.headwear-award').html(arrTips[index])
$('.content span').eq(index).html(item.name) $('.content span').eq(index).html(item.name)
@@ -122,7 +122,7 @@ const renderList = () => {
}) })
} }
//只有两个接口都求到数据,才渲染默认页 //只有兩個接口都求到數據,才渲染默認頁
const isShow = () => { const isShow = () => {
if(isGetListPackInterFace && isGetUserInfoInterFace){ if(isGetListPackInterFace && isGetUserInfoInterFace){
hideLoading(layerIndex) hideLoading(layerIndex)
@@ -139,13 +139,13 @@ $(function(){
getListPack() getListPack()
}, 50) }, 50)
// 点击玩法介绍按钮 // 點擊玩法介紹按鈕
$('.rule-btn').on('click', function () { $('.rule-btn').on('click', function () {
$('.shade').fadeIn(300) $('.shade').fadeIn(300)
$('.rule-mask').fadeIn(300) $('.rule-mask').fadeIn(300)
$('body').css('overflow', 'hidden') $('body').css('overflow', 'hidden')
}) })
// 关闭规则弹 // 關閉規則彈
$('.rule-mask .cancel').on('click', function(){ $('.rule-mask .cancel').on('click', function(){
$('.shade').fadeOut(300) $('.shade').fadeOut(300)
$('.rule-mask').fadeOut(300) $('.rule-mask').fadeOut(300)
@@ -162,11 +162,11 @@ $(function(){
e.stopPropagation() e.stopPropagation()
}) })
// 监听购买按钮点击事件 // 監聽購買按鈕點擊事件
$('ul.buy-area').on('click', '.buy-btn', function(){ $('ul.buy-area').on('click', '.buy-btn', function(){
console.log($(this).data()); console.log($(this).data());
if (!$(this).data('name') || !$(this).data('day') || !$(this).data('gold') || !$(this).data('giftId')) { if (!$(this).data('name') || !$(this).data('day') || !$(this).data('gold') || !$(this).data('giftId')) {
toastMsg('包信息不完整') toastMsg('包信息不完整')
return return
} }
@@ -186,7 +186,7 @@ $(function(){
$('.shade-mask-buy').fadeIn(50) $('.shade-mask-buy').fadeIn(50)
$('body').css('overflow', 'hidden') $('body').css('overflow', 'hidden')
}) })
// 关闭购买弹 // 關閉購買彈
$('.buy-confirm-btn .cancel').on('click', function(){ $('.buy-confirm-btn .cancel').on('click', function(){
$('.shade-mask-buy').fadeOut(50) $('.shade-mask-buy').fadeOut(50)
$('body').css('overflow', 'auto') $('body').css('overflow', 'auto')
@@ -198,7 +198,7 @@ $(function(){
$('.shade-content-buy').on('click', function(e){ $('.shade-content-buy').on('click', function(e){
e.stopPropagation() e.stopPropagation()
}) })
// 增加购买数 // 增加購買數
$('.increase').on('click', function(){ $('.increase').on('click', function(){
if(giftObj['num']<999){ if(giftObj['num']<999){
giftObj['num']++; giftObj['num']++;
@@ -208,10 +208,10 @@ $(function(){
$('.buy-day span').html(giftObj['day']) $('.buy-day span').html(giftObj['day'])
$('.buy-price span').html(allPrice) $('.buy-price span').html(allPrice)
}else{ }else{
toastMsg('单次购买数量最多999') toastMsg('單次購買數量最多999')
} }
}) })
// 减少购买数 // 減少購買數
$('.decrease').on('click', function(){ $('.decrease').on('click', function(){
if($('.inputNum').val()>0){ if($('.inputNum').val()>0){
giftObj['num']--; giftObj['num']--;
@@ -221,14 +221,14 @@ $(function(){
$('.buy-day span').html(giftObj['day']) $('.buy-day span').html(giftObj['day'])
$('.buy-price span').html(allPrice) $('.buy-price span').html(allPrice)
}else{ }else{
toastMsg('最少购买数量为1') toastMsg('最少購買數量為1')
} }
}) })
// 手动输入购买数 // 手動輸入購買數
$('.inputNum').on('input', function(){ $('.inputNum').on('input', function(){
let exp = /^[0-9]+$/ let exp = /^[0-9]+$/
if (!exp.test($(this).val())) { if (!exp.test($(this).val())) {
toastMsg('请输入数字') toastMsg('請輸入數字')
return return
} }
if($(this).val() > 999){ if($(this).val() > 999){
@@ -242,17 +242,17 @@ $(function(){
$('.buy-day span').html(giftObj['day']) $('.buy-day span').html(giftObj['day'])
$('.buy-price span').html(allPrice) $('.buy-price span').html(allPrice)
}) })
// 确认购买 // 確認購買
let lock = false let lock = false
$('.confirm').on('click', function(){ $('.confirm').on('click', function(){
let exp = /^[0-9]+$/ let exp = /^[0-9]+$/
if(!exp.test($('.inputNum').val())){ if(!exp.test($('.inputNum').val())){
toastMsg('请输入数字') toastMsg('請輸入數字')
$('.inputNum').val(1) $('.inputNum').val(1)
return return
} }
if($('.inputNum').val() == 0){ if($('.inputNum').val() == 0){
return toastMsg('最少购买数量为1') return toastMsg('最少購買數量為1')
} }
if(!lock){ if(!lock){
lock = true lock = true
@@ -270,7 +270,7 @@ $(function(){
getUserInfo(res.data) getUserInfo(res.data)
$('.shade-mask-buy').hide() $('.shade-mask-buy').hide()
$('.shade').fadeIn(300) $('.shade').fadeIn(300)
$('.shade-mask-success .tip').html(`获赠糖果x` + giftObj.ticketNum * giftObj.num) $('.shade-mask-success .tip').html(`獲贈糖果x` + giftObj.ticketNum * giftObj.num)
$('.shade-mask-success').fadeIn() $('.shade-mask-success').fadeIn()
}else if(res.code === 2103){ }else if(res.code === 2103){
$('.shade-mask-buy').hide() $('.shade-mask-buy').hide()
@@ -289,13 +289,13 @@ $(function(){
} }
}) })
// 关闭购买成功 // 關閉購買成功
$('.in-btn').on('click', function(){ $('.in-btn').on('click', function(){
$('.shade-mask-success').fadeOut() $('.shade-mask-success').fadeOut()
$('.shade').fadeOut() $('.shade').fadeOut()
$('body').css('overflow', 'auto') $('body').css('overflow', 'auto')
}) })
// 跳充值 // 跳充值
$('.recharge').on('click', function(){ $('.recharge').on('click', function(){
$('.shade-mask-no-money').fadeOut(300) $('.shade-mask-no-money').fadeOut(300)
$('.shade').fadeOut(300) $('.shade').fadeOut(300)
@@ -307,11 +307,11 @@ $(function(){
window.webkit.messageHandlers.openChargePage.postMessage(null) window.webkit.messageHandlers.openChargePage.postMessage(null)
} }
}else{ }else{
toastMsg('在app内打开') toastMsg('在app內打開')
} }
}) })
//充值面返回活动页面 重新求用信息接口 //充值面返回活動頁面 重新求用信息接口
var hiddenProperty = 'hidden' in document ? 'hidden' : var hiddenProperty = 'hidden' in document ? 'hidden' :
'webkitHidden' in document ? 'webkitHidden' : 'webkitHidden' in document ? 'webkitHidden' :
'mozHidden' in document ? 'mozHidden' : null; 'mozHidden' in document ? 'mozHidden' : null;

View File

@@ -59,7 +59,7 @@
<script src="../../common/js/common2.js"></script> <script src="../../common/js/common2.js"></script>
<script src="../../common/js/vconsole.min.js"></script> <script src="../../common/js/vconsole.min.js"></script>
<!-- <script src="./js/moblink.js"></script> --> <!-- <script src="./js/moblink.js"></script> -->
<script type="text/javascript" src="//bvgw.t4m.cn/applink.js"></script> <script type="text/javascript" src="//cebg.t4m.cn/applink.js"></script>
<script src="js/index.js?v=2.0"></script> <script src="js/index.js?v=2.0"></script>
</body> </body>