main.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <div id="main">
  3. <header-view v-if="!isInFrame"></header-view>
  4. <main-header></main-header>
  5. <main-nav></main-nav>
  6. <nuxt/>
  7. <footer-view></footer-view>
  8. <right-bar ref="rightBar"></right-bar>
  9. </div>
  10. </template>
  11. <script>
  12. import { Header, Footer, RightBar } from '~components/default'
  13. import { MainHeader, MainNav } from '~components/main'
  14. export default {
  15. name: 'mainView',
  16. components: {
  17. HeaderView: Header,
  18. FooterView: Footer,
  19. RightBar,
  20. MainHeader,
  21. MainNav
  22. },
  23. created() {
  24. this.$root.$on('add_cart', this.drop)
  25. },
  26. methods: {
  27. drop(el) {
  28. this.$refs.rightBar.drop(el)
  29. }
  30. },
  31. head () {
  32. return {
  33. title: this.title || '【优软商城】IC电子元器件现货采购交易平台商城',
  34. meta: [
  35. {hid: 'description', name: 'description', content: this.description || '优软商城(usoftmall.com)是中国领先的IC电子元器件现货采购交易网上商城,提供上千万种电子元器件现货采购交易,采购电子元器件就上优软商城!'},
  36. {hid: 'keywords', name: 'keywords', content: this.keywords || '优软商城'}
  37. ]
  38. }
  39. },
  40. computed: {
  41. isMobile: function () {
  42. return this.$store.state.option.isMobile
  43. },
  44. title () {
  45. let path = this.$route.path
  46. if (path === '/product/kind/home') {
  47. return '电子元器件器件选型参数型号查询器件类别分类大全-优软商城'
  48. } else if (path.startsWith('/product/kind/')) {
  49. if (this.kinds[this.kinds.length - 1]) {
  50. return this.kinds[this.kinds.length - 1].nameCn + '产品品牌型号大全-优软商城'
  51. }
  52. return ''
  53. } else if (path.startsWith('/product/component/')) {
  54. if (this.componentDetail && this.componentDetail.brand) {
  55. return this.componentDetail.brand.nameCn + this.componentDetail.code + '参数|供应商|数据手册中文资料|规格书-优软商城'
  56. } else {
  57. return ''
  58. }
  59. } else if (path.startsWith('/product/brand/brandList/')) {
  60. return 'IC电子元器件品牌中心品牌大全-优软商城'
  61. } else if (path.startsWith('/product/brand/')) {
  62. if (this.brandDetail.nameEn) {
  63. return this.brandDetail.nameEn + '(' + this.brandDetail.nameCn + ')产品分类及产品型号大全-优软商城'
  64. }
  65. return '【优软商城】IC电子元器件现货采购交易平台商城'
  66. } else if (path === '/provider/factories') {
  67. return 'IC电子元器件厂家原厂直销原厂专卖店大全-优软商城'
  68. } else if (path === '/provider/home') {
  69. return 'IC电子元器件代理商经销商专营店大全-优软商城'
  70. } else if (path === '/news') {
  71. return 'IC电子元器件行业市场资讯新闻-优软商城'
  72. } else if (path.startsWith('/news/')) {
  73. return this.newsDetail.title + '-电子元器件行业资讯-优软商城' || 'IC电子元器件行业市场资讯新闻-优软商城'
  74. } else if (path === '/search') {
  75. return this.$route.query.w + '-产品搜索-优软商城'
  76. } else if (path === '/searchStore') {
  77. return this.$route.query.w + '-店铺搜索-优软商城'
  78. } else {
  79. return '【优软商城】IC电子元器件现货采购交易平台商城'
  80. }
  81. },
  82. description () {
  83. let path = this.$route.path
  84. if (path === '/product/kind/home') {
  85. return '优软商城电子元器件器件型号查询器件类别分类大全,优软商城提供元器件智能选型服务,能让您完美的找到热门型号的替代型号产品,一键搜索功能让您快速找到您想要的型号。'
  86. } else if (path.startsWith('/product/kind/')) {
  87. if (this.kinds[this.kinds.length - 1]) {
  88. return '优软商城' + this.kinds[this.kinds.length - 1].nameCn + '产品品牌型号大全,能让您快速的找到' + this.kinds[this.kinds.length - 1].nameCn + '产品品牌型号。'
  89. }
  90. return ''
  91. } else if (path.startsWith('/product/component/')) {
  92. if (this.componentDetail && this.componentDetail.brand) {
  93. return '优软商城提供' + this.componentDetail.brand.nameCn + this.componentDetail.code + '数据手册中文资料规格书下载,' + this.componentDetail.code + '供应商及参数报价。'
  94. } else {
  95. return ''
  96. }
  97. } else if (path.startsWith('/product/brand/brandList/')) {
  98. return 'IC电子元器件品牌中心品牌大全,优软商城品牌中心汇聚国内国际电子元器件品牌,全力打造国家级元器件电商品台。'
  99. } else if (path.startsWith('/product/brand/')) {
  100. if (this.brandDetail.brief) {
  101. return this.brandDetail.brief || '优软商城(usoftmall.com)是中国领先的IC电子元器件现货采购交易网上商城,提供上千万种电子元器件现货采购交易,采购电子元器件就上优软商城!'
  102. }
  103. return ''
  104. } else if (path === '/provider/factories') {
  105. return 'IC电子元器件厂家原厂直销原厂专卖店大全,优软商城原厂专区提供IC电子元器件厂家原厂直销原厂专卖店大全。'
  106. } else if (path === '/provider/home') {
  107. return 'IC电子元器件代理商经销商专营店大全,优软商城代理经销专区提供IC电子元器件代理商经销商专卖店大全。'
  108. } else if (path === '/news') {
  109. return '优软商城电子元器件采购网提供精准的电子快讯,电子资讯,电子元器件资讯。'
  110. } else if (path.startsWith('/news/')) {
  111. return this.newsDetail.summary
  112. } else {
  113. return '优软商城(usoftmall.com)是中国领先的IC电子元器件现货采购交易网上商城,提供上千万种电子元器件现货采购交易,采购电子元器件就上优软商城!'
  114. }
  115. },
  116. keywords () {
  117. let path = this.$route.path
  118. if (path === '/product/kind/home') {
  119. return '电子元器件分类,电子元器件参数,电子元器件型号,电子元器件类别'
  120. } else if (path.startsWith('/product/kind/')) {
  121. if (this.kinds[this.kinds.length - 1]) {
  122. return this.kinds[this.kinds.length - 1].nameCn
  123. }
  124. return ''
  125. } else if (path.startsWith('/product/component/')) {
  126. if (this.componentDetail) {
  127. return this.componentDetail.code + '供应商,' + this.componentDetail.code + '数据手册,' + this.componentDetail.code + '规格书'
  128. } else {
  129. return ''
  130. }
  131. } else if (path.startsWith('/product/brand/brandList/')) {
  132. return 'ic,元器件,品牌'
  133. } else if (path.startsWith('/product/brand/')) {
  134. if (this.brandDetail.nameEn) {
  135. return this.brandDetail.nameEn + '(' + this.brandDetail.nameCn
  136. }
  137. return '优软商城'
  138. } else if (path === '/provider/factories') {
  139. return '电子元器件原厂,电子元器件厂家'
  140. } else if (path === '/provider/home') {
  141. return 'ic代理商,ic经销商,电子元器件代理商 , 电子元器件经销商'
  142. } else if (path === '/news') {
  143. return '元器件新闻,电子资讯,电子元器件资讯'
  144. } else if (path.startsWith('/news/')) {
  145. return ''
  146. } else {
  147. return '优软商城'
  148. }
  149. },
  150. kinds () {
  151. return this.$store.state.product.kind.kindsParentWithBother.data
  152. },
  153. componentDetail () {
  154. return this.$store.state.componentDetail.detail.data
  155. },
  156. brandDetail () {
  157. return this.$store.state.brandDetail.detail.data
  158. },
  159. newsDetail () {
  160. return this.$store.state.newsData.detailNews.detailNews.data
  161. }
  162. }
  163. }
  164. </script>