<import src="../../../../utils/wxParse/wxParse.wxml"></import>
<wxs module="filters" src="../../../../utils/filter.wxs"></wxs>
<wxs module="g_filters" src="g_filter.wxs"></wxs>
<wxs module="tool" src="filter.wxs"></wxs>
<!-- <com_top_nav title="{{data.goods_name}}"></com_top_nav> -->
<!-- 判断隐私是不是显示 -->
<privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop>
<!-- 顶开 -->
<top_nav wx:if="{{!istop || activeCategoryId>0}}" nav_type="{{-1}}" nav_frontColor="{{nav_frontColor}}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav>

<block wx:if="{{show}}">
<!-- 商品内容区域,普通商品,秒杀,拼团 -->
<view class="container">
  <!-- 自定义顶部的优化 -->
  <view class="type-navbar_box">
    <top_nav id="my-nav" bindclickShare="clickShare" nav_type="{{nav_type}}" is_share="1"
             nav_frontColor="{{nav_frontColor}}" istop="{{(istop && searchbox_transparent && activeCategoryId==0)  ? 1 : 0 }}" nav_backgroundColor="{{nav_backgroundColor}}" nav_title="{{gtitle}}"></top_nav>
  </view>
  <view class="type-navbar" style="top:{{top_nav?(top_nav-4):0}}px">
    <view class="type-box" wx:for="{{categories}}" wx:key="categories">
      <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}">
        {{item.name}}
      </view>
    </view>
  </view>
  <view class="goods-detail">
    <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}">

   	<!-- 左上角轮播 历史购买记录 -->
     <view class="swiper-container" wx:if="{{historyBuyInfo.length}}">
					<swiper class="swiper" autoplay="true" circular="true" vertical="true" interval="3000">
						<swiper-item class="swiper-item" wx:for="{{historyBuyInfo}}" wx:key="order_id">
							<view class="item">
                <view class="avatar-container">
                  <image src="{{item.head_pic}}"></image>
                </view>
								<view class="flex ai_c pd10">
									<view class="nickname ellipsis-1x">{{item.nickname}}下单成功</view>
								</view>
							</view>
						</swiper-item>
					</swiper>
				</view>

      <!-- 视频 -->
      <!-- <swiper bindchange="swiperChange"class="xc-pictures  swiperContainer rel" current="{{swiperCurrent}}"
	  indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> -->
      <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove">
        <view class="xc-videos-picture rel">
          <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box  swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange">
            <swiper-item wx:if="{{mapurl}}">
              <view wx:if="{{noon == 0}}">
                <image class="xc-picturess" src="{{iurl+mapurl_f_img}}" mode="aspectFit">
                  <image id="{{index}}" class="xc-play" src="{{iurl}}/miniapp/images/pofang.png" bindtap="videoPlay"></image>
                </image>
              </view>
              <view wx:else>
                <video class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"></video>
              </view>
            </swiper-item>
            <swiper-item wx:for="{{gallery}}" wx:key="gallery">
              <!-- <image class="wh100" src="{{item.image_url}}" mode="aspectFit" binderror="bind_bnerr" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image> -->
              <view class="wh100 g_img_box" style="background-image:url({{iurl +(item.image_url?item.image_url:'miniapp/images/default_g_img.gif')}});"></view>
            </swiper-item>
          </swiper>
          <block wx:if="{{mapurl}}">
            <view wx:if="{{hiddenn==1}}">
              <view class="xc-imageCount">{{current}}/{{gallery.length}}</view>
            </view>
            <view class="xc-video-picture abs">
              <view class="xc-video" data-vipi="0" bindtap="videopicture">
                <view class="{{videopicture==0 ? 'xc-video-button':'xc-video-buttons'}}  {{videopicture==0 ? 'xc-sn':''}}">
                  视频
                </view>
              </view>
              <view class="xc-picture  {{videopicture==1 ? 'xc-sn':''}}" data-vipi="1" bindtap="videopicture">
                <view>图片</view>
              </view>
            </view>
          </block>
        </view>
      </view>
      <view class="goo">
        <view class="pt_view rel">
          <!-- 许程 7. 24 -->
          <image wx:if="{{type == 0}}" class="secondkill-img" src="{{iurl?iurl+'miniapp/images/blue_ks.png':''}}" />
          <image wx:else class="secondkill-img" src="{{iurl?iurl+'miniapp/images/red_jx.png':''}}" />
          <!-- <view class=""> -->
          <!-- <view class="flex" style='height:40rpx; margin-top:5rpx;'> -->
          <view class="abs xc-qt-price fs28 xc-qtsign">预售价</view>
          <view class="abs flex presell_price">
            <view class="fs28 val" style="margin-right:60rpx">￥{{presellList.presell_price}}</view>
            <view wx:if="{{is_retail_price}}" class="word-line fs26 xc-qtunit-price">
               零售价￥{{filters.toFix(data.market_price,2)}}
            </view>
          </view>


          <block>
            <!-- </view> -->
            <view class="hy-stop word-color fs26 abs cl_r {{type==0?'pre_cl':''}}">距活动{{type==0?'开始':'结束'}}还有</view>
            <view class="secview  flex abs fs24 " style="color: black;right: 3px; top:46rpx;">
              <block wx:if="djs.day">
                <view class="day-val cl_r {{type==0?'pre_cl':''}}" style="margin-top:-34rpx;">
                  {{djs.day}}
                </view>
                <view class="day cl_r {{type==0?'pre_cl':''}}" style="margin-top:-34rpx;margin-right:10rpx;">
                  天
                </view>
              </block>
              <view class="xc-time-val white t-c {{type==0?'pre_ba':''}}" >
                {{djs.hou}}
              </view>
              <view class="xc-time {{type==0?'pre_cl':''}}">时</view>
              <view class="xc-time-val white t-c {{type==0?'pre_ba':''}}" >
                {{djs.min}}
              </view>
              <view class="xc-time {{type==0?'pre_cl':''}}">分</view>
              <view class="xc-time-val white t-c {{type==0?'pre_ba':''}}" >
                {{djs.sec}}
              </view>
              <view class="xc-time {{type==0?'pre_cl':''}}">秒</view>
            </view>
          </block>
        </view>
        <view class="pt_fir pd20">
          <!-- --显示团类型和团价格-- -->
          <view class="pt_fir_title ">
            <view class="xc-goods-explain flex-vertical-between">
               <view class="xc-explain fs32 ellipsis-2">
                 <text  selectable='true' user-select="true">{{data.goods_name}}</text>
                </view>
              <!-- 这个是分享按钮 -->
              <view wx:if="{{isLogin}}" class="xc-share-frame t-c" bindtap="clickShare">
                <view class="iconfont icon-share"></view>
                <view class="fs22 c-7b">分享</view>
              </view>
            </view>
          </view>
          <view wx:if="{{presellForm.presell_type==0}}" class="fs24" style="padding-bottom:20rpx">
            <view class="stock" style="color:#999">尾款:{{filters.format_time(presellForm.pay_begindate,1)}}-{{filters.format_time(presellForm.pay_enddate,1)}}</view>
          </view>
          <view class="goods-num">
            <block wx:if="{{presellList.virtual_qty && type !=0}}">
              <view class="stock">总数量:{{presellList.presell_sumqty+presellList.virtual_qty}}件</view>
              <view class="stock" wx:if="{{presellList.vip_butyqty}}">限购:{{presellList.vip_butyqty}}件</view>
              <view class="stock" wx:else>限购:不限</view>
              <view class="sales">已购:{{presellList.buy_goodnum+presellList.virtual_qty}}件</view>
            </block>
            <block wx:else>
              <view class="stock">总数量：{{presellList.presell_sumqty}}件</view>
              <view class="stock" wx:if="{{presellList.vip_butyqty}}">限购:{{presellList.vip_butyqty}}件</view>
              <view class="stock" wx:else>限购:不限</view>
              <view class="sales">已购:{{presellList.buy_goodnum}}件</view>
            </block>
          </view>
        </view>
        <view class="t_gz" wx:if="{{is_show_gz==1}}">{{prom_act.remark}}</view>
      </view>
              <!-- 许程 7.24暂时注释 -->
      <view class="bdt16" wx:if="{{ prom_type!=1 && prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1 && sele_g.is_xz_yh !=1}}">
          <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}">
            <view class="cx-sizs fs30">领券</view>
            <view class="flex ai_c f1 pdh20">
              <view class="xc-coupon-fram" wx:for="{{fir_quan}}" wx:key="id">
                <view class="circle xc-circular xc-one"></view>
                <view class="xc-coupon t-c four-level-word">
                  满{{item.condition}}减{{item.money}}
                </view>
                <view class="circle xc-circular xc-two"></view>
              </view>
            </view>
            <view data-coupon="1" bindtap="switchCoupon" class="cx-obtain-coupon wsize">
              <text class="bg_jj"></text>
            </view>
          </view>
        </view>
      <!-- 门店收货地址 -->
      <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}">
        <view class="address_frame" bindtap="choice_store" data-ind="0">
          <view class="flex-vertical-between ">
            <view class="flex-vertical select_store_height">
              <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
              <view class="fs30" style="color:black;">选择门店</view>
            </view>
            <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red_bb fs26">更多门店<text class="bg_jj"></text></view>
          </view>
          <view wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
            <view class="flex-space-between address ai_end pdv10">
              <view>
                <text class="fs30 xc-black3 shop_name bold">{{def_pick_store.pickup_name}}</text>
              </view>
              <view class="distance fs24" wx:if="{{def_pick_store.distance!=null}}">
                距离：{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
              </view>
            </view>
            <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
            <block wx:else>
              <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
                (库存不足)
              </view>
              <block wx:else>
                <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">
                  (配送不匹配)
                </view>
                <view class="no_store" wx:elif="{{def_pick_store && def_pick_store.is_no_dis_act}}">
                  (该店不可售)
                </view>
                <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0}}">
                  (库存不足)
                </view>
              </block>
            </block>
            <view class="fs24 xc-ash-9f">地址:{{def_pick_store.fulladdress}}</view>
          </view>
        </view>
      </view>


      <!-- - 宝贝评价 -- -->
      <view class="bdt16">
        <view class="bb_view">
          <view class="bold">宝贝评价({{categories3[0].num}})</view>
          <view class="red_bb fs26" bindtap="look_pj">
            查看全部
            <text class="bg_jj"></text>
          </view>
        </view>
        <view class="xc_comment">
          <view class="xc_comment-have-pictures" data-val="5" bindtap="clik_evaluate">
            有图({{categories3[1].num}})
          </view>
          <view class="xc_comment-discuss" data-val="2" bindtap="clik_evaluate">
            好评({{categories3[2].num}})
          </view>
          <view class="xc_comment-discuss" data-val="3" bindtap="clik_evaluate">
            中评({{categories3[3].num}})
          </view>
          <view class="xc_comment-discuss" data-val="4" bindtap="clik_evaluate">
            差评({{categories3[4].num}})
          </view>
        </view>
        <scroll-view scroll-x="true" class="pj_scroll">
          <view class="flex">
            <view class="xc_comment-detail" wx:for="{{fir_comments}}" wx:key="fir_comments">
              <view class="xc_comment-left">
                <view class="xc_comment-user">
                  <view class="xc_user-img">
                    <image class="xc_imgs" src='{{item.is_anonymous!=1?item.head_pic:iurl+"/miniapp/images/hui_hear_pic.png"}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image>
                  </view>
                  <view class="xc_user">
                    <view class="xc_user-name five-level-word">
                      {{item.is_anonymous!=1?item.username:'匿名'}}
                    </view>
                    <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="rank"></image>
                  </view>
                </view>
                <view class="xc_comment-font pj_word_size ellipsis-1 pdt12">
                  <text class="ellipsis-1">{{item.content?item.content:'此用户没有填写评价。'}}</text>
                </view>
                <view class="xc_comment-val">
                  <view class="xc_comment-time">{{item.add_time}}</view>
                </view>
              </view>
              <view class="xc_goods-img-frame">
                <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image>
                <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image>
                <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image>
              </view>
            </view>
          </view>
        </scroll-view>
      </view>


      <!-- 图文详情 -->
      <view class="t_g_info bdt16">
        <view class="red_shu"></view>
        <view class="fs30 bold">卡项详情</view>
      </view>
      <view class="pdh20">

        <block wx:if="{{listServiceItem && listServiceItem.length > 0}}">
          <view class="card fs28" wx:for="{{listServiceItem}}">
            <view class="flex ai_c jc_sb" style="height: 88rpx;">
              <view class="ellipsis-2 f1" wx:if="{{item.displayqty==1}}" >{{item.projectName}}（无限次）</view>
              <view class="ellipsis-2 f1" wx:else>{{item.projectName}}（{{item.frequency}}次）</view>
              <view class="pdl30 t-r">
                <view class="rmb fs36 bold c-red">{{item.vipprice}}</view>
                <view class="fs22 c-9 del" wx:if="{{item.showPrice}}">零售价：￥{{item.showPrice}}</view>
              </view>
            </view>
            <view class="flex ai_c jc_sb fs24 c-6">
              <view class="ellipsis-1">备注：{{filters.show_default(item.remark, '无')}}</view>
              <!-- 指定开始日期和结束日期 -->
              <view class="pdl30 shrink0">有效期：{{filters.showStartAndEndDate(item, data.validDays)}}</view>
            </view>
          </view>
        </block>

        <block wx:if="{{enableMeiye}}">
          <block wx:if="{{taoheList && taoheList.length > 0}}">
            <view class="taohe fs28" wx:for="{{taoheList}}">
              <view class="flex ai_c jc_sb" style="height: 88rpx;">
                <view class="ellipsis-2 f1">{{item.goods_name}} ({{item.goods_sn}}) ({{item.frequency}}个)</view>
                <view class="pdl30 t-r">
                  <view class="rmb fs36 bold c-red">{{item.vipprice}}</view>
                  <view class="fs22 c-9 del">零售价：￥{{item.show_price}}</view>
                </view>
              </view>
              <view class="flex ai_c jc_sb fs24 c-6 pdt10">
                <view class="ellipsis-1">备注：{{filters.show_default(item.remark, '无')}}</view>
                <view class="pdl30 shrink0">有效期：{{filters.showStartAndEndDate(item,data.validDays)}}</view>
              </view>
            </view>
          </block>
        </block>

        <!-- <view class="table_s" wx:if="{{service_list}}">
