Commit 3d7b94b2230672838bc14f28c2b4fc10207a12f1
1 parent
129cbbb8
企业微信的优化
Showing
4 changed files
with
74 additions
and
0 deletions
pages/test/test.js
0 → 100644
1 | +var ut = require("../../utils/util.js"); | ||
2 | +var os=getApp().globalData.setting; | ||
3 | +Page({ | ||
4 | + data:{ | ||
5 | + store:null, | ||
6 | + imghots: os.imghost, | ||
7 | + msg:"", | ||
8 | + qyid:'wwc96c9375cd8d185a' | ||
9 | + }, | ||
10 | + | ||
11 | + onLoad:function(t){ | ||
12 | + wx.qy.login({ | ||
13 | + success: function (res) { | ||
14 | + //var qyid = that.data.qyid; | ||
15 | + var req_data = { | ||
16 | + js_code: res.code, | ||
17 | + //qyid: qyid | ||
18 | + }; | ||
19 | + | ||
20 | + | ||
21 | + //调用接口获取userid | ||
22 | + that.globalData.request.promiseGet('api/weshop/qywechat/getjscode2session', { | ||
23 | + data: req_data | ||
24 | + }).then(rs => { | ||
25 | + if (rs.data.code == 0) { | ||
26 | + | ||
27 | + | ||
28 | + wx.qy.getCurExternalChat ({ | ||
29 | + success: function(res) { | ||
30 | + var chatId = res.chatId //返回当前外部群的群聊ID | ||
31 | + | ||
32 | + console.log(chatId); | ||
33 | + getApp().confirmBox(chatId+"---"); | ||
34 | + | ||
35 | + } | ||
36 | + }) | ||
37 | + | ||
38 | + | ||
39 | + } | ||
40 | + }) | ||
41 | + } | ||
42 | + }) | ||
43 | + }, | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | +}); |
pages/test/test.json
0 → 100644
pages/test/test.wxml
0 → 100644
pages/test/test.wxss
0 → 100644
1 | +.all_page{ | ||
2 | + position: fixed; | ||
3 | + height: 100%; | ||
4 | + width: 100%; | ||
5 | + background: #fff; | ||
6 | + justify-content: center;/*水平居中*/ | ||
7 | +} | ||
8 | +.all_page .content{ | ||
9 | + font-size: 30rpx; | ||
10 | + text-align: center; | ||
11 | + height: 400px; | ||
12 | + width: 100%; | ||
13 | + position: absolute; | ||
14 | + top: 50%; | ||
15 | + margin-top:-200px; | ||
16 | +} | ||
17 | +.logo{width: 140rpx; height: 140rpx; border-radius:50% } | ||
18 | +.all_page .content .title{ | ||
19 | + font-size: 36rpx; margin: 20rpx 0 | ||
20 | +} | ||
21 | + | ||
22 | +.all_page .err{ | ||
23 | + color:red; | ||
24 | + font-size: 36rpx; | ||
25 | + margin-top: 300rpx; | ||
26 | +} | ||
0 | \ No newline at end of file | 27 | \ No newline at end of file |