12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- import {
- getInviteRanking
- } from '~/api/global'
- import {
- getInviteList
- } from '~/api/user'
- import event from '~/mixins/event'
- Page({
- behaviors: [event],
- data: {
- userInfo: {},
- ranking: '',
- gap: '',
- myCount: '',
- userList: [],
- inviteList: []
- },
- /**
- * 生命周期函数--监听页面加载
- */
- async onLoad(options) {
- wx.setNavigationBarColor({
- frontColor: '#ffffff',
- backgroundColor: '#2DCE66'
- })
- this.setData({
- userInfo: getApp().globalData.userInfo
- })
- let {
- list
- } = await getInviteList({
- pageSize: 9999
- })
- let {
- userList,
- ranking,
- gap,
- myCount
- } = await getInviteRanking()
- this.setData({
- inviteList: list,
- userList,
- ranking,
- gap,
- myCount
- })
- },
- jumpIndex() {
- wx.switchTab({
- url: '/pages/index/index',
- })
- },
- jumpUserInfo({
- currentTarget
- }) {
- if (!currentTarget.dataset.uid) {
- return
- }
- wx.navigateTo({
- url: `/pages/personal/index?uid=${currentTarget.dataset.uid}`,
- })
- },
- showTranscript() {
- this.selectComponent("#popUp").showModal()
- },
- closeTranscript() {
- this.selectComponent("#popUp").hideModal()
- },
- onShareAppMessage() {
- // #if MP
- return {
- title: '这个小程序太赞了!孩子朗读能力蹭蹭上涨,推荐你试试!',
- path: `/pages/index/index?uid=${wx.getStorageSync('uid')}`,
- imageUrl: 'http://reader-wx.ai160.com/images/reader/v3/375-300-2.jpg'
- }
- // #elif ANDROID
- return {
- title: '这个小程序太赞了!孩子朗读能力蹭蹭上涨,推荐你试试!',
- userName: 'gh_50f61361ad1d',
- path: `/pages/index/index?uid=${wx.getStorageSync('uid')}`,
- imagePath: '/static/375-300-2.jpg',
- webpageUrl: 'http://www.efunbox.cn',
- withShareTicket: true,
- miniprogramType: 1,
- scene: 0,
- }
- // #endif
- }
- })
|