<view class="tb_item tb-l">
<view class="item_left f1">
  <text>项目名称</text>
</view>
            <view class="item_left f1">
              <text>耗时(分)</text>
            </view>
            <view class="item_left f1">
              <text>次数</text>
            </view>
</view>
<view class="tb_item tb-l" wx:for="{{service_list}}">
<view class="item_right f1">
  <text>{{item.projectName}}</text>
</view>
            <view class="item_right f1">
              <text>{{item.timeConsuming}}</text>
            </view>
            <view class="item_right f1">
              <text>{{item.frequency}}</text>
            </view>
</view>
</view> -->

        <view class="wxParse">
          <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
        </view>

      </view>

      <!-- 推荐商品 -->
      <view class="flex-center rel xc-linellae-frame">
        <view class="xc-linellae"></view>
        <view class="abs flex-center xc-recommend-frame ">
          <image class=" xc-recommend" src="{{iurl}}/miniapp/images/diamond.png"></image>
          <view class="xc-recommend-word">推荐</view>
        </view>
      </view>
      <goods_recommend id="goods_list"></goods_recommend>
      <!-- 技术支持 -->
      <view class="logo-container t-c">
        <view class="flex ai_c fs24 jc-center pdv30 white">
          <image src="{{iurl + 'miniapp/images/luckDraw/logo.png?v=3'}}" class="logo" lazy-load></image>
          提供技术支持
        </view>
      </view>
    </view>

    <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}">
      <view class="pd20">
        <!-- <view class="table_s" wx:if="{{service_list}}">
      <view class="tb_item tb-l">
        <view class="item_left f1">
          <text>项目名称</text>
        </view>
            <view class="item_left f1">
              <text>耗时(分)</text>
            </view>
            <view class="item_left f1">
              <text>次数</text>
            </view>
      </view>
      <view class="tb_item tb-l" wx:for="{{service_list}}">
        <view class="item_right f1">
          <text>{{item.projectName}}</text>
        </view>
            <view class="item_right f1">
              <text>{{item.timeConsuming}}</text>
            </view>
            <view class="item_right f1">
              <text>{{item.frequency}}</text>
            </view>
      </view>
    </view> -->

        <block wx:if="{{listServiceItem && listServiceItem.length > 0}}">
          <view class="card fs28" wx:for="{{listServiceItem}}">
            <view class="flex ai_c jc_sb" style="height: 88rpx;">
              <view class="ellipsis-2 f1">{{item.projectName}}（{{item.frequency}}次）</view>
              <view class="pdl30 t-r">
                <view class="rmb fs36 bold c-red">{{item.vipprice}}</view>
                <view class="fs22 c-9 del" wx:if="{{item.showPrice}}">零售价：￥{{item.showPrice}}</view>
              </view>
            </view>
            <view class="flex ai_c jc_sb fs24 c-6">
              <view class="ellipsis-1">备注：{{filters.show_default(item.remark, '无')}}</view>
              <!-- 指定开始日期和结束日期 -->
              <view class="pdl30 shrink0">有效期：{{filters.showStartAndEndDate(item, data.validDays)}}</view>
            </view>
          </view>
        </block>

        <block wx:if="{{enableMeiye}}">
          <block wx:if="{{taoheList && taoheList.length > 0}}">
            <view class="taohe fs28" wx:for="{{taoheList}}">
              <view class="flex ai_c jc_sb" style="height: 88rpx;">
                <view class="ellipsis-2 f1">{{item.goods_name}} ({{item.goods_sn}}) ({{item.frequency}}个)</view>
                <view class="pdl30 t-r">
                  <view class="rmb fs36 bold c-red">{{item.vipprice}}</view>
                  <view class="fs22 c-9 del">零售价：￥{{item.show_price}}</view>
                </view>
              </view>
              <view class="flex ai_c jc_sb fs24 c-6 pdt10">
                <view class="ellipsis-1">备注：{{filters.show_default(item.remark, '无')}}</view>
                <view class="pdl30 shrink0">有效期：{{filters.showStartAndEndDate(item,data.validDays)}}</view>
              </view>
            </view>
          </block>
        </block>

        <view class="wxParse">
          <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
        </view>

      </view>
    </view>

    <view class="goods-comment" hidden="{{activeCategoryId==2?false:true}}">
      <view class="topframe">
        <view class="topframe-top">
          <view class="topframe-top-content">
            <view>宝贝评价</view>
            <view class="topframe-top-val">({{categories3[0].num}})</view>
          </view>
          <view class="topframe-praise" wx:if="{{categories3[0].num}}">
            好评{{ filters.toFix(categories3[2].num/categories3[0].num*100,2) }}%
          </view>
          <view wx:else>好评 0%</view>
        </view>
        <view class="buttem-list">
          <view bindtap="tabClick3" id="{{item.id}}" wx:for="{{categories3}}" wx:key="categories3" class="item {{activeCategoryId3==item.id?'red':''}}">
            {{item.name}}({{item.num}})
          </view>
        </view>
      </view>
      <block wx:for="{{comments}}" wx:for-index="cIdx" wx:key="{{cIdx}}">
        <view style='border-bottom:4rpx solid #eee;'>
          <view class="middle">
            <view class="middle-img-frame">
              <image class="middle-img" src="{{item.is_anonymous!=1?item.head_pic:iurl+'/miniapp/images/hui_hear_pic.png'}}" binderror="bind_bnerr2" data-errorimg="comments[{{cIdx}}].head_pic"></image>
              <view class="middle-user-frame">
                <view class="middle-user">
                  {{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}}
                </view>
                <image class="star" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>
              </view>
            </view>
            <view class="xc-pirces">
              <view class="middle-font {{item.seeMore==true?'ellipsis-3':''}}" style="word-break: break-all;">
                {{item.content?item.content:'此用户没有填写评价。'}}
              </view>
            </view>
            <view wx:if='{{item.seeMore}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleHandler'>
              全部显示
            </view>
            <view wx:if='{{!item.seeMore && item.auto}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleContent'>
              收起
            </view>
            <view class="img-ul">
              <block wx:if="{{item.source_type==0}}">
                <view class="img-li" wx:for="{{item.img}}" wx:key="{{index}}">
                  <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}" data-img="{{iurl}}{{item}}" data-id="{{index}}" src="{{iurl}}{{item}}"></image>
                </view>
              </block>
              <block wx:if="{{item.source_type==1}}">
                <view class="img-li" wx:for="{{item.weapp_img}}" wx:if="{{aitem.length>10}}" wx:key="{{index}}" wx:for-item="aitem">
                  <image bindtap="previewCommentImgs_w" class="wh100" data-cidx="{{cIdx}}" data-img="{{aitem}}" data-id="{{index}}" src="{{aitem}}"></image>
                </view>
              </block>
            </view>
            <view class="z_parameter">
              <view class="parameter-font">{{item.add_time}}</view>
              <view class="parameter-dian" bindtap="click_zan" data-com_id="{{item.comment_id}}" data-item_id="{{cIdx}}">
                <image wx:if="{{item.userZanNum==1}}" class="parameter-img" src="{{iurl}}/miniapp/images/zan_red.png"></image>
                <image wx:else class="parameter-img" src="{{iurl}}/miniapp/images/dianzan.png"></image>
                <view class="parameter-val" style='color:{{item.userZanNum==1? "#d60022":"#999" }}'>
                  {{item.zan_num}}
                </view>
              </view>
            </view>
          </view>
          <view class="reply rel" wx:if="{{item.replay_list}}">
            <view class="line_bulge"></view>
            <view class="shop-reply">店家回复:</view>
            <view class="shop-font" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="{{index}}">
              {{r_item.content}}
            </view>
          </view>
        </view>
      </block>
      <block wx:if="{{(!comments || comments.length==0) && get_c }}">
        <text class="no_pj_list">暂无评价</text>
      </block>
      <block wx:if="{{comments.length>10 && comments_no_more}}">
        <text class="no_pj_list">已经加载到底部</text>
      </block>
    </view>

  </view>
