<!--nova-tourism/pages/collect/collect-detail/index.wxml-->
<nav type="back" background-color="#ffffff" frontColor="#000000" title="商品详细" />
<view class="bax" style="height: {{contentHeight}}rpx;">
  <view class="all" style="height: {{contentHeight}}rpx;">
    <!-- 轮播图 -->
    <view class="picturebox">
      <swiper autoplay="{{true}}" indicator-dots='{{true}}' indicator-color='#D9D9D9' indicator-active-color='#F8DA7F' interval="{{3000}}" circular duration="{{500}}" class="img">
        <block wx:for="{{good.images}}" wx:for-index="img_index" wx:key="index" wx:for-item="img">
          <swiper-item class="img">
            <image data-list="{{good.images}}" data-index="{{img_index}}" bind:tap="preview" src="{{img}}" mode="aspectFill"></image>
          </swiper-item>
        </block>
      </swiper>
    </view>
    <view class="box">
      <view class="infobox">
        <view class="title">{{good.name}}</view>
        <view class="lebalbox">
          <block wx:for="{{good.tag}}" wx:key="index">
            <view class="lebal">{{item}}</view>
          </block>
        </view>
        <view class="carbox">
          <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241230/62pr1k034930486.png"></image>
          <view class="car-tex">48小时内发货</view>
        </view>
        <block wx:if="{{!spec}}">
          <view class="carbox2" bind:tap="openSpec">
            <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241230/1st61g035044073.png"></image>
            <view class="car-tex">暂无其他规格</view>
            <van-icon name="arrow" size='15' color='#727783' style="margin-left: auto;" />
          </view>
        </block>
        <view wx:else class="carbox2" bind:tap="openSpec">
          <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241230/1st61g035044073.png"></image>
          <view class="car-tex">{{checkSpec.title}}</view>
          <van-icon name="arrow" size='15' color='#727783' style="margin-left: auto;" />
        </view>
        <view class="carbox3">
          <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241230/2bp2t7035055633.png"></image>
          <view class="carbox3-tex">
            <view class="carbox3-tex1">{{good.colors[0]}}</view>
            <block wx:for="{{good.colors}}" wx:key="index">
              <block wx:if="{{index>0}}">
                <view class="carbox3-tex2">{{item}}</view>
              </block>
            </block>
            <block wx:if="{{!good.colors.length}}">
              <view class="car-tex">暂无商品简介</view>
            </block>
          </view>
        </view>
        <view class="carbox4" data-url="/common-page/pages/address/index?type=1&activeColor=#3498ff" bind:tap="tourl">
          <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241230/j2sn43035105148.png"></image>
          <view class="car-tex">{{(address.full_region+address.address)||'确认收货地址'}}</view>
          <van-icon name="arrow" size='15' color='#727783' style="margin-left: auto;" />
        </view>
      </view>
      <view class="tipbox">
        <view class="dinggou">
          <view class="dinggou-title">订购须知</view>
          <block wx:for="{{good.order_notice}}" wx:key="index">
            <view class="dinggou-tex">{{index+1}}.{{item}}</view>
          </block>
        </view>
        <block wx:if="{{good.order_images.length}}">
          <view class="picbox">
            <block wx:for="{{good.order_images}}" wx:key="index">
              <image src="{{item}}" mode="widthFix"></image>
            </block>
          </view>
        </block>
        <block wx:if="{{good.order_images.length<=0&&good.order_notice<=0}}">
          <view class="dinggou">
            <view class="dinggou-tex">暂无</view>
          </view>
        </block>
        <view class="dinggou">
          <view class="dinggou-title">售后须知</view>
          <block wx:for="{{good.aftersales_notice}}" wx:key="index">
            <view class="dinggou-tex">{{index+1}}.{{item}}</view>
          </block>
          <block wx:if="{{good.aftersales_notice.length<=0}}">
            <view class="dinggou-tex">暂无</view>
          </block>
        </view>
      </view>
      <view class="tipbox2">
        <view class="dinggou">
          <view class="dinggou-title">关于云上望仙</view>
          <block wx:for="{{good.about}}" wx:key="index">
            <view class="dinggou-tex">{{index+1}}.{{item}}</view>
          </block>
        </view>
        <view class="qrBox">
          <view class="logo">
            <image src="{{good.code}}" mode="widthFix" />
          </view>
          <view class="qr">
            <block wx:for="{{good.about_qr}}" wx:key="index">
              <image src="{{item}}" mode="widthFix" />
            </block>
          </view>
        </view>
        <!-- <image src="https://img95.699pic.com/photo/60072/5330.jpg_wh860.jpg" mode="aspectFill"></image>
        <view>log</view>
        <view class="tip2-tex">公众号 抖音号 小红书</view> -->
      </view>
    </view>
  </view>

  <!-- 按钮 -->
  <view class="paybox">
    <view class="pay1">
      <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241230/rpl9a1024145457.png"></image>
      <view class="pay1-tex">首页</view>
    </view>
    <view class="pay2" bind:tap="openSpec">
      <view class="pay2-tex">优惠0</view>
      <view class="pay2-tex2">实付款￥{{totalPrice}}</view>
    </view>
  </view>

