Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
weixin_sdk_release
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
JIRA
JIRA
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
open
weixin_sdk_release
Commits
fde188ed
提交
fde188ed
authored
8月 16, 2018
作者:
王进
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整启动参数获取方式
上级
7bf4d1f2
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
20 行删除
+14
-20
SDK.ts
20180816_1448/SDK.ts
+14
-20
没有找到文件。
20180816_1448/SDK.ts
浏览文件 @
fde188ed
...
@@ -25,15 +25,14 @@ class WechatSDK {
...
@@ -25,15 +25,14 @@ class WechatSDK {
that
.
ReportParams
.
productCode
=
that
.
sdkParams
.
product_code
=
SDKConfig
.
productCode
that
.
ReportParams
.
productCode
=
that
.
sdkParams
.
product_code
=
SDKConfig
.
productCode
that
.
sdkParams
.
appid
=
SDKConfig
.
appid
that
.
sdkParams
.
appid
=
SDKConfig
.
appid
that
.
sdkParams
.
version
=
SDKConfig
.
sdkVersion
that
.
sdkParams
.
version
=
SDKConfig
.
sdkVersion
const
p1
=
this
.
getLaunchOptionsSync
().
then
(
res
=>
{
const
options
=
this
.
getOptionsInfo
()
let
queryObj
=
res
.
referrerInfo
&&
res
.
referrerInfo
.
extraData
&&
Object
.
keys
(
res
.
referrerInfo
.
extraData
).
length
>
0
?
re
s
.
referrerInfo
.
extraData
:
{}
let
queryObj
=
options
.
referrerInfo
&&
options
.
referrerInfo
.
extraData
&&
Object
.
keys
(
options
.
referrerInfo
.
extraData
).
length
>
0
?
option
s
.
referrerInfo
.
extraData
:
{}
res
=
that
.
deepCopy
({},
re
s
.
query
,
queryObj
)
queryObj
=
that
.
deepCopy
({},
option
s
.
query
,
queryObj
)
that
.
printf
(
"SDK -> p1:"
,
0
)
that
.
printf
(
"SDK -> p1:"
,
0
)
that
.
printf
(
res
,
0
)
that
.
printf
(
queryObj
,
0
)
that
.
ReportParams
.
from
=
res
.
from
||
''
that
.
ReportParams
.
from
=
queryObj
.
from
||
''
that
.
ReportParams
.
tag
=
res
.
tag
||
''
that
.
ReportParams
.
tag
=
queryObj
.
tag
||
''
that
.
ReportParams
.
fromOpenId
=
res
.
fromId
||
''
that
.
ReportParams
.
fromOpenId
=
queryObj
.
fromId
||
''
},
err
=>
{
console
.
log
(
err
)
})
const
p2
=
this
.
getNetworkType
().
then
(
res
=>
{
const
p2
=
this
.
getNetworkType
().
then
(
res
=>
{
that
.
printf
(
"SDK -> p2:"
,
0
)
that
.
printf
(
"SDK -> p2:"
,
0
)
that
.
printf
(
res
,
0
)
that
.
printf
(
res
,
0
)
...
@@ -51,7 +50,7 @@ class WechatSDK {
...
@@ -51,7 +50,7 @@ class WechatSDK {
that
.
sdkParams
.
os
=
(
res
.
system
).
split
(
' '
)[
0
].
toLowerCase
()
that
.
sdkParams
.
os
=
(
res
.
system
).
split
(
' '
)[
0
].
toLowerCase
()
},
err
=>
{
console
.
log
(
err
)
})
},
err
=>
{
console
.
log
(
err
)
})
// 同步完所有参数后调用getUserOpenId
// 同步完所有参数后调用getUserOpenId
Promise
.
all
([
p
1
,
p
2
,
p3
]).
then
(
res
=>
{
Promise
.
all
([
p2
,
p3
]).
then
(
res
=>
{
console
.
log
(
"队列结束...."
)
console
.
log
(
"队列结束...."
)
that
.
getUserOpenId
()
that
.
getUserOpenId
()
},
err
=>
{
console
.
log
(
err
)
})
},
err
=>
{
console
.
log
(
err
)
})
...
@@ -159,7 +158,8 @@ class WechatSDK {
...
@@ -159,7 +158,8 @@ class WechatSDK {
that
.
sdkParams
.
token
=
res
.
data
.
token
// 记录用户toekn
that
.
sdkParams
.
token
=
res
.
data
.
token
// 记录用户toekn
that
.
ReportParams
.
userId
=
res
.
data
.
uid
// 记录用户ID
that
.
ReportParams
.
userId
=
res
.
data
.
uid
// 记录用户ID
that
.
ReportData
({
action
:
type
})
// 上报登录/注册
that
.
ReportData
({
action
:
type
})
// 上报登录/注册
LoginCallBack
(
that
.
deepCopy
({},
res
.
data
,
userInfo
,
{
LoginCallBack
(
that
.
deepCopy
({},
res
.
data
,
that
.
getOptionsInfo
(),
userInfo
,
{
os
:
(
that
.
ReportParams
.
system
).
split
(
' '
)[
0
],
// 返回系统类型IOS或者android
os
:
(
that
.
ReportParams
.
system
).
split
(
' '
)[
0
],
// 返回系统类型IOS或者android
session_key
:
that
.
sdkParams
.
session_key
// 返回session_key
session_key
:
that
.
sdkParams
.
session_key
// 返回session_key
}))
// 将用户信息拼上平台用户信息返回
}))
// 将用户信息拼上平台用户信息返回
...
@@ -237,10 +237,6 @@ class WechatSDK {
...
@@ -237,10 +237,6 @@ class WechatSDK {
public
sdkAlert
(
str
)
{
public
sdkAlert
(
str
)
{
this
.
showMsg
(
str
)
this
.
showMsg
(
str
)
}
}
// 获取分享参数
public
getShareParams
()
{
return
this
.
getLaunchOptionsSync
()
}
// 分享
// 分享
public
ShareApp
(
params
?)
{
public
ShareApp
(
params
?)
{
const
that
=
this
const
that
=
this
...
@@ -587,19 +583,17 @@ class WechatSDK {
...
@@ -587,19 +583,17 @@ class WechatSDK {
})
})
})
})
}
}
// 获取启动参数
p
rivate
async
getLaunchOptionsSync
():
Promise
<
any
>
{
p
ublic
getOptionsInfo
()
{
const
that
=
this
const
that
=
this
return
new
Promise
((
resolve
)
=>
{
const
options
=
(
wx
as
any
).
getLaunchOptionsSync
()
const
options
=
(
wx
as
any
).
getLaunchOptionsSync
()
if
(
Object
.
keys
(
options
.
query
).
length
>
0
||
Object
.
keys
(
options
.
referrerInfo
).
length
>
0
)
{
if
(
Object
.
keys
(
options
.
query
).
length
>
0
||
Object
.
keys
(
options
.
referrerInfo
).
length
>
0
)
{
const
obj
=
{}
const
obj
=
{}
that
.
deepCopy
(
obj
,
options
.
query
,
options
.
referrerInfo
.
extraData
)
// 合并数据
that
.
deepCopy
(
obj
,
options
.
query
,
options
.
referrerInfo
.
extraData
)
// 合并数据
resolve
(
obj
)
return
obj
}
else
{
}
else
{
resolve
(
options
)
return
options
}
}
})
}
}
private
createUserInfoButton
()
{
private
createUserInfoButton
()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论