| | |
| | | <template> |
| | | <view class="index"> |
| | | <view class="head" :style="{ height: 'calc(' + (navHeight + statusbarHeight + 'px + 248rpx)') }"> |
| | | <view :style="{ width: '100%', height: navHeight + statusbarHeight + 'px' }"></view> |
| | | <view class="head-bar" :style="{ height: navHeight + statusbarHeight + 'px' }"> |
| | | <view :style="{ width: '100%', height: statusbarHeight + 'px' }"></view> |
| | | <view class="head-bar-nav" :style="{ height: navHeight + 'px' }" @click="openLoacing"> |
| | | <image src="/static/icon/home_ic_location@2x.png" mode="widthFix"></image> |
| | | <text>{{position.formatted_addresses.recommend}}</text> |
| | | <text>{{position.formatted_addresses.recommend || '点击定位'}}</text> |
| | | <u-icon name="arrow-right" color="#222222" size="13"></u-icon> |
| | | </view> |
| | | </view> |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="dingwei" v-if="!position"> |
| | | <view class="dingwei" v-if="isShow"> |
| | | <view class="dingwei-left"> |
| | | <text>未授权定位</text> |
| | | <text>我们无法获得您当前位置信息为您推荐附近经销商</text> |
| | |
| | | Login |
| | | }, |
| | | computed: { |
| | | ...mapState(['navHeight', 'statusbarHeight', 'position']) |
| | | ...mapState(['navHeight', 'statusbarHeight', 'position', 'userInfo']) |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | specialZone: [], |
| | | goodsList: [], |
| | | page: 1, |
| | | next: true |
| | | next: true, |
| | | isShow: false |
| | | } |
| | | }, |
| | | async onLoad() { |
| | | await this.$onLaunched; |
| | | if (!this.position) { |
| | | this.isShow = true |
| | | } |
| | | this.getBanner() |
| | | this.getLabels() |
| | | this.getGoodsList() |
| | |
| | | }) |
| | | }, |
| | | addCard(e) { |
| | | if (!this.userInfo) { |
| | | this.$refs.loginRef.open() |
| | | return |
| | | } |
| | | this.$u.api.addCart({ |
| | | goodsId: e.id, |
| | | goodsSkuId: e.goodsSkuResponseList[0].id, |
| | |
| | | countInCurrentChunk = 0; // 重置计数器 |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | |
| | | if (result[1].length === 0) { |
| | | return [result[0]] |
| | | } else { |
| | | return result; |
| | | } |
| | | }, |
| | | goToAppSetting() { |
| | | var that = this; |
| | |
| | | |
| | | .head-bar { |
| | | width: 100%; |
| | | position: fixed; |
| | | padding: 0 30rpx; |
| | | box-sizing: border-box; |
| | | top: 0; |
| | | left: 0; |
| | | z-index: 999; |
| | | // background-color: #ffffff; |
| | | |
| | | .head-bar-nav { |
| | |
| | | .commodity-item-image { |
| | | width: 100%; |
| | | height: 336rpx; |
| | | overflow: hidden; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | |
| | | } |
| | | |
| | | .cate-item { |
| | | width: calc(100vw / 4 - 96rpx); |
| | | width: calc(100vw / 4 - 86rpx); |
| | | height: auto; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | margin-bottom: 30rpx; |
| | | margin-right: 96rpx; |
| | | margin-right: 86rpx; |
| | | |
| | | &:last-child { |
| | | margin-right: 0 !important; |
| | |
| | | } |
| | | |
| | | text { |
| | | width: 100%; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | font-weight: 400; |
| | | font-size: 26rpx; |
| | | color: #333333; |