index.vue 17 KB

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