</view>
<!-- 选择商品规格 -->
<!-- <van-action-sheet show="{{ specBox }}" actions="{{spec}}" bind:close="closeSpec" description="选择商品规格" bind:select="getCheckSpec"></van-action-sheet> -->
<van-popup show="{{ specBox }}" position="bottom" bind:close="closeSpec" round>
  <view class="specBox" style="height: 80vh;">
    <view class="{{distributeType}}">
      <view class="tab tab1">
        <image bind:tap="closeSpec" src="https://file-cloud.fmode.cn/EbxZUK5lBI/20250320/cm1krr094543335.png" mode="" />
        <view data-type="delivery" bind:tap="chickDistributeType">
          物流配送
        </view>
      </view>
      <view class="tab2 tab" data-type="verify" bind:tap="chickDistributeType">民宿自提</view>
    </view>
    <block wx:if="{{distributeType=='delivery'}}">
      <view class="address" data-url="/common-page/pages/address/index?type=1&activeColor=#3498ff" bind:tap="tourl">
        <view class="add">
          <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20250320/1kjb1k101141655.png" mode="" />
          <block wx:if="{{address.objectId}}">
            <view>{{address.name||'微信用户'}} , {{address.mobile||'未知手机号'}} , {{(address.full_region||'')+(address.address||'')}}</view>
          </block>
          <block wx:else>
            <view>暂未选择配送地址</view>
          </block>
        </view>
        <van-icon name="arrow" />
      </view>
    </block>
    <block wx:else>
      <view class="address">
        <view class="add">
          <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20250320/1kjb1k101141655.png" mode="" />
          <view>{{store.storeName}} - {{store.storeAddress}}</view>
        </view>
        <van-icon name="arrow" />
      </view>
    </block>
    <view class="good">
      <image src="{{good.image||'https://file-cloud.fmode.cn/EbxZUK5lBI/20250321/vdq1j1110711455.jpg'}}" mode="" />
      <view class="info">
        <view>
          <view class="price">
            <view class="after">
              <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20250320/fq10ev101141515.png" mode="" />
              <text class="int">券后￥{{totalPrice}}</text>
              <!-- <text class="point">0</text> -->
            </view>
            <text class="befor">券前 <text>￥{{totalPrice}}</text></text>
          </view>
          <view class="name">
            已选：{{checkSpec.title}}
          </view>
        </view>
        <view>
          <van-stepper bind:change="changeCount" button-size="59rpx" model:value="{{ count }}" min="1" max="99" integer />
        </view>
      </view>
    </view>
    <view class="li">
      <view class="tit">优惠</view>
      <view class="right">
        <text>店铺券</text>
        <text class="coupons">-0元</text>
        <van-icon name="arrow" />
      </view>
    </view>
    <view class="tagBox">
      <view class="tit">型号</view>
      <block wx:for="{{spec}}" wx:key="index">
        <text data-title="{{item}}" bind:tap="getCheckSpec" class="tag {{item==checkSpec.title?'tag_chick':'tag_normal'}}">{{item}}<text>￥{{good.specMap[item][0].price}}</text></text>
        <view class="occup"></view>
      </block>
    </view>
    <view class="more" bind:tap="openListBox">
      一次选多款
      <van-icon name="arrow" />
    </view>
    <button bind:tap="submitOrder" class="btn">支付￥{{totalPrice}}</button>
    <view style="height: 100rpx;"></view>
  </view>
