home.vue 17 KB

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