|
@@ -164,6 +164,7 @@ var task = new Vue({
|
|
|
yureInfo: {
|
|
|
timerId: null,
|
|
|
tipText: '',
|
|
|
+ tipFloat: false,
|
|
|
buttonText: '点击免费领',
|
|
|
buttonDisabled: false
|
|
|
},
|
|
@@ -183,23 +184,27 @@ var task = new Vue({
|
|
|
className: 'first',
|
|
|
rate: 0, // 进度,单位%,最大为100
|
|
|
pointImg: '', // ''/unreceived/received
|
|
|
- anchorText: '0剑鱼币'
|
|
|
+ anchorText: '0'
|
|
|
},
|
|
|
{
|
|
|
- id: '800',
|
|
|
+ id: '1000',
|
|
|
className: 'unreceived',
|
|
|
- rate: 80,
|
|
|
+ rate: 66.67,
|
|
|
pointImg: 'unreceived',
|
|
|
- anchorText: '800剑鱼币',
|
|
|
- tipText: '1个月超级订阅'
|
|
|
+ anchorText: '1000',
|
|
|
+ tipText: '1个月超级订阅',
|
|
|
+ disabled: false,
|
|
|
+ buttonText: ''
|
|
|
},
|
|
|
{
|
|
|
id: '1500',
|
|
|
className: 'unreceived',
|
|
|
rate: 100,
|
|
|
pointImg: 'unreceived',
|
|
|
- anchorText: '1500剑鱼币',
|
|
|
- tipText: '1个月超级订阅'
|
|
|
+ anchorText: '1500',
|
|
|
+ tipText: '1个月超级订阅',
|
|
|
+ disabled: false,
|
|
|
+ buttonText: ''
|
|
|
}
|
|
|
],
|
|
|
},
|
|
@@ -218,7 +223,7 @@ var task = new Vue({
|
|
|
},
|
|
|
{
|
|
|
id: 'invite',
|
|
|
- className: 'delay-100',
|
|
|
+ className: '',
|
|
|
x: 2.84,
|
|
|
y: 0.06,
|
|
|
num: 500,
|
|
@@ -229,7 +234,7 @@ var task = new Vue({
|
|
|
},
|
|
|
{
|
|
|
id: 'share',
|
|
|
- className: 'delay-300',
|
|
|
+ className: '',
|
|
|
x: 4.8,
|
|
|
y: 0.82,
|
|
|
num: 200,
|
|
@@ -243,7 +248,7 @@ var task = new Vue({
|
|
|
rewardList: [],
|
|
|
dialog: {
|
|
|
show: false,
|
|
|
- giftMonth: 1,
|
|
|
+ text: '',
|
|
|
type: 'rule',
|
|
|
myReward: false // 奖励弹窗
|
|
|
},
|
|
@@ -280,7 +285,7 @@ var task = new Vue({
|
|
|
if (calcRate < 0) {
|
|
|
calcRate = 0
|
|
|
}
|
|
|
- return calcRate
|
|
|
+ return calcRate.toFixed(2) - 0
|
|
|
},
|
|
|
blinkTextShow: function () {
|
|
|
var anchorList = this.progress.anchorList
|
|
@@ -322,7 +327,11 @@ var task = new Vue({
|
|
|
var lastTimeConf = this.calcLastTimeDiff(this.lastTimestamp)
|
|
|
var days = lastTimeConf.days
|
|
|
if (this.yureInfo.buttonText) {
|
|
|
- return !(days < 1 && this.yureConf.total <= 0)
|
|
|
+ if (this.yureConf.got) {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return !(days < 1 && this.yureConf.total <= 0)
|
|
|
+ }
|
|
|
} else {
|
|
|
return false
|
|
|
}
|
|
@@ -337,13 +346,56 @@ var task = new Vue({
|
|
|
}
|
|
|
},
|
|
|
onKeyReceiveShow: function () {
|
|
|
- var arr = []
|
|
|
- this.couponList.forEach(function (item) {
|
|
|
- if (item.IsReceive === false && item.IsUser) {
|
|
|
- arr.push(item)
|
|
|
+ if (this.activeState !== 'activating') {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ var arr = []
|
|
|
+ this.couponList.forEach(function (item) {
|
|
|
+ if (item.IsReceive === false) {
|
|
|
+ arr.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return arr.length !== this.couponList.length
|
|
|
+ }
|
|
|
+ },
|
|
|
+ receiveActiveButton: function () {
|
|
|
+ var anchor1 = this.progress.anchorList[1]
|
|
|
+ var anchor2 = this.progress.anchorList[2]
|
|
|
+ var anchor = {}
|
|
|
+ var buttonText = '免费领1个月超级订阅'
|
|
|
+ var disabled = false
|
|
|
+
|
|
|
+ // 1. 第一个anchor未完成,则显示第一个(都未完成)--anchor1
|
|
|
+ // 2. 第一个anchor完成,未领取,第二个未完成--anchor1
|
|
|
+ // 3. 第一个anchor完成,已经领取,第二个未完成--anchor1
|
|
|
+ // 4. 第一个anchor完成,未领取,第二个完成,未领取(都未领取)--anchor1
|
|
|
+ // 5. 第一个anchor完成,已经领取,第二个完成,未领取--anchor2
|
|
|
+ // 6. 都完成都且都已经领取(都已经领取)--anchor1
|
|
|
+
|
|
|
+ var bothUnReceived = anchor1.className === 'unreceived' && anchor2.className === 'unreceived'
|
|
|
+ var bothWait = anchor1.className === 'wait' && anchor2.className === 'wait'
|
|
|
+ var bothReceived = anchor1.className === 'received' && anchor2.className === 'received'
|
|
|
+
|
|
|
+ if (anchor1.className === 'received' && anchor2.className !== 'unreceived') {
|
|
|
+ anchor = anchor2
|
|
|
+ } else {
|
|
|
+ anchor = anchor1
|
|
|
+ }
|
|
|
+
|
|
|
+ // 格式化文字
|
|
|
+ if (bothReceived) {
|
|
|
+ buttonText = '已领取2个月超级订阅'
|
|
|
+ disabled = true
|
|
|
+ } else if (anchor1.className === 'received') {
|
|
|
+ if (anchor2.className === 'unreceived') {
|
|
|
+ buttonText = '已领取1个月,继续任务,可再领一个月超级订阅'
|
|
|
+ disabled = true
|
|
|
}
|
|
|
- })
|
|
|
- return arr.length !== this.couponList.length
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$set(anchor, 'disabled', disabled)
|
|
|
+ this.$set(anchor, 'buttonText', buttonText)
|
|
|
+ return anchor
|
|
|
},
|
|
|
forbidClose: function () {
|
|
|
return this.dialog.type === 'over'
|
|
@@ -360,16 +412,17 @@ var task = new Vue({
|
|
|
},
|
|
|
mounted: function () {
|
|
|
// this.calcPointList()
|
|
|
- this.stickyTopEvents()
|
|
|
this.headerTransparent()
|
|
|
+ this.stickyTopEvents()
|
|
|
},
|
|
|
methods: {
|
|
|
add0: function (t) {
|
|
|
return t < 10 ? ('0' + t) : t
|
|
|
},
|
|
|
- dialogShow: function (type, show) {
|
|
|
+ dialogShow: function (type, show, text) {
|
|
|
this.dialog.type = type
|
|
|
this.dialog.show = show
|
|
|
+ this.dialog.text = text
|
|
|
},
|
|
|
ajaxActiveStatus: function () {
|
|
|
var _this = this
|
|
@@ -486,42 +539,43 @@ var task = new Vue({
|
|
|
clearInterval(this.yureInfo.timerId)
|
|
|
}
|
|
|
if (this.activeState === 'yureing') {
|
|
|
- // 当天时间
|
|
|
- var todayString = new Date().pattern('yyyy/MM/dd')
|
|
|
- // 当领券开始时间
|
|
|
- var yureCouponStartTime = [todayString, this.conf.clock].join(' ')
|
|
|
- var yureCouponStartStamp = +new Date(yureCouponStartTime)
|
|
|
- // 计算倒计时
|
|
|
- var diff = yureCouponStartStamp - Date.now()
|
|
|
- if (diff > 0) {
|
|
|
- // 预热当天未开始抢券
|
|
|
- buttonDisabled = true
|
|
|
- // 计算小时
|
|
|
- if (this.conf.clock) {
|
|
|
- var clockArr = this.conf.clock.split(':')
|
|
|
- buttonText = '今日'+ clockArr[0] +'点开抢'
|
|
|
- } else {
|
|
|
- buttonText = '今日10点开抢'
|
|
|
- }
|
|
|
- // 创建定时器刷新倒计时
|
|
|
- this.yureInfo.timerId = setInterval(function () {
|
|
|
- var d = yureCouponStartStamp - Date.now()
|
|
|
- var obj = _this.calcLastTimeDiff(d)
|
|
|
- if (d <= 0) {
|
|
|
- clearInterval(_this.yureInfo.timerId)
|
|
|
- _this.calcYuReText()
|
|
|
+ if (this.yureConf.got) {
|
|
|
+ // 已领取过
|
|
|
+ this.yureConf.tipFloat = true
|
|
|
+ buttonDisabled = false
|
|
|
+ buttonText = '去查看'
|
|
|
+ tipText = '已领取成功'
|
|
|
+ } else {
|
|
|
+ // 当天时间
|
|
|
+ var todayString = new Date().pattern('yyyy/MM/dd')
|
|
|
+ // 当领券开始时间
|
|
|
+ var yureCouponStartTime = [todayString, this.conf.clock].join(' ')
|
|
|
+ var yureCouponStartStamp = +new Date(yureCouponStartTime)
|
|
|
+ // 计算倒计时
|
|
|
+ var diff = yureCouponStartStamp - Date.now()
|
|
|
+ if (diff > 0) {
|
|
|
+ // 预热当天未开始抢券
|
|
|
+ buttonDisabled = true
|
|
|
+ // 计算小时
|
|
|
+ if (this.conf.clock) {
|
|
|
+ var clockArr = this.conf.clock.split(':')
|
|
|
+ buttonText = '今日'+ clockArr[0] +'点开抢'
|
|
|
} else {
|
|
|
- // 计算倒计时
|
|
|
- tipText = [_this.add0(obj.hours), _this.add0(obj.minutes), _this.add0(obj.seconds)].join(':')
|
|
|
- _this.yureInfo.tipText = tipText
|
|
|
+ buttonText = '今日10点开抢'
|
|
|
}
|
|
|
- }, 1000)
|
|
|
- } else {
|
|
|
- if (this.yureConf.got) {
|
|
|
- // 已领取过
|
|
|
- buttonDisabled = false
|
|
|
- buttonText = '去查看'
|
|
|
- tipText = '已领取成功'
|
|
|
+ // 创建定时器刷新倒计时
|
|
|
+ this.yureInfo.timerId = setInterval(function () {
|
|
|
+ var d = yureCouponStartStamp - Date.now()
|
|
|
+ var obj = _this.calcLastTimeDiff(d)
|
|
|
+ if (d <= 0) {
|
|
|
+ clearInterval(_this.yureInfo.timerId)
|
|
|
+ _this.calcYuReText()
|
|
|
+ } else {
|
|
|
+ // 计算倒计时
|
|
|
+ tipText = [_this.add0(obj.hours), _this.add0(obj.minutes), _this.add0(obj.seconds)].join(':')
|
|
|
+ _this.yureInfo.tipText = '开始倒计时:' + tipText
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
} else {
|
|
|
buttonDisabled = this.yureConf.total <= 0
|
|
|
// 券是否有剩余
|
|
@@ -530,8 +584,16 @@ var task = new Vue({
|
|
|
tipText = '今日还剩<span class="num">' + this.yureConf.total + '</span>份'
|
|
|
} else {
|
|
|
// 今日券领完了
|
|
|
- buttonText = '今天已抢完'
|
|
|
- tipText = '今天已经抢完啦~明天再来吧'
|
|
|
+ var obj = this.calcLastTimeDiff(this.lastTimestamp)
|
|
|
+ // 判断是否是预热最后一天
|
|
|
+ if (obj.days < 1) {
|
|
|
+ this.yureConf.tipFloat = true
|
|
|
+ buttonText = '今天已抢完'
|
|
|
+ tipText = '今天已经抢完啦~<br />更多福利明日即将开启'
|
|
|
+ } else {
|
|
|
+ buttonText = '今天已抢完'
|
|
|
+ tipText = '今天已经抢完啦~<br />明天再来吧'
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -542,6 +604,7 @@ var task = new Vue({
|
|
|
this.yureInfo.buttonDisabled = buttonDisabled
|
|
|
this.yureInfo.buttonText = buttonText
|
|
|
this.yureInfo.tipText = tipText
|
|
|
+ return this.yureInfo
|
|
|
},
|
|
|
calcLastTimeDiff: function (timestamp) {
|
|
|
var diff = moment.duration(Math.abs(timestamp))
|
|
@@ -595,8 +658,8 @@ var task = new Vue({
|
|
|
type: 'post',
|
|
|
success: function (res) {
|
|
|
if (res.data) {
|
|
|
+ _this.dialogShow('success', true, '7天')
|
|
|
_this.getYuReCouponCount()
|
|
|
- _this.$toast('领取成功')
|
|
|
// 刷新我的奖励列表
|
|
|
_this.getMissionList()
|
|
|
}
|
|
@@ -622,9 +685,8 @@ var task = new Vue({
|
|
|
if (coupons.length === 1) {
|
|
|
var item = coupons[0]
|
|
|
if (!item.IsReceive && item.IsUser) {
|
|
|
- this.toBuyVip()
|
|
|
+ return this.toBuyVip()
|
|
|
}
|
|
|
- return
|
|
|
}
|
|
|
var idArr = []
|
|
|
coupons.forEach(function (item) {
|
|
@@ -650,6 +712,7 @@ var task = new Vue({
|
|
|
_this.couponList.forEach(function (item) {
|
|
|
if (ids.indexOf(item.LotteryIdStr) !== -1) {
|
|
|
item.IsReceive = false
|
|
|
+ item.IsUser = true
|
|
|
}
|
|
|
})
|
|
|
_this.$toast('领取成功')
|
|
@@ -688,7 +751,7 @@ var task = new Vue({
|
|
|
for (var i = 0; i < priceArr.length; i++) {
|
|
|
if (priceArr[i].price - full >= 0) {
|
|
|
var pay = priceArr[i].price - reduce
|
|
|
- item.tipText = prefix + priceArr[i].text + ':券后' + pay + '元'
|
|
|
+ item.tipText = prefix + priceArr[i].text + ':券后<span class="num">' + pay + '</span>元'
|
|
|
break
|
|
|
}
|
|
|
}
|
|
@@ -770,7 +833,7 @@ var task = new Vue({
|
|
|
} else {
|
|
|
var text = '尚未达到领取条件,无法领取'
|
|
|
switch (item.id) {
|
|
|
- // 800
|
|
|
+ // 1000
|
|
|
case this.progressAnchorList[1].id: {
|
|
|
text = '尚未达到'+ this.progressAnchorList[1].id +'剑鱼币,无法领取'
|
|
|
break
|
|
@@ -822,12 +885,12 @@ var task = new Vue({
|
|
|
_this.$toast('已成功领取' + item.num + '剑鱼币', 1500)
|
|
|
break
|
|
|
}
|
|
|
- case '800': {
|
|
|
- _this.dialogShow('success', true)
|
|
|
+ case '1000': {
|
|
|
+ _this.dialogShow('success', true, '1个月')
|
|
|
break
|
|
|
}
|
|
|
case '1500': {
|
|
|
- _this.dialogShow('success', true)
|
|
|
+ _this.dialogShow('success', true, '1个月')
|
|
|
break
|
|
|
}
|
|
|
}
|
|
@@ -881,10 +944,10 @@ var task = new Vue({
|
|
|
'-1': 'received',
|
|
|
}
|
|
|
|
|
|
- _this.progress.anchorList[1].className = anchorStatus[res.data.schedule['800']]
|
|
|
+ _this.progress.anchorList[1].className = anchorStatus[res.data.schedule['1000']]
|
|
|
_this.progress.anchorList[2].className = anchorStatus[res.data.schedule['1500']]
|
|
|
|
|
|
- _this.progress.anchorList[1].pointImg = imgStatus[res.data.schedule['800']]
|
|
|
+ _this.progress.anchorList[1].pointImg = imgStatus[res.data.schedule['1000']]
|
|
|
_this.progress.anchorList[2].pointImg = imgStatus[res.data.schedule['1500']]
|
|
|
}
|
|
|
}
|
|
@@ -964,8 +1027,13 @@ var task = new Vue({
|
|
|
document.body.removeChild(input) // 最后删除实例中临时创建的input输入框,完成复制操作
|
|
|
},
|
|
|
scrollTo: function (className) {
|
|
|
+ var offsetTop = 0
|
|
|
+ if (utils.isWeiXinBrowser) {
|
|
|
+ offsetTop = $(className)[0].offsetTop - 72 - 6
|
|
|
+ } else {
|
|
|
+ offsetTop = $(className)[0].offsetTop - $('.jy-app-header').outerHeight() * 2
|
|
|
+ }
|
|
|
setTimeout(function () {
|
|
|
- var offsetTop = $(className)[0].offsetTop
|
|
|
$('#main-app').scrollTop(offsetTop)
|
|
|
}, 100)
|
|
|
},
|
|
@@ -973,7 +1041,11 @@ var task = new Vue({
|
|
|
var _this = this
|
|
|
var fixedTop = $('.fixed-top.top-timeline')
|
|
|
var scrollDOM = $('#main-app')
|
|
|
- var height = $('.header-banner').height()
|
|
|
+ if (utils.isWeiXinBrowser) {
|
|
|
+ var height = $('.header-banner').height() - 72 * 1.5
|
|
|
+ } else {
|
|
|
+ var height = $('.header-banner').height() - $('.jy-app-header').outerHeight() * 2
|
|
|
+ }
|
|
|
var showHide = function () {
|
|
|
var scrollTop = scrollDOM.scrollTop()
|
|
|
if (scrollTop > height) {
|
|
@@ -982,7 +1054,7 @@ var task = new Vue({
|
|
|
fixedTop.hide()
|
|
|
}
|
|
|
}
|
|
|
- showHide()
|
|
|
+ setTimeout(showHide, 200)
|
|
|
scrollDOM.on('scroll', function () {
|
|
|
showHide()
|
|
|
})
|
|
@@ -990,6 +1062,7 @@ var task = new Vue({
|
|
|
$(e.currentTarget).addClass('active').siblings().removeClass('active')
|
|
|
var className = $(e.currentTarget).attr('data-s-class')
|
|
|
_this.scrollTo('.' + className)
|
|
|
+ showHide()
|
|
|
})
|
|
|
},
|
|
|
headerTransparent: function () {
|