info.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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="mb-40 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. },
  56. mounted() {
  57. this.shopInfo()
  58. },
  59. methods: {
  60. to() {
  61. uni.navigateTo({
  62. url: '/pages-takeout/aptitude?shopId='+this.shopId
  63. })
  64. },
  65. shopInfo() {
  66. const operate_id = uni.getStorageSync('operate_id')
  67. shopInfo({
  68. shop_id: this.shopId,
  69. operate_id: operate_id
  70. }).then((res) => {
  71. if (res.code == 1) {
  72. this.shopInfoData = res.data
  73. res.data.business_hours.forEach((v, k) => {
  74. // let time =
  75. v.forEach((i, j) => {
  76. let time = ''
  77. if (j == 0 || j == 3) {
  78. time = i + '-'
  79. } else {
  80. time = i
  81. }
  82. this.array = this.array + time
  83. })
  84. if (res.data.business_hours.length === k + 1) {
  85. this.timeData = this.timeData + this.array
  86. } else {
  87. this.timeData = this.timeData + this.array + ','
  88. }
  89. this.array = ''
  90. })
  91. }
  92. })
  93. }
  94. },
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. .shop-info-box {
  99. height: 100%;
  100. overflow: scroll;
  101. background-color: #F5F4F9;
  102. padding: 16rpx 24rpx;
  103. .box-card {
  104. width: 100%;
  105. min-height: 10rpx;
  106. border-radius: 20rpx;
  107. image {
  108. width: 40rpx;
  109. height: 40rpx;
  110. margin-right: 16rpx;
  111. }
  112. .right-img-f {
  113. position: relative;
  114. .right-img {
  115. position: absolute;
  116. top: 10rpx;
  117. right: -10rpx;
  118. width: 32rpx;
  119. height: 32rpx;
  120. }
  121. }
  122. }
  123. }
  124. </style>