</view>
<!-- -滚动到顶部-- -->
<view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}">
  <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image>
</view>
<!-- -----------------底部按钮------------------ -->
<view class="join-cart">
  <!-- bindtap="contactService" -->
  <!-- <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split" bindtap="click_contact" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
    <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
    <view>客服</view>
  </button>

  <view wx:elif="{{sys_switch.weapp_customertype==2}}" class="custom-service cart-ico new_split" bindtap="con_weixin">
    <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
    <view>客服</view>
  </view>

  <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">
    <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
    <view>客服</view>
  </view> -->
	
	<view class="custom-service cart-ico new_split" bindtap="openCS">
	  <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
	  <view>客服</view>
	</view>
	
  <view bindtap="collectGoods" class="custom-service cart-ico new_split">
    <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image>
    <image hidden="{{!is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart-h.png"></image>
    <view>收藏</view>
  </view>
  <view class="shopping-cart cart-ico new_split">
    <navigator open-type="switchTab" url="/pages/cart/cart/cart">
      <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>
      <!-- <view class="cart-num ellipsis-1">{{cartGoodsNum}}</view> -->
      <view>购物车</view>
    </navigator>
  </view>

  <view wx:if="{{type == 0}}" class="buy-btn cart-btn cart-btn-lg lanse set_width" style="border-radius: 56rpx;">即将开始</view>
  <view wx:else class="fs24 f1 flex ai-center bg-FF4732 t-c white" style="border-radius:10rpx;justify-content: center">
    <view style="padding: 0 6rpx">
      <view class="">{{filters.format_time(presellForm.end_time,2)}} 预售结束</view>
      <!-- <view class="">08.30 23:59:59 开始发货</view> -->
      <view class="" wx:if="{{presellForm.delivery_type==1}}">{{filters.format_time(presellForm.delivery_date,2)}} 开始发货</view>
      <view class="" wx:else>付款{{presellForm.delivery_daynum}} 天内发货</view>
    </view>

    <view class="line" bindtap="openSpecModel" data-ind="2" style="margin-left: 10rpx; padding-left: 10rpx">
      <block wx:if="{{presellForm.presell_type==0}}">
        <view class="">支付定金</view>
      <view class="flex">
        定金
        <text class="rmb">{{presellList.presell_money}}</text>
      </view>
      </block>
      <block wx:else>
        <view class="">支付金额</view>
      <view class="flex">
        <text class="rmb" style="margin-left:10rpx;">{{presellList.presell_price}}</text>
      </view>
      </block>
    </view>
  </view>
