<wxs src="../../wxs/util.wxs" module="filter" />
<share make="{{show}}" aid="{{info.aid}}" sid="{{info.sid}}" pid="{{info.pid}}" type="1" orderid="{{info.orderid}}" invitefbtn="{{invitefbtn}}" />
<nps show="{{npsStatus}}" options="{{npsOptons}}" bind:myevent="close" bind:selectImage="selectImage" />
<address show="{{showAddress}}" data="{{info.mailAddress}}" data-name="address" bind:submit="submitAddress" bind:close="closeAddress" />
<chat show="{{showChat}}" aid="{{info.aid}}" type="{{info.atype==1?0:1}}" wx:if="{{showChat}}" />
<view class="bottom">
  <!-- 底部左侧按钮组 -->
  <view class="bottom-left" id="bottom-left">
    <view wx:if="{{info.orderStatus==2&&info.atype=='0'}}" class="icon-tab" bindtap="showMore">
      <view class="more" id="more">
        <!-- 上拉框 -->
        <!-- class="{{((info.verifyStatus!==1&&!info.comment && info.comment == ''&&info.comment.modified !== 0)||(!info.comment && info.comment == ''&&info.comment.modified !== 0))?'select_box':'select_boxTwo select_boxThr'}}" -->
        <view class="selectBorder" wx:if="{{selectIsShow}}">
          <view wx:if="{{info.orderStatus==2&&info.timeEnd==1}}" class="select_one" bindtap="invoicing">申请开票</view>
          <view wx:if="{{info.orderStatus==2&&info.timeEnd==1}}" class="div"></view>
          <view class="{{info.orderStatus!==2||info.timeEnd!==1?'':''}}">
            <view bindtap="customer" class="{{info.orderStatus!==2||info.timeEnd!==1?'select_one':'select_one'}}">联系客服</view>
            <view wx:if="{{info.comment && info.comment != ''&&info.comment.modified == 0&&info.orderStatus==2&&info.atype=='0'}}" class="div"></view>
          </view>
          <view wx:if="{{info.comment && info.comment != ''&&info.comment.modified == 0&&info.orderStatus==2&&info.atype=='0'}}" class="select_one" bindtap="actEvaluate">修改评价</view>
        </view>
        <image wx:if="{{!moreIsShow}}" class="moreImg" src="https://images.weserv.nl/?url=https://lanhu.oss-cn-beijing.aliyuncs.com/psmnecm0kijnxbjk1yv6evs03wg5v99rv2v74eb5772-e009-470a-8425-afc238c29f2e" alt="" />
        <image wx:if="{{moreIsShow}}" class="moreImg" src="https://images.weserv.nl/?url=https://lanhu.oss-cn-beijing.aliyuncs.com/psbp87rbv294451h3g44ad85h7of0cclj7t92a07e7f-187f-42e3-aa52-65c2727cd635" alt="" />
        <view class="name">更多</view>
      </view>
    </view>
    <view class='icon-tab' bindtap="jumpPage">
      <text class="icon icon-home"></text>
      <view class="name">首页</view>
    </view>
    <view wx:if="{{info.orderStatus==2&&info.atype=='0'?false:true}}" class="icon-tab" bindtap="customer">
      <text class="icon icon-cus-service"></text>
      <view class="name">客服</view>
    </view>
    <view class="icon-tab" wx:if="{{info.atype!='1' && info.orderStatus==2 && info.detailStopUpdate!=1 && ( info.waitComment!=2 ||(info.comment.additional == 1 && info.comment.modified == 1))}}" bindtap="editOrderDetail">
      <text class="icon icon-bj"></text>
      <view class="name">修改信息</view>
    </view>
    <view class="icon-tab" wx:if="{{info.orderStatus == 1 && info.waitPayResult!=1}}" data-presellStatus="{{query.presellStatus}}" bindtap="cancelOrder">
      <text class="icon icon-cancel-order"></text>
      <view class="name">{{query.presellStatus ==2?'取消支付':'取消订单'}}</view>
    </view>
    <!-- <view class="icon-tab" wx:if="{{info.comment && info.comment != ''&&info.comment.modified == 0}}" data-index="1" bindtap="actEvaluate">
      <text class="icon icon-bj"></text>
      <view class="name">修改评价</view>
    </view> -->
    <view class="icon-tab" wx:if="{{info.orderStatus==2&&info.atype=='0'?false:true&&info.comment && info.comment != ''&&info.comment.modified == 0}}" data-index="1" bindtap="actEvaluate">
      <text class="icon icon-bj"></text>
      <view class="name">修改评价</view>
    </view>
  </view>
  <!--—— 底部右侧按钮 ——-->
  <view class="bottom-right">
    <!-- 填写退货单号 -->
    <button wx:if="{{info.atype==1&&info.orderStatus==3&&info.subOrders[0].status==6}}" class="button button-warn share-group" bindtap="showAddressPopup">填写退货单号</button>
    <!-- 完成支付 -->
    <button class="button button-warn share-group" wx:elif="{{info.orderStatus == 1&& info.waitPayResult != 1}}" bindtap="goPay">继续支付</button>
    <!-- 活动评价 -->
    <button class="button button-warn share-group" wx:elif="{{info.waitComment == 1&&info.orderStatus!=3&&info.orderStatus!=4&&(query.otype==0||query.otype==3)}}" bindtap="actEvaluate">{{info.atype==1?'商品':'活动'}}评价</button>
    <!-- 追加评价 -->
    <button class="button button-warn share-group" wx:elif="{{info.comment&&info.comment.additional == 0&&(query.otype==0||query.otype==3)}}" bindtap="editEvaluate">追加评价</button>
    <!-- 修改追评 -->
    <button class="button button-warn share-group" wx:elif="{{info.comment.additional == 1 && info.comment.additionalComment.modified == 0&&(query.otype==0||query.otype==3)}}" bindtap="editEvaluate">修改追评</button>
    <!-- 支付尾款 -->
    <button type="warn" wx:elif="{{info.atype == 0 && info.orderStatus ==4 && info.needPayBalance==1}}" class="button button-warn share-group" data-aid="{{info.aid}}" data-orderid="{{query.orderid}}" data-presellStatus="{{query.presellStatus}}" data-otype="{{query.otype}}" data-campSex="{{info.campSex}}" data-military="{{info.military}}" bindtap="jumpBalancePayment">支付尾款</button>
    <!-- 分享拼团 -->
    <button class="button button-warn share-group" wx:elif="{{info.orderStatus == 2 && info.groupinfo && info.groupinfo.groupbook == 1 && !info.groupinfo.groupid && query.otype != '3'}}" open-type="share">分享拼团</button>
    <!-- 邀请拼团 -->
    <button class="button button-warn share-group" wx:elif="{{info.groupinfo && info.groupinfo.discount&&info.groupinfo.groupbook==1&&info.groupinfo.gstatus == 0 && query.otype != '3'}}" data-invitefbtn="1" bindtap="inviteGroup">邀请拼团</button>
    <!-- 邀请好友参加 -->
    <!-- <button class="button button-warn share-group" wx:elif="{{info.atype==0&& info.timeContrast&& info.waitComment != 1 &&((info.groupinfo.groupbook != 1 || (info.groupinfo.groupbook == 1 && info.orderStatus==6)) && (info.orderStatus==2 || (info.orderStatus==4&& info.needPayBalance!=1) || info.orderStatus==6))}}" bindtap="inviteGroup" data-invitefbtn="0">邀请好友</button> -->
    <button class="button button-warn share-group" wx:elif="{{info.orderStatus != 3&&info.timeContrast}}" bindtap="inviteGroup" data-invitefbtn="0">邀请好友</button>
  </view>
