Blame view

member-miniapp/packageBooking/store-detail/store-detail.vue 5.48 KB
5c34676a   “wangming”   对会员端进行了设计
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  <template>
    <view class="page-shell store-detail-page">
      <view class="page-blur"></view>
      <view class="page-blur-secondary"></view>
      <view class="page-blur-tertiary"></view>
  
      <view class="page-content subpage-content">
        <view class="subpage-nav">
          <view class="subpage-back" @tap="goBack">‹</view>
          <view class="subpage-title-wrap">
            <text class="subpage-title">门店详情</text>
            <text class="subpage-subtitle">空间、交通与到店提醒,都为你提前准备好</text>
          </view>
        </view>
  
        <view class="detail-hero glass-card">
e1dcb3a0   “wangming”   1
17
          <image v-if="store.cover" class="hero-image" :src="store.cover" mode="aspectFill" />
5c34676a   “wangming”   对会员端进行了设计
18
19
          <view class="hero-overlay"></view>
          <view class="hero-content">
e1dcb3a0   “wangming”   1
20
            <text class="hero-kicker">{{ store.city || '门店' }}</text>
5c34676a   “wangming”   对会员端进行了设计
21
            <text class="hero-title">{{ store.name }}</text>
e1dcb3a0   “wangming”   1
22
            <text v-if="store.description" class="hero-desc">{{ store.description }}</text>
5c34676a   “wangming”   对会员端进行了设计
23
24
25
26
27
28
29
          </view>
        </view>
  
        <view class="subpage-card">
          <view class="info-list">
            <view class="info-row">
              <text class="info-label">地址</text>
e1dcb3a0   “wangming”   1
30
              <text class="info-value">{{ store.address || '无' }}</text>
5c34676a   “wangming”   对会员端进行了设计
31
32
33
            </view>
            <view class="info-row">
              <text class="info-label">营业时间</text>
e1dcb3a0   “wangming”   1
34
              <text class="info-value">{{ store.hours || '无' }}</text>
5c34676a   “wangming”   对会员端进行了设计
35
36
37
            </view>
            <view class="info-row">
              <text class="info-label">联系电话</text>
e1dcb3a0   “wangming”   1
38
              <text class="info-value">{{ store.phone || '无' }}</text>
5c34676a   “wangming”   对会员端进行了设计
39
            </view>
e1dcb3a0   “wangming”   1
40
41
42
            <view v-if="store.city" class="info-row">
              <text class="info-label">所在城市</text>
              <text class="info-value">{{ store.city }}</text>
5c34676a   “wangming”   对会员端进行了设计
43
44
45
46
            </view>
          </view>
        </view>
  
e1dcb3a0   “wangming”   1
47
        <view v-if="store.description" class="subpage-card">
5c34676a   “wangming”   对会员端进行了设计
48
          <view class="section-head">
e1dcb3a0   “wangming”   1
49
            <text class="section-title">门店介绍</text>
5c34676a   “wangming”   对会员端进行了设计
50
51
          </view>
          <view class="soft-panel note-panel">
e1dcb3a0   “wangming”   1
52
            <text class="note-desc">{{ store.description }}</text>
5c34676a   “wangming”   对会员端进行了设计
53
54
55
56
          </view>
        </view>
  
        <view class="cta-row">
e1dcb3a0   “wangming”   1
57
58
          <view class="secondary-button" @tap="openMap">导航前往</view>
          <view v-if="store.phone" class="secondary-button" @tap="callStore">联系门店</view>
5c34676a   “wangming”   对会员端进行了设计
59
60
61
62
63
64
65
          <view class="primary-button" @tap="bookStore">预约到店</view>
        </view>
      </view>
    </view>
  </template>
  
  <script>
e1dcb3a0   “wangming”   1
66
67
  import { getPickupStores } from '@/api/mall'
  import { normalizeStore } from '@/utils/store'