</van-popup>
<!-- 一次选多款-款式列表 -->
<van-popup show="{{ listBox }}" position="bottom" bind:close="closeListBox" round>
  <view class="specBox listBox" style="height: 80vh;">
    <view class="more_title">
      <view class="tab">
        <image bind:tap="closeListBox" src="https://file-cloud.fmode.cn/EbxZUK5lBI/20250320/cm1krr094543335.png" mode="" />
        <view data-type="delivery" bind:tap="chickDistributeType">
          一次选多款
        </view>
      </view>
    </view>
    <view style="margin: 20rpx;font-size: 26rpx;font-weight: bold;">组合</view>
    <block wx:for="{{specGoodList}}" wx:key="index">
      <view class="good_item">
        <van-checkbox value="{{ item.checked }}" data-index="{{index}}" bind:change="changeChecked" icon-size="32rpx" checked-color="#F89B7F"></van-checkbox>
        <view class="item">
          <image src="{{good.image||'https://file-cloud.fmode.cn/EbxZUK5lBI/20250321/vdq1j1110711455.jpg'}}" mode="" />
          <view class="info">
            <view class="name">{{item.spec}}</view>
            <view class="under">
              <view class="price">￥<text>{{item.price}}</text></view>
              <van-stepper value="{{ item.count }}" data-index="{{index}}" bind:change="changeLMCount" />
            </view>
          </view>
        </view>
      </view>
    </block>
    <view class="add" type="default" plain="true" bind:tap="openMoreBox">+ 添加款式</view>
    
    <button bind:tap="submitOrder_more" class="btn">合计￥{{totalPrice_more}} · 去结算</button>
    <view style="height: 100rpx;"></view>
  </view>
</van-popup>
<!-- 一次选多款-款式 -->
<van-popup show="{{ moreBox }}" position="bottom" bind:close="closeMoreBox" round>
  <view class="specBox moreBox" style="height: 80vh;">
    <view class="more_title">
      <view class="tab">
        <image bind:tap="closeMoreBox" src="https://file-cloud.fmode.cn/EbxZUK5lBI/20250320/cm1krr094543335.png" mode="" />
        <view data-type="delivery" bind:tap="chickDistributeType">
          选择第{{(specGoodList.length||0)+1}}款
        </view>
      </view>
    </view>
    <view class="already">
      <view class="left">
        已选择{{specGoodList.length||0}}款：
        <image src="{{good.image}}" mode="" />
        <text><block wx:for="{{specGoodList}}" wx:key="index"> {{item.spec}}</block></text>
      </view>
      <view class="right" bind:tap="settlement">
        去结算
        <van-icon name="arrow" />
      </view>
    </view>
    <view class="good">
      <image src="{{good.image||'https://file-cloud.fmode.cn/EbxZUK5lBI/20250321/vdq1j1110711455.jpg'}}" mode="" />
      <view class="info">
        <view>
          <view class="price">
            <view class="after">
              <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20250320/fq10ev101141515.png" mode="" />
              <text class="int">￥{{checkSpec_more.totalPrice}}</text>
              <!-- <text class="point">0</text> -->
            </view>
          </view>
          <view class="name">
            已选：{{checkSpec.title}}
          </view>
        </view>
        <view>
          <van-stepper bind:change="changeCount_more" button-size="59rpx" model:value="{{ count_more }}" min="1" max="99" integer />
        </view>
      </view>
    </view>

    <view class="tagBox">
      <view class="tit">型号</view>
      <block wx:for="{{spec}}" wx:key="index">
        <text data-title="{{item}}" bind:tap="getCheckSpec_more" class="tag {{item==checkSpec_more.title?'tag_chick':'tag_normal'}}">{{item}}<text>￥{{good.specMap[item][0].price}}</text></text>
        <view class="occup"></view>
      </block>
    </view>
    <button bind:tap="confirmCurrent" class="btn">确定选择第{{(specGoodList.length||0)+1}}款</button>
    <view style="height: 100rpx;"></view>
  </view>
</van-popup>


<payment style="z-index: 99999;" show="{{showPay}}" tradeNo="{{tradeNo}}" price="{{totalPrice}}" bind:payResult='acceptResult' showType="all" />
<payment style="z-index: 99999;" show="{{showPay_more}}" tradeNo="{{tradeNo}}" price="{{totalPrice_more}}" bind:payResult='acceptResult' showType="all" />