cart2.wxml 15.6 KB
<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
<form bindsubmit="submitForm">
    <view class="container">
         <!--要进行判断地址是否显示---->
        <view bindtap="enterAddressPage" class="user-mes"
            hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'>
            <!---默认地址显示------>
            <block wx:if="{{user_addr!=null}}">
                <view class="user-contact">{{user_addr.consignee}}{{'  '}}{{user_addr.mobile}}</view>
                <view class="location">
                    <view class="address">{{user_addr.more_address}}{{'  '}}{{user_addr.address}}</view>
                    <view class="pos-icon">
                        <image class="wh100" src="{{imgUrl}}/miniapp/images/iconfont-address.png"></image>
                    </view>
                </view>
                <view class="update-logistics">
                     <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/icon-arrowdown.png"></image>
                </view>
            </block>
            <!---先增地址------>
            <block wx:else>
                <view class="add_new">
                    <image class="addr_jia" src="{{imgUrl}}/miniapp/images/jia.png"></image>添加地址
                </view>
            </block>
            <view class="border-img"><image class="wh100" src="{{imgUrl}}/miniapp/images/tt.png"></image></view>
        </view>

        <!---------------------购物车进来,有可能多单---------------------->
        <block wx:if="{{is_b_now==0}}">
            <view  wx:for="{{cartlist}}" wx:for-index="pidx">
                <view class="use-item bfff">
                      <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{item.pname}}</view></view>
                <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx"  wx:for-item="items">
                    <!----商品图片----->
                    <view class="goods-img">
                        <image class="wh100" src="{{items.original_img}}"  binderror='cart_set_err'
                         data-err='cartlist[{{pidx}}].goods[{{idx}}].original_img' ></image>
                    </view>
                    <!----商品名称规格---->
                    <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}">
                        <view class="goods-name">{{items.goods_name}}</view>
                         <view class="goods-color">
                                <text wx:if="{{items.goods_spec!='' && items.goods_spec!=null }}">{{items.goods_spec}}/</text>
                                {{items.goods_color==null?"":items.goods_color}}
                          </view>
                    </navigator>
                     <!-----商品名称规格------>
                    <view class="order-num">
                        <view class="co-red">¥{{items.goods_price}}</view>
                        <view class="goods-num">x{{items.goods_num}}</view>
                    </view>
                </view>

                <!-----使用优惠券------>
                <view class="xc-coupon-frame flex-center" data-bn="0"  bindtap="open_coupon_list" 
				    wx:if="{{item.quan_list && item.quan_list.length>0 }}" data-cind="{{pidx}}" data-pickid="{{item.pickup_id}}">
                    <view class="work-frame flex-space-between">
                        <view class="work">使用优惠券</view>
                        <view class="xc-right-frame">
                            <text wx:if="{{using_quan[item.pickup_id].is_nouse}}">不使用</text>
                            <text wx:if="{{using_quan[item.pickup_id].money}}">{{using_quan[item.pickup_id].money}}元优惠券</text>
							<view class="xc-right"></view>
                        </view>
                    </view>
                </view>

                <view class="set-mes">
                    <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}}
                    </view>
                    <view class="use-item">
                          <view  data-t='1' style="display:{{item.distr_t==2?'none':'flex'}};">
                             <icon  bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type'  color="{{item.exp_type==1?'red':'gray'}}" size="16" type="success"></icon>
                             <view bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">门店自提</view>
                          </view>

                          <view  data-t='0'  style="display:{{item.distr_t==1?'none':'flex'}};">
                             <icon   bindtap='setexptype_w' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' class="wuliu" color="{{item.exp_type==0?'red':'gray'}}" size="16" type="success"></icon>
                            <view bindtap='setexptype_w' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">快递邮寄</view>
                          </view>
                    </view>
                    <view class="use-item" hidden='{{item.exp_type==1}}'>
                          <view>选择物流:</view>
                          <picker bindchange="bindPickerChange_w" data-txt='cartlist[{{pidx}}].wind'  value="{{item.wind}}" range="{{wu_arr}}" range-key="name">
                                <view >{{wu_arr[item.wind].name}}</view>
                          </picker>
                    </view>
                </view>
                <view class="coupon-mes">
                    <view>用户备注(50字)</view>
                    <view class="leave-word">
                        <textarea bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="50" name="user_note_{{item.pickup_id}}"></textarea>
                        <view class="max-word">{{maxWord}}/50</view>
                    </view>
                </view>
            </view>
            <!-----使用余额------>
            <view class="set-mes" wx:if="{{yuer>0}}">
                    <view class="use-item" bindtap='set_js_useyuer'>
                            <icon  color="{{js_use_money?'red':'gray'}}" size="16" type="success"></icon>
                            <view class="yu_er">使用余额 :¥{{yuer}} </view>
                    </view>
            </view>
        </block>

        <!------立即购买-------->
        <block wx:if="{{is_b_now==1}}">
                <view class="use-item bfff">
                      <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{bn_pickname}}</view></view>
                <view class="order-detail">
                      <view class="goods-img">
                          <image class="wh100" src="{{bn_goods.original_img}}" binderror='cart_set_err' data-err="bn_goods.original_img"></image>
                      </view>
                      <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}">
                          <view class="goods-name">{{bn_goods.goods_name}}</view>
                          <view class="goods-color">
                                <text wx:if="{{bn_goods.goods_spec!=''}}">{{bn_goods.goods_spec}}/</text>{{bn_goods.goods_color}}
                          </view>
                      </navigator>
                      <view class="order-num">
                          <view class="co-red">¥{{bn_goods.shop_price}}</view>
                          <view class="goods-num">x{{bn_goods.buynum}}</view>
                      </view>
                </view>
                <view class="set-mes">
                    <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}}
                    </view>

                    <view class="xc-coupon-frame flex-center" data-bn="1"  bindtap="open_coupon_list"  data-pickid="{{bn_pick}}"
					      wx:if="{{selected_quan_list && selected_quan_list.length>0}}">
                        <view class="work-frame flex-space-between">
                            <view class="work">
                                使用优惠券
                            </view>
                            <view class="xc-right-frame">
                                <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text>
								<text wx:if="{{using_quan[bn_pick].money}}">{{using_quan[bn_pick].money}}元优惠券</text>
								<view class="xc-right"></view>
                            </view>
                        </view>
                    </view>

                    <view class="use-item">
                        <view bindtap='setexptype' data-t='1'  style="display:{{bn_t_exp_t==2?'none':'flex'}};">
                          <icon   color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon>
                           <view class="yu_er">自提</view>
                        </view>
                        <view bindtap='setexptype' data-t='0'  style="display:{{bn_t_exp_t==1?'none':'flex'}};">
                            <icon  color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon>
                            <view class="yu_er">物流</view>
                        </view>
                    </view>

                    <view class="use-item" hidden='{{bn_exp_type==1}}'>
                          <view>使用物流:</view>
                          <picker bindchange="bindPickerChange" value="{{index}}" range="{{wu_arr}}" range-key="name">
                                <view >{{wu_arr[index].name}}</view>
                          </picker>
                    </view>

                    <!-- <view class="use-item">
                        <view>使用积分 : </view>
                        <input bindblur="keyUpChangePay2" maxlength="20" name="pay_points" placeholder="可用积分为:{{order.userInfo.pay_points}}" type="number"></input>
                        <button class="use-btn" formType="submit">使用</button>
                    </view>
                    <view class="use-item">
                        <view>使用券码 : </view>
                        <input name="couponCode" placeholder="请输入优惠券券码" type="text"></input>
                        <button class="use-btn" formType="submit">使用</button>
                    </view>
                    <view class="use-item" style="display:{{payWithUserMoney&&payWithPoints?'none':'flex'}}">
                        <view>支付密码 : </view>
                        <input password maxlength="20" name="paypwd" placeholder="请输入密码" type="text"></input>
                    </view> -->
                </view>

                 <!-----使用余额------>
                <view class="set-mes" wx:if="{{yuer>0}}">
                  <view class="use-item" bindtap='set_bn_useyuer'>
                          <icon  color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon>
                          <view class="yu_er">使用余额 :¥{{yuer}} </view>
                          <!-- <input bindblur="keyUpChangePay1" maxlength="20" name="user_money" placeholder="可用余额:{{order.userInfo.user_money}}" type="digit"></input> <button class="use-btn" formType="submit">使用</button>-->
                  </view>
                </view>
                <view class="coupon-mes">
                    <view>用户备注(50字)</view>
                    <view class="leave-word">
                        <textarea bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="50" name="user_note"></textarea>
                        <view class="max-word">{{maxWord}}/50</view>
                    </view>
                </view>
         </block>

         <view class="information">
            <view class="item">
                <view>商品金额</view>
                <view class="co-red">¥ {{formData.all_price}}元</view>
            </view>
            <view class="item">
                <view>配送费用</view>
                <view class="co-red">¥ {{formData.shipping_price}}元</view>
            </view>

            <view class="item" wx:if="{{formData.coupon_price>0}}">
                <view>使用优惠券</view>
                <view class="co-red">- ¥ {{formData.coupon_price}}元</view>
            </view>
             <!--
           <view class="item">
               <view>使用积分</view>
               <view class="co-red">- ¥ {{orderPrices.integral_money}}元</view>
           </view> -->
            <view class="item">
                <view>使用余额</view>
                <view class="co-red">- ¥ {{formData.user_money}}元</view>
            </view>
            <!-- <view class="item">
                <view>优惠活动</view>
                <view class="co-red">- ¥ {{orderPrices.order_prom_amount}}元</view>
            </view> -->
        </view>
    </view>

     <view class="btn-wrap">
            <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button>
            <view class="pay-amount">
                <view class="payable">应付金额 : </view>
                <view class="co-red big">¥ {{formData.order_amount}}元</view>
            </view>
     </view>
