Commit a897bff2 by 胡悦

修改

1 parent 1ae7e4b6
......@@ -19,12 +19,9 @@ Component({
methods: {
// 获取手机号
getPhoneNumber({ detail }) {
console.log(detail);
getApp()
.login(true)
.then(({ data }) => {
console.log(data, "----------");
// wx.$util.setSessionId(data.sessionId)
if (
detail.errMsg &&
detail.errMsg == "getPhoneNumber:fail user deny"
......@@ -33,15 +30,19 @@ Component({
}
delete detail.errMsg;
if (detail.iv && detail.encryptedData) {
console.log("1111");
detail.sessionId = data.sessionId;
console.log(detail);
ssoApi.authUserPhone(detail).then(({ data, code }) => {
console.log(data);
wx.$util.setUserInfo(data);
wx.$util.setSessionId(data.sessionId);
// 其他操作
this.triggerEvent("getPhoneNumber");
ssoApi.authUserPhone(detail).then(({ data, code, message }) => {
if (code==0) {
wx.$util.setUserInfo(data);
wx.$util.setSessionId(data.sessionId);
// 其他操作
this.triggerEvent("getPhoneNumber");
} else {
wx.showToast({
title: message,
icon: 'none',
duration: 2000
})
}
});
}
});
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2022-08-30 11:26:21
* @LastEditors: huyue
* @LastEditTime: 2022-09-09 09:57:16
* @LastEditTime: 2022-09-09 14:41:59
*/
// pages/tab/index/index.js
import { menuMixin } from "../../../mixins/index";
......@@ -85,7 +85,6 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(this.data.hasUserInfo);
wx.$util.showLoading('加载中...')
getApp()
.login()
......@@ -112,8 +111,8 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
console.log(wx.$trackData, wx.getLaunchOptionsSync())
const options = wx.getLaunchOptionsSync()
console.log(wx.$trackData, wx.getEnterOptionsSync())
const options = wx.getEnterOptionsSync()
wx.$trackData = options.query
console.log(options.query,'--------------')
if (wx.$trackData.merchant) {
......
......@@ -9,7 +9,7 @@
</view>
</block>
</view>
<view>
<view class="isFullSucreen">
<block wx:if="{{curIntroduceIndex === 0}}">
<template is="cube" data="{{IMGURL, hasPhoneNumber}}"></template>
</block>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!