123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- import {
- get,
- } from '../../utils/http';
- import {
- trackUserEvent
- } from '../../utils/util'
- const app = getApp()
- const XEnum_Inviter_Type = 7
- Page({
-
- data: {
- call_team: [
- ],
- steps: [],
- active: -1,
- show: false,
- activity_time: '',
- page: 1,
- limit: 10,
- loading: false,
- finished: false,
- total:0,
- experienceList:['【舒敏修复】华熙生物智慧舒敏修复','【祛黄提亮】华熙智慧水光肌提亮祛黄','【无创水光】华熙生物真皮层补水','【清痘消炎】痘痘清理痘肌消炎','【紧致嫩肤】华熙智慧紧致提拉嫩肤'],
- },
-
- onLoad() {
- this.getInvite()
- this.scrollToLower()
-
- wx.showShareMenu({
- menus: ['shareAppMessage', 'shareTimeline'],
-
- success(res) {
- console.log(res);
- },
- fail(e) {
- console.log(e);
- }
- });
- },
- onOpenShow() {
- this.setData({
- show: true
- });
- },
- onClose() {
- this.setData({
- show: false
- })
- },
- onShareFriends () {
- trackUserEvent(XEnum_Inviter_Type)
- },
- onMoments() {
- wx.navigateTo({
- url: `/pages/invitationDetails/poster/poster`,
- })
- },
-
- getInvite() {
- get('/api/invite', {}, (res) => {
- console.log(res);
- this.setData({
- activity_time: res.data.activity_time
- })
- let array = []
-
- res.data.progress_list.forEach((item, index) => {
- let obj = {}
- let init = {
-
-
- greyText_1: '成功解锁',
- greyText_2: `,可获得${item.product_name}一次`
- }
- obj["text"] = item.product_name
-
- obj["redText"] = `${item.require_num.require_num}人`
- obj["status"] = item.status
- let obj_info = {
- ...obj,
- ...init
- }
- array.push(obj_info)
- if (item.status == 1) {
- this.setData({
- active: index
- })
- }
- })
- getApp().invite_id = res.data.qrcode_content
- this.setData({
- steps: array,
- })
- })
- },
-
- scrollToLower() {
- if (!this.data.finished && !this.data.loading) {
- this.setData({
- loading: true
- })
- setTimeout(() => {
- get('/api/invite/list', {
- page: this.data.page,
- limit: this.data.limit
- }, (res) => {
- this.setData({
- loading: false,
- total:res.data.total,
- page: this.data.page + 1
- })
- let arr = []
- arr = [...res.data.list, ...this.data.call_team]
- console.log(arr,'arrarr');
- this.setData({
- call_team:arr
- })
- if (res.data.list.length < 10) {
- this.setData({
- finished: true
- })
- }
- })
- }, 1000)
- }
- },
- onShareAppMessage() {
- return {
- title: '朋友送你的0元修丽可B5补水还未领取,点击去领取~',
- path: `pages/invitees/invitees?invite_id=${app.globalData.userInfo.uid}`,
- imageUrl: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20220811/%E4%BA%8C%E5%9B%BE/%E5%9B%BE%E7%89%87/%E7%BC%96%E7%BB%84%203%402x.png',
- };
- },
- onShareTimeline() {
- return {
- title: '送你一份修丽可无创水光项目,一起变美丽吧',
- path: `pages/invitees/invitees?invite_id=${app.globalData.userInfo.uid}`,
- imageUrl: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20220413/%E9%82%80%E8%AF%B7%E8%80%85%E5%88%86%E4%BA%AB%E6%9C%8B%E5%8F%8B%E5%9C%88%E6%B5%B7%E6%8A%A5%402x%20%282%29.png',
- };
- },
-
- onReady() {
- },
-
- onShow() {
- },
-
- onHide() {
- },
-
- onUnload() {
- },
-
- onPullDownRefresh() {
- },
-
- onReachBottom() {
- },
- closeShow() {
- this.setData({
- show: false
- })
- }
- })
|