欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

啦啦外卖独立版40.4最新外卖源码全开源

程序员文章站 2022-04-07 12:31:29
...

啦啦外卖独立版40.4最新外卖源码全开源
啦啦外卖独立版40.4最新外卖源码全开源
啦啦外卖独立版40.4最新外卖源码全开源
代码预览:

{itemplate 'public/header'}
<div class="page clearfix page-config-store-delivery">
	<h2>服务费率</h2>
	<form class="form-horizontal form form-validate" id="form1" action="" method="post" enctype="multipart/form-data" style="max-width: 100%">
		<input type="hidden" name="form_type" value="another">
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="require">* </span>配送模式</label>
			<div class="col-sm-9 col-xs-12">
				<div class="radio radio-inline">
					<input type="radio" name="delivery_mode" value="1" id="delivery-mode-1" required="true" {if $delivery['delivery_mode'] == 1}checked{/if}>
					<label for="delivery-mode-1">店内配送员</label>
				</div>
				<div class="radio radio-inline">
					<input type="radio" name="delivery_mode" value="2" id="delivery-mode-2" required="true" {if $delivery['delivery_mode'] == 2}checked{/if}>
					<label for="delivery-mode-2">平台配送员</label>
				</div>
				<div class="help-block">
					门店只能选择一个配送方式, 不能同时使用"平台配送员"和"店内配送员". <br>
					如需单独设置某个门店的配送模式,配送费,配送时间段等信息, 请到"<a href="{php echo iurl('merchant/account/index');}" target="_blank">财务中心-门店账户</a>"进行设置.
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">配送费</label>
			<div class="col-sm-9 col-xs-12">
				<div class="radio radio-inline">
					<input type="radio" name="delivery_fee_mode" value="1" id="delivery-fee-mode-1" required="true" {if $delivery['delivery_fee_mode'] == 1 || !$delivery['delivery_fee_mode']}checked{/if} onclick="$('.delivery-fee-mode').hide();$('.delivery-fee-mode-1').show();">
					<label for="delivery-fee-mode-1">固定金额</label>
				</div>
				<div class="radio radio-inline">
					<input type="radio" name="delivery_fee_mode" value="2" id="delivery-fee-mode-2" required="true" {if $delivery['delivery_fee_mode'] == 2}checked{/if} onclick="$('.delivery-fee-mode').hide();$('.delivery-fee-mode-2').show();">
					<label for="delivery-fee-mode-2">按距离收取</label>
				</div>
				<div class="radio radio-inline">
					<input type="radio" name="delivery_fee_mode" value="3" id="delivery-fee-mode-3" required="true" {if $delivery['delivery_fee_mode'] == 3}checked{/if} onclick="$('.delivery-fee-mode').hide();$('.delivery-fee-mode-3').show();">
					<label for="delivery-fee-mode-3">按区域收取</label>
				</div>
			</div>
		</div>
		<div class="form-group delivery-fee-mode delivery-fee-mode-1" {if $delivery['delivery_fee_mode'] == 1 || !$delivery['delivery_fee_mode']}style="display: block"{/if}>
			<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
			<div class="col-sm-9 col-xs-12">
				<div class="input-group">
					<div class="input-group-addon">起送价</div>
					<input type="number" name="send_price_1" value="{$delivery['send_price']}" class="form-control"/>
					<div class="input-group-addon">{$_W['Lang']['dollarSignCn']}</div>
					<div class="input-group-addon">满</div>
					<input type="number" name="delivery_free_price_1" value="{$delivery['delivery_free_price']}" class="form-control"/>
					<div class="input-group-addon">{$_W['Lang']['dollarSignCn']}免配送费</div>
				</div>
				<br>
				<div class="input-group">
					<div class="input-group-addon">每单</div>
					<input type="text" name="delivery_fee" value="{$delivery['delivery_fee']}" required="true" class="form-control"/>
					<div class="input-group-addon">{$_W['Lang']['dollarSignCn']}</div>
				</div>
				<div class="help-block">
					如需单独设置某个门店的配送模式,配送费,配送时间段等信息, 请到"<a href="{php echo iurl('merchant/account/index');}" target="_blank">财务中心-门店账户</a>"进行设置.
					<br/>
					此项设置: 商家使用平台配送模式后, 下单人需要支付的配送费.使用平台配送模式后, 商家将不能自己变更配送费, 只能由平台管理员设置配送费.
				</div>
			</div>
		</div>
		<div class="form-group delivery-fee-mode delivery-fee-mode-2" {if $delivery['delivery_fee_mode'] == 2}style="display: block"{/if}>
			<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
			<div class="col-sm-9 col-xs-12">
				<div class="input-group">
					<div class="input-group-addon">起送价</div>
					<input type="number" name="send_price_2" value="{$delivery['send_price']}" class="form-control"/>
					<div class="input-group-addon">{$_W['Lang']['dollarSignCn']}</div>
					<div class="input-group-addon">满</div>
					<input type="number" name="delivery_free_price_2" value="{$delivery['delivery_free_price']}" class="form-control"/>
					<div class="input-group-addon">{$_W['Lang']['dollarSignCn']}免配送费</div>
				</div>
				<br>
				<div class="input-group">
					<span class="input-group-addon">起步价</span>
					<input type="text" class="form-control" name="start_fee" required="true" value="{$delivery['delivery_fee']['start_fee']}">
					<span class="input-group-addon">{$_W['Lang']['dollarSignCn']}包含</span>
					<input type="text" class="form-control" name="start_km" required="true" value="{$delivery['delivery_fee']['start_km']}">
					<span class="input-group-addon">公里,每增加1公里加</span>
					<input type="number" class="form-control" name="pre_km_fee" value="{$delivery['delivery_fee']['pre_km_fee']}">
					<span class="input-group-addon">{$_W['Lang']['dollarSignCn']}</span>
				</div>
				<br>
				<div class="input-group">
					<span class="input-group-addon">超出</span>
					<input type="number" class="form-control" name="over_km" value="{$delivery['delivery_fee']['over_km']}">
					<span class="input-group-addon">公里后,每增加1公里加</span>
					<input type="number" class="form-control" name="over_pre_km_fee" value="{$delivery['delivery_fee']['over_pre_km_fee']}">
					<span class="input-group-addon">{$_W['Lang']['dollarSignCn']},最高收取</span>
					<input type="number" class="form-control" name="max_fee" value="{$delivery['delivery_fee']['max_fee']}">
					<span class="input-group-addon">{$_W['Lang']['dollarSignCn']}</span>
				</div>
				<div class="help-block">
					<strong class="text-danger">
						计费规则:例如设置 起步3km内5{$_W['Lang']['dollarSignCn']},每增加 1km 加 1 {$_W['Lang']['dollarSignCn']},超过6km,每增加 1km 加 2 {$_W['Lang']['dollarSignCn']}。如果配送距离5km,配送费:5 + (5-3)X 1 = 7{$_W['Lang']['dollarSignCn']};配送距离8km,配送费:5 + (8-3)X 2 = 15{$_W['Lang']['dollarSignCn']}。
					</strong>
				</div>
				<div class="help-block">
					<strong class="text-danger">
						特别注意: 设置按照"按距离收取"配送费后,系统会自动变更使用"平台配送"模式商家的某些配置。包括:收货地址被设置为自动获取, 超过配送范围是仍可下单
					</strong>
					<br/>
				</div>
				<div class="input-group" style="width: 80%;">
					<label class="col-xs-12 col-sm-2 col-md-2 control-label">路径计算方式</label>
					<div class="col-sm-9 col-xs-12">
						<div class="radio radio-inline">
							<input type="radio" name="distance_type" value="0" id="distance_type-0" {if $delivery['delivery_fee']['distance_type'] == 0}checked{/if}>
							<label for="distance_type-0">直线距离</label>
						</div>
						<div class="radio radio-inline">
							<input type="radio" name="distance_type" value="2" id="distance_type-2" {if $delivery['delivery_fee']['distance_type'] == 2}checked{/if}>
							<label for="distance_type-2">骑行规划距离</label>
						</div>
						<div class="radio radio-inline">
							<input type="radio" name="distance_type" value="1" id="distance_type-1" {if $delivery['delivery_fee']['distance_type'] == 1}checked{/if}>
							<label for="distance_type-1">驾车导航距离</label>
						</div>
						<div class="radio radio-inline">
							<input type="radio" name="distance_type" value="3" id="distance_type-3" {if $delivery['delivery_fee']['distance_type'] == 3}checked{/if}>
							<label for="distance_type-3">步行距离</label>
						</div>
						<div class="help-block">提示:设置为按步行距离计算,如果距离超过5千米,系统会自动按骑行距离计算;设置的按骑行距离计算,如果距离过长,系统会自动按驾车距离计算。</div>
					</div>
				</div>
				<div class="input-group" style="width: 80%;">
					<label class="col-xs-12 col-sm-2 col-md-2 control-label">配送距离取整</label>
					<div class="col-sm-9 col-xs-12">
						<div class="radio radio-inline">
							<input type="radio" name="calculate_distance_type" id="calculate_distance_type-0" value="0" {if $delivery['delivery_fee']['calculate_distance_type'] == 0 || !$delivery['delivery_fee']['calculate_distance_type']}checked{/if}>
							<label for="calculate_distance_type-0">默认</label>
						</div>
						<div class="radio radio-inline">
							<input type="radio" name="calculate_distance_type" id="calculate_distance_type-1" value="1" {if $delivery['delivery_fee']['calculate_distance_type'] == 1}checked{/if}>
							<label for="calculate_distance_type-1">向上取整</label>
						</div>
						<div class="radio radio-inline">
							<input type="radio" name="calculate_distance_type" id="calculate_distance_type-2" value="2" {if $delivery['delivery_fee']['calculate_distance_type'] == 2}checked{/if}>
							<label for="calculate_distance_type-2">向下取整</label>
						</div>
						<div class="help-block">例:配送距离为3.5公里,向上取整为4公里,向下取整为3公里,默认为不变</div>
					</div>
				</div>
			</div>
		</div>
		<div class="form-group delivery-fee-mode delivery-fee-mode-3" {if $delivery['delivery_fee_mode'] == 3}style="display: block"{/if}>
			<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
			<div class="col-sm-9 col-xs-12">
				{itemplate 'store/shop/geofence'}
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">商家额外承担配送费</label>
			<div class="col-sm-9 col-xs-12">
				<div class="input-group">
					<span class="input-group-addon">每单</span>
					<input type="number" name="store_bear_deliveryprice" class="form-control" value="{$delivery['delivery_extra']['store_bear_deliveryprice']}">
					<span class="input-group-addon">{$_W['Lang']['dollarSignCn']}</span>
				</div>
				<span class="help-block">设置了商家额外承担配送费,将会从商家利润中扣除相应的这部分金额<br>此项设置的费用将进入平台的收益,与配送员的订单提成没有关系</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">平台额外补贴配送员</label>
			<div class="col-sm-9 col-xs-12">
				<div class="input-group">
					<span class="input-group-addon">每单</span>
					<input type="number" name="plateform_bear_deliveryprice" class="form-control" value="{$delivery['delivery_extra']['plateform_bear_deliveryprice']}">
					<span class="input-group-addon">{$_W['Lang']['dollarSignCn']}</span>
				</div>
				<span class="help-block">此项设置的费用将在配送员订单提成的基础上,额外给配送员加上此费用,属于平台针对某个商户的订单,额外补贴给配送员的费用。如果您不需要此功能,请忽略此设置</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">满金额免配送费由谁承担</label>
			<div class="col-sm-9 col-xs-12">
				<div class="radio radio-inline">
					<input type="radio" name="delivery_free_bear" id="delivery_free_bear-plateform" value="plateform" {if $delivery['delivery_extra']['delivery_free_bear'] == 'plateform' || !$delivery['delivery_extra']['delivery_free_bear']}checked{/if}>
					<label for="delivery_free_bear-plateform">平台</label>
				</div>
				<div class="radio radio-inline">
					<input type="radio" name="delivery_free_bear" id="delivery_free_bear-store" value="store" {if $delivery['delivery_extra']['delivery_free_bear'] == 'store'}checked{/if}>
					<label for="delivery_free_bear-store">商家</label>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">配送时间段</label>
			<div class="col-sm-9 col-xs-12">
				<div class="input-group">
					<span class="input-group-addon">间隔</span>
					<input type="text" class="form-control" name="pre_delivery_time_minute" required="true" digits="true" value="{$delivery['pre_delivery_time_minute']}">
					<span class="input-group-addon">分钟</span>
					<div class="input-group-btn btn-build-delivery-time">
						<a href="javascript:;" class="btn btn-primary">生成配送时间段</a>
					</div>
				</div>
				<div class="help-block">
					建议配送时间段间隔不小于15分钟
				</div>
			</div>
		</div>
		<div id="delivery-times" class="delivery-times">
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
				<div class="col-sm-9 col-xs-12 containter">
					{loop $delivery_times $time}
						<div class="col-sm-6">
							<div class="input-group">
								<span class="input-group-addon">{$time['start']} ~ {$time['end']}</span>
								<span class="input-group-addon">附加费</span>
								<input type="text" class="form-control" name="times[fee][]" value="{$time['fee']}" placeholder="增加附加费">
								<input type="hidden" name="times[start][]" value="{$time['start']}"/>
								<input type="hidden" name="times[end][]" value="{$time['end']}"/>
								<input type="hidden" name="times[status][]" value="{$time['status']}">
								<span class="input-group-addon">{$_W['Lang']['dollarSignCn']}</span>
								<div class="input-group-btn">
									<a href="javascript:;" class="btn btn-delivery-time-item {if $time['status'] == 1}btn-success{else}btn-default{/if}">{if $time['status'] == 1}使用中{else}已弃用{/if}</a>
								</div>
							</div>
						</div>
					{/loop}
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">将配送模式和配送费同步到商户</label>
			<div class="col-sm-9 col-xs-12 toggle-tabs" data-content=".sync-type">
				<div class="input-group">
					<div class="radio radio-inline">
						<input type="radio" name="delivery_sync" id="delivery-sync-1" value="1" checked/>
						<label for="delivery-sync-1" class="toggle-role" data-target="sync-type-1">同步到所有商户</label>
					</div>
					<div class="radio radio-inline">
						<input type="radio" value="2" name="delivery_sync" id="delivery-sync-2">
						<label for= "delivery-sync-2" class="toggle-role" data-target="sync-type-2">同步到指定商户</label>
					</div>
				</div>
				<div class="help-block">同步后,所有商户的配送员模式都会被设置为这个规则</div>
			</div>
		</div>
		<div class="toggle-content sync-type">
			<div class="toggle-pane" id="sync-type-2">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
					<div class="col-sm-9 col-xs-12">
						{loop $stores $store}
							<div class="col-xs-3">
								<div class="checkbox checkbox-inline">
									<input type="checkbox" value="{$store['id']}" name="store_ids[]" id="store_{$store['id']}">
									<label for="store_{$store['id']}">{$store['title']}</label>
								</div>
							</div>
						{/loop}
					</div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-9 col-xs-9 col-md-9">
				<input type="submit" value="提交" class="btn btn-primary">
			</div>	
		</div>
	</form>
	<form class="form-horizontal form form-validate" id="form2" action="" method="post" enctype="multipart/form-data">
		<h3>免配送费</h3>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">满免配送费</label>
			<div class="col-sm-9 col-xs-12">
				<div class="input-group">
					<div class="input-group-addon">满</div>
					<input type="number" name="delivery_free_price_1" value="" class="form-control"/>
					<div class="input-group-addon">{$_W['Lang']['dollarSignCn']}免配送费</div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">将以上设置</label>
			<div class="col-sm-9 col-xs-12 toggle-tabs" data-content=".sync-type">
				<div class="input-group" >
					<div class="radio radio-inline">
						<input type="radio" name="extra_sync" id="extra-sync-3" value="1" checked/>
						<label for="extra-sync-3" class="toggle-role" data-target="sync-type-3">同步到所有商户</label>
					</div>
					<div class="radio radio-inline">
						<input type="radio" value="2" name="extra_sync" id="extra_sync-4"/>
						<label for="extra_sync-4" class="toggle-role" data-target="sync-type-4">同步到指定商户</label>
					</div>
				</div>
			</div>
		</div>
		<div class="toggle-content sync-type">
			<div class="toggle-pane" id="sync-type-4">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
					<div class="col-sm-9 col-xs-12">
						{loop $stores $store}
							<div class="col-xs-3">
								<div class="checkbox checkbox-inline">
									<input type="checkbox" value="{$store['id']}" name="store_ids[]" id="from2_store_{$store['id']}">
									<label for="from2_store_{$store['id']}">{$store['title']}</label>
								</div>
							</div>
						{/loop}
					</div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-9 col-xs-9 col-md-9">
				<input type="submit" value="提交" class="btn btn-primary">
			</div>	
		</div>
	</form>
	<form class="form-horizontal form form-validate" id="form3" action="" method="post" enctype="multipart/form-data">
		<input type="hidden" name="form_type" value="reserve">
		<h3>预定单设置</h3>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">非营业时间下单</label>
			<div class="col-sm-9 col-xs-9 col-md-9">
				<div class="radio radio-inline">
					<input type="radio" name="rest_can_order" value="1" id="rest_can_order-1" {if $reserve['rest_can_order'] == 1}checked{/if}>
					<label for="rest_can_order-1">可非营业时间下单</label>
				</div>
				<div class="radio radio-inline">
					<input type="radio" name="rest_can_order" value="0" id="rest_can_order-0" {if $reserve['rest_can_order'] == 0 || !$reserve['rest_can_order']}checked{/if}>
					<label for="rest_can_order-0">不可非营业时间下单</label>
				</div>
				<span class="help-block">如果选择“可非营业时间下单”,用户可在门店营业时间外下预订单,并选择营业时间段内的某个时间送达。请务必关注用户预订单要求的送达时间,该预订单在门店营业时间开始后5分钟还未处理将会被系统自动取消,请在营业时间开始之前及时查看预订单并处理</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">预订单设置</label>
			<div class="col-sm-9 col-xs-12">
				<div class="input-group">
					<div class="input-group-addon">下单时间距离送达时间超过</div>
					<input type="text" class="form-control" name="reserve[reserve_time_limit]" value="{$reserve['reserve']['reserve_time_limit']}">
					<div class="input-group-addon">分钟 属于预定单</div>
					<div class="input-group-addon">距离送达时间</div>
					<input type="text" class="form-control" name="reserve[notice_clerk_before_delivery]" value="{$reserve['reserve']['notice_clerk_before_delivery']}">
					<div class="input-group-addon">分钟通知商户备餐</div>
				</div>
				<span class="help-block">
					<span class="text-danger"></span>
				</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">将预定单设置</label>
			<div class="col-sm-9 col-xs-12 toggle-tabs" data-content=".sync-type">
				<div class="input-group" >
					<div class="radio radio-inline">
						<input type="radio" name="reserve_sync" id="extra-sync-reserve-1" value="1" checked/>
						<label for="extra-sync-reserve-1" class="toggle-role" data-target="extra-sync-reserve-1">同步到所有商户</label>
					</div>
					<div class="radio radio-inline">
						<input type="radio" value="2" name="reserve_sync" id="extra-sync-reserve-2"/>
						<label for="extra-sync-reserve-2" class="toggle-role" data-target="extra-sync_reserve-2">同步到指定商户</label>
					</div>
				</div>
			</div>
		</div>
		<div class="toggle-content sync-type">
			<div class="toggle-pane" id="extra-sync_reserve-2">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
					<div class="col-sm-9 col-xs-12">
						{loop $stores $store}
						<div class="col-xs-3">
							<div class="checkbox checkbox-inline">
								<input type="checkbox" value="{$store['id']}" name="store_ids[]" id="reserve_store_{$store['id']}">
								<label for="reserve_store_{$store['id']}">{$store['title']}</label>
							</div>
						</div>
						{/loop}
					</div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-9 col-xs-9 col-md-9">
				<input type="submit" value="提交" class="btn btn-primary">
			</div>
		</div>
	</form>
	<form class="form-horizontal form form-validate" id="form4" action="" method="post" enctype="multipart/form-data">
		<input type="hidden" name="form_type" value="pindan">
		<h3>拼单设置</h3>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">开启拼单</label>
			<div class="col-sm-9 col-xs-9 col-md-9">
				<div class="radio radio-inline">
					<input type="radio" name="pindan_status" value="1" id="pindan_status-1" {if $pindan['pindan_status'] == 1}checked{/if}>
					<label for="pindan_status-1">开启</label>
				</div>
				<div class="radio radio-inline">
					<input type="radio" name="pindan_status" value="0" id="pindan_status-0" {if $pindan['pindan_status'] == 0 || !$pindan['pindan_status']}checked{/if}>
					<label for="pindan_status-0">关闭</label>
				</div>
				<span class="help-block">同步到商户之后才能生效</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">将拼单设置</label>
			<div class="col-sm-9 col-xs-12 toggle-tabs" data-content=".sync-type">
				<div class="input-group" >
					<div class="radio radio-inline">
						<input type="radio" name="pindan_sync" id="extra-sync-pindan-1" value="1" checked/>
						<label for="extra-sync-pindan-1" class="toggle-role" data-target="extra-sync_pindan-1">同步到所有商户</label>
					</div>
					<div class="radio radio-inline">
						<input type="radio" value="2" name="pindan_sync" id="extra-sync-pindan-2"/>
						<label for="extra-sync-pindan-2" class="toggle-role" data-target="extra-sync_pindan-2">同步到指定商户</label>
					</div>
				</div>
			</div>
		</div>
		<div class="toggle-content sync-type">
			<div class="toggle-pane" id="extra-sync_pindan-2">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
					<div class="col-sm-9 col-xs-12">
						{loop $stores $store}
							<div class="col-xs-3">
								<div class="checkbox checkbox-inline">
									<input type="checkbox" value="{$store['id']}" name="store_ids[]" id="pindan_store_{$store['id']}">
									<label for="pindan_store_{$store['id']}">{$store['title']}</label>
								</div>
							</div>
						{/loop}
					</div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-9 col-xs-9 col-md-9">
				<input type="submit" value="提交" class="btn btn-primary">
			</div>
		</div>
	</form>
