Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhqg-mini
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhqg
zhqg-mini
Commits
52207aa2
Commit
52207aa2
authored
Oct 16, 2020
by
wangyalan-git
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加
parent
162955ff
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
29 deletions
+31
-29
app.js
app.js
+20
-19
index.js
pages/index/index.js
+6
-4
invite.js
pages/invite/invite.js
+0
-0
invite.json
pages/invite/invite.json
+1
-3
config.js
utils/config.js
+1
-1
http.js
utils/http.js
+3
-2
No files found.
app.js
View file @
52207aa2
...
...
@@ -18,28 +18,29 @@ App({
overShare
:
function
()
{
//监听路由切换
//间接实现全局设置分享内容
var
that
=
this
wx
.
onAppRoute
(
function
(
res
)
{
//获取加载的页面
let
pages
=
getCurrentPages
(),
//获取当前页面的对象
view
=
pages
[
pages
.
length
-
1
],
data
;
if
(
view
)
{
data
=
view
.
data
;
console
.
log
(
'是否重写分享方法'
,
this
.
globalData
.
userInfo
);
if
(
!
data
.
isOverShare
)
{
data
.
isOverShare
=
true
;
view
.
onShareAppMessage
=
function
()
{
//你的分享配置
return
{
title
:
'中厦全供'
,
path
:
'/pages/index/index?shareCode='
+
this
.
globalData
.
userInfo
.
shareCode
};
}
}
//获取加载的页面
let
pages
=
getCurrentPages
(),
//获取当前页面的对象
view
=
pages
[
pages
.
length
-
1
],
data
;
if
(
view
)
{
data
=
view
.
data
;
console
.
log
(
'是否重写分享方法'
,
that
.
globalData
.
userInfo
);
if
(
!
data
.
isOverShare
)
{
data
.
isOverShare
=
true
;
view
.
onShareAppMessage
=
function
()
{
//你的分享配置
return
{
title
:
'中厦全供'
,
path
:
'/pages/index/index?shareCode='
+
that
.
globalData
.
userInfo
.
shareCode
};
}
}
}
})
},
},
globalData
:
{
userInfo
:
''
,
// 定义全局请求队列
...
...
pages/index/index.js
View file @
52207aa2
...
...
@@ -80,12 +80,14 @@ Page({
},
onShow
:
function
()
{
console
.
log
(
'页面参路径'
,
this
.
options
)
var
that
=
this
wx
.
getSetting
({
success
(
res
)
{
if
(
!
res
.
authSetting
[
'scope.userInfo'
])
{
if
(
th
is
.
options
.
shareCode
)
{
if
(
th
at
.
options
.
shareCode
)
{
wx
.
navigateTo
({
url
:
'/pages/login/login?shareCode='
+
th
is
.
options
.
shareCode
,
url
:
'/pages/login/login?shareCode='
+
th
at
.
options
.
shareCode
,
})
}
else
{
wx
.
navigateTo
({
...
...
@@ -93,8 +95,8 @@ Page({
})
}
}
else
{
if
(
th
is
.
options
.
shareCode
)
{
th
is
.
boundParentByShareCode
(
options
.
shareCode
);
// 绑定内容获取
if
(
th
at
.
options
.
shareCode
)
{
th
at
.
boundParentByShareCode
(
options
.
shareCode
);
// 绑定内容获取
}
}
}
...
...
pages/invite/invite.js
View file @
52207aa2
This diff is collapsed.
Click to expand it.
pages/invite/invite.json
View file @
52207aa2
{
"usingComponents"
:
{
"painter"
:
"/components/painter/painter"
},
"usingComponents"
:
{},
"navigationBarTitleText"
:
"邀请海报"
,
"navigationBarBackgroundColor"
:
"#000000"
,
"navigationBarTextStyle"
:
"white"
...
...
utils/config.js
View file @
52207aa2
var
domain
=
"http://192.168.31.11
0
:8086/capi"
;
//统一接口域名,测试环境
var
domain
=
"http://192.168.31.11
3
:8086/capi"
;
//统一接口域名,测试环境
exports
.
domain
=
domain
;
utils/http.js
View file @
52207aa2
...
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment