feat(M08-A): 接入顾客端选店下单入口
This commit is contained in:
@@ -59,6 +59,12 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
openStore(event) {
|
||||
const storeId = event.currentTarget.dataset.storeId
|
||||
if (!storeId) return
|
||||
wx.navigateTo({ url: `/pages/store/detail?storeId=${encodeURIComponent(storeId)}` })
|
||||
},
|
||||
|
||||
async resolveScene(code, sourceType) {
|
||||
this.setData({ loading: true, errorMessage: '' })
|
||||
try {
|
||||
|
||||
@@ -8,13 +8,14 @@
|
||||
</view>
|
||||
<view wx:if="{{errorMessage}}" class="error">{{errorMessage}}</view>
|
||||
<view wx:if="{{!loading && stores.length === 0}}" class="empty">暂无门店</view>
|
||||
<view wx:for="{{stores}}" wx:key="id" class="store-card">
|
||||
<view wx:for="{{stores}}" wx:key="id" class="store-card" bindtap="openStore" data-store-id="{{item.id}}">
|
||||
<view class="store-name">{{item.name}}</view>
|
||||
<view>{{item.city}}{{item.district}} {{item.address}}</view>
|
||||
<view wx:if="{{item.distanceMeters !== null}}">距离 {{item.distanceMeters}} 米</view>
|
||||
<view class="{{item.openNow ? 'open' : 'closed'}}">
|
||||
{{item.openNow ? '营业中' : '休息中'}}
|
||||
</view>
|
||||
<view class="card-action">查看房间</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.store-card:active {
|
||||
background: #eef4ff;
|
||||
}
|
||||
|
||||
.store-name {
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
@@ -55,3 +59,9 @@
|
||||
color: #888888;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.card-action {
|
||||
margin-top: 16rpx;
|
||||
color: #1f6feb;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user