Commit a897bff2 by 胡悦

修改

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