index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  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. :title="$L('用户登录')"
  88. :closable="false"
  89. :mask-closable="false">
  90. <Form ref="login" :model="formLogin" :rules="ruleLogin">
  91. <FormItem prop="username">
  92. <Input type="text" v-model="formLogin.username" :placeholder="$L('用户名')" @on-enter="onLogin">
  93. <Icon type="ios-person-outline" slot="prepend"></Icon>
  94. </Input>
  95. </FormItem>
  96. <FormItem prop="userpass">
  97. <Input type="password" v-model="formLogin.userpass" :placeholder="$L('密码')" @on-enter="onLogin">
  98. <Icon type="ios-lock-outline" slot="prepend"></Icon>
  99. </Input>
  100. </FormItem>
  101. </Form>
  102. <div slot="footer">
  103. <Button type="default" @click="loginShow=false">{{$L('取消')}}</Button>
  104. <Button type="primary" :loading="loadIng > 0" @click="onLogin">{{$L('登录')}}</Button>
  105. </div>
  106. </Modal>
  107. </div>
  108. </template>
  109. <style lang="scss" scoped>
  110. .index {
  111. position: absolute;
  112. color: #000000;
  113. top: 0;
  114. left: 0;
  115. min-width: 100%;
  116. min-height: 100%;
  117. padding: 0;
  118. margin: 0;
  119. .header {
  120. height: 50px;
  121. background: #0396f2;
  122. padding-top: 12px;
  123. max-width: 1280px;
  124. margin: 0 auto;
  125. .z-row {
  126. color: #fff;
  127. height: 50px;
  128. position: relative;
  129. z-index: 2;
  130. max-width: 1680px;
  131. margin: 0 auto;
  132. .header-col-sub {
  133. width: 500px;
  134. h2 {
  135. font-size: 1.2rem;
  136. height: 48px;
  137. line-height: 54px;
  138. display: inline-block;
  139. width: 400px;
  140. position: relative;
  141. img {
  142. width: 150px;
  143. margin: 1rem 0 0 1rem;
  144. }
  145. span {
  146. position: absolute;
  147. font-size: 12px;
  148. font-weight: normal;
  149. top: 8px;
  150. left: 172px;
  151. color: rgba(255, 255, 255, 0.85);
  152. }
  153. }
  154. }
  155. .z-1 {
  156. dl {
  157. position: absolute;
  158. right: 20px;
  159. top: 0;
  160. font-size: 14px;
  161. dd {
  162. line-height: 50px;
  163. color: #fff;
  164. cursor: pointer;
  165. margin-right: 1px;
  166. .right-info {
  167. cursor: pointer;
  168. .right-globe {
  169. vertical-align: middle;
  170. }
  171. }
  172. }
  173. }
  174. }
  175. }
  176. }
  177. .welcome {
  178. height: 700px;
  179. display: block;
  180. background: #2d8cf0;
  181. overflow: hidden;
  182. color: #FFFFFF;
  183. padding-top: 480px;
  184. margin-top: -480px;
  185. transform: skewY(-2deg);
  186. box-shadow: 0 2px 244px 0 rgba(56, 132, 255, 0.4);
  187. .unslider-arrow {
  188. display: none;
  189. }
  190. .banner {
  191. padding-top: 60px;
  192. height: 460px;
  193. max-width: 1200px;
  194. margin: 0 auto;
  195. transform: skewY(2deg);
  196. .banner-carousel {
  197. max-width: 685px;
  198. }
  199. img {
  200. height: 400px;
  201. border: 5px solid #fff;
  202. border-radius: 5px;
  203. }
  204. }
  205. .z-8 {
  206. text-align: center;
  207. }
  208. h3 {
  209. color: rgba(255, 255, 255, 0.8);
  210. font-size: 40px;
  211. font-weight: normal;
  212. text-align: center;
  213. margin: 30px auto;
  214. width: 380px;
  215. }
  216. .start {
  217. display: inline-block;
  218. width: 160px;
  219. height: 50px;
  220. line-height: 50px;
  221. text-align: center;
  222. font-weight: normal;
  223. cursor: pointer;
  224. font-size: 20px;
  225. background: #fff;
  226. color: #0396f2;
  227. border-radius: 4px;
  228. border: 0;
  229. &:hover, &:focus {
  230. background: #f6f6f6;
  231. color: #0396f2;
  232. }
  233. }
  234. .second {
  235. position: relative;
  236. height: 220px;
  237. text-align: center;
  238. transform: skewY(2deg);
  239. .bg {
  240. transform: skewY(-4.5deg);
  241. display: block;
  242. position: absolute;
  243. top: 0;
  244. left: 0;
  245. right: 0;
  246. bottom: 0;
  247. background: #1F65D6;
  248. }
  249. .z-row {
  250. z-index: 2;
  251. position: relative;
  252. font-size: 22px;
  253. max-width: 1400px;
  254. margin: 0 auto;
  255. line-height: 220px;
  256. }
  257. i {
  258. color: rgba(255, 255, 255, 0.85);
  259. margin-right: 6px;
  260. }
  261. a {
  262. color: #fff;
  263. &:hover, &:visited {
  264. color: #fff;
  265. }
  266. }
  267. }
  268. }
  269. .block {
  270. max-width: 1200px;
  271. margin: 30px auto;
  272. padding-top: 50px;
  273. border: 1px solid #F4F7F9;
  274. .wrap-left, .wrap-right {
  275. line-height: 36px;
  276. color: #666;
  277. font-size: 16px;
  278. }
  279. .wrap-left {
  280. margin: 20px 30px 0 0;
  281. }
  282. .wrap-right {
  283. margin: 20px 0 0 30px;
  284. }
  285. i {
  286. color: rgba(248, 14, 21, 0.7);
  287. margin-right: 6px;
  288. }
  289. img {
  290. border: 5px solid #fff;
  291. border-radius: 10px;
  292. width: 100%;
  293. }
  294. }
  295. .p-footer {
  296. margin: 20px 0;
  297. text-align: center;
  298. color: #333;
  299. a, span {
  300. color: #333;
  301. margin-left: 10px;
  302. }
  303. }
  304. }
  305. </style>
  306. <script>
  307. export default {
  308. data () {
  309. return {
  310. loadIng: 0,
  311. loginShow: false,
  312. formLogin: {
  313. username: '',
  314. userpass: ''
  315. },
  316. ruleLogin: {}
  317. }
  318. },
  319. created() {
  320. this.ruleLogin = {
  321. username: [
  322. { required: true, message: this.$L('请填写用户名!'), trigger: 'change' },
  323. { type: 'string', min: 2, message: this.$L('用户名长度至少2位!'), trigger: 'change' }
  324. ],
  325. userpass: [
  326. { required: true, message: this.$L('请填写登录密码!'), trigger: 'change' },
  327. { type: 'string', min: 6, message: this.$L('密码错长度至少6位!'), trigger: 'change' }
  328. ]
  329. };
  330. },
  331. deactivated() {
  332. this.loginShow = false;
  333. },
  334. methods: {
  335. loginChack() {
  336. if ($A.getToken() !== false) {
  337. this.goForward({path: '/todo'}, true);
  338. } else {
  339. this.loginShow = true;
  340. }
  341. },
  342. onLogin() {
  343. this.$refs.login.validate((valid) => {
  344. if (valid) {
  345. this.loadIng++;
  346. $A.ajax({
  347. url: $A.urlApi('users/login'),
  348. data: this.formLogin,
  349. complete: () => {
  350. this.loadIng--;
  351. },
  352. success: (res) => {
  353. if (res.ret === 1) {
  354. $A.storage("userInfo", res.data);
  355. $A.setToken(res.data.token);
  356. $A.triggerUserInfoListener(res.data);
  357. //
  358. this.loadIng--;
  359. this.loginShow = false;
  360. this.$refs.login.resetFields();
  361. this.$Message.success(this.$L('登录成功'));
  362. this.goForward({path: '/todo'}, true);
  363. } else {
  364. this.$Modal.error({
  365. title: this.$L("温馨提示"),
  366. content: this.$L(res.msg)
  367. });
  368. }
  369. }
  370. })
  371. }
  372. })
  373. }
  374. },
  375. }
  376. </script>