</view>
<!-- 制作一个圆球导航 -->
<nav_box></nav_box>
</block>



<!-- --弹起来,选择规格数量,普通商品购买和秒杀---- -->
<view hidden="{{!openSpecModal}}">
  <view bindtap="closeSpecModal" class="cover-layer"></view>
  <view class="spec-model">
    <view class="pding">
      <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon>
      <view class="spec-goods">
        <image class="wh100 spec-img xc-distance-bottom" bindtap="previewImage" src="{{iurl+sele_g.image_url}}" binderror="pop_err_img" data-errorimg="sele_g.image_url"></image>
        <view class="spec-goods-info">
          <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view>
          <view class="flex ai_end xc-val-money">
            
            <view class="spec-goods-price tag">
              <text class="fs20">￥</text>{{pre_arr.presell_money}}
            </view>
            <!-- 显示线下价格 -->
            <view wx:if="{{sele_g.offline_price}}" class="quan_price flex ai-center jc-center">
              券后￥<text class="fs32">{{sele_g.offline_price}}</text>
            </view>
          </view>

            <view class="flex">
              <view class="spec-goods-stock">
                已售：{{pre_arr.buy_goodnum+pre_arr.virtual_qty}}
              </view>
              <view class="spec-goods-stock">可售：{{pre_arr.presell_sumqty-pre_arr.buy_goodnum}}</view>
            </view>


        </view>
        <!-- 选择门店模块 -->
        <view class="flex-space-between address ai_end xc-width ">
          <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
            <text class="fs30 xc-black3 shop_name bold">{{def_pick_store.pickup_name}}</text>
            <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}">
              距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
            </view>
          </view>
          <!-- 没有门店的时候 -->
          <view class="flex" bindtap="choice_store" wx:else>
            <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
            <view class="fs30" style="color:black;">选择门店</view>
          </view>
          <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red-co fs28" bindtap="choice_store">更多门店<text class="right-arrow"></text></view>
        </view>
        <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
        <block wx:else>
          <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
          <block wx:else>
            <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
            <view class="no_store" wx:elif="{{def_pick_store.is_no_dis_act}}">(该店不可售)</view>
            <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}">
              (库存不足)
            </view>
          </block>
        </block>
        <view class="fs24 xc-ash-9f xc-distance-top " wx:if="{{def_pick_store && def_pick_store.fulladdress}}">
          地址:{{def_pick_store.fulladdress}}
        </view>
      </view>
      <!-- 商品的属性项目 -->
      <view class="xc-goods-attribute">
        <view hidden="{{ismend==1}}" class="spec-name">商品规格</view>
        <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
          <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">
            {{item.gg}}
          </view>
        </view>
      </view>
      <view class="b_num">
        <view>购买数量</view>
        <view class="count">
          <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">
            -
          </view>
          <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>
          <view bindtap="addCartNum" class="add">+</view>
        </view>
      </view>
      <!-- 提示再买多少优惠 -->
      <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition && openSpecModal_ind==2}}">
        再买{{hui_condition.need}}
        <text wx:if="{{hui_condition.money}}">，免{{hui_condition.money}}元</text>
        <text wx:if="{{hui_condition.sale}}">，打{{hui_condition.sale}}折</text>
        <text wx:if="{{hui_condition.past==1}}">，包邮</text>
        <text wx:if="{{hui_condition.intValue>0}}">，送{{hui_condition.intValue}}积分</text>
        <text wx:if="{{hui_condition.couponId>0}}">，送优惠券</text>
        <text wx:if="{{hui_condition.gift_id>0}}">，送赠品</text>
        <text wx:if="{{hui_condition.lb_id>0}}">，送礼包</text>
      </view>
    </view>
    <view class="spec-cart-btns">
      <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add"  style="background-color: #dcdcdc;color: #999;">
           门店的不匹配
      </view>
      <view wx:elif="{{def_pick_store && def_pick_store.is_no_dis_act}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">
        该门店不可售
      </view>

      <block wx:else>
        <!-- 根本就找不到门店 -->
        <block wx:if="{{!only_pk && !def_pickpu_list}}">
          <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">未找到门店</view>
        </block>
        <block wx:else>
          <block wx:if="{{only_pk.length && !only_pk.length}}">
            <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">未找到门店</view>
          </block>
          <block wx:else>
            <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
              <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">未找到门店</view>
            </block>
            <block wx:else>
              <block wx:if="{{!def_pick_store}}">
                <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
                  请先选择门店
                </view>
              </block>
              <block wx:else>

                  <!-- 线上销售 -->
                  <block wx:if="{{sele_g.store_count<=0 || pre_arr.presell_sumqty<=pre_arr.buy_goodnum }}">
                    <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
                  </block>
                  <block wx:else>
                    <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"
                          data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" data-action="buy">
                          <text wx:if="{{presellForm.presell_type==0}}">支付定金（￥{{pre_arr.presell_money}}）</text>
                          <text wx:else>支付金额（￥{{pre_arr.presell_price}}）</text>
                    </view>
                  </block>

              </block>
            </block>
          </block>
        </block>
      </block>
    </view>


    <view class="clear"></view>
    <!-- 选择门店的列表 -->
    <view hidden="{{ismend==0}}" class="sto_v">
      <view class="title" hidden="{{is_sec_mend==1}}" bindtap="hidemend">
        <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>
        选择门店
      </view>
      <!-- ---第一级显示---- -->
      <view class="itemlists" hidden="{{is_sec_mend==1}}">
        <block wx:if="{{is_show_sto_cat}}">
          <view wx:for="{{all_sto}}" wx:key="all_sto" class="item" bindtap="show_sec" data-index="{{index}}">
            {{item.name}}
          </view>
        </block>
        <block wx:else>
          <view wx:for="{{only_pk}}" wx:key="only_pk" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">
            {{item.pickup_name}}
          </view>
        </block>
      </view>
      <!-- ---第二级显示---- -->
      <view class="stitle" hidden="{{is_sec_mend==0}}" bindtap="hide_sec_mend">
        <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>
        {{sec_sto.name}}
      </view>
      <view class="itemlists" hidden="{{is_sec_mend==0}}">
        <view wx:for="{{sec_sto.s_arr}}" wx:key="index" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">
          {{item.pickup_name}}
        </view>
      </view>
    </view>
  </view>
