|
@@ -113,6 +113,63 @@ function RandomCoordinate (conf) {
|
|
|
this.init()
|
|
|
}
|
|
|
|
|
|
+// 判断活动是否结束
|
|
|
+var initPageTime = new Date().getTime()
|
|
|
+var initActiveOverCheck = -1
|
|
|
+function activeOverCheck (endTime, callback) {
|
|
|
+ if (initPageTime >= endTime) {
|
|
|
+ return callback()
|
|
|
+ }
|
|
|
+ clearTimeout(initActiveOverCheck)
|
|
|
+ var reloadTime = endTime - new Date().getTime()
|
|
|
+ if (reloadTime <= (10 * 60 * 1000) ) {
|
|
|
+ initActiveOverCheck = setTimeout(function (){
|
|
|
+ callback()
|
|
|
+ }, reloadTime)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// toast上限提示
|
|
|
+function toastFn (text, duration) {
|
|
|
+ if (duration) {
|
|
|
+ duration = 1000
|
|
|
+ }
|
|
|
+ var _html = ""
|
|
|
+ _html+='<div class="custom-toast"><div class="mask" style="background-color: transparent;"></div><div class="toast-container">'
|
|
|
+ _html+='<span>' + text + '</span></div></div>'
|
|
|
+ $('body').append(_html)
|
|
|
+ setTimeout(function(){
|
|
|
+ $(".custom-toast").fadeOut().remove();
|
|
|
+ },duration)
|
|
|
+}
|
|
|
+
|
|
|
+// 展示弹窗
|
|
|
+function showDialogOfType (type) {
|
|
|
+ // $('#active-tip-modal').attr('data-modal-type', 'success').modal('show')
|
|
|
+ // $('#active-tip-modal').attr('data-modal-type', 'over').modal('show')
|
|
|
+ // $('#active-tip-modal').attr('data-modal-type', 'code').modal('show')
|
|
|
+
|
|
|
+ $('#active-tip-modal').attr('data-modal-type', type).modal('show')
|
|
|
+}
|
|
|
+
|
|
|
+// 固定事件
|
|
|
+$(function () {
|
|
|
+ // 扫一扫 二维码
|
|
|
+ $.ajax({
|
|
|
+ url: '/publicapply/shareFission/info',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.error_code === 0 && res.data) {
|
|
|
+ $('#active-tip-modal .active-tip--code .code-img').attr('src', 'data:image/png;base64,' + res.data.erUrl)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // 弹窗按钮事件
|
|
|
+ $('#dialog-button--over').on('click', function () {
|
|
|
+ location.href = '/swordfish/frontPage/share/sess/index'
|
|
|
+ })
|
|
|
+ $('#dialog-button--success').on('click', function () {})
|
|
|
+})
|
|
|
|
|
|
var task = new Vue({
|
|
|
el: '#main-app',
|
|
@@ -121,27 +178,31 @@ var task = new Vue({
|
|
|
progress: {
|
|
|
min: 0,
|
|
|
max: 1000,
|
|
|
- current: 200, // 当前剑鱼币
|
|
|
+ current: 0, // 当前剑鱼币
|
|
|
pointImgMap: {
|
|
|
unreceived: '/frontRouter/pc/activity/image/unreceived@2x.png',
|
|
|
- received: '/frontRouter/pc/activity/image/received@2x.png'
|
|
|
+ received: '/frontRouter/pc/activity/image/received@2x.png',
|
|
|
+ wait: '/frontRouter/pc/activity/image/received@2x.png'
|
|
|
},
|
|
|
anchorList: [
|
|
|
{
|
|
|
+ id: '',
|
|
|
className: 'first',
|
|
|
rate: 0, // 进度,单位%,最大为100
|
|
|
pointImg: '', // ''/unreceived/received
|
|
|
anchorText: '0剑鱼币'
|
|
|
},
|
|
|
{
|
|
|
- className: '',
|
|
|
+ id: '800',
|
|
|
+ className: 'unreceived',
|
|
|
rate: 80,
|
|
|
- pointImg: 'received',
|
|
|
+ pointImg: 'unreceived',
|
|
|
anchorText: '800剑鱼币',
|
|
|
tipText: '7天超级订阅'
|
|
|
},
|
|
|
{
|
|
|
- className: 'last',
|
|
|
+ id: '1000',
|
|
|
+ className: 'unreceived',
|
|
|
rate: 100,
|
|
|
pointImg: 'unreceived',
|
|
|
anchorText: '1000剑鱼币',
|
|
@@ -152,85 +213,73 @@ var task = new Vue({
|
|
|
// 任务球
|
|
|
missionsList: [
|
|
|
{
|
|
|
- id: 1,
|
|
|
+ id: 'subscribe',
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
num: 300,
|
|
|
unit: '剑鱼币',
|
|
|
complete: false,
|
|
|
+ hide: false,
|
|
|
name: '超级订阅' // 任务描述
|
|
|
},
|
|
|
{
|
|
|
- id: 2,
|
|
|
+ id: 'invite',
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
num: 500,
|
|
|
unit: '剑鱼币',
|
|
|
complete: false,
|
|
|
+ hide: false,
|
|
|
name: '邀请领好礼'
|
|
|
},
|
|
|
{
|
|
|
- id: 3,
|
|
|
+ id: 'improveInfo',
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
- num: 300,
|
|
|
+ num: 200,
|
|
|
unit: '剑鱼币',
|
|
|
- complete: true,
|
|
|
+ complete: false,
|
|
|
+ hide: false,
|
|
|
name: '完善信息'
|
|
|
}
|
|
|
],
|
|
|
- rewardList: [
|
|
|
- {
|
|
|
- id: '',
|
|
|
- icon: 'jy-coin',
|
|
|
- rewardText: '200剑鱼币',
|
|
|
- receiveTime: 1234567890000,
|
|
|
- receiveFrom: '邀请好友'
|
|
|
- },
|
|
|
- {
|
|
|
- id: '',
|
|
|
- icon: 'jy-svip',
|
|
|
- rewardText: '200剑鱼币',
|
|
|
- receiveTime: 1234567890000,
|
|
|
- receiveFrom: '邀请好友'
|
|
|
- }
|
|
|
- ],
|
|
|
+ rewardList: [],
|
|
|
toolBoxList: [
|
|
|
{
|
|
|
text: '超级订阅',
|
|
|
- url: ''
|
|
|
+ url: '/front/subscribe.html'
|
|
|
},
|
|
|
{
|
|
|
text: '大会员',
|
|
|
- url: ''
|
|
|
+ url: '/big/page/index'
|
|
|
},
|
|
|
{
|
|
|
- text: '企业管理',
|
|
|
- url: ''
|
|
|
+ text: '企业商机管理',
|
|
|
+ url: '/swordfish/frontPage/entpc/free/enptc_index'
|
|
|
},
|
|
|
{
|
|
|
text: '数据定制服务',
|
|
|
- url: ''
|
|
|
+ url: '/front/structed/pc_index.html'
|
|
|
},
|
|
|
{
|
|
|
- text: '数据自主导出',
|
|
|
- url: ''
|
|
|
+ text: '数据自助导出',
|
|
|
+ url: '/front/dataExport/toSieve'
|
|
|
},
|
|
|
{
|
|
|
text: '数据流量包',
|
|
|
- url: ''
|
|
|
+ url: '/front/dataPack/createOrder'
|
|
|
},
|
|
|
{
|
|
|
text: '电信行业解决方案',
|
|
|
- url: ''
|
|
|
+ url: '/swordfish/frontPage/solution/free/index'
|
|
|
},
|
|
|
{
|
|
|
text: '中标必听课',
|
|
|
- url: ''
|
|
|
+ url: '/jyxspc'
|
|
|
},
|
|
|
{
|
|
|
text: '剑鱼文库',
|
|
|
- url: ''
|
|
|
+ url: '/swordfish/docs'
|
|
|
},
|
|
|
],
|
|
|
rulesList: [
|
|
@@ -283,12 +332,11 @@ var task = new Vue({
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- watch: {
|
|
|
- rate: function () {
|
|
|
- this.calcProgressAnchorList()
|
|
|
- }
|
|
|
+ created: function () {
|
|
|
+ this.ajaxActiveStatus()
|
|
|
+ this.ajaxProgress()
|
|
|
+ this.ajaxList()
|
|
|
},
|
|
|
- created: function () {},
|
|
|
mounted: function () {
|
|
|
this.calcPointList()
|
|
|
},
|
|
@@ -305,6 +353,157 @@ var task = new Vue({
|
|
|
this.missionsList[i].x = pointList[i].x
|
|
|
this.missionsList[i].y = pointList[i].y
|
|
|
}
|
|
|
+ },
|
|
|
+ onClickLink: function (item) {
|
|
|
+ window.open(item.url)
|
|
|
+ },
|
|
|
+ onClickListItem: function (item) {
|
|
|
+ if (item.icon === 'jy-svip') {
|
|
|
+ location.href = '/front/subscribe.html'
|
|
|
+ } else {
|
|
|
+ location.href = '/swordfish/integral/index/detail'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onClickReceive: function (type, item) {
|
|
|
+ var status = false
|
|
|
+ if (type === 'schedule' && item.className === 'wait') {
|
|
|
+ status = true
|
|
|
+ } else if (type === 'mission' && item.complete) {
|
|
|
+ status = true
|
|
|
+ }
|
|
|
+ if (!status) {
|
|
|
+ switch (item.id) {
|
|
|
+ case 'subscribe': {
|
|
|
+ showDialogOfType('code')
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'invite': {
|
|
|
+ location.href = '/swordfish/frontPage/share/sess/index'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'improveInfo': {
|
|
|
+ // 留资
|
|
|
+ vm.isNeedSubmit('activity_free_plan', function(){
|
|
|
+ vm.showSuccess = true
|
|
|
+ })
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var _this = this
|
|
|
+ this.ajaxReceive({ type: type, value: item.id }, function (result, msg) {
|
|
|
+ if (result) {
|
|
|
+ switch (item.id) {
|
|
|
+ case 'subscribe': {
|
|
|
+ toastFn('已成功领取300剑鱼币', 1500)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'invite': {
|
|
|
+ toastFn('已成功领取500剑鱼币', 1500)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'improveInfo': {
|
|
|
+ // 留资
|
|
|
+ toastFn('已成功领取200剑鱼币', 1500)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case '800': {
|
|
|
+ $('.active-tip--success .text-give-day').text('7')
|
|
|
+ showDialogOfType('success')
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case '1000': {
|
|
|
+ $('.active-tip--success .text-give-day').text('30')
|
|
|
+ showDialogOfType('success')
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _this.ajaxActiveStatus()
|
|
|
+ _this.ajaxProgress()
|
|
|
+ _this.ajaxList()
|
|
|
+ } else {
|
|
|
+ toastFn(msg, 1500)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ ajaxReceive: function (data, callback) {
|
|
|
+ $.ajax({
|
|
|
+ url: '/jyActivity/bidderPlan/receive',
|
|
|
+ type: 'post',
|
|
|
+ data: data,
|
|
|
+ success: function (res) {
|
|
|
+ return callback(res.data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ ajaxProgress: function () {
|
|
|
+ var _this = this
|
|
|
+ $.ajax({
|
|
|
+ url: '/jyActivity/bidderPlan/schedule',
|
|
|
+ type:' post',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.error_code === 0 && res.data) {
|
|
|
+ _this.progress.current = res.data.nowNum
|
|
|
+
|
|
|
+ _this.missionsList[0].complete = res.data.missions.subscribe === 1
|
|
|
+ _this.missionsList[1].complete = res.data.missions.invite === 1
|
|
|
+ _this.missionsList[2].complete = res.data.missions.improveInfo === 1
|
|
|
+
|
|
|
+ _this.missionsList[0].hide = res.data.missions.subscribe === -1
|
|
|
+ _this.missionsList[1].hide = res.data.missions.invite === -1
|
|
|
+ _this.missionsList[2].hide = res.data.missions.improveInfo === -1
|
|
|
+
|
|
|
+ var anchorStatus = {
|
|
|
+ 1: 'wait',
|
|
|
+ 0: 'unreceived',
|
|
|
+ '-1': 'received',
|
|
|
+ }
|
|
|
+
|
|
|
+ _this.progress.anchorList[1].className = anchorStatus[res.data.schedule['800']]
|
|
|
+ _this.progress.anchorList[2].className = anchorStatus[res.data.schedule['1000']]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ ajaxActiveStatus: function () {
|
|
|
+ $.ajax({
|
|
|
+ url: '/jyActivity/bidderPlan/period',
|
|
|
+ type: 'get',
|
|
|
+ success: function (res) {
|
|
|
+ activeOverCheck(res.data.end * 1000, function () {
|
|
|
+ showDialogOfType('over')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ ajaxList: function () {
|
|
|
+ var _this = this
|
|
|
+ $.ajax({
|
|
|
+ url: '/jyActivity/myAward/awardlist',
|
|
|
+ type: 'post',
|
|
|
+ data: {
|
|
|
+ code: 'bidderPlan',
|
|
|
+ pageSize: 10,
|
|
|
+ pageNum: 0
|
|
|
+ },
|
|
|
+ success: function (res) {
|
|
|
+ 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) {
|
|
|
+ return {
|
|
|
+ id: v._id,
|
|
|
+ icon: v.award.indexOf('订阅') !== -1 ? 'jy-svip' : 'jy-coin',
|
|
|
+ rewardText: v.award,
|
|
|
+ receiveTime: new Date(v.date * 1000).pattern('yyyy-MM-dd HH:mm:ss'),
|
|
|
+ receiveFrom: v.getway
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
})
|