StoreTitle.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <div class="container" id="title-fragment">
  3. <div class="container">
  4. <div class="row" style="margin-bottom: 20px;">
  5. <!-- 商标展示 -->
  6. <div class="shop-logo">
  7. <img :src="storeInfo.logoUrl || '/images/store/common/default.png'" />
  8. </div>
  9. <!-- 店名展示 -->
  10. <div class="shop-banner">
  11. <img :src="storeInfo.bannerUrl || '/images/store/default/shop_banner.png'">
  12. <div id="shop-title" v-if="storeInfo.storeShortName" v-text="storeInfo.storeShortName">店铺名称</div>
  13. </div>
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. import axios from '~plugins/axios'
  20. export default {
  21. name: 'store-title',
  22. data () {
  23. return {
  24. storeInfo: {},
  25. params: this.$route.params
  26. }
  27. },
  28. mounted () {
  29. axios.get('/api/store-service/stores', { params: this.params })
  30. .then(response => {
  31. this.storeInfo = response.data
  32. })
  33. },
  34. computed: {
  35. // storeInfo () {
  36. // return this.$store.state.shop.storeInfo.store.data
  37. // }
  38. }
  39. }
  40. </script>
  41. <style scoped>
  42. #title-fragment {
  43. padding: 0;
  44. }
  45. #title-fragment .container {
  46. width: 1190px;
  47. padding-left: 0px;
  48. padding-right: 0px;
  49. }
  50. #title-fragment .container >.row {
  51. margin-left: 0px;
  52. margin-right: 0px;
  53. }
  54. #title-fragment .shop-logo {
  55. width: 220px;
  56. height: 220px;
  57. border: 1px solid #e8e8e8;
  58. float: left;
  59. text-align: center;
  60. line-height: 210px;
  61. overflow: hidden;
  62. }
  63. #title-fragment .shop-logo img {
  64. max-width: 220px;
  65. max-height: 220px;
  66. vertical-align: middle;
  67. }
  68. #title-fragment .shop-banner {
  69. float: left;
  70. position: relative;
  71. width: 970px;
  72. height: 220px;
  73. border: 1px solid #e8e8e8;
  74. border-left: none;
  75. overflow: hidden;
  76. }
  77. #title-fragment .shop-banner img {
  78. width: 970px;
  79. height: 220px;
  80. }
  81. #title-fragment .shop-banner #shop-title {
  82. position: absolute;
  83. top: 50px;
  84. left: 60px;
  85. font-size: 30px;
  86. color: rgb(255,255,255);
  87. }
  88. .container{
  89. width: 1190px;
  90. padding: 0;
  91. }
  92. </style>