<wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
<com_top_nav title="礼包详情"></com_top_nav>

<view class="box data-v-3a5b7e36" style="background-color:{{default_color?default_color:'#e85f93'}}">
  <view class="box_top data-v-3a5b7e36">
    <image mode="widthFix" src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr" data-errorimg="giftImage"></image>
  </view>
  <view class="box_title data-v-3a5b7e36" >

    <view class="flex ai_c fs28" style="margin-bottom: 20rpx"  wx:if="{{isBuy==0 && pick_up}}">
      <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>{{pick_up.pickup_name}}
    </view>

    <view class="top_title data-v-3a5b7e36">
      <text class="data-v-3a5b7e36 ellipsis-2" style="width:90%;">{{giftTitle}}</text>

        <!-- 这个是分享按钮 --> 
        <view wx:if="{{c_state<2 && isLogin && !is_share}}" class="xc-share-frame t-c" bindtap="clickShare">
            <view class="iconfont icon-share fs40" ></view>
            <view class="fs22 c-7b">分享</view>
        </view>


    </view>
		<view class="top_time data-v-3a5b7e36" wx:if="{{!flag}}">
		  <block wx:if="{{isBuy==1 && giftTitle && isStart!=1}}" >
		     <text class="data-v-3a5b7e36">
		        {{"活动开始时间："+giftStart}}
		     </text>
		  </block>

		  <block wx:else>
		    <text class="data-v-3a5b7e36" wx:if="{{isBuy==0 && iswarelbtype}}">{{"兑换结束时间："+giftDate}}</text>
		    <text class="data-v-3a5b7e36" wx:if="{{flag == 1}}">
		        {{"活动结束时间："+giftDate}}
		    </text>
		  </block>
		</view>
    <view class="top_time data-v-3a5b7e36" wx:if="{{flag == 1 && iswarelbtype}}">
			<text class="data-v-3a5b7e36" wx:if="{{exchangeType == 1}}">
			   {{"兑换时间：领取后"+exchangeDay+"天内兑换"}}
			</text>
			<text class="data-v-3a5b7e36" wx:elif="{{exchangeType == 2}}">
			   {{"兑换时间："+exchangeStartTime+"至"+exchangeEndTime}}
			</text>
    </view>
		
    <view class="top_price data-v-3a5b7e36">


      <block wx:if="{{giftPrice>0}}">
        <text class="data-v-3a5b7e36">{{"￥"+giftPrice}}</text>
      </block>
      <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
        <text class="data-v-3a5b7e36">/</text>
      </block>
      <block wx:if="{{giftIntegral>0}}">
        <text class="data-v-3a5b7e36">{{giftIntegral+"积分"}}</text>
      </block>
      <block wx:if="{{giftType>0}}">
        <text class="data-v-3a5b7e36">{{actTitle}}</text>
      </block>

    </view>
    <view class="top_foot data-v-3a5b7e36">
      <view class="top_foot_price data-v-3a5b7e36 no_line_x">
        <text class="data-v-3a5b7e36"> {{is_retail_price?'零售价：':''}}{{giftPosPrice+"元"}}</text>
      </view>
      <view class="top_foot_qty data-v-3a5b7e36">
        <text class="data-v-3a5b7e36" wx:if="{{!flag}}">{{"已售:"+giftQty+"件"}}</text>
				<text class="data-v-3a5b7e36" wx:elif="{{flag == 1 && giftQty > 0}}">{{"数量:"+giftQty+"件"}}</text>
      </view>
    </view>
  </view>
  <view class="box_ware data-v-3a5b7e36">
    <view class="box_ware_title data-v-3a5b7e36">
      <text class="data-v-3a5b7e36">礼包内容</text>
    </view>
    <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="Id">
      <view wx:if="{{item.couponName!=undefined}}" class="box_ware_box data-v-3a5b7e36">
        <view class="box_ware_img data-v-3a5b7e36">
          <block wx:if="{{item.lbType==1}}">
            <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
          </block>
          <block wx:if="{{item.lbType==2}}">
            <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
          </block>
          <block wx:if="{{item.lbType==3}}">
            <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
          </block>
          <block wx:if="{{item.lbType==4}}">
            <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
          </block>
          <block wx:if="{{item.lbType==5}}">
            <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
          </block>
        </view>
        <view class="box_ware_item data-v-3a5b7e36">
          <view class="box_ware_item_title data-v-3a5b7e36">
            <text class="data-v-3a5b7e36">{{item.couponName}}</text>
          </view>
          <view class="box_ware_item_price data-v-3a5b7e36">
            <text class="data-v-3a5b7e36"></text>
          </view>
          <view class="box_ware_item_qty data-v-3a5b7e36 flex">
            <text class="data-v-3a5b7e36 ellipsis-1">
			        {{"数量:"+item.num}}
			      </text>
            <block wx:if="{{isBuy==0 && !flag && item.lbType==1}}">
                <text style="margin-left:10rpx" wx:if="{{item.useState}}">
                已核销
              </text>
              <text style="margin-left:10rpx" wx:else>
                未核销
              </text>
            </block>
          </view>

          <view class="box_ware_code data-v-3a5b7e36" wx:if="{{!flag}}">
            <!-- <block wx:if="{{c_state==0}}"> -->

              <block wx:if="{{isBuy==0&item.lbType==1}}">
                <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" data-codeId="{{item.Id}}" class="data-v-3a5b7e36"></image>
              </block>

            <block wx:if="{{isBuy==0&item.lbType==2}}">
              <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/packageD/pages/user/coupons/coupons" bindtap="goto"></image>
            </block>
            <block wx:if="{{isBuy==0&item.lbType==3}}">
              <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/my_service/i_service" bindtap="goto"></image>
            </block>
            <block wx:if="{{isBuy==0&item.lbType>3}}">
              <text class="data-v-3a5b7e36">奖励已发放</text>
            </block>
          </view>
        </view>
      </view>
    </block>
  </view>
  <view class="foot_box data-v-3a5b7e36">
    <view class="foot_box_title data-v-3a5b7e36">
      <text class="data-v-3a5b7e36">活动说明</text>
    </view>
    <view class="foot_box_remark data-v-3a5b7e36">
      <rich-text nodes="{{giftRemark}}" style="word-break:break-all;word-wrap:break-word"></rich-text>
    </view>
  </view>
	
	
		<view class="foot_empty data-v-3a5b7e36"></view>
		
	<block wx:if="{{flag != 1}}">
		<block wx:if="{{isBuy==1 && giftTitle}}">
		  <block wx:if="{{isStart==1}}">
		    <view class="foot_button data-v-3a5b7e36">
		      <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
		        <view class="foot_button_left data-v-3a5b7e36 " data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice">
		          <text class="data-v-3a5b7e36  ">立即购买</text>
		        </view>
		        <view class="foot_button_right data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}">
		          <text class="data-v-3a5b7e36">立即兑换</text>
		        </view>
		      </block>
		      <block wx:if="{{giftPrice>0 && giftIntegral<=0}}">
		        <view class="foot_button_buy data-v-3a5b7e36 " data-money="{{giftPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}">
		          <text class="data-v-3a5b7e36">立即购买</text>
		        </view>
		      </block>
		      <block wx:if="{{giftPrice<=0 && giftIntegral>0}}">
		         <view class="foot_button_intalge data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}">
		            <text class="data-v-3a5b7e36">立即兑换</text>
		         </view>
		      </block>
		
		      <block wx:if="{{giftPrice<=0 && giftIntegral<=0}}">
		        <view class="foot_button_intalge data-v-3a5b7e36 " bindtap="GetFree" data-id="{{lbId}}">
		          <text class="data-v-3a5b7e36">免费领取</text>
		        </view>
		      </block>
		
		
		    </view>
		  </block>
		  <block wx:else>
		    <view class="foot_button data-v-3a5b7e36">
		    <view class="foot_button_intalge data-v-3a5b7e36 gray ">
		        <text class="data-v-3a5b7e36">活动还未开始</text>
		    </view>
		    </view>
		  </block>
		
		</block>
		<block wx:if="{{isBuy==0}}">
		  <view class="foot_button data-v-3a5b7e36">
		    <block wx:if="{{is_lb!=1}}">
		      <view class="foot_button_buy data-v-3a5b7e36 overdue">
		        <text class="data-v-3a5b7e36">无核销商品</text>
		      </view>
		    </block>
		    <block wx:else>
          <view wx:if="{{c_state==-1}}" class="foot_button_buy data-v-3a5b7e36 overdue" >
		        <text class="data-v-3a5b7e36">兑换未开始</text>
		      </view>
		      <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode">
		        <text class="data-v-3a5b7e36">立即使用</text>
		      </view>
		      <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue" bindtap="getcode">
		        <text class="data-v-3a5b7e36">商品已核销</text>
		      </view>
		      <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue">
		        <text class="data-v-3a5b7e36">商品兑换时间已过</text>
		      </view>
		    </block>
		  </view>
		</block>
	</block>
  
</view>
<!-- 引入提示组件 -->
<warn id="warn"></warn>
<my_confirm id="my_confirm"></my_confirm>
<!-- 弹出框扫描 -->
<qr_code id="qc_com"></qr_code>
<!--  制作一个圆球导航  -->
<nav_b id="nav_b"></nav_b>

<include src="../../../../pages/giftpack/public/buy_com.wxml"></include>
<canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if="{{!canvasHidden}}"></canvas>
<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" 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"></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>