123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- const app = require('../../utils/util.js');
- const tool = require('../../utils/tool.js');
- Page({
- data: {
- currentIndex: 0,
- arr: [],
- arr1: [],
- isInfo: false,
- isTargetInfo: false
- },
- // 轮播
- handleChange: function (e) {
- this.setData({
- currentIndex: e.detail.current
- })
- },
- // 跳转活动详情页面
- goActive(e) {
- console.log(e)
- let id = e.currentTarget.dataset.id
- let openId = e.currentTarget.dataset.openid
- wx.navigateTo({
- url: '/pages/activeDetail/activeDetail?id=' + id + '&openId=' + openId,
- })
- },
- // 获取活动列表
- getActivies() {
- wx.request({
- url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/actives',
- method: "get",
- data: {
- activeStatus: 0
- },
- success: (res) => {
- console.log(res)
- if (res.data.code == 0) {
- let arr1 = res.data.actives;
- wx.request({
- url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/actives',
- method: "get",
- data: {
- activeStatus: 1
- },
- success: (res1) => {
- if (res1.data.code == 0) {
- this.setData({
- arr: arr1.concat(res1.data.actives)
- })
- wx.hideLoading();
- }
- }
- })
- }
- }
- })
- },
- //判断是否登录
- // 判断是否完善个人信息
- isFinishInfo() {
- wx.request({
- url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/info',
- method: "get",
- success: (res) => {
- console.log(res)
- if (res.data.code == 0) {
- this.setData({
- isInfo: true
- })
- } else {
- this.setData({
- isInfo: false
- })
- }
- }
- })
- },
- //判断是否完善择偶信息
- isFinishTargetInfo() {
- wx.request({
- url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/standard',
- method: "get",
- success: (res) => {
- console.log(res)
- if (res.data.code == 0) {
- this.setData({
- isTargetInfo: true
- })
- } else {
- this.setData({
- isTargetInfo: false
- })
- }
- }
- })
- },
- async onShow() {
- wx.showLoading({
- title: '加载中',
- })
- tool.openidStatus().then(result => {
- this.setData({
- openid: result[0],
- sessionkey: result[1]
- })
- this.getActivies();
- this.isFinishInfo();
- this.isFinishTargetInfo();
- })
- }
- })
|