</view>
<view class="content" style="padding-bottom: 90rpx;">
  <view class="order-card white-bg">
    <navigator hover-class="none" bindtap="toDetail" class="order-card-main">
      <image src="{{info.logo}}" mode="aspectFill" binderror="errorImg"></image>
      <view class="order-card-content">
        <view class="listTitle">{{info.title}}</view>
        <text class="font12 black">
          {{info.atype == 0 ? '场次':'颜色'}}：{{info.sessionName}}
          {{info.atype == 0 ? (info.military==1?'排':'套餐'):'尺寸'}}：<block wx:for="{{info.meals}}" wx:for-index="index" wx:for-item="infoName" wx:key="index">{{infoName.policyName}}<text wx:if="{{info.military==1}}">（{{info.campSex==0?'仅女生可报':(info.campSex==1?'仅男生可报':'不限性别')}}）</text>({{infoName.num}})</block>
        </text>
      </view>
    </navigator>
  </view>
  <view class="mTop10">
    <view class="cell">
      <view class="cell-title">订单号</view>
      <view class="cell-value">{{info.orderid}}</view>
    </view>
    <view class="cell">
      <view class="cell-title">订单时间</view>
      <view class="cell-value">{{filter.formatDate(info.crtTime)}}</view>
    </view>
    <view class="cell">
      <view class="cell-title">购买手机</view>
      <view class="cell-value">{{info.phone}}</view>
    </view>
    <view class="cell">
      <view class="cell-title">总金额</view>
      <view class="cell-value">{{info.priceDesc}}元</view>
    </view>
  </view>
  <view class="mTop10" wx:if="{{info.atype == 1}}">
    <view class="cell" wx:if="{{info.mail}}">
      <view class="cell-title">收件人</view>
      <view class="cell-value">{{info.mail.name}} {{info.mail.postMobile}}</view>
    </view>
    <view class="cell" wx:if="{{info.mail}}">
      <view class="cell-title">收件地址</view>
      <view class="cell-value">{{info.mail.address}}</view>
    </view>
    <view class="cell" wx:if="{{info.remark}}" bindtap="editOrderDetail">
      <view class="cell-title">备注</view>
      <view class="cell-value" >{{info.remark}}</view>
    </view>
  </view>
  <view class="mTop10" wx:if="{{info.orderStatus == 3}}">
    <view class="cell">
      <view class="cell-title">退款金额</view>
      <view class="cell-value">
        <block wx:if="{{info.refundAmount}}">{{info.refundAmount}}</block>
        <block wx:else>根据【<text class="subtitleColor">取消条款</text>】约定金额</block>
      </view>
    </view>
  </view>
  <block wx:if="{{info.names || (info.remark && info.remark != '' && info.atype == 0) || info.agreementUrl || (info.canRefund && info.atype == 1)}}">
    <view class="mTop10">
      <view class="cell" wx:if="{{info.names}}">
        <view class="cell-title">身份证信息</view>
        <view class="cell-value">{{info.names}}</view>
      </view>
      <view class="cell" wx:if="{{info.remark && info.atype == 0}}" bindtap="editOrderDetail">
        <view class="cell-title">备注</view>
        <view class="cell-value">{{info.remark}}</view>
      </view>
      <view class="cell" wx:if="{{info.orderStatus == 2 && info.agreementUrl}}">
        <view class="cell-title">旅游电子合同</view>
        <view class="cell-value">
          <button plain size="mini" type="warn" data-type="电子合同" bindtap="lookContract" data-url="{{info.agreementUrl}}" class="button button-radius contract">点击查看</button>
        </view>
      </view>


      <!-- wx:if="{{info.travelPlanUrl!=null}}" -->
      <view class="cell" wx:if="{{info.travelPlanUrl!=null}}">
        <view class="cell-title">行程单</view>
        <view class="cell-value">
          <button plain size="mini" type="warn" data-type="行程单" bindtap="lookContract" data-url="{{info.travelPlanUrl}}" class="button button-radius contract">点击查看</button>
        </view>
      </view>
      <navigator class="cell ceill-link scan" hover-class="none" url="/pages/order/groupQrcode/index?orderid={{info.orderid}}" wx:if="{{info.orderStatus == 2 && info.sessionQrcode}}">
        <view class="cell-title">扫码加入活动群</view>
        <view class="cell-value">
          <text class="qrCode"></text>
        </view>
      </navigator>
      <view class="cell" wx:if="{{info.canRefund && info.atype == 1}}">
        <view class="cell-title">申请退款</view>
        <view class="cell-value">
          <button size="mini" class="button refund button-plain-gray button-radius" bindtap="refund" data-index="{{index}}">申请退款</button>
        </view>
      </view>
    </view>
  </block>
  <view class="content-box-pad white-bg mTop10" wx:if="{{info.orderStatus == 4}}">
    <view class="order-title order-title-line order-title-button">
      预付信息
    </view>
    <view class="sub-order font14">
      <view>活动总价：￥{{info.totalPayPrice}}</view>
      <view>预付金：已付￥{{info.totalPresellPayPrice}} 抵￥{{info.totalPresellDiscount}}</view>
      <view>尾款支付时间：{{info.startTime}}～{{info.endTime}}</view>
    </view>
  </view>
  <view class="content-box-pad white-bg mTop10" wx:if="{{info.atype == 0 && ((info.smailAddress!='no' && info.mailAddress) || (info.expList && info.expList.length > 0))}}">
    <view class="order-title order-title-line order-title-button">邮寄信息</view>
    <view class="cell" style="padding: 30rpx 0;" wx:if="{{info.smailAddress!='no' && info.mailAddress}}">
      <view class="cell-title">邮寄地址</view>
      <textarea class="mailAddress cell-value" placeholder="无" value="{{info.mailAddress}}" name="mailAddress" disabled auto-height style="text-align:left;min-height:70rpx;" />
    </view>
    <block wx:if="{{info.atype == 0 && info.expList && info.expList.length > 0}}">
      <navigator class="cell ceill-link" url="/pages/order/express/express?no={{item.expNo}}&code={{item.expCode}}&phoneNum={{info.mail.postMobile}}" hover-class="none" wx:for="{{info.expList}}" wx:key="unique">
        <view class="cell-title">{{item.expName}}</view>
        <view class="cell-value">{{item.expNo}}</view>
      </navigator>
    </block>
  </view>

  <navigator class="cellBorder cell ceill-link" url="/pages/order/express/express?no={{info.expressNo}}&code={{info.expressCompany}}&phoneNum={{info.mail.postMobile}}" hover-class="none" wx:elif="{{info.atype == 1 && info.expressNo}}">
    <view class="cell-title">物流信息</view>
    <view class="cell-value">{{info.expressNo && info.expressCompanyName ? info.expressCompanyName+'（'+info.expressNo+'）' : '自提，无物流'}}</view>
  </navigator>

  <view class="mTop10" style="font-size: 28rpx;" wx:if="{{info.atype == 1&&info.refundAddress&&info.orderStatus==3&&info.subOrders[0].status==6}}">
    <view class="address-title">退货地址</view>
    <view class="address-content">
      <view class="address-detail">
        <text>{{info.refundAddress}}</text>
      </view>
      <text class="address-copy" data-text="{{info.refundAddress}}" bindtap="copyAddress">复制</text>
    </view>
  </view>

  <view class="content-box-pad white-bg mTop10" wx:if="{{info.atype == 0}}">
    <view class="order-title order-title-line order-title-button">消费码</view>
    <!-- <button type="warn" wx:if="{{info.orderStatus ==4 && info.needPayBalance==1}}" size="mini" class="button button-radius" data-aid="{{info.aid}}" data-orderid="{{query.orderid}}" data-presellStatus="{{query.presellStatus}}" data-otype="{{query.otype}}" data-campSex="{{info.campSex}}" data-military="{{info.military}}" plain bindtap="jumpBalancePayment">支付尾款</button> -->
    <view class="sub-order" wx:for="{{info.subOrders}}" wx:key="index">
      <view class="sub-order-password {{item.status == 1 ? ' link':''}}" bindtap="qrcode" data-status="{{item.status}}" data-password="{{item.password}}">
        <view class="sub-order-item">{{item.name ? item.name:('消费码'+(index+1))}}</view>
        <view class="sub-order-item">
          <block wx:if="{{item.status == 3&&item.statusDesc!='处理中'}}">待支付</block>
          <block wx:elif="{{item.statusDesc=='处理中'}}">支付结果确认中</block>
          <block wx:else>
            <text class="subtitleColor">{{item.password}} </text><text class="qrCode"></text>
          </block>
        </view>
        <view class="sub-order-item right">{{item.statusDesc}}</view>
      </view>
      <view class="sub-order-footer mTop10 right" wx:if="{{item.status == 15 || item.status == 1 || item.status == 6 || info.isManyDay == 1 || item.changeStatus!=2}}">
        <!-- wx:if="{{(item.status == 1 || item.status == 15) && item.canRefund}}" -->
        <button size="mini" class="button refund button-plain-gray button-radius" wx:if="{{(item.status == 1 || item.status == 15)&& item.canRefund}}" bindtap="refund" data-password="{{item.password}}" data-status="{{item.status}}" data-index="{{index}}">申请退款</button>
        <button size="mini" class="button cancelRefund button-plain-gray button-radius" wx:if="{{item.status == 6}}" bindtap="cancelRefund" data-password="{{item.password}}">取消退款</button>
        <button size="mini" class="button refund button-plain-gray button-radius" wx:if="{{item.changeStatus!=2}}" data-status="{{item.changeStatus}}" data-oid="{{item.oid}}" bindtap="changeMeals">{{item.changeStatus==0?'更换场次':'申请中'}}</button>
        <button plain size="mini" type="warn" bindtap="lookContract" data-url="{{item.noticeUrl}}" class="button button-radius" wx:if="{{item.noticeUrl}}">营前须知</button>
        <!-- <button size="mini" plain type="warn" class="button button-radius" wx:if="{{info.isManyDay == 1 && item.status == 1}}" bindtap="trip" data-refundpwd="{{item.password}}">补充营员信息</button> -->
        <button size="mini" type="warn" bindtap="scheduling" data-oid="{{item.oid}}" data-optionId="{{item.optionId}}" class="button button-radius button-subtitle" wx:if="{{item.optionId && item.showSchedule==1}}">选择排期</button>
      </view>
    </view>
  </view>

  <view class="content-box-pad white-bg mTop10" wx:if="{{info.groupinfo && info.groupinfo.discount}}">
    <view class="order-title order-title-line order-title-button">
      我的团 <text class="font12 gray">
        <block wx:if="{{info.groupinfo.discount.before > 0 && info.groupinfo.discount.total >= info.groupinfo.discount.before && info.groupinfo.discount.next-info.groupinfo.discount.total > 0}}">已满{{info.groupinfo.discount.before}}人团，</block>
        <block wx:if="{{info.groupinfo.discount.next-info.groupinfo.discount.total > 0}}">还差<text class="subtitleColor">{{info.groupinfo.discount.next-info.groupinfo.discount.total}}</text>人成{{info.groupinfo.discount.next}}人团</block>
        <block wx:elif="{{info.groupinfo.discount.next > 0}}">已满{{info.groupinfo.discount.next}}人团</block>
      </text>

      <button type="warn" size="mini" class="button invite-group button-radius" plain wx:if="{{(info.groupinfo.discount.status == 0 || info.groupinfo.discount.status == 4) && query.otype != '3'}}" disabled="{{info.groupinfo.groupbook == -1}}" data-invitefbtn="1" bindtap="inviteGroup">{{info.groupinfo.gstatus == 2 ? '已满额':(info.groupinfo.gstatus == 4 ? '已结束':'邀请拼团')}}</button>

      <button size="mini" class="button  button-radius button-plain-gray" wx:elif="{{info.groupinfo.discount.status == 1}}">待返现</button>
      <button size="mini" class="button  button-radius button-plain-gray" wx:elif="{{info.groupinfo.discount.status == 2}}">已返现</button>
    </view>
    <view class="order-users-box mTop10" wx:if="{{info.groupinfo.discount && info.groupinfo.discount.users.length > 0}}">
      <view class="order-users-list">
        <view wx:for="{{info.groupinfo.discount.users}}" wx:key="unique">
          <image src="{{item.avatar}}"></image>
          <view class="font10">
            <view class="Unpaid" wx:if="{{item.status == 4 && iconView}}"></view>{{item.nickname}}
          </view>
        </view>
      </view>
      <view class="order-users-text">
        <block wx:if="{{info.groupinfo.gstatus == 0 && info.groupinfo.discount.status == 0 && info.groupinfo.discount.deadline > 0 && query.otype != '3'}}">{{info.updateTime.hour}}:{{info.updateTime.minite}}:{{info.updateTime.second}}</block>
        <block wx:elif="{{info.groupinfo.discount.status == 1 || info.groupinfo.discount.status == 2}}">每人返<text class="subtitleColor">{{info.groupinfo.discount.price}}</text>元</block>
      </view>
    </view>
    <view class="font12" wx:if="{{iconView}}">
      <view class="Unpaid"></view>:代表该用户未付尾款
    </view>
  </view>

  <!-- <view class="content-box-pad white-bg mTop10" wx:if="{{info.expList && info.expList.length > 0}}">
    <view class="order-title order-title-line">营员包裹信息</view>
  </view> -->

  <!-- 我的评价 -->
  <view class="content-box-pad white-bg mTop10" wx:if="{{info.comment && info.comment != ''}}">
    <view class="order-title order-title-line">
      <view class="star r-float">
        <image src="{{info.comment.arating >= 1?'/images/star_real.png':'/images/star.png'}}"></image>
        <image src="{{info.comment.arating >= 2?'/images/star_real.png':'/images/star.png'}}"></image>
        <image src="{{info.comment.arating >= 3?'/images/star_real.png':'/images/star.png'}}"></image>
        <image src="{{info.comment.arating >= 4?'/images/star_real.png':'/images/star.png'}}"></image>
        <image src="{{info.comment.arating == 5?'/images/star_real.png':'/images/star.png'}}"></image>
      </view>
      我的评价
    </view>
    <view class="comment-content font14">
      <text>{{info.comment.content}}</text>
      <text class="subtitleColor">{{info.comment.tag}}</text>
      <view class="scoreImg" wx:if="{{info.comment.images.length>0}}">
        <image wx:for="{{info.comment.images}}" wx:key="unique" bindtap="previewImage" data-id="0" data-index="{{index}}" wx:for-item="itemImg" src="{{itemImg}}" mode="aspectFill"></image>
      </view>
    </view>
    <view class="comment-content add-comment font14" wx:if="{{info.comment.additionalComment.cid}}">
      <view class="font14 subtitleColor">追加评价</view>
      <view class="mTop10"><text>{{info.comment.additionalComment.content}}</text></view>
      <view class="scoreImg" wx:if="{{info.comment.additionalComment.images && info.comment.additionalComment.images.length > 0}}">
        <image wx:for="{{info.comment.additionalComment.images}}" wx:key="unique" data-index="{{index}}" data-id="1" wx:for-item="itemImg" src="{{itemImg}}" mode="aspectFill" bindtap="previewImage"></image>
      </view>
    </view>
  </view>
  <view class="mTop10" wx:if="{{showGoodsRecom}}">
    <physicalForCard title="活动所需物品清单" link="{{'/pages/public/showGoodsList/index?aid='+info.aid}}"></physicalForCard>
    <!-- <physicalList showType="{{true}}" aid="{{info.aid}}"></physicalList> -->
  </view>
