info.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view class="shop-info-box box-border-box">
  3. <view class="box-card box-border-box p-24 bgc-f mb-20">
  4. <view class="fs-32 fw-500 mb-32">商家信息</view>
  5. <view class="mb-40 align-items-center">
  6. <image src="@/static/img/takeout/info-address.png" mode=""></image>
  7. <view class="fs-28 fw-400">{{shopInfoData.city_name}}{{shopInfoData.shop_name}}</view>
  8. </view>
  9. <!-- <view class="mb-40 align-items-center">
  10. <image src="@/static/img/takeout/info-class.png" mode=""></image>
  11. <view class="fs-28 fw-400">门店类目:{{shopInfoData.cate_name}}</view>
  12. </view> -->
  13. <view class="mb-40 align-items-center">
  14. <image src="@/static/img/takeout/info-time.png" mode=""></image>
  15. <view class="fs-28 fw-400">营业时间:{{timeData}}</view>
  16. </view>
  17. <view class="align-items-center">
  18. <image src="@/static/img/takeout/info-phone.png" mode=""></image>
  19. <view class="fs-28 fw-400">联系电话:{{shopInfoData.shop_phone}} </view>
  20. </view>
  21. <!-- <view class="right-img-f align-items-center" @click.stop="to()">
  22. <image src="@/static/img/takeout/info-zz.png" mode=""></image>
  23. <view class="fs-28 fw-400">查看营业资质 </view>
  24. <image class="right-img" src="@/static/img/toRight.png" mode=""></image>
  25. </view> -->
  26. </view>
  27. <view class="box-card box-border-box p-24 bgc-f mb-20">
  28. <view class="fs-32 fw-500 mb-32">商家公告</view>
  29. <view class="display-flex">
  30. <image class="flex-shrink0" src="@/static/img/takeout/info-gg.png" mode=""></image>
  31. <view v-if="shopInfoData.notice" class="fs-28 fw-400">{{shopInfoData.notice}}</view>
  32. <view class="" v-else>
  33. 无
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. shopInfo
  42. } from "@/api/shop.js"
  43. export default {
  44. props: {
  45. shopId: {}
  46. },
  47. data() {
  48. return {
  49. shopInfoData: {},
  50. timeData: '',
  51. array: ''
  52. }
  53. },
  54. onShow() {},
  55. mounted() {
  56. this.shopInfo()
  57. },
  58. methods: {
  59. shopInfo() {
  60. const operate_id = uni.getStorageSync('operate_id')
  61. shopInfo({
  62. shop_id: this.shopId,
  63. operate_id: operate_id
  64. }).then((res) => {
  65. if (res.code == 1) {
  66. this.shopInfoData = res.data
  67. res.data.business_hours.forEach((v, k) => {
  68. // let time =
  69. v.forEach((i, j) => {
  70. let time = ''
  71. if (j == 0 || j == 3) {
  72. time = i + '-'
  73. } else {
  74. time = i
  75. }
  76. this.array = this.array + time
  77. })
  78. if (res.data.business_hours.length === k + 1) {
  79. this.timeData = this.timeData + this.array
  80. } else {
  81. this.timeData = this.timeData + this.array + ','
  82. }
  83. this.array = ''
  84. })
  85. }
  86. })
  87. }
  88. },
  89. }
  90. </script>
  91. <style scoped lang="scss">
  92. .shop-info-box {
  93. height: 100%;
  94. overflow: scroll;
  95. background-color: #F5F4F9;
  96. padding: 16rpx 24rpx;
  97. .box-card {
  98. width: 100%;
  99. min-height: 10rpx;
  100. border-radius: 20rpx;
  101. image {
  102. width: 32rpx;
  103. height: 32rpx;
  104. margin-right: 16rpx;
  105. }
  106. .right-img-f {
  107. position: relative;
  108. .right-img {
  109. position: absolute;
  110. top: 10rpx;
  111. right: -10rpx;
  112. width: 32rpx;
  113. height: 32rpx;
  114. }
  115. }
  116. }
  117. }
  118. </style>