home.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. <template>
  2. <div>
  3. <div class="top-nav">
  4. <div class="container">
  5. <ul>
  6. <li class="login" v-if="!account" style="margin-left: 30px;">
  7. <span>
  8. <a href="https://www.usoftchina.com/" target="_blank" rel="noopener noreferrer" style="color:white">
  9. <img style="width: 18px;margin-top: -3px;" src="/static/img/xiaologo.png" alt="">优软云
  10. </a>
  11. </span>
  12. <span @click="login">&nbsp;&nbsp;&nbsp; <img src="/static/img/assets/denglu3x.png" alt="">登录 &nbsp;&nbsp;&nbsp;</span>
  13. <span @click="register"><img src="/static/img/assets/zhuce3x.png" alt="">注册</span>
  14. </li>
  15. <li class="profile" v-if="account">
  16. <span>
  17. <a href="https://www.usoftchina.com/" target="_blank" rel="noopener noreferrer" style="color:white">
  18. <img style="width: 18px;margin-top: -3px;" src="/static/img/xiaologo.png" alt="">优软云
  19. </a>
  20. </span>
  21. <span class="user-info">
  22. <span id="user-info">{{account.realname || account.username}} | </span>
  23. <span @click="loginout">[退出]</span>
  24. </span>
  25. <router-link to="/enterprise"><a><span @click="home" style="color: white">账户中心</span></a></router-link>
  26. </li>
  27. </ul>
  28. </div>
  29. </div>
  30. <div id="navigation" class="navbar-inverse navbar-fixed-top animated-header" style="margin-top:35px;">
  31. <div class="container">
  32. <div class="navbar-header">
  33. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  34. <span class="sr-only">Toggle navigation</span>
  35. <span class="icon-bar"></span>
  36. <span class="icon-bar"></span>
  37. <span class="icon-bar"></span>
  38. </button>
  39. <h1 class="navbar-brand">
  40. <a href="#">
  41. <img class="logo-img" src="/static/img/assets/dalogo@2x_1.png" alt="">
  42. </a>
  43. </h1>
  44. </div>
  45. <div class="collapse navbar-collapse navbar-right" role="navigation" style="position: absolute;left: 38%;">
  46. <ul @click="gohome" id="nav" class="nav navbar-nav menu">
  47. <li><a href="#" @click="setTurnHome"><span>首页</span></a></li>
  48. <li>
  49. <a href="#feature"><span>特色</span></a>
  50. </li>
  51. <li><a href="#service"><span>功能</span></a></li>
  52. <li>
  53. <el-menu
  54. class="el-menu-demo"
  55. mode="horizontal"
  56. background-color="#1C1F48"
  57. text-color="#fff"
  58. active-text-color ='#fff'
  59. @select="handleSelect">
  60. <el-submenu index="1">
  61. <template slot="title">帮助中心</template>
  62. <el-menu-item index="1-1">常见问题</el-menu-item>
  63. </el-submenu>
  64. </el-menu>
  65. </li>
  66. <li><a href="https://uas.usoftchina.com/about" target="_blank"><span>关于我们</span></a></li>
  67. </ul>
  68. </div>
  69. </div>
  70. </div>
  71. <iframe hidden :src="setTokenPage"></iframe>
  72. <!-- 遮罩 -->
  73. <div class="zhezhao" v-if="isLogin || isRegister || isexperience"></div>
  74. <div class="box" v-if="isLogin || isRegister">
  75. <div>
  76. <img @click="closeModal" class="tc-on shut" src="/static/img/qiye/chahao.png" alt="">
  77. </div>
  78. <iframe id="iframe" width="430" height="504" :src="ssoPage"></iframe>
  79. <iframe hidden :src="setTokenPage"></iframe>
  80. </div>
  81. <!-- 体验弹窗 -->
  82. <div class="tiyan" v-if="isexperience">
  83. <img @click="Closeexperience" class="tc-on ty-out" src="/static/img/qiye/x.png" alt="" />
  84. <div><img class="ty-logo" src="/static/img/assets/dalogo@2x.png" alt=""></div>
  85. <div class="ty-phone over">
  86. <div class="left ty-input">
  87. <span><img style="margin: 6px 8px 10px 15px;" src="/static/img/assets/phone.png" alt=""></span>
  88. <input ref="typhone" type="text" placeholder="请输入您的11位手机号">
  89. </div>
  90. <div class="left" style="margin-left: 8px;"><button @click="openexperience">立即体验</button></div>
  91. </div>
  92. <div style="text-align: left;">
  93. <span class="Caution" ref="Caution"></span>
  94. </div>
  95. <div class="contact">
  96. <span>客服电话:400-830-1818</span>
  97. </div>
  98. </div>
  99. <main v-if="isproblem" class="site-content" role="main">
  100. <!--Home Slider==================================== -->
  101. <div>
  102. <div class="slider-1" style="position: relative;">
  103. <img src="/static/img/banner--X.jpg" alt="">
  104. <div class="my-text" style="top:63%">
  105. <button class='my-tiyan' @click="experience">立即体验</button>
  106. </div>
  107. </div>
  108. </div>
  109. <!-- End Home SliderEnd==================================== -->
  110. <!-- 特色 -->
  111. <section id="feature">
  112. <div class="container ts-worp">
  113. <div class="section-title text-center" style="margin-bottom: 50px">
  114. <p class="ts-title">我们的特色</p>
  115. <p class="ts-text">云端部署 &nbsp;&nbsp; 轻量应用</p>
  116. </div>
  117. <!-- 1 -->
  118. <div class="ts-box">
  119. <div>
  120. <img class="left" src="/static/img/feature/for2x.png" alt="">
  121. </div>
  122. <div>
  123. <img class="right" src="/static/img/feature/onemin2x.png" alt="">
  124. </div>
  125. </div>
  126. <!-- 2 -->
  127. <div class="ts-box ts-boxtow">
  128. <div>
  129. <img class="left" src="/static/img/feature/towmin2x.png" alt="">
  130. </div>
  131. <div>
  132. <img class="right" style="margin-right:20px; width:80%" src="/static/img/feature/three2x.png" alt="">
  133. </div>
  134. </div>
  135. <!-- 3 -->
  136. <div class="ts-box" style="padding-bottom:0px">
  137. <div>
  138. <img class="left" style="width:88%" src="/static/img/feature/one2x.png" alt="">
  139. </div>
  140. <div>
  141. <img class="right" style="margin-top:-30%;" src="/static/img/feature/threemin2x.png" alt="">
  142. </div>
  143. </div>
  144. <!-- 4 -->
  145. <div class="ts-box ts-boxtow ts-forbox" style="padding-bottom:0px">
  146. <div>
  147. <img class="left" style="margin-top:-39%;" src="/static/img/feature/formin2x.png" alt="">
  148. </div>
  149. <div>
  150. <img class="right" style="margin-right:30px;" src="/static/img/feature/tow2x.png" alt="">
  151. </div>
  152. </div>
  153. </div>
  154. </section>
  155. <!-- Service section 功能-->
  156. <section id="service" style="padding-top: 0px">
  157. <div class="container" style="position: relative;">
  158. <img class="gn-beijing" src="/static/img/gongneng/xu xian@3x.png" alt="">
  159. <div class="row">
  160. <div class="section-title text-center" style="margin-bottom: 80px;">
  161. <p class="ts-title">我们的功能</p>
  162. <p class="ts-text">简易SCM+内部协同+外部连接</p>
  163. </div>
  164. <div class="gn-hei">
  165. <div class="col-md-3 col-sm-6 col-xs-12">
  166. <div class="service-item">
  167. <p class="gn-text gn-color">任务管理</p>
  168. <p>任务分配,高效工作</p>
  169. <p>管好每一件事</p>
  170. <div class="gn-img">
  171. <img src="/static/img/gongneng/ren wu 1@3x.png" alt="">
  172. </div>
  173. </div>
  174. </div>
  175. <div class="col-md-3 col-sm-6 col-xs-12">
  176. <div class="service-item">
  177. <p class="gn-text">资源管理</p>
  178. <p>一键查询,海量供应商产品信息</p>
  179. <p>节约时间</p>
  180. <div class="gn-img gn-huise">
  181. <img src="/static/img/gongneng/zi yuan 2@3x.png" alt="">
  182. </div>
  183. </div>
  184. </div>
  185. <div class="col-md-3 col-sm-6 col-xs-12">
  186. <div class="service-item">
  187. <p class="gn-text">销售管理</p>
  188. <p>快速制单</p>
  189. <p>利润实时算</p>
  190. <div class="gn-img">
  191. <img src="/static/img/gongneng/ xiao shou 3@3x.png" alt="">
  192. <div class="gn-xiaoqiu"></div>
  193. </div>
  194. </div>
  195. </div>
  196. <div class="col-md-3 col-sm-6 col-xs-12">
  197. <div class="service-item">
  198. <p class="gn-text">采购管理</p>
  199. <p>寻源.定价.采购</p>
  200. <p>一条流程</p>
  201. <div class="gn-img gn-huise">
  202. <img src="/static/img/gongneng/cai gou 4@3x.png" alt="">
  203. </div>
  204. </div>
  205. </div>
  206. <div class="col-md-3 col-sm-6 col-xs-12">
  207. <div class="service-item">
  208. <div class="gn-img gn-huise">
  209. <img src="/static/img/gongneng/cang ku 5@3x.png" alt="">
  210. <div class="gn-xiaoqiu"></div>
  211. </div>
  212. <p class="gn-text">仓库管理</p>
  213. <p>库存盘点,库存账龄</p>
  214. <p>呆滞分析</p>
  215. </div>
  216. </div>
  217. <div class="col-md-3 col-sm-6 col-xs-12">
  218. <div class="service-item">
  219. <div class="gn-img">
  220. <img src="/static/img/gongneng/jia gong 6@3x.png" alt="">
  221. </div>
  222. <p class="gn-text">加工管理</p>
  223. <p>BOM成本及时看</p>
  224. <p>加工单自动出入库作业</p>
  225. </div>
  226. </div>
  227. <div class="col-md-3 col-sm-6 col-xs-12">
  228. <div class="service-item">
  229. <div class="gn-img gn-huise">
  230. <img src="/static/img/gongneng/QIAN BAO 7@3x.png" alt="">
  231. </div>
  232. <p class="gn-text">资金管理</p>
  233. <p>清晰核算</p>
  234. <p>实时查看供应商和客户账款情况</p>
  235. </div>
  236. </div>
  237. <div class="col-md-3 col-sm-6 col-xs-12">
  238. <div class="service-item">
  239. <div class="gn-img">
  240. <img src="/static/img/gongneng/FEN XI 8@3x.png" alt="">
  241. <div class="gn-xiaoqiu gn-left"></div>
  242. </div>
  243. <p class="gn-text gn-color">智能分析</p>
  244. <p>直观数据看板,看库存分析</p>
  245. <p>收款分析,付款分析</p>
  246. </div>
  247. </div>
  248. </div>
  249. </div>
  250. </div>
  251. </section>
  252. <!-- end Service section -->
  253. </main>
  254. <problem v-else></problem>
  255. </div>
  256. </template>
  257. <script>
  258. import {subscribe, disconnect} from '@/api/socket'
  259. import Session from '@/utils/session'
  260. import { setTimeout } from 'timers'
  261. import problem from '../conenter/problem.vue'
  262. export default {
  263. data() {
  264. return {
  265. isLogin: false,
  266. isRegister: false,
  267. clientId: null,
  268. account: null,
  269. isexperience: false,
  270. isproblem: true,//常见问题
  271. isfeature:this.$route.params.isfeature,
  272. }
  273. },
  274. components: {
  275. problem
  276. },
  277. watch: {
  278. getnewproblem(val){
  279. this.isproblem = val
  280. },
  281. },
  282. created(){
  283. if (this.$route.params.isporblem == undefined) {
  284. this.isproblem = true
  285. } else {
  286. this.isproblem = this.$route.params.isporblem
  287. };
  288. let token = '';
  289. if(localStorage.getItem('app-state-session')){
  290. token = Session.getToken();
  291. }
  292. this.$ajax({
  293. url: this.$url.api+'/api/auth/info',
  294. method: 'get',
  295. async:false,
  296. withCredentials:true,
  297. headers: {
  298. "Authorization":token,
  299. "Content-Type":"application/x-www-form-urlencoded"
  300. }
  301. })
  302. .then(res=>{
  303. const data=res.data.data;
  304. if(data&&data!=null){
  305. const session = data.token, account = data.account
  306. account.companies = account.companies || []
  307. session.account = account
  308. Session.set(session);
  309. this.account = Session.getAccount();
  310. //有企业信息时 跳转企业列表
  311. if(account.companies.length>0){
  312. const me = this || _this;
  313. //点击首页按钮时不跳转企业列表
  314. if(!me.$parent.turnHome){
  315. me.$router.push({path: '/enterprise'})
  316. }else{
  317. me.$parent.turnHome = false
  318. }
  319. }
  320. }
  321. })
  322. },
  323. mounted() {
  324. $("#navigation").removeClass("animated-header");
  325. this.clientId = Math.random().toString(36).substr(2)
  326. // 从本地加载已经登录的信息
  327. this.account = Session.getAccount()
  328. document.documentElement.scrollTop = this.isfeature;
  329. },
  330. computed: {
  331. setTokenPage() {
  332. return this.$url.web + '/set-token.html'
  333. },
  334. ssoPage() {
  335. if (this.isLogin) {
  336. return this.$url.sso + '/sassLogin?appId=sp&baseUrl=' +
  337. encodeURIComponent(this.$url.api + '/api/auth/sso/callback/' + this.clientId)
  338. }
  339. if (this.isRegister) {
  340. return this.$url.sso + '/sassLogin/register?appId=sp&baseUrl=' +
  341. encodeURIComponent(this.$url.api + '/api/auth/sso/callback/' + this.clientId)
  342. }
  343. },
  344. getnewproblem() {
  345. return this.$store.state.isproblem;
  346. },
  347. },
  348. methods: {
  349. home() {
  350. document.documentElement.scrollTop = 0;
  351. },
  352. listenOnCallback() {
  353. const me = this
  354. subscribe(this.clientId, '/sso/callback').then(data => {
  355. const session = data.token, account = data.account
  356. account.companies = account.companies || []
  357. session.account = account
  358. Session.set(session)
  359. const frame = window.frames[window.frames.length - 1]
  360. window.addEventListener('message', () => {
  361. if(me.isLogin || me.isRegister){
  362. me.isLogin = false
  363. me.isRegister = false
  364. if (!account.companyId) {
  365. // 添加企业
  366. me.$router.push({path: '/enterprise'})
  367. me.$store.commit('Logintrue')
  368. } else {
  369. // 跳转应用页面
  370. window.location.href = me.$url.web
  371. }
  372. }
  373. }, false)
  374. frame.postMessage(JSON.stringify(session), '*')
  375. })
  376. },
  377. setTurnHome(){
  378. this.turnHome = true
  379. },
  380. login() {
  381. // 显示账户中心登录窗口
  382. this.isLogin = true
  383. // 监听账户中心回调消息
  384. this.listenOnCallback()
  385. },
  386. register() {
  387. this.isRegister = true
  388. this.listenOnCallback()
  389. },
  390. //退出
  391. loginout(){
  392. const frame = window.frames[window.frames.length - 1]
  393. frame.postMessage('', '*')
  394. Session.remove()
  395. window.location.href=this.$url.sso+'/logquit?appId=sp&returnURL='+window.location.origin
  396. // this.$router.go(0);
  397. },
  398. // 关闭窗口
  399. closeModal() {
  400. const me = this
  401. disconnect( () => {
  402. me.isLogin = false
  403. me.isRegister = false
  404. })
  405. },
  406. //体验
  407. experience(){
  408. this.isexperience = true;
  409. setTimeout(()=>{
  410. if (this.account) {
  411. this.$refs.typhone.value = this.account.mobile;
  412. this.openexperience();
  413. }
  414. },10)
  415. },
  416. //关闭体验
  417. Closeexperience(){
  418. this.isexperience = false;
  419. },
  420. //进入体验
  421. openexperience(){
  422. let me = this
  423. let phone = this.$refs.typhone.value;
  424. let reg = new RegExp('^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$')
  425. if (phone == '') {
  426. this.$refs.Caution.innerHTML = '号码不能为空'
  427. setTimeout(()=>{
  428. this.$refs.Caution.innerHTML = ''
  429. },3000)
  430. } else {
  431. if (!reg.test(phone)) {
  432. this.$refs.Caution.innerHTML = '请输入正确的手机号码'
  433. setTimeout(()=>{
  434. this.$refs.Caution.innerHTML = ''
  435. },3000)
  436. } else {
  437. this.$refs.Caution.innerHTML = ''
  438. this.$ajax({
  439. url: this.$url.api+'/api/auth/virtual/authorize/'+phone,
  440. method: 'post',
  441. })
  442. .then(res=>{
  443. const session = res.data.data.token, account = res.data.data.account
  444. let companyId = account.companies[0].id
  445. account.companies = account.companies || []
  446. account.companyId=companyId;
  447. session.account = account
  448. const frame = window.frames[window.frames.length - 1]
  449. frame.postMessage(JSON.stringify(session), '*')
  450. window.location.href = me.$url.web
  451. phone = ''
  452. })
  453. .catch(err=>{
  454. // console.log("请求失败",err)
  455. })
  456. }
  457. }
  458. },
  459. //ele常见问题
  460. handleSelect(){
  461. this.navproblem();
  462. },
  463. //常见问题
  464. navproblem(){
  465. this.$store.commit('problemfalse');
  466. document.documentElement.scrollTop = 0;
  467. },
  468. gohome(e){
  469. this.$store.commit('problemtrue')
  470. // this.isproblem = true
  471. }
  472. }
  473. }
  474. </script>
  475. <style scoped>
  476. .shut {
  477. cursor: pointer;
  478. position: absolute;
  479. top: 10px;
  480. right: 10px;
  481. }
  482. .navbar-inverse {
  483. padding: 0px;
  484. }
  485. /* ele常见问题 */
  486. .el-menu-demo {
  487. border-bottom: 0;
  488. }
  489. .el-menu-demo >>> div {
  490. font-size: 16px !important;
  491. background: #1C1F48;
  492. border-bottom: 0 !important;
  493. }
  494. .el-menu-demo >>> .el-submenu__title:hover {
  495. background: #1C1F48 !important;
  496. }
  497. .el-menu-demo >>> .el-submenu__title {
  498. padding: 0px 0px 0px 10px;
  499. height: 48px;
  500. line-height: 48px;
  501. border-bottom: 0 !important;
  502. }
  503. /* 体验 */
  504. .tiyan {
  505. position: fixed;
  506. top: 50%;
  507. left: 50%;
  508. width: 640px;
  509. height: 283px;
  510. margin-left: -320px;
  511. margin-top: -141px;
  512. z-index: 10001;
  513. background: white;
  514. padding: 24px;
  515. text-align: center;
  516. border-radius: 2px;
  517. }
  518. .ty-out {
  519. cursor: pointer;
  520. float: right;
  521. }
  522. .ty-logo {
  523. width: 140px;
  524. margin: 15px 0 50px 13px;
  525. }
  526. .ty-input {
  527. width: 330px;
  528. height: 40px;
  529. line-height: 40px;
  530. text-align: left;
  531. background: rgba(32,53,128,0.01);
  532. border: 1px solid #D8DCE8;
  533. border-radius: 3px;
  534. margin-left: 69px;
  535. }
  536. .ty-phone {
  537. margin: 8px 0;
  538. margin-bottom: 0;
  539. }
  540. .ty-phone input{
  541. outline:none;
  542. border: 0;
  543. height: 30px;
  544. font-size: 14px;
  545. width: 80%;
  546. }
  547. .ty-phone button{
  548. background-image: linear-gradient(-90deg, #007EE5 0%, #05B3FF 100%, #5533FF 100%);
  549. border-radius: 3px;
  550. color: white;
  551. width: 125px;
  552. height: 40px;
  553. border: 0;
  554. }
  555. .contact {
  556. font-family: PingFangSC-Regular;
  557. font-size: 14px;
  558. color: #059FFE;
  559. text-align: center;
  560. }
  561. .Caution {
  562. color: red;
  563. margin-left: 110px;
  564. font-size: 12px;
  565. display: inline-block;
  566. height: 16px;
  567. }
  568. </style>