const app = getApp() const Http = require("../../utils/HttpBasics"); const config = require("../../config/config"); const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" Page({ data: { navigationBarHeight, mallImgUrl:"", }, backHome: function() { tt.navigateBack({ delta: 1, success: (res) => { }, fail: (res) => { }, }); }, bindGetUserInfo(e){ let that = this; tt.getUserInfo({ withCredentials:true, success:function(res){ console.log(res,"res"); Http.post({ url:config.api.getUserInfo, data: { encryptedData: res.encryptedData, iv: res.iv } }).then(res=>{ that.backHome() }).catch(err=>{ tt.showToast({ title: err.message?err.message:err.data, icon: 'none', duration: 2000, mask: false }); }) }, fail(err) { console.log(err,` 调用失败`); }, }) }, onLoad: function (options) { Http.get({ url: config.api.marketicon, data: { appId: 'ttef6599d8705b49b101' } }).then(res => { this.setData({ mallImgUrl: res.data.mallImgUrl }); tt.setNavigationBarTitle({ title: res.data.mallName }) }) .catch(err => { tt.showToast({ title: err.message?err.message:err.data, icon: 'none', duration: 2000, mask: false }); }) } })