</view>

<!-- --弹起来优惠信息---- -->
<view hidden="{{!openPromModal}}">
  <view bindtap="closePromModal" class="cover-layer"></view>
  <view class="prom-model">
    <icon bindtap="closePromModal" class="modal-close" color="gray" size="22" type="cancel"></icon>
    <view class="prom-title">优惠信息</view>
    <view class="logistics-item" wx:for="{{select.activity.data}}" wx:key="index">
      <view class="item-title">
        <text class="prom-item">{{item.title}}</text>
      </view>
      <view class="item-mes ellipsis-1">{{item.content}}</view>
    </view>
  </view>
</view>

<!-- --弹起领券-- -->
<view wx:if='{{coupon==1}}'>
  <view class="cover-layer flex-center" data-coupon='0' bindtap="switchCoupon"></view>
  <view class="cx-popup {{coupon== true ? 'up' : 'down'}} ">
    <view class="top-frame">
      <!-- <view class="top two-level-word t-c"> -->
      <view class="top t-c">优惠券领取</view>
    </view>
    <!-- <view class="top-frame">
      <view class="xc-valid-coupon four-level-word">可以领优惠券</view>
    </view> -->
    <view class="xc-frame">
      <view class="top-frame">
        <view class="xc-coupon-frame ">
          <!-- -单张的券- -->
          <view class="rel" wx:for="{{quan_list}}" wx:key="index">
            <view class="coupon flex">
              <view class="circle xc-circular-one"></view>
              <view class="xc-coupon-left ">
                <view class="flex ai_c xc-money-frame">
                  <text class="xc-money two-level-word  xc-rmb">￥</text>
                  <text class="one-level-word xc-money">{{item.money}}</text>
                </view>
                <view class="xc-money four-level-word  xc-spacing">满{{item.condition}}元可用</view>
              </view>
              <view class="xc-coupon-right flex">
                <view class="xc-detail-coupon">
                  <view class="four-level-word">订单金额满{{item.condition}}元可用</view>
                  <view class="four-level-word xc-below">
                    {{filters.replace_time2(item.start)}} 至 {{filters.replace_time2(item.end)}}
                  </view>
                </view>
                <view class="flex-vertical">
                  <view class="three-level-word xc-get background  {{item.everyone_num>0 && item.lqnum>=item.everyone_num?'nouse':''}}" data-ind="{{index}}" data-cid="{{item.id}}" bindtap="get_quan">
                    {{ item.linging==1?'领取中':'领取'}}
                  </view>
                </view>
              </view>
              <view class="circle xc-circular-two"></view>
            </view>
          </view>
        </view>
      </view>
    </view>
    <view class="cx-confirm pd20" data-coupon='0' bindtap="switchCoupon">
      <view class="confirm t-c">关闭</view>
    </view>
  </view>