</view>

<view class="layer" wx:if="{{percent>0 && percent != 100}}" bindtap="layer">
  <view class="layerBox">
    <view class="layerTitle" hidden="{{!loadingSuc}}">下载进度</view>
    <view class="layerTitle" hidden="{{loadingSuc}}">{{percent == 100?'下载成功':'下载失败'}}</view>
    <progress percent="{{percent}}" show-info active activeColor="#09BB07" class="progress" active-mode="forwards" />
  </view>
</view>
<returnOrderNo show="{{showOrderNo}}" orderId="{{info.orderid}}" refundExpressCompany="{{info.refundExpressCompany}}" refundExpressNum="{{info.refundExpressNum}}" bind:close="closeOrderNo" bind:sub="subOrderNo"></returnOrderNo>
<sku show="{{showSku}}" s1="{{info.sid}}" s2="{{info.pid}}" military="{{info.military}}" aid="{{info.aid}}" atype="{{info.atype}}" changeSku="{{true}}" orderInfo="{{orderInfo}}" bind:confirmChange="confirmChange" bind:close="closeSku" bindshowFund="showFund" bindshowCode="showCode"></sku>
<!-- 退款条例弹框 -->
<refund bindclose="closeRefund" type="{{type}}" show="{{refundShow}}"></refund>
<!-- 关注二维码弹框 -->
<service bindsure="isOK" show="{{codeShow}}"></service>