糖果树活动繁体化;解决分享房间跳转anan问题
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 2.3 MiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 58 KiB |
@@ -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;
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|