community-shop.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <u-popup v-model="show" mode="bottom" height="900" closeable border-radius="14">
  3. <view class="xl p-24 text-center bold">TA提到的店铺</view>
  4. <navigator v-for="(shopItem, shopIndex) in lists" :key="shopIndex" hover-class="none"
  5. :url="'/pages/store_index/store_index?id=' + shopItem.id">
  6. <view class="shop flex">
  7. <u-image width="160" height="160" :src="shopItem.logo"></u-image>
  8. <view class="m-l-20 shop-info">
  9. <view class="line-2 nr normal">
  10. {{ shopItem.name }}
  11. </view>
  12. </view>
  13. </view>
  14. </navigator>
  15. </u-popup>
  16. </template>
  17. <script>
  18. import {
  19. getCommunityShopLists
  20. } from "@/api/community.js"
  21. export default {
  22. name: "community-shop",
  23. props: {
  24. value: {
  25. type: Boolean
  26. },
  27. communityId: {
  28. type: [String, Number],
  29. default: ''
  30. }
  31. },
  32. data() {
  33. return {
  34. lists: []
  35. }
  36. },
  37. computed: {
  38. // 弹窗Popup显示状态
  39. show: {
  40. get: function() {
  41. return this.value
  42. },
  43. set: function(value) {
  44. value ? this.initRecommendShop() : ''
  45. this.$emit('input', value)
  46. }
  47. }
  48. },
  49. methods: {
  50. // 获取
  51. initRecommendShop() {
  52. getCommunityShopLists({
  53. id: this.communityId
  54. }).then(res => {
  55. this.lists = res.data
  56. })
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. .shop {
  63. padding: 20rpx;
  64. border-top: 1px solid $-color-body;
  65. .shop-info {
  66. height: 160rpx;
  67. line-height: 160rpx;
  68. }
  69. }
  70. </style>