<wxs module="filters" src="../../../../utils/filter.wxs"></wxs>
<view class="container">
    <view class="user-mes" wx:if="{{order.exp_type==0 || order.exp_type==2 }}">
        <view class="user-contact">
        {{order.consignee}}{{'　　'}}{{order.mobile}}
        </view>
        <view class="location" wx:if="{{order.order_prom_type!=5}}">
            <view class="address">{{order.more_address}} {{order.address}}</view>
            <view class="pos-icon">
                <image class="wh100" src="{{iurl}}/miniapp/images/iconfont-shouhuodizhi.png"></image>
            </view>
        </view>
        <view class="border-img">
            <image class="wh100" src="{{iurl}}/miniapp/images/tt.png"></image>
        </view>
    </view>
    <view class="order-meg">
        <view class="order-state"><view class="shop_name">门店：{{order.pickname}}</view>
             <view>{{order.order_status_detail}}</view>
        </view>
        <!--wx:if="{{item.return_btn!=4}}" -->
        <view class="order-detail" wx:for="{{order.order_goods}}" wx:key="{{index}}" >
            <view class="goods-img"  bindtap="go_gd" data-gd="{{item}}">
                <image class="wh100" src="{{resourceUrl+item.original_img}}"  binderror="bind_bnerr" lazy-load="true"
                        data-errorimg="order.order_goods[{{index}}].original_img"></image>
            </view>
            <!-- 跳转到商品 -->
            <navigator class="order-cont"  bindtap="go_gd" data-gd="{{item}}">
                <view class="goods-name">{{item.goods_name}}</view>
                <!--<view class="goods-color">{{item.goods_spec}} {{item.goods_color}}</view>-->
                <view class="goods-color">{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</view>
            </navigator>

            <view class="order-num">
                <view class="goods-price">￥{{item.member_goods_price}}<text wx:if="{{item.prom_type==10}}" style="margin-left: 5rpx">({{item.ladder_discount}}折)</text> </view>
                <view class="goods-num">×{{item.goods_num}}</view>

                <!-- 不是整单退的时候 -->
                <block wx:if="{{!order.pre_cut && order.is_all_return!=1 && order.discount<=0  && order.coupon_price<=0 &&  order.order_prom_amount<=0 && order.discount_amount<=0 && item.prom_type!=5 && !order.is_prom && item.is_whsle_goods!=1}}">
                    <view bindtap="checkReturnGoodsStatus" class="goods-num" data-oid="{{item.order_id}}"
                          data-recid="{{item.goods_id}}"  wx:if="{{item.return_btn==1 && !order.is_bedistri}}">申请退款</view>
                    <view bindtap="gotoreturn" class="return-btn" data-oid="{{item.order_id}}"
                          data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==2}}">退款中</view>
                    <view bindtap="checkReturnGoodsStatus" class="goods-num" data-oid="{{item.order_id}}"
                          data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==3}}">重新退款</view>
                    <view bindtap="gotoreturn" class="goods-num" data-oid="{{item.order_id}}"
                          data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==4}}">退款完成</view>
                </block>


            </view>
        </view>
        <view class="order-operate">
            <view bindtap="checkTeam" class="contact-us check-btn" wx:if="{{optionIsGoup}}">查看拼团详情</view>
						<view>

							<button wx:if="{{sys_switch.weapp_customertype==1}}" class="contact-us goods-btn" bindtap="click_contact" open-type="contact"  session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">联系客服</button>

                            <view wx:elif="{{sys_switch.weapp_customertype==2}}" bindtap="con_weixin" class="contact-us goods-btn">联系客服</view>
							<view wx:else bindtap="contactService" class="contact-us goods-btn">联系客服</view>
						</view>
            <!-- <view bindtap="contactService" class="contact-us goods-btn">联系客服</view> -->
            <view bindtap="cancelOrder" class="cancel-order goods-btn" data-id="{{order.order_id}}"
              hidden="{{!(order.order_status==0&&order.pay_status==0)}}">取消订单</view>
        </view>
    </view>
    <view class="basic-information information">
        <view class="title">基本信息</view>
        <view class="item">
            <view>订单编号</view>
            <view>{{order.order_sn}}</view>
        </view>
        <view class="item">
            <view>下单时间</view>
            <view>{{order.addTimeFormat}}</view>
        </view>

        <view class="item" wx:if="{{order.order_prom_type!=5}}">
            <view>配送方式</view>
            <view wx:if="{{order.pt_status<4 && order.is_zsorder==4}}">
                --
            </view>
            <block wx:else>

            <view wx:if="{{order.exp_type==2}}">同城配送</view>
            <view wx:elif="{{order.exp_type==1}}">自提</view>
            <view wx:else>物流({{order.shipping_name}})</view>
            </block>
        </view>
        <view class="item">
            <view>买家留言</view>
            <view class="leave-word">{{order.user_note!=''?order.user_note:'无'}}</view>
        </view>
    </view>
    <view class="price-information information" style="margin-bottom: 120rpx;">
           <view class="title" style="margin-bottom:10rpx" >价格信息</view>
           <view class="item pnew"  wx:if="{{order.is_zsorder==4}}">
                <view>商品总价</view>
                <view>￥ {{filters.toFix(order.order_goods[0].member_goods_price*order.order_goods[0].goods_num,2)}}元</view>
           </view>
           <view class="item pnew" wx:else>
              <view>商品总价</view>
              <view>￥ {{order.goods_price}}元</view>
            </view>

           <view class="item pnew" wx:if="{{order.is_zsorder==4}}">
                <view>定金金额</view>
                <view>￥ {{filters.toFix(order.order_amount+order.user_money+order.pre_cut,2)}}元</view>
           </view>
           <view class="item pnew" wx:if="{{order.pt_tail_money>0}}">
              <view>尾款金额</view>
              <view>￥ {{filters.toFix(order.pt_tail_money-order.shipping_price,2)}}元</view>
           </view>

            <view class="item pnew" wx:if="{{order.shipping_price>0}}">
                 <view>配送费用</view>
                 <view>￥ {{order.shipping_price}}元</view>
            </view>
            <view class="item pnew" wx:if="{{order.coupon_price>0}}">
                <view>优惠券</view>
                <view> ￥ {{order.coupon_price}}元</view>
           </view>
           <view class="item pnew" wx:if="{{order.pre_cut>0}}">
                <view>使用预存</view>
                <view> ￥ {{order.pre_cut}}元</view>
           </view>
            <view class="item pnew" wx:if="{{order.integral>0}}">
               <view>积分</view>
               <view>{{order.integral}}积分</view>
            </view>

            <view class="item pnew" wx:if="{{order.discount_amount>0}}">
                <view>优惠活动</view>
                <view>￥ {{filters.toFix(order.discount_amount,2)}}元</view>
            </view>

            <view class="item pnew" wx:if="{{order.ladder_amount>0}}">
                <view>阶梯优惠活动</view>
                <view>￥ {{filters.toFix(order.ladder_amount,2)}}元</view>
            </view>

            <view class="item pnew" wx:if="{{order.order_prom_amount>0}}">
                <view>订单优惠</view>
                <view>￥ {{order.order_prom_amount}}元</view>
            </view>

            <view class="item">
              <view>订单总价</view>
              <view>￥ {{filters.toFix(order.order_amount+order.user_money+order.pt_tail_money+order.use_commission+order.pre_cut,2)}}元</view>
            </view>

           <view class="item-line"></view>

           <view class="item" wx:if="{{order.use_commission>0}}">
                <view>使用佣金</view>
                <view>￥ {{filters.toFix(order.use_commission,2)}}元</view>
           </view>

           <view class="item" wx:if="{{order.user_money>0}}">
              <view>使用余额</view>
              <view wx:if="{{order.tail_pay_type==1}}">￥ {{filters.toFix(order.user_money+order.pt_tail_money,2)}}元</view>
              <view wx:else>￥ {{filters.toFix(order.user_money,2)}}元</view>
           </view>
           <view style="height:10rpx"></view>
    </view>

    <view class="btn-wrap">

        <view bindtap="zfwk" class="tips-btn" wx:if="{{order.pt_tail_money>0 && order.pt_status==2 }}">支付尾款</view>
        <view bindtap="jumpToCart4" class="tips-btn" hidden="{{!order.pay_btn}}">
            <text wx:if="{{paying}}">支付中</text>
            <text wx:else>立即付款</text>
        </view>

        <block wx:if="{{!(order.has_rt || order.return_btn==2 || order.return_btn==4)}}">
           <navigator bindtap="confirmOrder" class="tips-btn" hidden="{{!order.receive_btn}}">收货确认</navigator>
        </block>
		
		<view class="tips-btn" wx:if="{{order.order_status==3}}"  bindtap="deleteOrderData" data-order_id="{{order.order_id}}" >删除订单</view>
		

        <navigator bindtap="go_wuliu" class="tips-btn" hidden="{{!order.shipping_btn}}"
                   data-order_id="{{order.order_id}}"
                   data-url="/packageG/pages/user/express/express?order_id={{order.order_id}}">查看物流</navigator>

          <!---has_rt部分退---->
         <block wx:if="{{order.return_btn==undefined && order.is_all_return!=1 && order.has_rt!=1}}">
                          <navigator class="tips-btn" wx:if="{{(order.order_status==0&&order.pay_status==1) && !order.is_bedistri}}" url="/packageG/pages/order/refund_order/refund_order?order_id={{order.order_id}}">申请退款</navigator>
                          <navigator class="tips-btn" wx:if="{{(order.order_status==1&&order.pay_status==1) && !order.is_bedistri}}" url="/packageG/pages/order/refund_order/refund_order?order_id={{order.order_id}}">申请退款</navigator>
         </block>
         <block wx:else>
                          <view class="tips-btn" wx:if="{{order.is_all_return_status==2 && order.isdel==0}}"  bindtap="deleteOrderData" data-order_id="{{order.order_id}}" >删除订单</view>
                          <navigator class="tips-btn" wx:if="{{order.is_all_return_status==3 && order.order_status<2}}"  url="/packageG/pages/order/refund_order/refund_order?order_id={{order.order_id}}">重新退款</navigator>
                          <navigator class="tips-btn" wx:if="{{order.is_all_return_status==0 || order.is_all_return_status==1}}"
                                     url="/packageF/pages/user/return_goods_info/return_goods_info?order_id={{order.order_id}}">退款详情</navigator>
        </block>
		
		
        <block wx:if="{{order.order_status==2 && order.is_zsorder!=4}}">
            <navigator wx:if="{{order.order_goods.length>1}}"  class="tips-btn"
                       url="/packageB/pages/user/comment/comment?status=0&order_id={{order.order_id}}">评价</navigator>
            <navigator wx:else  class="tips-btn"
                       url="/packageB/pages/user/add_comment/add_comment?goods_id={{order.order_goods[0].goods_id}}&order_id={{order.order_id}}">去评价</navigator>
        </block>
		<!-- 积分购  拼团 搭配购没有有再来一单 -->
		<block wx:if="{{ (order.pay_status==1 || order.order_status==3) && order.pt_prom_id<=0 && order.integral<=0 && order.order_goods[0].prom_type!=5}}">
			<view style="background-color: #feca53;"  class="tips-btn"  bindtap="moreOrder" >再来一单</view>										
		</block>
    </view>
</view>

<warn id="warn"></warn>
