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 910a011e
authored
Sep 08, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加请求
1 parent
7210b752
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
49 deletions
api/api.js
api/entmicroApi.js
api/environment.js
pages/tab/index/index.js
api/api.js
View file @
910a011
import
api
from
'./request'
import
api
from
'./request'
import
ssoApi
from
'./ssoApi'
import
ssoApi
from
'./ssoApi'
import
entmicroApi
from
'./entmicroApi'
const
common
=
'scrm.api.carlife.common.'
const
common
=
'scrm.api.carlife.common.'
module
.
exports
=
{
module
.
exports
=
{
ssoApi
,
ssoApi
,
entmicroApi
,
commonApi
:
{
commonApi
:
{
/**上传图片
/**上传图片
*/
*/
...
...
api/entmicroApi.js
0 → 100644
View file @
910a011
import
api
from
"./request"
;
module
.
exports
=
{
// 智能名片详情
getCardDetail
(
data
)
{
return
api
.
post
(
{
method
:
`entmicro.api.business.card.cardDetail`
,
...
data
,
},
true
);
},
}
\ No newline at end of file
\ No newline at end of file
api/environment.js
View file @
910a011
const
target
=
[
const
target
=
[
"ip"
,
"dev"
,
"uat"
,
"prod"
];
'ip'
,
'dev'
,
'uat'
,
'prod'
]
/**
/**
*
*
0本地
0本地
...
@@ -11,43 +6,44 @@ const target = [
...
@@ -11,43 +6,44 @@ const target = [
2测试
2测试
3生产
3生产
*/
*/
const
index
=
2
const
index
=
1
;
const
secretKey
=
{
const
secretKey
=
{
ip
:
{},
ip
:
{},
dev
:
{
dev
:
{
sso
:
{
sso
:
{
appKey
:
'8b31ae1009ccb0f96130ca4bd90e3d89'
,
appKey
:
"8b31ae1009ccb0f96130ca4bd90e3d89"
,
secret
:
'02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
,
secret
:
"02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b"
,
}
}
,
},
},
uat
:
{
uat
:
{
sso
:
{
sso
:
{
appKey
:
'8b31ae1009ccb0f96130ca4bd90e3d89'
,
appKey
:
"8b31ae1009ccb0f96130ca4bd90e3d89"
,
secret
:
'02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
,
secret
:
"02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b"
,
}
}
,
},
},
prod
:
{
prod
:
{
sso
:
{
sso
:
{
appKey
:
'8b31ae1009ccb0f96130ca4bd90e3d89'
,
appKey
:
"8b31ae1009ccb0f96130ca4bd90e3d89"
,
secret
:
'02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
,
secret
:
"02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b"
,
}
}
,
},
},
}
[
target
[
index
]]
}
[
target
[
index
]];
const
domain
=
{
const
domain
=
{
ip
:
'http://192.168.3.181:8394'
,
ip
:
"http://192.168.3.181:8394"
,
dev
:
'https://scrm.dev.glsx.com.cn'
,
dev
:
"https://scrm.dev.glsx.com.cn"
,
uat
:
'https://scrm.test.glsx.com.cn'
,
uat
:
"https://scrm.test.glsx.com.cn"
,
prod
:
'https://scrm.glsx.com.cn'
,
prod
:
"https://scrm.glsx.com.cn"
,
}
[
target
[
index
]]
}
[
target
[
index
]];
const
pathEnum
=
{
const
pathEnum
=
{
sso
:
'/rop-scrm-sso/'
,
sso
:
"/rop-scrm-sso/"
,
wechant
:
'rop-scrm-wechant'
wechant
:
"rop-scrm-wechant"
,
}
business
:
"/rop-scrm-entmicro/"
,
};
module
.
exports
=
{
module
.
exports
=
{
index
,
index
,
domain
,
domain
,
pathEnum
,
pathEnum
,
secretKey
,
secretKey
,
}
\ No newline at end of file
\ No newline at end of file
};
pages/tab/index/index.js
View file @
910a011
...
@@ -7,8 +7,9 @@
...
@@ -7,8 +7,9 @@
*/
*/
// pages/tab/index/index.js
// pages/tab/index/index.js
import
{
menuMixin
}
from
"../../../mixins/index"
;
import
{
menuMixin
}
from
"../../../mixins/index"
;
import
Draw
from
'../../../utils/Draw'
;
import
Draw
from
"../../../utils/Draw"
;
import
{
ssoApi
}
from
'../../../api/api'
;
import
{
ssoApi
,
entmicroApi
}
from
"../../../api/api"
;
import
util
from
"../../../utils/util"
;
Page
({
Page
({
behaviors
:
[
menuMixin
],
behaviors
:
[
menuMixin
],
/**
/**
...
@@ -42,7 +43,7 @@ Page({
...
@@ -42,7 +43,7 @@ Page({
// 0-员工,1-代理商
// 0-员工,1-代理商
customerType
:
0
,
customerType
:
0
,
// 是否授权昵称
// 是否授权昵称
hasUserInfo
:
false
hasUserInfo
:
false
,
},
},
introduce
(
e
)
{
introduce
(
e
)
{
const
curTabIndex
=
e
.
currentTarget
.
dataset
.
index
;
const
curTabIndex
=
e
.
currentTarget
.
dataset
.
index
;
...
@@ -72,6 +73,15 @@ Page({
...
@@ -72,6 +73,15 @@ Page({
*/
*/
onLoad
(
options
)
{
onLoad
(
options
)
{
console
.
log
(
this
.
data
.
hasUserInfo
);
console
.
log
(
this
.
data
.
hasUserInfo
);
// 获取员工名片信息
const
sessionId
=
util
.
getSessionId
();
let
params
=
{};
params
.
cardId
=
21
;
params
.
sessionId
=
sessionId
;
console
.
log
(
params
,
"+++"
);
// entmicroApi.getCardDetail(params).then((res) => {
// console.log(res);
// });
},
},
/**
/**
...
@@ -237,35 +247,34 @@ Page({
...
@@ -237,35 +247,34 @@ Page({
},
},
// 获取用户昵称
// 获取用户昵称
getUserProfile
(
e
)
{
getUserProfile
(
e
)
{
console
.
log
(
e
)
console
.
log
(
e
)
;
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx
.
getUserProfile
({
wx
.
getUserProfile
({
desc
:
'用于完善资料'
,
// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
desc
:
"用于完善资料"
,
// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
;
console
.
log
(
this
.
data
.
hasUserInfo
)
console
.
log
(
this
.
data
.
hasUserInfo
)
;
this
.
setData
({
this
.
setData
({
hasUserInfo
:
true
hasUserInfo
:
true
,
});
ssoApi
.
authUserInfo
({
...
res
,
})
})
ssoApi
.
authUserInfo
({
.
then
(({
code
})
=>
{
...
res
if
(
code
==
"0"
)
{
}).
then
(({
getApp
()
code
.
login
()
})
=>
{
.
then
(({
data
})
=>
{
if
(
code
==
'0'
)
{
getApp
().
login
().
then
(({
data
})
=>
{
this
.
setData
({
this
.
setData
({
userInfo
:
data
,
userInfo
:
data
,
// hasUserInfo: true
// hasUserInfo: true
})
});
})
});
}
})
}
}
})
});
},
});
},
},
});
});
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