Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
ai-card
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 39470ec2
authored
Sep 08, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'kuangyq_v2.10.0' of
http://192.168.3.233:8090/saas/mini-program/ai…
…-card into kuangyq_v2.10.0
2 parents
b2c36343
4d1884bb
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
12 deletions
api/api.js
api/environment.js
api/ssoApi.js
api/wechantApi.js → api/wechatApi.js
app.js
utils/Track.js
api/api.js
View file @
39470ec
import
api
from
'./request'
import
api
from
'./request'
import
ssoApi
from
'./ssoApi'
import
ssoApi
from
'./ssoApi'
import
wecha
ntApi
from
'./wechan
tApi'
import
wecha
tApi
from
'./wecha
tApi'
import
entmicroApi
from
'./entmicroApi'
import
entmicroApi
from
'./entmicroApi'
const
common
=
'scrm.api.carlife.common.'
const
common
=
'scrm.api.carlife.common.'
module
.
exports
=
{
module
.
exports
=
{
ssoApi
,
ssoApi
,
entmicroApi
,
entmicroApi
,
wecha
n
tApi
,
wechatApi
,
commonApi
:
{
commonApi
:
{
/**上传图片
/**上传图片
*/
*/
...
...
api/environment.js
View file @
39470ec
...
@@ -38,7 +38,7 @@ const domain = {
...
@@ -38,7 +38,7 @@ const domain = {
const
pathEnum
=
{
const
pathEnum
=
{
sso
:
'/rop-scrm-sso/'
,
sso
:
'/rop-scrm-sso/'
,
wechat
:
'/rop-scrm-
sso
/'
,
wechat
:
'/rop-scrm-
wechat
/'
,
business
:
'/rop-scrm-entmicro/'
business
:
'/rop-scrm-entmicro/'
}
}
module
.
exports
=
{
module
.
exports
=
{
...
...
api/ssoApi.js
View file @
39470ec
...
@@ -22,6 +22,13 @@ module.exports = {
...
@@ -22,6 +22,13 @@ module.exports = {
...
data
...
data
},
true
)
},
true
)
},
},
/**根据openId获取用户信息 */
getUserInfo
(
data
)
{
return
api
.
post
({
method
:
`
${
path
}
userProfile.getUserInfo`
,
...
data
},
true
)
},
/**退出 */
/**退出 */
logout
()
{
logout
()
{
return
api
.
post
({
return
api
.
post
({
...
...
api/wecha
n
tApi.js
→
api/wechatApi.js
View file @
39470ec
import
api
from
'./request'
import
api
from
'./request'
const
path
=
'scrm.api.wechat.'
const
path
=
'scrm.api.wechat.'
module
.
exports
=
{
module
.
exports
=
{
/**
根据openId获取用户信息
*/
/**
解析scene
*/
get
UserInfo
(
data
)
{
get
SceneById
(
data
)
{
return
api
.
post
({
return
api
.
post
({
method
:
`
${
path
}
weapp.userProfile.getUserInfo
`
,
method
:
`
${
path
}
get.scene.by.id
`
,
...
data
...
data
},
true
)
},
true
)
}
,
}
}
}
app.js
View file @
39470ec
...
@@ -4,8 +4,9 @@ import util from './utils/util.js'
...
@@ -4,8 +4,9 @@ import util from './utils/util.js'
import
'./utils/Track'
import
'./utils/Track'
import
{
import
{
ssoApi
,
ssoApi
,
wecha
n
tApi
wechatApi
}
from
'./api/api'
}
from
'./api/api'
import
{
trackData
}
from
'./utils/data'
App
({
App
({
onLaunch
:
function
(
options
)
{
onLaunch
:
function
(
options
)
{
/**挂载到wx对象 */
/**挂载到wx对象 */
...
@@ -13,6 +14,7 @@ App({
...
@@ -13,6 +14,7 @@ App({
wx
.
$router
=
router
wx
.
$router
=
router
wx
.
$imgUrl
=
'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
wx
.
$imgUrl
=
'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
wx
.
$appId
=
wx
.
getAccountInfoSync
().
miniProgram
.
appId
wx
.
$appId
=
wx
.
getAccountInfoSync
().
miniProgram
.
appId
wx
.
$trackData
=
options
.
query
this
.
globalData
.
appId
=
wx
.
getAccountInfoSync
().
miniProgram
.
appId
this
.
globalData
.
appId
=
wx
.
getAccountInfoSync
().
miniProgram
.
appId
const
systemInfo
=
wx
.
getStorageSync
(
'srcm_shopmall_system_info'
)
const
systemInfo
=
wx
.
getStorageSync
(
'srcm_shopmall_system_info'
)
if
(
!
systemInfo
)
wx
.
getSystemInfo
({
if
(
!
systemInfo
)
wx
.
getSystemInfo
({
...
@@ -21,7 +23,10 @@ App({
...
@@ -21,7 +23,10 @@ App({
}
}
})
})
console
.
log
(
options
)
console
.
log
(
options
)
if
(
options
.
path
!=
'pages/tab/index/index'
)
{
this
.
login
()
this
.
login
()
}
},
},
login
(
returnResponse
)
{
login
(
returnResponse
)
{
let
_this
=
this
let
_this
=
this
...
@@ -38,7 +43,7 @@ App({
...
@@ -38,7 +43,7 @@ App({
wx
.
$authStatus
=
res
.
code
!=
0
wx
.
$authStatus
=
res
.
code
!=
0
util
.
setSessionId
(
res
.
data
.
sessionId
)
util
.
setSessionId
(
res
.
data
.
sessionId
)
const
openId
=
res
.
data
.
openId
const
openId
=
res
.
data
.
openId
wechant
Api
.
getUserInfo
({
sso
Api
.
getUserInfo
({
openId
openId
}).
then
(
result
=>
{
}).
then
(
result
=>
{
console
.
log
(
result
)
console
.
log
(
result
)
...
@@ -63,7 +68,31 @@ App({
...
@@ -63,7 +68,31 @@ App({
wx
.
$authStatus
=
true
wx
.
$authStatus
=
true
reject
()
reject
()
})
})
console
.
log
(
wx
.
$trackData
.
scene
,
'--------'
)
if
(
wx
.
$trackData
.
scene
)
{
_this
.
getScene
(
wx
.
$trackData
.
scene
).
then
(
res
=>
{
console
.
log
(
res
)
wx
.
$trackData
.
merchant
=
res
.
merchantId
})
wx
.
$Track
.
sendTrack
(
trackData
.
COMPANY
)
}
}
}
})
})
},
getScene
(
scene
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
wechatApi
.
getSceneById
({
id
:
decodeURIComponent
(
scene
).
split
(
'='
)[
1
]
}).
then
(({
data
})
=>
{
let
op
=
{}
data
.
scene
.
split
(
'&'
).
map
(
item
=>
{
const
[
key
,
val
]
=
item
.
split
(
"="
)
op
[
key
]
=
val
})
console
.
log
(
op
)
resolve
(
op
)
// wx.$trackData.merchant = op.merchantId
})
})
})
})
},
},
...
...
utils/Track.js
View file @
39470ec
...
@@ -124,6 +124,7 @@ class TRACK {
...
@@ -124,6 +124,7 @@ class TRACK {
}
}
/**定时发送埋点数据 */
/**定时发送埋点数据 */
sendTrack
(
p
)
{
sendTrack
(
p
)
{
console
.
log
(
wx
.
$trackData
)
let
params
=
{
let
params
=
{
method
:
'entmicro.api.business.card.cardRecord'
method
:
'entmicro.api.business.card.cardRecord'
}
}
...
@@ -133,10 +134,13 @@ class TRACK {
...
@@ -133,10 +134,13 @@ class TRACK {
openId
:
'123445'
,
openId
:
'123445'
,
unionId
:
''
,
unionId
:
''
,
phone
:
'18873336682'
,
phone
:
'18873336682'
,
merchant
:
'12121'
,
//
merchant: '12121',
cardId
:
'1'
//
cardId: '1'
}
}
params
=
Object
.
assign
(
params
,
userInfo
,
p
)
if
(
!
wx
.
$trackData
.
merchant
)
{
}
params
=
Object
.
assign
(
params
,
userInfo
,
p
,
wx
.
$trackData
)
console
.
log
(
params
)
console
.
log
(
params
)
api
.
reportTrack
(
params
).
then
(({
api
.
reportTrack
(
params
).
then
(({
code
,
code
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment