StoreHeader.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div class="store-share-header">
  3. <div class="wrap">
  4. <div class="img">
  5. <img :src="storeInfo.logoUrl" alt="">
  6. </div>
  7. <div class="title">
  8. <h1>{{storeInfo.storeName}}</h1>
  9. <p>{{storeInfo.description | descFilter}}</p>
  10. </div>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. import { getRealLen, cutOutString } from '~utils/baseUtils'
  16. export default {
  17. computed: {
  18. storeInfo () {
  19. return this.$store.state.shop.storeInfo.store.data
  20. }
  21. },
  22. filters: {
  23. descFilter: function (val) {
  24. return getRealLen(val) > 78 ? cutOutString(val, 78) + '...' : val
  25. }
  26. }
  27. }
  28. </script>
  29. <style lang="scss" scoped>
  30. .store-share-header {
  31. height: 1.9rem;
  32. background: #272a32;
  33. padding-top: .18rem;
  34. .wrap {
  35. height: 1.72rem;
  36. width: 7.16rem;
  37. margin: 0 auto;
  38. background: url('/images/mobile/@2x/shareStore/background@2x.png') no-repeat;
  39. background-size: cover;
  40. padding: .2rem 0 0 .4rem;
  41. > div {
  42. display: inline-block;
  43. vertical-align: middle;
  44. &.img {
  45. width: 1.24rem;
  46. height: 1.24rem;
  47. text-align: center;
  48. line-height: 1.24rem;
  49. border-radius: 2px;
  50. background: #fff;
  51. img {
  52. max-width: 1.24rem;
  53. max-height: 1.24rem;
  54. }
  55. }
  56. &.title {
  57. margin-left: .44rem;
  58. width: 5rem;
  59. h1 {
  60. font-size: .36rem;
  61. color: #fff;
  62. overflow: hidden;
  63. text-overflow: ellipsis;
  64. white-space: nowrap;
  65. width: 4.5rem;
  66. }
  67. p {
  68. font-size: .24rem;
  69. color: #fff;
  70. margin-top: .2rem;
  71. line-height: .32rem;
  72. overflow: hidden;
  73. max-height: .64rem;
  74. }
  75. }
  76. }
  77. }
  78. }
  79. </style>