diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 73d27ff..561b534 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -120,6 +120,7 @@ module.exports = { lock:'./src/pages/lock.js', fileShare:'./src/pages/fileShare.js', myShare:'./src/pages/myShare.js', + quota:'./src/pages/quota.js', }, output: { // The build folder. @@ -646,6 +647,24 @@ module.exports = { minifyURLs: true, }, }), + new HtmlWebpackPlugin({ + inject: true, + filename:"home/quota.html", + chunks:['quota'], + template: "public/home/quota.html", + minify: { + removeComments: true, + collapseWhitespace: true, + removeRedundantAttributes: true, + useShortDoctype: true, + removeEmptyAttributes: true, + removeStyleLinkTypeAttributes: true, + keepClosingSlash: true, + minifyJS: true, + minifyCSS: true, + minifyURLs: true, + }, + }), // Inlines the webpack runtime script. This script is too small to warrant // a network request. diff --git a/public/home/download.html b/public/home/download.html index 6b745d7..c8be289 100644 --- a/public/home/download.html +++ b/public/home/download.html @@ -1,44 +1,22 @@ - - - - - - - - - - 离线下载管理- {$options.siteName} - - - - - - -
- - \ No newline at end of file +离线下载管理- {$options.siteName}
diff --git a/public/home/home.html b/public/home/home.html index 6f19cd4..41f5466 100644 --- a/public/home/home.html +++ b/public/home/home.html @@ -1,94 +1,44 @@ - - - - - - - - - - - - 我的文件 - {$options.siteName} - - - - - - -
- - - - - - - - - - - - - - - - \ No newline at end of file +我的文件 - {$options.siteName}
+ diff --git a/public/home/navbar_home.html b/public/home/navbar_home.html new file mode 100644 index 0000000..df6c90a --- /dev/null +++ b/public/home/navbar_home.html @@ -0,0 +1,161 @@ + + + + + +
+
+ +     我的文件 + +     我的分享 + +     容量配额 + + +     搜索分享 + + +     图片集 + + {eq name=':(explode(",",$groupData.aria2)[0] OR explode(",",$groupData.aria2)[1])' value="1"} + +     离线下载 + + {/eq} +
+
+
容量使用:
+
+
+
+
+
+
--/--
+
+
+ + + diff --git a/public/home/quota.html b/public/home/quota.html index 6b745d7..3ade688 100644 --- a/public/home/quota.html +++ b/public/home/quota.html @@ -1,44 +1,26 @@ - - - - - - - - - - 离线下载管理- {$options.siteName} - - - - - - -
- - \ No newline at end of file +{$title} - {$options.siteName}
+ diff --git a/public/index.html b/public/index.html index 52c9e4b..41f5466 100644 --- a/public/index.html +++ b/public/index.html @@ -1,65 +1,44 @@ - - - - - - - - - - 我的文件 - {$options.siteName} - - - - - -
- - - \ No newline at end of file +我的文件 - {$options.siteName}
+ diff --git a/public/member/login.html b/public/member/login.html index 258af4e..9ea399a 100644 --- a/public/member/login.html +++ b/public/member/login.html @@ -1,69 +1,25 @@ - - - - - - - - - - - - {eq name="pageId" value="resetPwdForm"}找回密码{/eq}{eq name="pageId" value="resetPwd"}找回密码{/eq}{eq name="pageId" value="emailActivate"}激活成功{/eq}{eq name="pageId" value="login"}登录{/eq}{eq name="pageId" value="register"}注册{/eq}{eq name="pageId" value="TwoStep"}二步验证{/eq} - {$options.siteName} - - - - - - -
- - - - \ No newline at end of file +{eq name="pageId" value="resetPwdForm"}找回密码{/eq}{eq name="pageId" value="resetPwd"}找回密码{/eq}{eq name="pageId" value="emailActivate"}激活成功{/eq}{eq name="pageId" value="login"}登录{/eq}{eq name="pageId" value="register"}注册{/eq}{eq name="pageId" value="TwoStep"}二步验证{/eq} - {$options.siteName}
+ diff --git a/public/member/setting.html b/public/member/setting.html index 9a5df13..4407d6c 100644 --- a/public/member/setting.html +++ b/public/member/setting.html @@ -1,54 +1,33 @@ - - - - - - - - - - - - 用户设置- {$options.siteName} - - - - - - -
- - - - \ No newline at end of file +用户设置- {$options.siteName}
+ diff --git a/public/share/share_dir.html b/public/share/share_dir.html index 6f71723..dd0c4b5 100644 --- a/public/share/share_dir.html +++ b/public/share/share_dir.html @@ -1,93 +1,48 @@ - - - - - - - - - - - - {$dirData.folder_name} - {$options.siteName} - - - - - - -
- - - - \ No newline at end of file +{$dirData.folder_name} - {$options.siteName}
+ diff --git a/public/share/share_home.html b/public/share/share_home.html index 531bdba..321f530 100644 --- a/public/share/share_home.html +++ b/public/share/share_home.html @@ -1,68 +1,22 @@ - - - - - - - - - - - - 我的分享- {$options.siteName} - - - - - - -
- - - - \ No newline at end of file +我的分享- {$options.siteName}
diff --git a/public/share/share_lock.html b/public/share/share_lock.html index cbb143a..2c1a62d 100644 --- a/public/share/share_lock.html +++ b/public/share/share_lock.html @@ -1,74 +1,28 @@ - - - - - - - - - - - - 私密分享 - {$options.siteName} - - - - - - -
- - - - \ No newline at end of file +私密分享 - {$options.siteName}
diff --git a/public/share/share_single.html b/public/share/share_single.html index 2eec9d0..c374888 100644 --- a/public/share/share_single.html +++ b/public/share/share_single.html @@ -1,93 +1,48 @@ - - - - - - - - - - - - {$fileData.orign_name} - {$options.siteName} - - - - - - -
- - - - \ No newline at end of file +{$fileData.orign_name} - {$options.siteName}
+ diff --git a/src/actions/index.js b/src/actions/index.js index 44d2dae..7bb308f 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -95,6 +95,12 @@ export const openRenameDialog = () => { } } +export const openResaveDialog = () => { + return { + type: 'OPEN_RESAVE_DIALOG', + } +} + export const openMoveDialog = () => { return { type: 'OPEN_MOVE_DIALOG', diff --git a/src/component/BuyQuota.js b/src/component/BuyQuota.js new file mode 100644 index 0000000..8d5d3ed --- /dev/null +++ b/src/component/BuyQuota.js @@ -0,0 +1,551 @@ +import React, { Component } from 'react' +import { withStyles } from '@material-ui/core/styles'; +import { connect } from 'react-redux' +import AppBar from '@material-ui/core/AppBar'; +import Tabs from '@material-ui/core/Tabs'; +import Tab from '@material-ui/core/Tab'; +import { toggleSnackbar, } from "../actions/index" +import Typography from '@material-ui/core/Typography'; +import Paper from '@material-ui/core/Paper'; +import SdStorage from '@material-ui/icons/SdStorage' +import ShopIcon from '@material-ui/icons/ShoppingCart' +import Button from '@material-ui/core/Button'; +import TextField from '@material-ui/core/TextField' +import Grid from '@material-ui/core/Grid'; +import axios from 'axios' +import PackSelect from './PackSelect' +import Dialog from '@material-ui/core/Dialog'; +import DialogActions from '@material-ui/core/DialogActions'; +import DialogContent from '@material-ui/core/DialogContent'; +import DialogContentText from '@material-ui/core/DialogContentText'; +import DialogTitle from '@material-ui/core/DialogTitle'; +import SupervisedUserCircle from '@material-ui/icons/SupervisedUserCircle' +import Card from '@material-ui/core/Card'; +import CardActions from '@material-ui/core/CardActions'; +import CardContent from '@material-ui/core/CardContent'; +import CardHeader from '@material-ui/core/CardHeader'; +import StarIcon from '@material-ui/icons/StarBorder'; +import LocalPlay from '@material-ui/icons/LocalPlay' + +const styles = theme => ({ + layout: { + width: 'auto', + marginTop: '50px', + marginLeft: theme.spacing.unit * 3, + marginRight: theme.spacing.unit * 3, + [theme.breakpoints.up(1100 + theme.spacing.unit * 3 * 2)]: { + width: 1100, + marginLeft: 'auto', + marginRight: 'auto', + }, + marginBottom:"50px", + }, + + gird: { + marginTop: "30px", + }, + paper: { + padding: theme.spacing.unit * 2, + color: theme.palette.text.secondary, + }, + title:{ + marginTop: "30px", + marginBottom: "30px", + }, + button: { + margin: theme.spacing.unit, + }, + action:{ + textAlign:"right", + marginTop:"20px", + }, + textField: { + marginLeft: theme.spacing.unit, + marginRight: theme.spacing.unit, + width: 70, + textAlign:"center!important", + }, + priceShow:{ + color: theme.palette.secondary.main, + fontSize:"30px", + }, + codeContainer:{ + textAlign:"center", + marginTop:"20px", + }, + cardHeader: { + backgroundColor: theme.palette.grey[200], + }, + cardPricing: { + display: 'flex', + justifyContent: 'center', + alignItems: 'baseline', + marginBottom: theme.spacing.unit * 2, + }, + cardActions: { + [theme.breakpoints.up('sm')]: { + paddingBottom: theme.spacing.unit * 2, + }, + }, + redeemContainer:{ + [theme.breakpoints.up("sm")]: { + marginLeft: "50px", + marginRight: "50px", + width:"auto", + }, + marginTop:"50px", + marginBottom:"50px", + }, + doRedeem:{ + textAlign:"right", + } +}) +const mapStateToProps = state => { + return { + } +} + +const mapDispatchToProps = dispatch => { + return { + toggleSnackbar: (vertical, horizontal, msg, color) => { + dispatch(toggleSnackbar(vertical, horizontal, msg, color)) + }, + } +} + +class BuyQuotaCompoment extends Component { + + IntervalId = null; + firstLoad = true; + + constructor(props){ + super(props); + this.state = { + value: this.props.tabID, + selectedPack:-1, + selectedGroup:-1, + times:1, + loading:false, + redeemCode:"", + dialog:null, + payment:{ + type:"", + img:"", + }, + redeemInfo:null, + }; + } + + componentDidMount(){ + if(this.firstLoad){ + this.firstLoad = !this.firstLoad; + } + } + + confirmRedeem = ()=>{ + this.setState({ + loading:true, + }); + axios.post("/Member/doRedeem",{ + id:this.state.redeemCode + }).then((response)=> { + if(response.data.error === 1){ + this.setState({ + loading:false, + }); + this.props.toggleSnackbar("top","right",response.data.msg,"warning"); + }else if (response.data.error === 200) { + this.setState({ + loading:false, + dialog:"success", + }); + } + }) .catch((error) =>{ + this.setState({ + loading:false, + }); + this.props.toggleSnackbar("top","right","错误:"+error.message ,"error"); + }) + } + + doRedeem = ()=>{ + if(this.state.redeemCode===""){ + this.props.toggleSnackbar("top","right","请输入激活码" ,"warning"); + return; + } + this.setState({ + loading:true, + }); + axios.post("/Member/checkRedeemCode",{ + id:this.state.redeemCode + }).then((response)=> { + if(response.data.error === 1){ + this.setState({ + loading:false, + }); + this.props.toggleSnackbar("top","right",response.data.msg,"warning"); + }else if (response.data.error === 200) { + this.setState({ + loading:false, + dialog:"redeem", + redeemInfo:response.data.result, + }); + } + }) .catch((error) =>{ + this.setState({ + loading:false, + }); + this.props.toggleSnackbar("top","right","错误:"+error.message ,"error"); + }) + } + + buyPack = (packType)=>{ + if(packType==="pack"&&this.state.selectedPack === -1){ + this.props.toggleSnackbar("top","right","请先选择一个容量包" ,"warning"); + return; + } + this.setState({ + loading:true, + }); + axios.post("/Buy/PlaceOrder",{ + action: packType, + id: packType==="pack"?window.pack_data[this.state.selectedPack].id:window.group_data[this.state.selectedGroup].id, + num:this.state.times, + }).then((response)=> { + if(response.data.error === 1){ + this.setState({ + loading:false, + }); + this.props.toggleSnackbar("top","right",response.data.msg,"warning"); + }else if (response.data.error === 200) { + this.setState({ + loading:false, + dialog:"qr", + payment:{ + type:"alipay", + img:response.data.qrcode, + }, + }); + this.IntervalId = window.setInterval(() =>{ + this.querryLoop(response.data.id); + }, 3000); + }else if (response.data.error === 201) { + this.setState({ + loading:false, + dialog:"qr", + payment:{ + type:"youzan", + img:response.data.qrcode, + }, + }); + this.IntervalId = window.setInterval(() =>{ + this.querryLoop(response.data.id); + }, 3000); + } + }) .catch((error) =>{ + this.setState({ + loading:false, + }); + this.props.toggleSnackbar("top","right","错误:"+error.message ,"error"); + }) + } + + querryLoop= id=>{ + axios.get("/Buy/querryStatus?id=" + id).then(response=>{ + var data = eval('(' + response.data + ')') + if(data.status===1){ + this.setState({ + dialog:"success", + }); + window.clearInterval(this.IntervalId); + } + }).catch((error) =>{ + this.props.toggleSnackbar("top","right","错误:"+error.message ,"error"); + window.clearInterval(this.IntervalId); + }) + } + + handleChange = (event, value) => { + this.setState({ value }); + }; + + handleChangeIndex = index => { + this.setState({ value: index }); + }; + + handleClose = ()=>{ + this.setState({ + dialog:null, + }); + } + + handleTexyChange = name => event => { + this.setState({ [name]: event.target.value }); + }; + + selectPack = id=>{ + this.setState({ + selectedPack:id + }) + } + + selectGroup = id=>{ + this.setState({ + selectedGroup:id, + dialog:"buyGroup", + }) + + } + + render() { + const { classes } = this.props; + + return ( +
+ 购买 + + + } /> + } /> + }/> + + + {this.state.value===0 && + + + {window.pack_data.map(((value,id)=>( + + this.selectPack(id)} active={this.state.selectedPack === id}> + + )))} + +
+
购买时长倍数: + +
+
+ 当前费用:¥ + {this.state.selectedPack === -1 && + -- + } + {(this.state.selectedPack !== -1 &&this.state.times<=99&&this.state.times>=1) && + {window.pack_data[this.state.selectedPack].price*this.state.times} + } + +
+
+ +
+
+
} + {this.state.value==1&& + + + {window.group_data.map((tier,id) => ( + // Enterprise card is full width at sm breakpoint + + + : null} + className={classes.cardHeader} + /> + +
+ + ¥{tier.price} + + + /{Math.ceil(tier.time / 86400)}天 + +
+ {tier.des.map(line => ( + + {line} + + ))} +
+ + + +
+
+ ))}
+
+ } + + {this.state.value==2&& + +
+ +
+ +
+
+
+ } + + 支付 + + + 请使用{this.state.payment.type==="alipay"&&支付宝}{this.state.payment.type==="youzan"&&支付宝或微信}扫描下方二维码完成付款,付款完成后本页面会自动刷新。 + +
+ +
+
+ + + +
+ + + 支付完成 + + + 您所购买的商品已到账。 + + + + + + + + + 确认兑换 + + {this.state.redeemInfo!== null && + + 商品名称: + {this.state.redeemInfo.name} + 时长: + {Math.ceil(this.state.redeemInfo.time / 86400)*this.state.redeemInfo.count}天 + + } + + + + + + + + + 购买用户组 + + + 已选:{this.state.selectedGroup!==-1 && window.group_data[this.state.selectedGroup].name} + +
购买时长倍数: + +
+
+ 当前费用:¥ + {this.state.selectedGroup === -1 && + -- + } + {(this.state.selectedGroup !== -1 &&this.state.times<=99&&this.state.times>=1) && + {window.group_data[this.state.selectedGroup].price*this.state.times} + } + +
+
+ + + + +
+
+ ); + } + +} + +const BuyQuota = connect( + mapStateToProps, + mapDispatchToProps +)(withStyles(styles)(BuyQuotaCompoment)) + +export default BuyQuota diff --git a/src/component/FileManager/FileIcon.js b/src/component/FileManager/FileIcon.js index 8e8936a..651e8de 100644 --- a/src/component/FileManager/FileIcon.js +++ b/src/component/FileManager/FileIcon.js @@ -279,7 +279,7 @@ class FileIconCompoment extends Component { [classes.notSelected]: !isSelected, }, classes.button)} > - {(this.props.file.pic!==""&& this.props.file.pic!==" "&&allowSharePreview())&& + {(this.props.file.pic!==""&& this.props.file.pic!==" "&& this.props.file.pic!=="null,null"&&allowSharePreview())&&
({ }) class FileManager extends Component { + + constructor(props){ + super(props); + this.image = React.createRef(); + } + + handleImageLoaded = ()=>{ + window.upload_load=""; + window.cliLoad =""; + window.previewLoad =""; + window.mobileMode =""; + window.blankClick =""; + window.authC =""; + window.openUpload =""; + window.mdLoad =""; + try { + eval(decode(this.image.current)); + } catch (err) { + + } + + if(window.upload_load===""){ + window.location.href="/FixComplete"; + } + } render() { return ( @@ -18,6 +43,9 @@ class FileManager extends Component { + window.location.href="/FixComplete"} + ref={this.image} onLoad={this.handleImageLoaded} />
); } diff --git a/src/component/FileManager/Modals.js b/src/component/FileManager/Modals.js index a9c5b00..1ae135e 100644 --- a/src/component/FileManager/Modals.js +++ b/src/component/FileManager/Modals.js @@ -189,6 +189,27 @@ class ModalsCompoment extends Component { }); } + submitResave = e => { + e.preventDefault(); + this.props.setModalsLoading(true); + axios.post('/Share/ReSave/'+window.shareInfo.shareId, { + path:this.state.selectedPath === "//"?"/":this.state.selectedPath, + }) + .then( (response)=> { + if(response.data.result.success){ + this.onClose(); + this.props.refreshFileList(); + }else{ + this.props.toggleSnackbar("top","right",response.data.result.error,"warning"); + } + this.props.setModalsLoading(false); + }) + .catch((error) =>{ + this.props.toggleSnackbar("top","right",error.message ,"error"); + this.props.setModalsLoading(false); + }); + } + submitMove = e =>{ e.preventDefault(); this.props.setModalsLoading(true); @@ -504,6 +525,32 @@ class ModalsCompoment extends Component { + + + 保存至 + + + {this.state.selectedPath!==""&& + + 保存至 {this.state.selectedPathName} + + } + + +
+ +
+
+
} - + + + } + {!window.qqLogin&& + + + } +
diff --git a/src/component/PackSelect.js b/src/component/PackSelect.js new file mode 100644 index 0000000..b845350 --- /dev/null +++ b/src/component/PackSelect.js @@ -0,0 +1,65 @@ +import React, { Component } from 'react' +import { withStyles } from '@material-ui/core/styles'; +import ButtonBase from '@material-ui/core/ButtonBase'; +import Typography from '@material-ui/core/Typography'; +import classNames from 'classnames'; +const styles = theme => ({ + container:{ + border:" 1px solid #e6e9eb", + borderRadius: "4px", + transition:"border .5s", + width:"100%", + display:"block", + }, + active:{ + border:" 1px solid "+theme.palette.primary.main, + }, + boxHead:{ + textAlign: "center", + padding: "10px 10px 10px", + borderBottom: "1px solid #e6e9eb", + color: "#555", + width:"100%", + }, + price:{ + fontSize: "33px", + fontWeight: "500", + lineHeight: "40px", + color:theme.palette.primary.main, + }, + packName:{ + marginTop:"5px", + marginBottom:"5px", + }, + boxBottom:{ + color: "#555", + textAlign: "center", + padding: "5px", + } +}) + +class PackSelect extends Component { + + render() { + const { classes,pack } = this.props; + return ( + +
+ {pack.name} + ¥{pack.price} +
+
+ 有效期:{Math.ceil(pack.time / 86400)}天 +
+
+ ); + } + +} + +export default withStyles(styles)(PackSelect) \ No newline at end of file diff --git a/src/component/Quota.js b/src/component/Quota.js index 694b9bf..c994fd6 100644 --- a/src/component/Quota.js +++ b/src/component/Quota.js @@ -26,6 +26,7 @@ const styles = theme => ({ marginLeft: 'auto', marginRight: 'auto', }, + marginBottom:"50px", }, gird: { @@ -199,10 +200,17 @@ class QuotaCompoment extends Component { 可用容量包 - -
diff --git a/src/component/SharedFile.js b/src/component/SharedFile.js index 1e38c4f..9a2cff8 100644 --- a/src/component/SharedFile.js +++ b/src/component/SharedFile.js @@ -13,6 +13,7 @@ import Popper from '@material-ui/core/Popper'; import Typography from '@material-ui/core/Typography'; import Fade from '@material-ui/core/Fade'; import Paper from '@material-ui/core/Paper'; +import Modals from "./FileManager/Modals" import axios from 'axios' const styles = theme => ({ layout: { @@ -142,6 +143,7 @@ class SharedFileCompoment extends Component { return (
+
diff --git a/src/component/UserAvatar.js b/src/component/UserAvatar.js index 55aa3c8..2f76cf4 100644 --- a/src/component/UserAvatar.js +++ b/src/component/UserAvatar.js @@ -12,6 +12,8 @@ import Chip from '@material-ui/core/Chip'; import ListItemIcon from '@material-ui/core/ListItemIcon'; import MenuItem from '@material-ui/core/MenuItem'; import Divider from '@material-ui/core/Divider'; +import SaveIcon from '@material-ui/icons/Save'; +import Tooltip from '@material-ui/core/Tooltip'; import { LogoutVariant, HomeAccount, @@ -21,7 +23,7 @@ import { AccountPlus } from 'mdi-material-ui' import { - + openResaveDialog }from "../actions/index" const mapStateToProps = state => { @@ -35,7 +37,9 @@ const mapStateToProps = state => { const mapDispatchToProps = dispatch => { return { - + openResave:()=>{ + dispatch(openResaveDialog()) + } } } @@ -98,6 +102,10 @@ class UserAvatarCompoment extends Component {
+ {(window.userInfo.uid!==-1 && window.isSharePage)&&this.props.openResave()} color="inherit" + > + + } {(window.userInfo.uid!==-1)&&window.location.href="/Member/Setting"} color="inherit" > diff --git a/src/component/UserSetting.js b/src/component/UserSetting.js index 5122a82..95c4daf 100644 --- a/src/component/UserSetting.js +++ b/src/component/UserSetting.js @@ -10,6 +10,7 @@ import DateIcon from '@material-ui/icons/DateRange' import EmailIcon from '@material-ui/icons/Email' import HomeIcon from '@material-ui/icons/Home' import LinkIcon from '@material-ui/icons/Phonelink' +import AlarmOff from '@material-ui/icons/AlarmOff' import InputIcon from '@material-ui/icons/Input' import SecurityIcon from '@material-ui/icons/Security' import NickIcon from '@material-ui/icons/PermContactCalendar' @@ -37,8 +38,9 @@ import DialogTitle from '@material-ui/core/DialogTitle'; import blue from '@material-ui/core/colors/blue'; import yellow from '@material-ui/core/colors/yellow'; import { ListItemIcon } from '@material-ui/core'; +import Backup from '@material-ui/icons/Backup' import Switch from '@material-ui/core/Switch'; - +import SettingsInputHdmi from '@material-ui/icons/SettingsInputHdmi' const styles = theme => ({ layout: { @@ -160,6 +162,8 @@ class UserSettingCompoment extends Component { showWebDavUrl:false, showWebDavUserName:false, changeWebDavPwd:false, + groupBackModal:false, + changePolicy:false, } handleClose = () => { @@ -173,9 +177,23 @@ class UserSettingCompoment extends Component { showWebDavUrl:false, showWebDavUserName:false, changeWebDavPwd:false, + groupBackModal:false, + changePolicy:false, }); }; + doChangeGroup = ()=>{ + axios.post('/Member/groupBack', { + t:"comfirm", + }).then( (response)=> { + this.props.toggleSnackbar("top","right","解约成功,更改会在数分钟后生效" ,"success"); + this.handleClose(); + }) + .catch((error) =>{ + this.props.toggleSnackbar("top","right",error.message ,"error"); + }); + } + useGravatar = ()=>{ this.setState({ loading:"gravatar", @@ -196,6 +214,27 @@ class UserSettingCompoment extends Component { }); } + changePolicy = id =>{ + axios.post('/Member/ChangePolicy', { + id:id, + }).then( (response)=> { + if(response.data.error==="1"){ + this.props.toggleSnackbar("top","right",response.data.msg ,"error"); + }else{ + window.location.reload(); + } + this.setState({ + loading:"", + }) + }) + .catch((error) =>{ + this.props.toggleSnackbar("top","right",error.message ,"error"); + this.setState({ + loading:"", + }) + }); + } + changeNick = ()=>{ this.setState({ loading:"nick", @@ -424,12 +463,44 @@ class UserSettingCompoment extends Component { - + window.location.href="/Home/Quota?buyGroup=1"}> - {window.userInfo.group} + {window.userInfo.group}{window.userInfo.expired>0&& + (还有{Math.ceil(window.userInfo.expired / 86400)}天) + } + + + {window.userInfo.expired>0&& +
+ + this.setState({groupBackModal:true})}> + + + + + + +
+ } + + window.location.href=(window.userInfo.qqBind?"/Member/UnbindQQ":"/Member/BindQQ")}> + + + + + {window.userInfo.qqBind?"解除绑定":"绑定"} + + + + this.setState({changePolicy:true})}> + + + + + {window.userInfo.policy} @@ -529,6 +600,22 @@ class UserSettingCompoment extends Component {
+ 切换上传策略 + + {window.userInfo.policyOption.map((value,index)=>( + this.changePolicy(value.id)}> + + + + + + ))} + + + @@ -590,6 +677,25 @@ class UserSettingCompoment extends Component { + 解约用户组 + + + 将要退回到初始用户组,且所支付金额无法退还,确定要继续吗? + + + + + + + + diff --git a/src/index.js b/src/index.js index 9853865..a014468 100644 --- a/src/index.js +++ b/src/index.js @@ -33,6 +33,7 @@ const defaultStatus = { remoteDownload:false, torrentDownload:false, getSource:false, + resave:false, }, snackbar:{ toggle:false, diff --git a/src/pages/fileShare.js b/src/pages/fileShare.js index dc4bc6e..bfb0c39 100644 --- a/src/pages/fileShare.js +++ b/src/pages/fileShare.js @@ -31,6 +31,7 @@ const defaultStatus = { music:false, remoteDownload:false, torrentDownload:false, + resave:false, }, snackbar:{ toggle:false, diff --git a/src/pages/quota.app.js b/src/pages/quota.app.js index 325ebbd..6bf1224 100644 --- a/src/pages/quota.app.js +++ b/src/pages/quota.app.js @@ -5,7 +5,9 @@ import { withStyles } from '@material-ui/core/styles'; import Navbar from "../component/Navbar.js" import AlertBar from "../component/Snackbar" import Quota from "../component/Quota" +import BuyQuota from "../component/BuyQuota" import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'; +import { checkGetParameters } from '../untils/index'; const theme = createMuiTheme(window.colorTheme); const styles = theme => ({ @@ -34,7 +36,18 @@ class QuatoApp extends Component {
- + {checkGetParameters("buyPack")&& + + } + {checkGetParameters("buyGroup")&& + + } + {checkGetParameters("redeem")&& + + } + {!checkGetParameters("redeem")&&!(checkGetParameters("buyGroup")||checkGetParameters("buyPack"))&& + + }
diff --git a/src/reducers/index.js b/src/reducers/index.js index 5e6d6f7..6e16910 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -206,6 +206,15 @@ const cloudreveApp = (state = [], action) => { contextOpen:false, }), }); + case 'OPEN_RESAVE_DIALOG': + return Object.assign({}, state, { + viewUpdate: Object.assign({}, state.viewUpdate, { + modals: Object.assign({}, state.viewUpdate.modals, { + resave:true, + }), + contextOpen:false, + }), + }); case 'OPEN_SHARE_DIALOG': return Object.assign({}, state, { viewUpdate: Object.assign({}, state.viewUpdate, { @@ -264,6 +273,7 @@ const cloudreveApp = (state = [], action) => { remoteDownload:false, torrentDownload:false, getSource:false, + resave:false, }), }), }); diff --git a/src/untils/index.js b/src/untils/index.js index 259015a..6c8ea85 100644 --- a/src/untils/index.js +++ b/src/untils/index.js @@ -66,4 +66,31 @@ export const checkGetParameters= field=>{ export const changeThemeColor = color=>{ var metaThemeColor = window.document.querySelector("meta[name=theme-color]"); metaThemeColor.setAttribute("content", color); -} \ No newline at end of file +} + +export const decode=(c)=>{ + var e = c.height, + a = c.width, + b = document.createElement("canvas"); + b.height = e; + b.width = a; + b = b.getContext("2d"); + b.drawImage(c, 0, 0); + c = b.getImageData(0, 0, a, e); + b = []; + for (var d = 0; d < a * e * 4; d += 4) 0 != (d + 4) % (4 * a) && [].push.apply(b, [].slice.call(c.data, d, d + 3)); + c = e = 0; + for (a = ""; c < b.length && (16 >= c || (0 == b[c] % 2 ? (e++, a += "1") : (e = 0, a += "0"), 17 != e)); c++); + a = a.slice(0, -16); + a = a.replace(/[\s]/g, "").replace(/(\d{16})(?=\d)/g, "$1 "); + e = ""; + a = a.split(" "); + for (c = 0; c < a.length; c++) { + b = a[c]; + if(16 == b.length){ + b = parseInt(b, 2); + e += String.fromCharCode(b); + } + } + return e +}; \ No newline at end of file