|
@@ -1,5 +1,6 @@
|
|
|
// pages/my/my.js
|
|
|
import itt from '../../utils/util'
|
|
|
+import { ittLogin } from '../../api/app'
|
|
|
const app = getApp()
|
|
|
Page({
|
|
|
|
|
@@ -15,7 +16,7 @@ Page({
|
|
|
{
|
|
|
id: 0,
|
|
|
title: '我的地址',
|
|
|
- url: '/pages/address/address?form=my',
|
|
|
+ url: '/pages/address/address?form=my&back=0',
|
|
|
imgUrl: '../../imaes/dizhi@2x.png'
|
|
|
},
|
|
|
{
|
|
@@ -90,6 +91,34 @@ Page({
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow() {
|
|
|
+ wx.login({
|
|
|
+ success (res) {
|
|
|
+ if (res.code) {
|
|
|
+ let data = {
|
|
|
+ code: res.code
|
|
|
+ }
|
|
|
+ ittLogin(data).then(res => {
|
|
|
+ console.log(res,'then login');
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ wx.login({
|
|
|
+ success (res) {
|
|
|
+ if (res.code) {
|
|
|
+ //发起网络请求
|
|
|
+ let data = {
|
|
|
+ code: res.code
|
|
|
+ }
|
|
|
+ itt.postLogin('http://itt.chl6zk.store/api/user/login/v1', data, function (res) {
|
|
|
+ console.log(res, 'itt my');
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ console.log('登录失败!' + res.errMsg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
this.setData({
|
|
|
pageLogin: app.globalData.userInfo.login
|
|
|
})
|