</view>

<!-- 选择门店的弹框，1.1版最新的 -->
<block wx:if="{{store==1}}">
  <view class="mongolia-layer" bindtap="close_popup"></view>
  <view class="popup-frame">
    <block wx:if="{{sort_store==0}}">
      <!-- 头部 标题 -->
      <view class="popup-top flex-space-between">
        <text class="fs32 nearby_store">{{choice_sort_store==0?'附近的门店':region_name}}</text>
        <view>
          <view>
            <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon>
          </view>
          <view class="felx choose_more" bindtap="more_store" wx:if="{{is_show_sto_cat>0}}" >
            <text class="fs26 red-co" >{{choice_sort_store==0?'更多门店':'返回'}}</text>
            <view class="bg_rights"></view>
          </view>
        </view>
      </view>
      <view class="searchbar flex-vertical-between storeListpadd">
        <input class="inputstore fs28" placeholder="输入要搜索的门店" value="{{keyword}}" placeholder-class="fs28" maxlength="16" bindinput="input_store" bindconfirm="searchfn" />
        <view class="search flex-center" bindtap="searchfn">
          <view class="fs28">搜索</view>
        </view>
      </view>
      <!-- 门店列表，最外层的门店列表，一开始 -->
      <view class="store-list">
        <!-- 如果还没有点击更多门店的时候 -->
        <block wx:if="{{choice_sort_store==0}}">
          <!-- 需要for循环 -->
          <block wx:if="{{is_show_sto_cat==1}}">
            <view class="store_choose flex" wx:for="{{def_pickpu_list}}" wx:key="dpl" bindtap="choose_for_store_fir" data-ind="{{index}}">
              <view class="store flex-vertical">
                <!-- 需要点击事件 -->
                <block wx:if="{{index==fir_pick_index}}">
                  <view class="circle white xc-hook fs20 red-b">Г</view>
                </block>
                <block wx:else>
                  <view class="circle  xc-hooks"></view>
                </block>
                <view class="address-frame xc-ash">
                  <view class="flex-vertical-between butttem5">
                    <view class="flex xc-ash">
                      <view class="fs30 xc-black3 address_name">{{item.pickup_name}}
                         <text class="c-red22" wx:if="{{item.is_no_dis}}">(配送不匹配)</text>
                         <text class="c-red22" wx:elif="{{item.is_no_dis_act}}">(该店不可售)</text>
                      </view>
                    </view>
                    <view>
                      <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}">
                        距离：{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}}
                      </view>
                    </view>
                  </view>
                  <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
                </view>
              </view>
            </view>
          </block>
          <block wx:else>
            <view class="store_choose flex" wx:for="{{only_pk}}" wx:key="olpk" bindtap="choose_for_store_fir" data-ind="{{index}}">
              <view class="store flex-vertical">
                <!-- 需要点击事件 -->
                <block wx:if="{{index==fir_pick_index}}">
                  <view class="circle white xc-hook fs20 red-b">Г</view>
                </block>
                <block wx:else>
                  <view class="circle  xc-hooks"></view>
                </block>
                <view class="address-frame xc-ash">
                  <view class="flex-vertical-between ">
                    <view class="flex xc-ash">
                      <view class="fs30 xc-black3 address_name">{{item.pickup_name}}
                        <text class="c-red22" wx:if="{{item.is_no_dis}}">(配送不匹配)</text>
                        <text class="c-red22" wx:elif="{{item.is_no_dis_act}}">(该店不可售)</text>
                      </view>
                    </view>
                    <view>
                      <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}">
                        距离：{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}
                      </view>
                    </view>
                  </view>
                  <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
                </view>
              </view>
            </view>
          </block>
        </block>
        <block wx:else>
          <!-- 如果是点击选择门店分类后显示分类下的门店 -->
          <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" wx:key="sec_arr" data-ind="{{index}}" bindtap="choose_for_store">
            <view class="store flex-vertical">
              <!-- 需要点击事件 -->
              <block wx:if="{{index==sec_pick_index}}">
                <view class="circle white xc-hook fs20 red-b">Г</view>
              </block>
              <block wx:else>
                <view class="circle  xc-hooks"></view>
              </block>
              <view class="address-frame xc-ash">
                <view class="flex-vertical-between ">
                  <view class="flex xc-ash">
                    <view class="fs28 xc-black3 address_name">{{item.pickup_name}}
                      <text class="c-red22" wx:if="{{item.is_no_dis}}">(配送不匹配)</text>
                      <text class="c-red22" wx:elif="{{item.is_no_dis_act}}">(该店不可售)</text>
                    </view>
                  </view>
                  <view>
                    <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}">
                      距离：{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}
                    </view>
                  </view>
                </view>
                <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
              </view>
            </view>
          </view>
        </block>
      </view>
      <!-- 门店列表底部 -->
      <view class="store-bottom-frame">
        <view class="store-bottom flex-vertical-between">
          <view class="determine red-b fs28 white t-c" bindtap="sure_pick" data-openindstore="{{open_ind_store}}">
            确定
          </view>
          <view class="default  t-c fs28" bindtap="set_def_pick" data-openindstore="{{open_ind_store}}">
            设为默认
          </view>
        </view>
      </view>
    </block>
    <block wx:else>
      <view class="popup-top flex-space-between">
        <text class="fs32 nearby_store">门店分类选择</text>
        <view>
          <view>
            <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon>
          </view>
          <view class="felx choose_mores" bindtap="returns">
            <text class="fs26 red-co">返回</text>
          </view>
        </view>
      </view>
      <view class="sort_store_list">
        <view class="sort-store-frame" wx:for="{{all_sto}}" wx:key="all_sto" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}">
          <view class="sort-store flex-vertical-between">
            <view class="fs30" di>{{item.name}}</view>
            <view class="black_rights-frame">
              <view class="black_rights"></view>
            </view>
          </view>
        </view>
      </view>
    </block>
  </view>
</block>
<!-- ---------------分享弹窗--------------- -->
<!-- 二维码显示页面 -->
<canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas>
<warn id="warn"></warn>
<!-- 分享控件，底部弹出 -->
<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageFn" wx:if="{{share_hidden}}"></share>

<view wx:if="{{showPoster}}">
  <view class="mask" catchtap="closePoster"></view>
  <view class="poster-container">
    <view class="poster-wrapper">
      <view class="poster" bindtap="previewPoster">
        <!-- <view class="poster" bindtap="previewImage"> -->
        <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image>
        <view class="btn-close" catchtap="closePoster">
          <text class="iconfont icon-close"></text>
        </view>
      </view>
      <view class="btn-container">
        <!-- <button class="btn-share" open-type="share" bindtap="">微信好友分享</button> --> 
        <button class="btn-share" bindtap="savePic">保存到相册</button>
      </view>
    </view>
  </view>
</view>

<include src="../../../../components/com_servicer/com_servicer.wxml"/>