</form>

<!-- 使用券列表的弹窗 -->
<view wx:if='{{open_quan==1}}' >
    <view class="cover-layer flex-center "  bindtap='close_coupon'>
    </view>
    <view class="cx-popup {{open_quan==true?'up' : 'down'}}" >
        <view class="top flex">
            <view class="xc-top-content  t-c">
                <view class="xc-title">
                    选择优惠券
                </view>
            </view>
            <view class="xc-close-frame"  bindtap='close_coupon' >
                <view class="xc-close">×</view>
            </view>
        </view>

        <view class="xc-frame flex-level">
            <view class="list-frame">	
				<view class="xc-coupon-effect flex-vertical flex-space-between" bindtap="sele_quan_item" data-no="1">
				    <view class="xc-goods-coupon ">
				        <view class="xc-coupon-money0">不使用优惠券</view>
				        <view class="flex"></view>
				    </view>
				    <view class="xc-coupon-selection flex-right-vertical" >
				        <icon color='red' size='20' type='success' wx:if="{{using_quan[selected_quan_pick].is_nouse_red}}"></icon>
				        <view class="circle xc-not-Selection" wx:if="{{!using_quan[selected_quan_pick].is_nouse_red }}"></view>
				    </view>
				</view>
				
				<!-- 循环那些还没有被其他门店选择的券 -->
                <view class="xc-coupon-effect flex-vertical flex-space-between" wx:for="{{selected_quan_list}}"  wx:if="{{!item.is_using}}" bindtap="sele_quan_item" data-ind="{{index}}">
                    <view class="xc-goods-coupon ">
                        <view class="xc-coupon-money">{{item.Sum}}元</view>
                        <view class="xc-coupon-money1">订单满{{item.BuySum}}元使用</view>
                        <view class="flex xc-coupon-time">使用期限   
						   <view class="time"  wx:if="{{item.BeginDate && item.ValidDate}}" >
							   {{filters.replace_time(item.BeginDate)}}至{{filters.replace_time(item.ValidDate)}}
						   </view>
                        </view>
                    </view>
                    <view class="xc-coupon-selection flex-right-vertical" >
                        <icon color='red' size='20' type='success' wx:if="{{item.show_red}}"></icon>
                        <view class="circle xc-not-Selection" wx:if="{{!item.show_red }}"></view>
                    </view>
                </view>
			
            </view>
        </view>

        <view class="xc-confirm flex-center" bindtap="confirm_quan">
            <view   class="flex-vertical  t-c">确定</view>
        </view>
    </view >
</view>


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