forked from trazyn/weweChat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
285 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
import React, { Component } from 'react'; | ||
import { observer, inject } from 'mobx-react'; | ||
|
||
import classes from './style.css'; | ||
|
||
@inject(stores => ({ | ||
show: stores.members.show, | ||
close: () => stores.members.toggle(false), | ||
user: stores.members.user, | ||
list: stores.members.list, | ||
})) | ||
@observer | ||
export default class Members extends Component { | ||
render() { | ||
var { user, list } = this.props; | ||
|
||
if (!this.props.show) { | ||
return false; | ||
} | ||
|
||
return ( | ||
<div className={classes.container}> | ||
<header> | ||
<span> | ||
Group '{user.NickName}' has {list.length} members | ||
</span> | ||
|
||
<i className="icon-ion-android-close" onClick={e => this.props.close()} /> | ||
</header> | ||
|
||
<ul className={classes.list}> | ||
{ | ||
list.map((e, index) => { | ||
var pallet = e.pallet || []; | ||
var frontColor = pallet[1] || [0, 0, 0]; | ||
|
||
return ( | ||
<li key={index} style={{ | ||
color: `rgb( | ||
${frontColor[0]}, | ||
${frontColor[1]}, | ||
${frontColor[2]} | ||
)`, | ||
}}> | ||
<div className={classes.cover} style={{ | ||
backgroundImage: `url(${e.HeadImgUrl})`, | ||
}} /> | ||
<span className={classes.username} dangerouslySetInnerHTML={{ __html: e.NickName }} /> | ||
</li> | ||
); | ||
}) | ||
} | ||
</ul> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
|
||
.container { | ||
position: fixed; | ||
top: 40px; | ||
left: 0; | ||
width: 100vw; | ||
background: #fff; | ||
color: #333; | ||
z-index: 9; | ||
box-shadow: inset 0 -1px 0 0 #eaedea; | ||
|
||
& header { | ||
display: flex; | ||
padding: 0 12px; | ||
height: 50px; | ||
line-height: 50px; | ||
justify-content: space-between; | ||
align-items: center; | ||
font-family: 'Roboto'; | ||
font-weight: 100; | ||
font-size: 20px; | ||
color: #333; | ||
box-shadow: inset 0 -1px 0 0 #eaedea; | ||
} | ||
|
||
& header i { | ||
cursor: pointer; | ||
} | ||
|
||
& header i:hover { | ||
color: red; | ||
} | ||
} | ||
|
||
.list { | ||
position: relative; | ||
padding: 8px; | ||
margin: 0; | ||
list-style: none; | ||
max-height: calc(100vh - 90px); | ||
overflow: hidden; | ||
overflow-y: auto; | ||
|
||
& li { | ||
position: relative; | ||
display: inline-block; | ||
padding: 0 14px; | ||
margin: 6px 8px; | ||
height: 32px; | ||
line-height: 32px; | ||
border-radius: 1px; | ||
cursor: pointer; | ||
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .3); | ||
overflow: hidden; | ||
transition: .2s; | ||
} | ||
|
||
|
||
& li:hover .cover { | ||
filter: opacity(1); | ||
transform: scale(1.2); | ||
} | ||
} | ||
|
||
.cover { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-size: cover; | ||
background-position: center; | ||
filter: opacity(.6); | ||
transform: scale(1); | ||
transition: .2s; | ||
|
||
&::after { | ||
content: ''; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: rgba(0, 0, 0, .3); | ||
} | ||
} | ||
|
||
.username { | ||
position: relative; | ||
font-size: 13px; | ||
|
||
& :global(.emoji) { | ||
margin-top: 10px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
|
||
import { observable, action } from 'mobx'; | ||
import axios from 'axios'; | ||
|
||
import storage from 'utils/storage'; | ||
import helper from 'utils/helper'; | ||
|
||
class Members { | ||
@observable show = false; | ||
@observable user = { | ||
MemberList: [], | ||
}; | ||
@observable list = []; | ||
|
||
@action async toggle(show = self.show, user = self.user) { | ||
var list = []; | ||
|
||
self.show = show; | ||
self.user = user; | ||
|
||
if (show === false) { | ||
return; | ||
} | ||
|
||
self.list.replace(user.MemberList.sort((a, b) => a.PYQuanPin - b.PYQuanPin)); | ||
|
||
Promise.all( | ||
user.MemberList.map(async e => { | ||
var pallet = e.pallet; | ||
|
||
if (!pallet) { | ||
e.pallet = await helper.getPallet(e.HeadImgUrl); | ||
} | ||
list.push(e); | ||
}) | ||
).then(() => { | ||
self.list.replace(list.sort((a, b) => a.PYQuanPin - b.PYQuanPin)); | ||
}); | ||
} | ||
|
||
@action async sendRequest(message) { | ||
var auth = await storage.get('auth'); | ||
var response = await axios.post(`/cgi-bin/mmwebwx-bin/webwxverifyuser?r=${+new Date()}`, { | ||
BaseRequest: { | ||
Sid: auth.wxsid, | ||
Uin: auth.wxuin, | ||
Skey: auth.skey, | ||
}, | ||
Opcode: 2, | ||
SceneList: [33], | ||
SceneListCount: 1, | ||
VerifyContent: message, | ||
VerifyUserList: [{ | ||
Value: self.user.UserName, | ||
VerifyUserTicket: '', | ||
}], | ||
VerifyUserListSize: 1, | ||
skey: auth.skey, | ||
}); | ||
|
||
return +response.data.BaseResponse.Ret === 0; | ||
} | ||
} | ||
|
||
const self = new Members(); | ||
export default self; |
Oops, something went wrong.