123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395 |
- import {
- getInviteList
- } from '~/api/user'
- import event from '~/mixins/event'
- Page({
- behaviors: [event],
- data: {
- list: [{
- num: 1,
- top: -60,
- left: 428
- }, {
- num: 2,
- top: 230,
- left: 274
- }, {
- num: 3,
- top: 580,
- left: 224
- }, {
- num: 4,
- top: 770,
- left: 570
- }, {
- num: 5,
- top: 856,
- left: 360
- }, {
- num: 6,
- top: 1194,
- left: 140
- }, {
- num: 7,
- top: 1194,
- left: 460
- }, {
- num: 8,
- top: 1466,
- left: 140
- }, {
- num: 9,
- top: 1466,
- left: 460
- }, {
- num: 10,
- top: 1740,
- left: 140
- }, {
- num: 11,
- top: 2088,
- left: 140
- }, {
- num: 12,
- top: 2088,
- left: 460
- }, {
- num: 13,
- top: 2360,
- left: 140
- }, {
- num: 14,
- top: 2360,
- left: 460
- }, {
- num: 15,
- top: 2636,
- left: 460
- }, {
- num: 16,
- top: 3036,
- left: 140
- }, {
- num: 17,
- top: 3036,
- left: 460
- }, {
- num: 18,
- top: 3310,
- left: 140
- }, {
- num: 19,
- top: 3310,
- left: 460
- }, {
- num: 20,
- top: 3580,
- left: 140
- }, {
- num: 21,
- top: 3580,
- left: 460
- }, {
- num: 22,
- top: 3852,
- left: 140
- }, {
- num: 23,
- top: 3852,
- left: 460
- }, {
- num: 24,
- top: 4126,
- left: 140
- }, {
- num: 25,
- top: 4126,
- left: 460
- }, {
- num: 26,
- top: 4396,
- left: 140
- }, {
- num: 27,
- top: 4396,
- left: 460
- }, {
- num: 28,
- top: 4670,
- left: 140
- }, {
- num: 29,
- top: 4670,
- left: 460
- }, {
- num: 30,
- top: 4944,
- left: 460
- }, {
- num: 31,
- top: 5332,
- left: 140
- }, {
- num: 32,
- top: 5332,
- left: 460
- }, {
- num: 33,
- top: 5604,
- left: 140
- }, {
- num: 34,
- top: 5604,
- left: 460
- }, {
- num: 35,
- top: 5878,
- left: 140
- }, {
- num: 36,
- top: 5878,
- left: 460
- }, {
- num: 37,
- top: 6148,
- left: 140
- }, {
- num: 38,
- top: 6148,
- left: 460
- }, {
- num: 39,
- top: 6418,
- left: 140
- }, {
- num: 40,
- top: 6418,
- left: 460
- }, {
- num: 41,
- top: 6692,
- left: 140
- }, {
- num: 42,
- top: 6692,
- left: 460
- }, {
- num: 43,
- top: 6960,
- left: 140
- }, {
- num: 44,
- top: 6960,
- left: 460
- }, {
- num: 45,
- top: 7284,
- left: 140
- }, {
- num: 46,
- top: 7284,
- left: 460
- }, {
- num: 47,
- top: 7554,
- left: 140
- }, {
- num: 48,
- top: 7554,
- left: 460
- }, {
- num: 49,
- top: 7828,
- left: 140
- }, {
- num: 50,
- top: 7828,
- left: 460
- }, {
- num: 51,
- top: 8100,
- left: 140
- }, {
- num: 52,
- top: 8100,
- left: 460
- }, {
- num: 53,
- top: 8372,
- left: 140
- }, {
- num: 54,
- top: 8372,
- left: 460
- }, {
- num: 55,
- top: 8642,
- left: 140
- }, {
- num: 56,
- top: 8642,
- left: 460
- }, {
- num: 57,
- top: 8912,
- left: 140
- }, {
- num: 58,
- top: 8912,
- left: 460
- }, {
- num: 59,
- top: 9120,
- left: 300
- }, {
- num: 60,
- top: 9422,
- left: 440
- }],
- treasureList: [{
- id: 2,
- num: 1,
- text: '加油!继续挑战第2关',
- text2: '你的成绩会被记录在排行榜上哦! 快来展示你的实力吧!',
- close: '/static/2t.png',
- open: '/static/2t-2.png',
- top: 310,
- left: -10
- }, {
- id: 5,
- num: 2,
- text: '再接再厉!通往下一关!',
- close: '/static/5.png',
- open: '/static/5-2.png',
- top: 840,
- left: 20
- }, {
- id: 10,
- num: 3,
- text: '挑战更高级难度!赢取更多奖励',
- close: '/static/10.png',
- open: '/static/10-2.png',
- top: 1736,
- left: 510
- }, {
- id: 15,
- num: 4,
- text: '保持冷静,一步一个脚印!',
- close: '/static/15.png',
- open: '/static/15-2.png',
- top: 2632,
- left: 26
- }, {
- id: 30,
- num: 5,
- text: '全力以赴,冲刺胜利!',
- text2: '不要气馁,坚持到底就能成功通关!',
- close: '/static/30.png',
- open: '/static/30-2.png',
- top: 4924,
- left: 16
- }],
- count: 0,
- state: false,
- modelInfo: {
- title: '',
- text: '',
- text2: ''
- }
- },
- async onLoad() {
- let {
- list
- } = await getInviteList({
- pageSize: 9999
- })
- this.setData({
- count: list.length
- })
- if (this.data.count > 2) {
- wx.pageScrollTo({
- selector: `#p${this.data.count<60?this.data.count-1:60}`,
- duration: 800
- })
- }
- },
- openTips({
- currentTarget
- }) {
- let info = currentTarget.dataset.info
- this.setData({
- state: true,
- modelInfo: this.data.count >= 60 ? {
- title: '恭喜,冲关成功!',
- text: '您展现了非凡的实力和毅力,获得SVIP终身会员',
- text2: '也期待着您未来的更多精彩表现!'
- } : info.id <= this.data.count ? {
- title: `恭喜,您已通关第${info.num}关`,
- text: info.text,
- text2: info.text2
- } : {
- title: '加油!冲关!',
- text: '保持积极的态度和努力的精神, 相信您可以顺利完成后面的关卡',
- text2: '展示您的实力吧!🏆'
- }
- })
- },
- applyOr({
- currentTarget
- }) {
- if (this.data.count < currentTarget.dataset.num) {
- this.setData({
- state: true,
- modelInfo: {
- title: '加油!冲关!',
- text: '保持积极的态度和努力的精神, 相信您可以顺利完成后面的关卡',
- text2: '展示您的实力吧!🏆'
- }
- })
- }
- },
- closeMediaBox() {
- this.setData({
- state: false
- })
- },
- jumpIntro({
- currentTarget
- }) {
- let iconDetail = currentTarget.dataset.icondetail
- if (iconDetail) {
- wx.navigateTo({
- url: `/pages/rankIntro/index?img=${iconDetail}`,
- })
- }
- },
- jumpRanking() {
- wx.navigateTo({
- url: '/pages/inviteRanking/index',
- })
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- const user = wx.getStorageSync('user');
- // #if MP
- return {
- title: '自从用了它,家里朗朗书声,美妙极了!你家孩子也快来试试!',
- path: `/pages/index/index?uid=${wx.getStorageSync('uid')}`,
- imageUrl: 'http://reader-wx.ai160.com/images/reader/v3/375-300-1.jpg'
- }
- // #elif ANDROID
- return {
- title: '这个小程序太赞了!孩子朗读能力蹭蹭上涨,推荐你试试!',
- userName: 'gh_50f61361ad1d',
- path: `/pages/index/index?uid=${wx.getStorageSync('uid')}`,
- imagePath: '/static/375-300-1.jpg',
- webpageUrl: 'http://www.efunbox.cn',
- withShareTicket: true,
- miniprogramType: 1,
- scene: 0,
- }
- // #endif
- }
- })
|