123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- import {
- getOpenidSessionKey
- } from '../../utils/httpUtil';
- Page({
-
- data: {
- index: undefined,
- canIUseGetUserProfile: false
- },
-
- onLoad: function (options) {
- if (options.index) {
- this.setData({
- index: options.index
- })
- }
- if (wx.getUserProfile) {
- this.setData({
- canIUseGetUserProfile: true
- })
- }
- },
- getUserProfile: function (e) {
- wx.getUserProfile({
- desc: '用于完善会员资料',
- success: (res) => {
- console.log('getUserProfile',res);
- getOpenidSessionKey((res) => {
- console.log('getUserProfilegetUserProfile',res)
- wx.showToast({
- title: '登录成功',
- icon: 'fail',
- duration: 1000,
- success: () => {
- const pages = getCurrentPages();
- const prevPage = pages[pages.length - 2];
- prevPage.setData({
- fromLoginIndex: this.data.index,
- }, () => {
- wx.navigateBack({
- delta: 1
- })
- })
- }
- })
- }, (error) => {
- wx.showToast({
- title: '登录失败',
- icon: 'fail',
- duration: 1000,
- success: () => {
- wx.navigateBack()
- }
- })
- });
- }
- })
- },
- impower: function (e) {
- console.log(e)
- var myEventDetail = {}
- var myEventOption = {}
- getOpenidSessionKey((res) => {
- console.log(res)
- wx.showToast({
- title: '登录成功',
- icon: 'fail',
- duration: 1000,
- success: () => {
- const pages = getCurrentPages();
- const prevPage = pages[pages.length - 2];
- prevPage.setData({
- fromLoginIndex: this.data.index,
- }, () => {
- wx.navigateBack({
- delta: 1
- })
- })
- }
- })
- }, (error) => {
- wx.showToast({
- title: '登录失败',
- icon: 'fail',
- duration: 1000,
- success: () => {
- wx.navigateBack()
- }
- })
- });
- },
- touchMove: function () {
- return false
- },
-
- onReady: function () {
- },
-
- onShow: function () {
- },
-
- onHide: function () {
- },
-
- onUnload: function () {
- },
-
- onPullDownRefresh: function () {
- },
-
- onReachBottom: function () {
- },
-
- onShareAppMessage: function () {
- }
- })
|