| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- <!--index.wxml-->
- <view class="wrap">
- <!-- 门店 -->
- <view class="store_wrap">
- <view class="store_l" wx:if="{{ store }}">
- <view class="logo_wrap">
- <image class="logo" mode="heightFix" src="{{ imgUrl+ store.thumb }}"></image>
- </view>
- <view class="store_t_info">
- <view class="">
- <view class="store_t_info_t">
- <view class="name slh">{{ store.title }}</view>
- <!-- <image class="icon_phone" src="/statics/img/icon_phone.png" bind:tap="onMakePhone"></image> -->
- </view>
- <view class="desc">距离您{{ store.distance }}km</view>
- <!-- <view class="desc">营业时间:{{ store.begin_at+'~'+ store.end_at }}</view> -->
- </view>
- <!-- <image class="icon_phone" src="/statics/img/icon_phone.png" bind:tap="onMakePhone"></image> -->
- </view>
- </view>
- <view class="store_r" wx:if="{{ store }}">
- <view class="{{ fare_type != 1 ? 'wenzi active' : 'wenzi'}}" bind:tap="changeFareType" data-type="0">外卖</view>
- <view class="{{ fare_type == 1 ? 'wenzi active' : 'wenzi'}}" bind:tap="changeFareType" data-type="1">自取</view>
- </view>
- </view>
- <!-- 商品 -->
- <view class="goods_wrap">
- <scroll-view scroll-y="{{true}}" style="height:{{ scrollH }}px" scroll-into-view="{{ toViewYiji }}">
- <view class="goods_wrap_l">
- <view class="{{ item.id == activeCateId ? 'cate_item active' : 'cate_item'}}" wx:for="{{ good_cate }}" wx:key="idx" id="{{ 'yijicate'+item.id }}" data-item="{{item}}" bindtap="selectClassesClick">{{ item.name }}</view>
- </view>
- </scroll-view>
- <view class="">
- <!-- wx:if="{{ showErjiCate }}" -->
- <view class="erji_cate">
- <view wx:if="{{ currentCate.children && currentCate.children.length != 0 }}">
- <scroll-view scroll-x="{{true}}" scroll-into-view="{{ toViewErji }}" style="white-space: nowrap;width:570rpx;">
- <text class="{{ activeErjiId == item.id ? 'cate_item active' : 'cate_item' }}" id="{{ 'erjiCate'+ item.id}}" wx:for="{{ currentCate.children }}" wx:key="idx" bind:tap="onErjiCate" data-item="{{item}}">{{ item.name }}</text>
- </scroll-view>
- </view>
- <view style="padding-left:15rpx;" wx:else>{{ currentCate.name }}</view>
- </view>
- <!-- toViewErji toView-->
- <scroll-view scroll-y="{{ true }}" style="height:{{ scrollH }}px" scroll-into-view="{{toView}}" scroll-with-animation bindscroll="scrollProductList">
- <view class="goods_wrap_r">
- <view class="goods_list_w" wx:for="{{ good_list }}" wx:key="idx" wx:for-item="goods" id="{{ 'yiji'+ goods.good_cate_id}}">
- <view class="cate_name">{{ goods.name }}</view>
- <view>
- <!-- 有二级 -->
- <view wx:if="{{ goods.children }}">
- <view class="goods_list" wx:for="{{ goods.children }}" wx:for-item="goods" wx:key="idx" id="{{ 'erji'+goods.good_cate_id }}">
- <view class="goods_item_w" wx:for="{{ goods.goodList }}" wx:for-item="item" wx:key="idx" id="{{ item.id }}">
- <view class="goods_item">
- <image class="goods_tu" src="{{ imgUrl + item.thumb }}" bind:tap="onGoodsSpec" data-item="{{ item }}"></image>
- <view class="goods_info">
- <view class="goods_title slh_s" bind:tap="onGoodsSpec" data-item="{{ item }}">{{ item.title }}</view>
- <view class="goods_desc slh" bind:tap="onGoodsSpec" data-item="{{ item }}">{{ item.describe ? item.describe : '' }}</view>
- <view class="goods_specs">
- <view class="price">
- <view><text class="unit">¥</text>{{ item.price }}</view>
- <view class='vip'>会员价{{ '¥'+item.low_member_price }}</view>
- </view>
- <view class="topNum_w" wx:if="{{ item.status == 1 }}">
- <view class="btn_specs" wx:if="{{ item.good_specs && item.good_specs.length != 0 }}" bind:tap="onGoodsSpec" data-item="{{ item }}">
- <text class="">选规格</text>
- <view class="topNum" wx:if="{{ item.good_specs && item.good_specs.length != 0 && item.cartNums }}">{{ item.cartNums }}</view>
- </view>
- <van-stepper wx:else value="{{ item.nums }}" input-width="40rpx" min="0" disable-input custom-class="stepper" plus-class="plus" minus-class="minus" input-class="step_input" bind:change="onChangeSpecNum" data-item="{{ item }}" />
- </view>
- <view class="topNum_w" wx:if="{{ item.status != 1 }}">已售罄</view>
- </view>
- </view>
- </view>
- <view class="use_coupon" wx:if="{{ item.is_use_coupon != 1 }}">特殊商品不参与任何活动</view>
- </view>
- </view>
- </view>
- <!-- 无二级 -->
- <view wx:else id="{{ 'erji'+ goods.good_cate_id}}">
- <view class="goods_list">
- <view class="goods_item_w" wx:for="{{ goods.goodList }}" wx:for-item="item" wx:key="idx" id="{{ item.id }}">
- <view class="goods_item">
- <image class="goods_tu" src="{{ imgUrl + item.thumb }}" bind:tap="onGoodsSpec" data-item="{{ item }}"></image>
- <view class="goods_info">
- <view class="goods_title slh_s" bind:tap="onGoodsSpec" data-item="{{ item }}">{{ item.title }}</view>
- <view class="goods_desc slh" bind:tap="onGoodsSpec" data-item="{{ item }}">{{ item.describe ? item.describe : '' }}</view>
- <view class="goods_specs">
- <view class="price">
- <view><text class="unit">¥</text>{{ item.price }}</view>
- <view class='vip'>会员价{{ '¥'+item.low_member_price }}</view>
- </view>
- <view class="topNum_w" wx:if="{{ item.status == 1 }}">
- <view class="btn_specs" wx:if="{{ item.good_specs && item.good_specs.length != 0 }}" bind:tap="onGoodsSpec" data-item="{{ item }}">
- <text class="">选规格</text>
- <view class="topNum" wx:if="{{ item.good_specs && item.good_specs.length != 0 && item.cartNums }}">{{ item.cartNums }}</view>
- </view>
- <van-stepper wx:else value="{{ item.nums }}" input-width="40rpx" min="0" disable-input custom-class="stepper" plus-class="plus" minus-class="minus" input-class="step_input" bind:change="onChangeSpecNum" data-item="{{ item }}" />
- </view>
- <view class="topNum_w" wx:if="{{ item.status != 1 }}">已售罄</view>
- </view>
- </view>
- </view>
- <view class="use_coupon" wx:if="{{ item.is_use_coupon != 1 }}">特殊商品不参与任何活动</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
- <!-- 合计 -->
- <!-- style="background-image:url({{ hejiBg }})" -->
- <view class="heji_wrap">
- <view class="heji_l">
- <view class="cart_w" bind:tap="goShopCart">
- <image class="cart_tu" src="/statics/img/shopcar_tu.png"></image>
- <view class="goods_num" wx:if="{{ totalNums }}">{{ totalNums }}</view>
- </view>
- <view class="total_price">
- <text><text class="unit">¥</text>{{ totalPrice }}</text>
- <!-- <text class="vip" wx:if="{{ totalMemberPrice }}"><text class="unit">{{ '会员¥'+totalMemberPrice }}</text></text> -->
- </view>
- </view>
- <view class="heji_btn" bind:tap="toPay">选好了</view>
- </view>
- </view>
- <!-- 规格 -->
- <van-overlay z-index="5" class-style="background: rgba(0,0,0,.3);" show="{{ showGoodsSpec }}" catch:tap="closeGoodsSpec"></van-overlay>
- <!-- style="top: {{ setBgHeight + 40 }}px" -->
- <view class="guige_wrap" wx:if="{{ showGoodsSpec }}">
- <view class="guige">
- <view class="goods_thumb_wrap" style="">
- <!-- aspectFit center widthFix -->
- <image class="goods_thumb" mode="widthFix" src="{{ imgUrl+currentGoods.thumb }}"></image>
- </view>
- <view class="goods_name">
- <view class="goods_name_l">{{ currentGoods.title }}</view>
- </view>
- <view class="goods_desc" wx:if="{{ currentGoods.describe }}">
- <view class="goods_desc_nr">{{ currentGoods.describe }}</view>
- </view>
- <view class="goods_guige" wx:if="{{ currentGoods.good_specs.length != 0 }}">
- <view class="goods_guige_name">规格</view>
- <view class="goods_guige_nr">
- <view class="{{ good_specs.is_checked ? 'guige_item selected' : 'guige_item' }}" wx:for="{{ currentGoods.good_specs }}" wx:for-item="good_specs" wx:key="index" bind:tap="onChangeSpecGoods" data-specs="{{ good_specs }}" data-id="{{good_specs.id}}">
- <view class="item_wenzi">
- <text>{{ good_specs.title }}</text>
- </view>
- <!-- <view class="price">
- <text>
- <text class="unit"></text>
- <text>{{ good_specs.price }}</text>
- </text>
- <text class="vip">会员价{{ '¥'+ good_specs.member_price}}</text>
- </view> -->
- </view>
- </view>
- </view>
- <view class="guige_b">
- <view class="guige_b_l">
- <text class="price"><text class="unit">¥</text>{{ checkedSpec.price }}</text>
- <text class="vip">会员价{{ '¥'+checkedSpec.member_price }}</text>
- </view>
- <!-- <view class="">
- <van-stepper value="{{ checkedSpec.nums }}" async-change input-width="40rpx" min="0" disable-input custom-class="stepper" plus-class="plus" minus-class="minus" input-class="step_input" data-item="{{ checkedSpec }}" bind:change="onChangeSpecNum" />
- </view> -->
- <view class="" wx:if="{{ checkedSpec.status == 1 }}">
- <van-stepper value="{{ checkedSpecNums }}" async-change input-width="40rpx" min="0" disable-input custom-class="stepper" plus-class="plus" minus-class="minus" input-class="step_input" data-item="{{ checkedSpec }}" bind:change="onChangeSpecNum" />
- </view>
- <view class="" wx:if="{{ checkedSpec.status != 1 }}">已售罄</view>
- </view>
- </view>
- <van-icon name="close" class="btn_close" color="#ffffff" size="30px" bind:tap="closeGoodsSpec" />
- </view>
- <!-- loading -->
- <!-- <van-overlay show="{{ loading }}" z-index="100">
- <van-loading custom-class="custom_loading" />
- </van-overlay> -->
- <!-- 开启定位提示 -->
- <van-dialog class="custom_dialog" title="地理位置未授权" message="开启羊汤馆小程序定位授权后,可为您推荐就近门店" show="{{ showOpenLocation }}" confirm-button-text="授权定位" confirm-button-color="#D54C43" show-cancel-button bind:close="onCloseLocation" bind:confirm="onConfirmLocation"></van-dialog>
- <!-- 所选门店不支持的提醒 -->
- <van-dialog
- title="{{ tipsTitle }}"
- show="{{ showTips }}"
- class="single_btn"
- confirm-button-color="#000000"
- confirmButtonText="我知道了"
- bind:confirm="closeShowTips"
- >
- </van-dialog>
- <!-- 配送方式弹层 -->
- <!-- <van-overlay z-index="5" class-style="background: rgba(0,0,0,.3);" show="{{ showSelectFare }}">
- <view class="fare_w">
- <view class="title">请选择您的取货方式</view>
- <view class="type">
- <image class="type_bg" src="/statics/img/type_bg.png"></image>
- <view class="type_item waimai" bind:tap="changeFareType" data-type="0">外卖</view>
- <view class="type_item ziqu" bind:tap="changeFareType" data-type="1">自提</view>
- </view>
- <van-icon name="close" class="btn_close" color="#ffffff" size="30px" bind:tap="closeSelectFare" />
- </view>
- </van-overlay> -->
- <!-- js -->
- <wxs module="we">
- /* 字符串长度截取 */
- var strSlice = function(value) {
- if(value.length > 10){
- value = value.slice(0,6)+'...'
- };
- return value;
- };
- module.exports = {
- strSlice: strSlice
- }
- </wxs>
|