index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. <template>
  2. <div class="w-box index">
  3. <v-title>{{$L('轻量级的团队在线协作')}}</v-title>
  4. <div class="header">
  5. <div class="z-row">
  6. <div class="header-col-sub">
  7. <h2>
  8. <img v-if="systemConfig.logo" :src="systemConfig.logo">
  9. <img v-else src="../../../statics/images/logo-white.png">
  10. <span>{{$L('轻量级的团队在线协作')}}</span>
  11. </h2>
  12. </div>
  13. <div class="z-1">
  14. <dl>
  15. <dd>
  16. <a v-if="systemConfig.github=='show'" class="right-info" target="_blank" href="https://github.com/kuaifan/wookteam">
  17. <Icon class="right-icon" type="logo-github"/>
  18. </a>
  19. <Dropdown class="right-info" trigger="hover" @on-click="setLanguage" transfer>
  20. <div>
  21. <Icon class="right-icon" type="md-globe"/>
  22. <Icon type="md-arrow-dropdown"/>
  23. </div>
  24. <Dropdown-menu slot="list">
  25. <Dropdown-item name="zh" :selected="getLanguage() === 'zh'">中文</Dropdown-item>
  26. <Dropdown-item name="en" :selected="getLanguage() === 'en'">English</Dropdown-item>
  27. </Dropdown-menu>
  28. </Dropdown>
  29. </dd>
  30. </dl>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="welcome">
  35. <div class="banner">
  36. <div class="z-row">
  37. <div class="z-16">
  38. <Carousel class="banner-carousel" autoplay loop :autoplay-speed="5000">
  39. <CarouselItem>
  40. <img src="../../../statics/images/index/banner/1.jpg">
  41. </CarouselItem>
  42. <CarouselItem>
  43. <img src="../../../statics/images/index/banner/2.jpg">
  44. </CarouselItem>
  45. </Carousel>
  46. </div>
  47. <div class="z-8"><h3>{{$L('酷团队协作工具就从这里开始')}}</h3>
  48. <div class="bl inline-block">
  49. <span class="start" @click="loginChack">{{$L('立即登陆')}}</span>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="second">
  55. <div class="bg"></div>
  56. <div class="z-row">
  57. <div class="z-6"><a href="#W_link1"><i class="ft icon">&#xe753;</i>{{$L('待办四象限')}}</a></div>
  58. <div class="z-6"><a href="#W_link2"><i class="ft icon">&#xe6b8;</i>{{$L('项目管理')}}</a></div>
  59. <div class="z-6"><a href="#W_link3"><i class="ft icon">&#xe915;</i>{{$L('在线知识库')}}</a></div>
  60. <div class="z-6"><a href="#W_link4"><i class="ft icon">&#xe706;</i>{{$L('日程管理')}}</a></div>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="z-row block">
  65. <div class="z-6">
  66. <div class="wrap-left" id="W_link1"><i class="ft icon">&#xe753;</i>{{$L('待办四象限:突出事情优先级,帮助员工合理安排时间,提高工作效率。')}}</div>
  67. </div>
  68. <div class="z-18"><img src="../../../statics/images/index/todo.jpg"/></div>
  69. </div>
  70. <div class="z-row block">
  71. <div class="z-18"><img src="../../../statics/images/index/project.jpg"/></div>
  72. <div class="z-6">
  73. <div class="wrap-right" id="W_link2"><i class="ft icon">&#xe6b8;</i>{{$L('项目管理:自定义项目看板,可视化任务安排。')}}</div>
  74. </div>
  75. </div>
  76. <div class="z-row block">
  77. <div class="z-6">
  78. <div class="wrap-left" id="W_link3"><i class="ft icon">&#xe915;</i>{{$L('在线知识库:在线流程图,在线文档,以及可视化的目录编排,文档管理无忧。')}}</div>
  79. </div>
  80. <div class="z-18"><img src="../../../statics/images/index/wiki.jpg"/></div>
  81. </div>
  82. <div class="z-row block">
  83. <div class="z-18"><img src="../../../statics/images/index/week.jpg"/></div>
  84. <div class="z-6">
  85. <div class="wrap-right" id="W_link4"><i class="ft icon">&#xe706;</i>{{$L('日程管理:可视化日程管理,快速搞定工作计划,了解工作宏观安排。')}}</div>
  86. </div>
  87. </div>
  88. <div class="p-footer"><span>WookTeam &copy; 2018-2020</span></div>
  89. <Modal
  90. v-model="loginShow"
  91. :mask-closable="false">
  92. <Form ref="login" :model="formLogin" :rules="ruleLogin">
  93. <FormItem prop="username">
  94. <Input type="text" v-model="formLogin.username" :placeholder="$L('用户名')" @on-enter="onLogin">
  95. <Icon type="ios-person-outline" slot="prepend"></Icon>
  96. </Input>
  97. </FormItem>
  98. <FormItem prop="userpass">
  99. <Input type="password" v-model="formLogin.userpass" :placeholder="$L('密码')" @on-enter="onLogin">
  100. <Icon type="ios-lock-outline" slot="prepend"></Icon>
  101. </Input>
  102. </FormItem>
  103. <FormItem v-if="loginType=='reg'" prop="userpass2">
  104. <Input type="password" v-model="formLogin.userpass2" :placeholder="$L('确认密码')" @on-enter="onLogin">
  105. <Icon type="ios-lock-outline" slot="prepend"></Icon>
  106. </Input>
  107. </FormItem>
  108. </Form>
  109. <div slot="header" class="login-header">
  110. <div @click="loginType='login'" class="login-header-item" :class="{active:loginType=='login'}">{{$L('用户登录')}}</div>
  111. <div v-if="systemConfig.reg=='open'" @click="loginType='reg'" class="login-header-item" :class="{active:loginType=='reg'}">{{$L('注册账号')}}</div>
  112. </div>
  113. <div slot="footer">
  114. <Button type="default" @click="loginShow=false">{{$L('取消')}}</Button>
  115. <Button type="primary" :loading="loadIng > 0" @click="onLogin">{{$L(loginType=='reg'?'注册':'登录')}}</Button>
  116. </div>
  117. </Modal>
  118. </div>
  119. </template>
  120. <style lang="scss">
  121. .login-header {
  122. display: flex;
  123. align-items: center;
  124. .login-header-item {
  125. height: 20px;
  126. line-height: 20px;
  127. font-size: 14px;
  128. color: #444444;
  129. overflow: hidden;
  130. text-overflow: ellipsis;
  131. white-space: nowrap;
  132. padding-right: 12px;
  133. cursor: pointer;
  134. &.active {
  135. font-size: 16px;
  136. color: #17233d;
  137. font-weight: 500;
  138. }
  139. }
  140. }
  141. </style>
  142. <style lang="scss" scoped>
  143. .index {
  144. position: absolute;
  145. color: #000000;
  146. top: 0;
  147. left: 0;
  148. min-width: 100%;
  149. min-height: 100%;
  150. padding: 0;
  151. margin: 0;
  152. .header {
  153. height: 50px;
  154. background: #0396f2;
  155. padding-top: 12px;
  156. max-width: 1280px;
  157. margin: 0 auto;
  158. .z-row {
  159. color: #fff;
  160. height: 50px;
  161. position: relative;
  162. z-index: 2;
  163. max-width: 1680px;
  164. margin: 0 auto;
  165. .header-col-sub {
  166. width: 500px;
  167. h2 {
  168. position: relative;
  169. padding: 1rem 0 0 1rem;
  170. display: flex;
  171. align-items: flex-end;
  172. img {
  173. width: 150px;
  174. margin-right: 6px;
  175. }
  176. span {
  177. font-size: 12px;
  178. font-weight: normal;
  179. color: rgba(255, 255, 255, 0.85);
  180. line-height: 14px;
  181. }
  182. }
  183. }
  184. .z-1 {
  185. dl {
  186. position: absolute;
  187. right: 20px;
  188. top: 0;
  189. font-size: 14px;
  190. dd {
  191. line-height: 50px;
  192. color: #fff;
  193. cursor: pointer;
  194. margin-right: 1px;
  195. .right-info {
  196. display: inline-block;
  197. cursor: pointer;
  198. margin-left: 12px;
  199. color: #ffffff;
  200. .right-icon {
  201. font-size: 26px;
  202. vertical-align: middle;
  203. }
  204. }
  205. }
  206. }
  207. }
  208. }
  209. }
  210. .welcome {
  211. height: 700px;
  212. display: block;
  213. background: #2d8cf0;
  214. overflow: hidden;
  215. color: #FFFFFF;
  216. padding-top: 480px;
  217. margin-top: -480px;
  218. transform: skewY(-2deg);
  219. box-shadow: 0 2px 244px 0 rgba(56, 132, 255, 0.4);
  220. .unslider-arrow {
  221. display: none;
  222. }
  223. .banner {
  224. padding-top: 60px;
  225. height: 460px;
  226. max-width: 1200px;
  227. margin: 0 auto;
  228. transform: skewY(2deg);
  229. .banner-carousel {
  230. max-width: 685px;
  231. }
  232. img {
  233. height: 400px;
  234. border: 5px solid #fff;
  235. border-radius: 5px;
  236. }
  237. }
  238. .z-8 {
  239. text-align: center;
  240. }
  241. h3 {
  242. color: rgba(255, 255, 255, 0.8);
  243. font-size: 40px;
  244. font-weight: normal;
  245. text-align: center;
  246. margin: 30px auto;
  247. width: 380px;
  248. }
  249. .start {
  250. display: inline-block;
  251. width: 160px;
  252. height: 50px;
  253. line-height: 50px;
  254. text-align: center;
  255. font-weight: normal;
  256. cursor: pointer;
  257. font-size: 20px;
  258. background: #fff;
  259. color: #0396f2;
  260. border-radius: 4px;
  261. border: 0;
  262. &:hover, &:focus {
  263. background: #f6f6f6;
  264. color: #0396f2;
  265. }
  266. }
  267. .second {
  268. position: relative;
  269. height: 220px;
  270. text-align: center;
  271. transform: skewY(2deg);
  272. .bg {
  273. transform: skewY(-4.5deg);
  274. display: block;
  275. position: absolute;
  276. top: 0;
  277. left: 0;
  278. right: 0;
  279. bottom: 0;
  280. background: #1F65D6;
  281. }
  282. .z-row {
  283. z-index: 2;
  284. position: relative;
  285. font-size: 22px;
  286. max-width: 1400px;
  287. margin: 0 auto;
  288. line-height: 220px;
  289. }
  290. i {
  291. color: rgba(255, 255, 255, 0.85);
  292. margin-right: 6px;
  293. }
  294. a {
  295. color: #fff;
  296. &:hover, &:visited {
  297. color: #fff;
  298. }
  299. }
  300. }
  301. }
  302. .block {
  303. max-width: 1200px;
  304. margin: 30px auto;
  305. padding-top: 50px;
  306. border: 1px solid #F4F7F9;
  307. .wrap-left, .wrap-right {
  308. line-height: 36px;
  309. color: #666;
  310. font-size: 16px;
  311. }
  312. .wrap-left {
  313. margin: 20px 30px 0 0;
  314. }
  315. .wrap-right {
  316. margin: 20px 0 0 30px;
  317. }
  318. i {
  319. color: rgba(248, 14, 21, 0.7);
  320. margin-right: 6px;
  321. }
  322. img {
  323. border: 5px solid #fff;
  324. border-radius: 10px;
  325. width: 100%;
  326. }
  327. }
  328. .p-footer {
  329. margin: 20px 0;
  330. text-align: center;
  331. color: #333;
  332. a, span {
  333. color: #333;
  334. margin-left: 10px;
  335. }
  336. }
  337. }
  338. </style>
  339. <script>
  340. export default {
  341. data () {
  342. return {
  343. loadIng: 0,
  344. loginShow: false,
  345. loginType: 'login',
  346. formLogin: {
  347. username: '',
  348. userpass: '',
  349. userpass2: ''
  350. },
  351. ruleLogin: {},
  352. systemConfig: $A.jsonParse($A.storage("systemSetting"), {
  353. github: '',
  354. reg: '',
  355. }),
  356. }
  357. },
  358. created() {
  359. this.ruleLogin = {
  360. username: [
  361. { required: true, message: this.$L('请填写用户名!'), trigger: 'change' },
  362. { type: 'string', min: 2, message: this.$L('用户名长度至少2位!'), trigger: 'change' }
  363. ],
  364. userpass: [
  365. { required: true, message: this.$L('请填写登录密码!'), trigger: 'change' },
  366. { type: 'string', min: 6, message: this.$L('密码错长度至少6位!'), trigger: 'change' }
  367. ],
  368. userpass2: [
  369. { required: true, message: this.$L('请填写确认密码!'), trigger: 'change' },
  370. { type: 'string', min: 6, message: this.$L('确认密码错长度至少6位!'), trigger: 'change' },
  371. {
  372. validator: (rule, value, callback) => {
  373. if (value !== this.formLogin.userpass) {
  374. callback(new Error(this.$L('两次密码输入不一致!')));
  375. } else {
  376. callback();
  377. }
  378. },
  379. required: true,
  380. trigger: 'change'
  381. },
  382. ]
  383. };
  384. },
  385. mounted() {
  386. this.getSetting();
  387. },
  388. deactivated() {
  389. this.loginShow = false;
  390. },
  391. watch: {
  392. loginShow(val) {
  393. if (val) {
  394. this.getSetting();
  395. } else {
  396. this.loginType = 'login';
  397. }
  398. }
  399. },
  400. methods: {
  401. getSetting() {
  402. $A.aAjax({
  403. url: 'system/setting',
  404. error: () => {
  405. $A.storage("systemSetting", {});
  406. },
  407. success: (res) => {
  408. if (res.ret === 1) {
  409. this.systemConfig = res.data;
  410. this.systemConfig.github = this.systemConfig.github || 'show';
  411. this.systemConfig.reg = this.systemConfig.reg || 'open';
  412. $A.storage("systemSetting", this.systemConfig);
  413. } else {
  414. $A.storage("systemSetting", {});
  415. }
  416. }
  417. });
  418. },
  419. loginChack() {
  420. if ($A.getToken() !== false) {
  421. this.goForward({path: '/todo'}, true);
  422. } else {
  423. this.loginShow = true;
  424. }
  425. },
  426. onLogin() {
  427. this.$refs.login.validate((valid) => {
  428. if (valid) {
  429. this.loadIng++;
  430. $A.ajax({
  431. url: $A.urlApi('users/login?type=' + this.loginType),
  432. data: this.formLogin,
  433. complete: () => {
  434. this.loadIng--;
  435. },
  436. success: (res) => {
  437. if (res.ret === 1) {
  438. $A.storage("userInfo", res.data);
  439. $A.setToken(res.data.token);
  440. $A.triggerUserInfoListener(res.data);
  441. //
  442. this.loadIng--;
  443. this.loginShow = false;
  444. this.$refs.login.resetFields();
  445. this.$Message.success(this.$L('登录成功'));
  446. this.goForward({path: '/todo'}, true);
  447. } else {
  448. this.$Modal.error({
  449. title: this.$L("温馨提示"),
  450. content: res.msg
  451. });
  452. }
  453. }
  454. })
  455. }
  456. })
  457. }
  458. },
  459. }
  460. </script>