</div>
<script id="tpl-delivery-time" type="text/html">
	<{# for(var i = 0, len = d.length; i < len; i++){ }>
		<div class="col-sm-6">
			<div class="input-group">
				<span class="input-group-addon"><{d[i].start}> ~ <{d[i].end}></span>
				<span class="input-group-addon">附加费</span>
				<input type="text" class="form-control" name="times[fee][]" value="<{d[i].fee}>" placeholder="增加附加费">
				<input type="hidden" name="times[start][]" value="<{d[i].start}>"/>
				<input type="hidden" name="times[end][]" value="<{d[i].end}>"/>
				<input type="hidden" name="times[status][]" value="1">
				<span class="input-group-addon">{$_W['Lang']['dollarSignCn']}</span>
				<div class="input-group-btn">
					<a href="javascript:;" class="btn btn-success btn-delivery-time-item">使用中</a>
				</div>
			</div>
		</div>
	<{# } }>
</script>
<script>
$(function(){
	$('#form1').submit(function(){
		var delivery_times_length = $('#delivery-times .containter .input-group').size();
		if(!delivery_times_length) {
			Notify.error('请先生成配送时间段');
			return false;
		}
	});

	$(document).on('click', '.btn-build-delivery-time', function(){
		var pre_minute = parseInt($.trim($(':text[name="pre_delivery_time_minute"]').val()));
		if(pre_minute < 15) {
			Notify.alert('建议配送时间段间隔不小于15分钟');
			return false;
		}
		$.post("{php echo iurl('common/utility/build_time');}", {pre_minute: pre_minute}, function(data) {
			var result = $.parseJSON(data);
			if(result.message.errno == -1) {
				Notify.error(result.message.message);
				return false;
			}
			var gettpl = $('#tpl-delivery-time').html();
			irequire(['laytpl'], function(laytpl){
				laytpl(gettpl).render(result.message.message, function(html){
					$('#delivery-times .containter').html(html);
				});
			});
		});
	});

	$(document).on('click', '.btn-delivery-time-item', function(){
		if($(this).hasClass('btn-success')) {
			$(this).parent().prev().prev().val(0);
			$(this).removeClass('btn-success').addClass('btn-default');
			$(this).html('已弃用');
		} else {
			$(this).parent().prev().prev().val(1);
			$(this).removeClass('btn-default').addClass('btn-success');
			$(this).html('使用中');
		}
	});
});
</script>
{itemplate 'public/footer'}

下载地址:
啦啦外卖独立版40.4最新外卖源码全开源
本文来自多重色彩