Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
b0b4fab5
Commit
b0b4fab5
authored
May 11, 2021
by
wufan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:员工列表也增加open-data组件
parent
7cdb72ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
20 deletions
+18
-20
src/common/js/wechatApi.js
+2
-19
src/modules/store-manage/EmployeesManagePage.tsx
+16
-1
No files found.
src/common/js/wechatApi.js
View file @
b0b4fab5
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Author: wufan
* @Date: 2021-05-11 10:21:37
* @Date: 2021-05-11 10:21:37
* @LastEditors: wufan
* @LastEditors: wufan
* @LastEditTime: 2021-05-11 16:
16:24
* @LastEditTime: 2021-05-11 16:
59:32
* @Description: 企业微信api
* @Description: 企业微信api
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -20,26 +20,9 @@ export default class WechatApi {
...
@@ -20,26 +20,9 @@ export default class WechatApi {
url
:
params
.
url
,
url
:
params
.
url
,
}).
then
((
result
)
=>
{
}).
then
((
result
)
=>
{
const
res
=
result
.
result
;
const
res
=
result
.
result
;
// if (/MicroMessenger/i.test(navigator.userAgent)) {
// wx.config({
// beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
// debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
// appId: res.corpId, // 必填,企业微信的corpID
// timestamp: res.timeStamp, // 必填,生成签名的时间戳
// nonceStr: res.nonceStr, // 必填,生成签名的随机串
// signature: res.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
// jsApiList: [
// "chooseImage",
// "shareToExternalContact",
// "selectExternalContact",
// "selectEnterpriseContact",
// ],
// });
// }
wx
.
config
({
wx
.
config
({
beta
:
true
,
// 必须这么写,否则wx.invoke调用形式的jsapi会有问题
beta
:
true
,
// 必须这么写,否则wx.invoke调用形式的jsapi会有问题
debug
:
tru
e
,
// 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
debug
:
fals
e
,
// 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId
:
res
.
corpId
,
// 必填,企业微信的corpID
appId
:
res
.
corpId
,
// 必填,企业微信的corpID
timestamp
:
res
.
timeStamp
,
// 必填,生成签名的时间戳
timestamp
:
res
.
timeStamp
,
// 必填,生成签名的时间戳
nonceStr
:
res
.
nonceStr
,
// 必填,生成签名的随机串
nonceStr
:
res
.
nonceStr
,
// 必填,生成签名的随机串
...
...
src/modules/store-manage/EmployeesManagePage.tsx
View file @
b0b4fab5
...
@@ -15,6 +15,8 @@ import { QuestionCircleOutlined } from "@ant-design/icons";
...
@@ -15,6 +15,8 @@ import { QuestionCircleOutlined } from "@ant-design/icons";
import
StoreService
from
"@/domains/store-domain/storeService"
;
import
StoreService
from
"@/domains/store-domain/storeService"
;
import
EmployeeAddOrEditModal
from
"./EmployeeAddOrEditModal"
;
import
EmployeeAddOrEditModal
from
"./EmployeeAddOrEditModal"
;
import
User
from
"@/common/js/user"
;
import
User
from
"@/common/js/user"
;
import
WechatApi
from
'@/common/js/wechatApi'
;
import
WWOpenDataCom
from
'@/components/WWOpenDataCom'
;
import
"./EmployeesManagePage.less"
;
import
"./EmployeesManagePage.less"
;
import
Item
from
"antd/lib/list/Item"
;
import
Item
from
"antd/lib/list/Item"
;
...
@@ -91,12 +93,22 @@ function EmployeesManagePage() {
...
@@ -91,12 +93,22 @@ function EmployeesManagePage() {
useEffect
(()
=>
{
useEffect
(()
=>
{
getEmployeeList
();
getEmployeeList
();
initWechatConfig
();
},
[
query
]);
},
[
query
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
getListInfo
();
getListInfo
();
},
[
storeId
]);
},
[
storeId
]);
async
function
initWechatConfig
()
{
WechatApi
.
initConfig
({
isAgentConfig
:
true
,
url
:
window
.
location
.
href
.
split
(
'#'
)[
0
]
}).
then
(()
=>
{
console
.
info
(
'window.WWOpenData'
,
window
.
WWOpenData
);
})
.
catch
(
error
=>
{
console
.
log
(
"error-----"
,
error
);
})
}
async
function
getListInfo
()
{
async
function
getListInfo
()
{
await
getStoreRole
();
await
getStoreRole
();
}
}
...
@@ -141,7 +153,10 @@ function EmployeesManagePage() {
...
@@ -141,7 +153,10 @@ function EmployeesManagePage() {
/>
/>
)
}
)
}
<
span
className=
"title"
>
{
val
}
</
span
>
{
/* <span className="title">{val}</span> */
}
<
span
className=
"title"
>
<
WWOpenDataCom
type=
"userName"
openid=
{
val
}
/>
</
span
>
</
div
>
</
div
>
);
);
},
},
...
...
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