Commit 52207aa2 by wangyalan-git

添加

parent 162955ff
......@@ -18,6 +18,7 @@ App({
overShare: function () {
//监听路由切换
//间接实现全局设置分享内容
var that = this
wx.onAppRoute(function (res) {
//获取加载的页面
let pages = getCurrentPages(),
......@@ -26,20 +27,20 @@ App({
data;
if (view) {
data = view.data;
console.log('是否重写分享方法', this.globalData.userInfo);
console.log('是否重写分享方法', that.globalData.userInfo);
if (!data.isOverShare) {
data.isOverShare = true;
view.onShareAppMessage = function () {
//你的分享配置
return {
title: '中厦全供',
path: '/pages/index/index?shareCode='+ this.globalData.userInfo.shareCode
path: '/pages/index/index?shareCode=' + that.globalData.userInfo.shareCode
};
}
}
}
})
},
},
globalData: {
userInfo: '',
// 定义全局请求队列
......
......@@ -80,12 +80,14 @@ Page({
},
onShow: function () {
console.log('页面参路径',this.options)
var that =this
wx.getSetting({
success(res) {
if (!res.authSetting['scope.userInfo']) {
if (this.options.shareCode) {
if (that.options.shareCode) {
wx.navigateTo({
url: '/pages/login/login?shareCode=' + this.options.shareCode,
url: '/pages/login/login?shareCode=' + that.options.shareCode,
})
} else {
wx.navigateTo({
......@@ -93,8 +95,8 @@ Page({
})
}
} else {
if (this.options.shareCode) {
this.boundParentByShareCode(options.shareCode); // 绑定内容获取
if (that.options.shareCode) {
that.boundParentByShareCode(options.shareCode); // 绑定内容获取
}
}
}
......
{
"usingComponents": {
"painter": "/components/painter/painter"
},
"usingComponents": {},
"navigationBarTitleText": "邀请海报",
"navigationBarBackgroundColor": "#000000",
"navigationBarTextStyle": "white"
......
var domain = "http://192.168.31.110:8086/capi"; //统一接口域名,测试环境
var domain = "http://192.168.31.113:8086/capi"; //统一接口域名,测试环境
exports.domain = domain;
......@@ -91,7 +91,7 @@ var getToken = function () {
wx.setStorageSync('token', '');
} else {
wx.setStorageSync('token', 'bearer' + result.access_token); //把token存入缓存,请求接口数据时要用
this.getUserInfo()
getUserInfo()
}
var globalData = getApp().globalData;
globalData.isLanding = false;
......@@ -112,10 +112,11 @@ function getUserInfo() {
data: {},
callBack: (res) => {
console.log('用户信息', res.result)
var app = getApp();
app.globalData.userInfo = res.result
}
};
http.request(params);
request(params);
}
// 更新用户头像昵称
function updateUserInfo() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment