mystore.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <theme>
  3. <view class="wrap">
  4. <Navbar title="门店列表" fixed border> </Navbar>
  5. <view class="content">
  6. <view
  7. class="item"
  8. v-for="(item, index) in detials"
  9. :key="index"
  10. @click="openUrlBlank(item.map_url)"
  11. >
  12. <view class="icon">
  13. <image
  14. class="img"
  15. src="/static/location.png"
  16. mode="widthFix"
  17. ></image>
  18. </view>
  19. <view class="item_cont">
  20. <view class="title"
  21. >{{ item.name }}({{ item.business_hours }})</view
  22. >
  23. <view class="location">{{ item.address }}</view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </theme>
  29. </template>
  30. <script setup>
  31. import Navbar from "@/components/navbar";
  32. import { computed, ref, nextTick } from "vue";
  33. import { t } from "@/locale";
  34. import { onShow } from "@dcloudio/uni-app";
  35. import { SHOP_STORE_LISTS } from "@/api";
  36. import { openUrlBlank } from "@/utils";
  37. const detials = ref([]);
  38. const getLists = async () => {
  39. try {
  40. const res = await SHOP_STORE_LISTS();
  41. detials.value = res.data || [];
  42. } catch (error) {
  43. Toast(error.msg);
  44. }
  45. };
  46. onShow(() => {
  47. nextTick(() => {
  48. getLists();
  49. });
  50. });
  51. </script>
  52. <style lang="less" scoped>
  53. @import url("@/style.less");
  54. .wrap {
  55. background: var(--bg);
  56. min-height: 100vh;
  57. .content {
  58. flex-grow: 1;
  59. height: calc(100vh - 44px);
  60. flex-direction: column;
  61. padding: 24rpx;
  62. box-sizing: border-box;
  63. .item {
  64. display: flex;
  65. padding: 24rpx;
  66. margin-bottom: 24rpx;
  67. border-radius: 20rpx;
  68. box-shadow: 0px 8rpx 20rpx 0px var(--bor-color1);
  69. .icon {
  70. width: 48rpx;
  71. height: 48rpx;
  72. margin-right: 24rpx;
  73. }
  74. .item_cont {
  75. .title {
  76. color: var(--text);
  77. .size(28rpx);
  78. }
  79. .location {
  80. margin-top: 10rpx;
  81. .size(20rpx);
  82. }
  83. }
  84. }
  85. .null_warp {
  86. .null_text {
  87. min-height: 100rpx;
  88. .flex_center();
  89. .size(28rpx);
  90. color: #333;
  91. }
  92. }
  93. }
  94. }
  95. </style>