shop-title.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="shop-title flex" @tap.stop="toShop">
  3. <view class="xxs tag white m-r-10 flex-none" v-if="shop.type == 1">自营</view>
  4. <view class="shop-name line-1 bold">{{shop.shop_name || shop.name || name}}</view>
  5. <u-icon v-if="isLink" class="m-l-10 m-r-20" name="arrow-right" size="28" />
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. name:"shop-title",
  11. options: {
  12. virtualHost: true
  13. },
  14. props: {
  15. name: {
  16. type: String
  17. },
  18. shop: {
  19. type: Object
  20. },
  21. isLink: {
  22. type: Boolean,
  23. default:true
  24. }
  25. },
  26. data() {
  27. return {
  28. };
  29. },
  30. methods: {
  31. toShop() {
  32. const {isLink, shop} = this
  33. if(!isLink) return
  34. this.$Router.push({
  35. path: '/pages/store_index/store_index',
  36. query: {
  37. id: shop.shop_id || shop.id
  38. }
  39. })
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .shop-title {
  46. height: 80rpx;
  47. flex: 1;
  48. min-width: 0;
  49. .tag {
  50. background: linear-gradient(267deg, #FF2C3C 0%, #F52E99 100%);
  51. border-radius: 6rpx;
  52. padding: 5rpx 9rpx;
  53. }
  54. }
  55. </style>