|
@@ -1,8 +1,3 @@
|
|
|
-var headers = {
|
|
|
- userId: '6103bb722abfa5f4d81bb1d1',
|
|
|
- Cookie: 'SESSIONID=c18b6791dd8a5806bfd26f7e0d29d8aafad33e1c'
|
|
|
-}
|
|
|
-
|
|
|
function Point (x, y) {
|
|
|
this.x = x
|
|
|
this.y = y
|
|
@@ -136,7 +131,7 @@ function activeOverCheck (endTime, callback) {
|
|
|
|
|
|
// toast上限提示
|
|
|
function toastFn (text, duration) {
|
|
|
- if (duration) {
|
|
|
+ if (!duration) {
|
|
|
duration = 1000
|
|
|
}
|
|
|
var _html = ""
|
|
@@ -430,6 +425,28 @@ var task = new Vue({
|
|
|
this.activeState = state
|
|
|
return state
|
|
|
},
|
|
|
+ // type=yure判断预热是否开始
|
|
|
+ // type=active 判断活动是否开始
|
|
|
+ activeNotStartToast: function (type) {
|
|
|
+ var state = this.checkActiveState()
|
|
|
+ type = type || 'active'
|
|
|
+ if (state === 'ended') {
|
|
|
+ toastFn('活动已结束')
|
|
|
+ } else if (state === 'waiting') {
|
|
|
+ toastFn('活动尚未开始,敬请期待')
|
|
|
+ } else {
|
|
|
+ if (type === 'yure') {
|
|
|
+ if (state === 'activating') {
|
|
|
+ // 预热已结束
|
|
|
+ toastFn('预热已结束')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (state === 'yureing') {
|
|
|
+ toastFn('活动尚未开始,敬请期待')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
startTopTimer: function () {
|
|
|
var _this = this
|
|
|
var start = this.conf.start * 1000
|
|
@@ -447,7 +464,7 @@ var task = new Vue({
|
|
|
var tipText = ''
|
|
|
var buttonDisabled = true
|
|
|
if (this.yureInfo.timerId) {
|
|
|
- clearInterval(timerId)
|
|
|
+ clearInterval(this.yureInfo.timerId)
|
|
|
}
|
|
|
if (this.activeState === 'yureing') {
|
|
|
// 当天时间
|
|
@@ -531,8 +548,12 @@ var task = new Vue({
|
|
|
},
|
|
|
receiveYuReCoupon: function () {
|
|
|
if (this.yureInfo.buttonDisabled) {
|
|
|
- // toastFn('活动尚未开始,敬请期待')
|
|
|
+ toastFn('活动尚未开始,敬请期待')
|
|
|
+ } else if (this.yureInfo.buttonText === '去查看') {
|
|
|
+ // 领过了
|
|
|
+ this.toBuyVip()
|
|
|
} else {
|
|
|
+ // 没领过
|
|
|
this.receiveYuReCouponAjax()
|
|
|
}
|
|
|
},
|
|
@@ -550,18 +571,20 @@ var task = new Vue({
|
|
|
})
|
|
|
},
|
|
|
receiveActiveButtonText: function (item) {
|
|
|
- if (item.IsUser) {
|
|
|
- if (item.IsReceive) {
|
|
|
- return '立即领取'
|
|
|
- } else {
|
|
|
+ if (item.IsReceive) {
|
|
|
+ return '立即领取'
|
|
|
+ } else {
|
|
|
+ if (item.IsUser) {
|
|
|
return '去使用'
|
|
|
+ } else {
|
|
|
+ return '已使用'
|
|
|
}
|
|
|
- } else {
|
|
|
- return '已使用'
|
|
|
}
|
|
|
},
|
|
|
receiveActiveCoupon: function (coupons) {
|
|
|
- if (this.activeState !== 'activating') return toastFn('活动尚未开始,敬请期待')
|
|
|
+ if (this.activeState !== 'activating') {
|
|
|
+ return this.activeNotStartToast()
|
|
|
+ }
|
|
|
if (coupons.length === 0) return
|
|
|
if (coupons.length === 1) {
|
|
|
var item = coupons[0]
|
|
@@ -649,19 +672,6 @@ var task = new Vue({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 领取福利2优惠券
|
|
|
- receiveFuLi2Coupon: function () {
|
|
|
- var _this = this
|
|
|
- $.ajax({
|
|
|
- url: '/jyActivity/membershipDay/getDailyBoonSVip',
|
|
|
- type: 'post',
|
|
|
- success: function (res) {
|
|
|
- if (res.data) {
|
|
|
- console.log('领取成功')
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
calcPointList: function () {
|
|
|
var dom = this.$refs.missions
|
|
|
window.points = new RandomCoordinate({
|
|
@@ -694,8 +704,10 @@ var task = new Vue({
|
|
|
onClickListItem: function (item) {
|
|
|
if (item.icon === 'jy-svip') {
|
|
|
window.open('/front/swordfish/toMyOrder')
|
|
|
- } else {
|
|
|
+ } else if (item.icon === 'jy-coin') {
|
|
|
window.open('/swordfish/integral/index/detail')
|
|
|
+ } else {
|
|
|
+ this.toBuyVip()
|
|
|
}
|
|
|
},
|
|
|
onClickReceive: function (type, item) {
|
|
@@ -838,9 +850,17 @@ var task = new Vue({
|
|
|
if (res.error_code === 0 && res.data) {
|
|
|
if (res.data.list && typeof res.data.list.map === 'function') {
|
|
|
_this.rewardList = res.data.list.map(function (v) {
|
|
|
+ var icon = ''
|
|
|
+ if (v.award.indexOf('剑鱼币') > -1) {
|
|
|
+ icon = 'jy-coin'
|
|
|
+ } else if (v.award.indexOf('订阅') > -1) {
|
|
|
+ icon = 'jy-svip'
|
|
|
+ } else {
|
|
|
+ icon = 'jy-coupon'
|
|
|
+ }
|
|
|
return {
|
|
|
id: v._id,
|
|
|
- icon: v.award.indexOf('订阅') !== -1 ? 'jy-svip' : 'jy-coin',
|
|
|
+ icon: icon,
|
|
|
rewardText: v.award,
|
|
|
receiveTime: new Date(v.date * 1000).pattern('yyyy-MM-dd HH:mm:ss'),
|
|
|
receiveFrom: v.getway
|
|
@@ -852,7 +872,10 @@ var task = new Vue({
|
|
|
})
|
|
|
},
|
|
|
receiveFuli3: function () {
|
|
|
- vm.isNeedSubmit('member_business_get',function(){
|
|
|
+ if (this.activeState !== 'activating') {
|
|
|
+ return this.activeNotStartToast()
|
|
|
+ }
|
|
|
+ vm.isNeedSubmit('super_membership_day',function(){
|
|
|
vm.showSuccess = true
|
|
|
})
|
|
|
},
|