5c34676a   “wangming”   对会员端进行了设计
68
69
70
71
  
  export default {
    data() {
      return {
e1dcb3a0   “wangming”   1
72
73
74
75
76
77
78
79
80
81
82
83
84
        storeId: '',
        store: {
          id: '',
          name: '门店详情',
          city: '',
          address: '',
          phone: '',
          hours: '',
          description: '',
          cover: '',
          latitude: null,
          longitude: null
        }
5c34676a   “wangming”   对会员端进行了设计
85
86
87
      }
    },
    onLoad(options) {
e1dcb3a0   “wangming”   1
88
89
      this.storeId = options && options.id ? String(options.id) : ''
      this.loadStore()
5c34676a   “wangming”   对会员端进行了设计
90
91
    },
    methods: {
e1dcb3a0   “wangming”   1
92
93
94
95
96
97
98
99
100
101
102
      loadStore() {
        getPickupStores({})
          .then((list) => {
            const rows = Array.isArray(list) ? list : []
            const found = rows.find(item => String(item.id) === this.storeId) || rows[0]
            if (found) {
              this.store = normalizeStore(found)
            }
          })
          .catch(() => {})
      },
5c34676a   “wangming”   对会员端进行了设计
103
104
105
106
107
108
109
110
      goBack() {
        uni.navigateBack({
          fail: () => {
            uni.redirectTo({ url: '/packageBooking/stores/stores' })
          }
        })
      },
      callStore() {
e1dcb3a0   “wangming”   1
111
112
113
114
115
116
117
118
119
120
121
122
123
124
        if (!this.store.phone) return
        uni.makePhoneCall({ phoneNumber: String(this.store.phone) })
      },
      openMap() {
        if (this.store.latitude === null || this.store.longitude === null) {
          uni.showToast({ title: '该门店暂无坐标,无法导航', icon: 'none' })
          return
        }
        uni.openLocation({
          latitude: this.store.latitude,
          longitude: this.store.longitude,
          name: this.store.name,
          address: this.store.address || ''
        })
5c34676a   “wangming”   对会员端进行了设计
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
      },
      bookStore() {
        uni.redirectTo({ url: `/pages/booking/booking?storeId=${this.store.id}` })
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  @import '@/styles/mixins.scss';
  @import '@/styles/subpage.scss';
  
  .detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 360rpx;
    margin-bottom: 28rpx;
d8035736   “wangming”   Refactor project ...
142
143
144
145
146
    transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 360ms ease;
  }
  
  .detail-hero:active {
    transform: translateY(-4rpx);
5c34676a   “wangming”   对会员端进行了设计
147
148
149
150
151
152
153
154
155
156
157
158
159
160
  }
  
  .hero-image,
  .hero-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
  
  .hero-overlay {
    background: linear-gradient(180deg, rgba(36, 74, 61, 0.08), rgba(36, 74, 61, 0.34));
  }
  
d8035736   “wangming”   Refactor project ...
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
  .hero-image {
    transition: transform 1.2s ease;
  }
  
  .detail-hero:active .hero-image {
    transform: scale(1.05);
  }
  
  .detail-hero::after {
    content: '';
    position: absolute;
    right: -80rpx;
    top: -40rpx;
    width: 260rpx;
    height: 260rpx;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0));
    animation: lfFloatSoft 11.6s ease-in-out infinite;
  }
  
5c34676a   “wangming”   对会员端进行了设计
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
  .hero-content {
    position: relative;
    z-index: 2;
    padding: 210rpx 34rpx 34rpx;
  }
  
  .hero-kicker {
    color: rgba(255, 255, 255, 0.86);
  }
  
  .hero-title {
    color: #fff;
  }
  
  .hero-desc {
    color: rgba(255, 255, 255, 0.82);
  }
  
  .note-panel {
    margin-top: 26rpx;
  }
  
  .note-title {
    display: block;
    font-size: 28rpx;
    font-weight: 600;
    color: $brand-primary-deep;
  }
  
  .note-desc {
    display: block;
    margin-top: 12rpx;
    font-size: 24rpx;
    line-height: 1.8;
    color: $text-secondary;
  }
  </style>