index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <!-- 定位店铺 -->
  3. <view class="main-loc">
  4. <view v-if="storeInfo.name" class="diy-location">
  5. <view class="inner" @click="onTargetLocation">
  6. <view class="location-input">
  7. <text class="store">
  8. <text class="name">{{ storeInfo.name }}</text>
  9. <text class="switch">[切换店铺]</text>
  10. <text class="address"><text class="location-icon iconfont icon-dingwei"></text>{{ storeInfo.address }}</text>
  11. </text>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. /**
  20. * 组件的属性列表
  21. * 用于组件自定义设置
  22. */
  23. props: {
  24. itemStyle: Object,
  25. storeInfo: Object
  26. },
  27. /**
  28. * 组件的方法列表
  29. * 更新属性和数据的方法与更新页面数据的方法类似
  30. */
  31. methods: {
  32. /**
  33. * 跳转到定位页面页面
  34. */
  35. onTargetLocation() {
  36. this.$navTo('pages/location/index')
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .main-loc {
  43. height: 90rpx;
  44. /* #ifdef H5 */
  45. height: 100rpx;
  46. /* #endif */
  47. color: #ffffff;
  48. .diy-location {
  49. background: linear-gradient(to bottom, $fuint-theme, $fuint-theme);
  50. padding: 3rpx 10rpx 10rpx 10rpx;
  51. /* #ifdef H5 */
  52. padding-top: 15rpx;
  53. /* #endif */
  54. position: fixed;
  55. z-index: 99999;
  56. width: 100%;
  57. }
  58. .inner {
  59. height: 82rpx;
  60. overflow: hidden;
  61. &.radius {
  62. border-radius: 10rpx;
  63. }
  64. &.round {
  65. border-radius: 60rpx;
  66. }
  67. }
  68. .location-input {
  69. color: #484848;
  70. padding-left: 10rpx;
  71. }
  72. .store {
  73. .name {
  74. font-size: 32rpx;
  75. font-weight: bold;
  76. color: #ffffff;
  77. }
  78. .switch {
  79. margin-left: 15rpx;
  80. font-size: 22rpx;
  81. color: #ffffff;
  82. }
  83. .address {
  84. clear: bold;
  85. display: block;
  86. margin-top: 2rpx;
  87. font-size: 23rpx;
  88. margin-left: 0rpx;
  89. color: #ffffff;
  90. .location-icon {
  91. margin-right: 4rpx;
  92. font-size: 24rpx;
  93. color: #f03c3c;
  94. font-weight: bold;
  95. }
  96. }
  97. }
  98. }
  99. </style>