home.vue 17 KB

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