Commit 18016f2c by LJM

js

parent cccc9bf5
......@@ -165,6 +165,23 @@ layui.use(['form', 'table', 'laydate'], function () {
},
handleBind: function () {
//国家/地区
$(document).on('change', 'select[name="country"]', function () {
var country_name = $(this).find('option:selected').text();
var type = $(this).attr('data');
if (type == 1) {
//收货信息
layui.form.val('receiveInfo', {
country_name: country_name
})
} else {
//账单邮寄信息
layui.form.val('billingInfo', {
country_name: country_name
})
}
});
//收货信息
layui.form.on('submit(receiveInfoSubmit)', function (data) {
var text = $(data.elem).text();
......@@ -189,6 +206,30 @@ layui.use(['form', 'table', 'laydate'], function () {
return false;
});
//账单邮寄信息
layui.form.on('submit(billingInfoSubmit)', function (data) {
var text = $(data.elem).text();
if (text == '修改') {
$(data.elem).text('保存');
$(data.elem).next().show();
$(data.elem).parent().parent().find('.show').prev().hide();
$(data.elem).parent().parent().find('.show').show();
return false;
} else {
Request('/api/order/editOrderAdress', 'POST', data.field, function (res) {
if (res.code == 0) {
layer.msg('操作成功', {shift: 0, time: 2000}, function () {
layer.closeAll();
window.location.reload();
});
} else {
layer.msg(res.msg);
}
});
}
return false;
});
//结算信息
layui.form.on('submit(settlementInfoSubmit)', function (data) {
var text = $(data.elem).text();
......@@ -230,6 +271,39 @@ layui.use(['form', 'table', 'laydate'], function () {
$("#order_total_amount").empty().text(freight_charge + pay_commission + order_amount);
}, 800))
//同收货地址
layui.form.on('switch(switchChange)', function (data) {
if (data.elem.checked) {
layui.form.val('billingInfo', {
shipping_name: layui.form.val('receiveInfo').shipping_name,
shipping_sn: layui.form.val('receiveInfo').shipping_sn,
consignee: layui.form.val('receiveInfo').consignee,
company_name: layui.form.val('receiveInfo').company_name,
email: layui.form.val('receiveInfo').email,
phone: layui.form.val('receiveInfo').phone,
country: layui.form.val('receiveInfo').country,
province: layui.form.val('receiveInfo').province,
city: layui.form.val('receiveInfo').city,
post_code: layui.form.val('receiveInfo').post_code,
detail_address: layui.form.val('receiveInfo').detail_address
})
} else {
layui.form.val('billingInfo', {
shipping_name: '',
shipping_sn: '',
consignee: '',
company_name: '',
email: '',
phone: '',
country: '',
province: '',
city: '',
post_code: '',
detail_address: ''
})
}
});
return this;
}
}
......
......@@ -8,32 +8,6 @@
font-size: 15px !important;
}
.row {
display: flex;
flex-direction: row;
}
.column {
display: flex;
flex-direction: column;
}
.bothSide {
justify-content: space-between;
}
.avarage {
justify-content: space-around;
}
.rowCenter {
justify-content: center;
}
.verCenter {
align-items: center;
}
.order-page {
padding: 20px;
}
......@@ -250,11 +224,11 @@
<div class="layui-form-mid mid-width">{{$info['receiveInfo']['country_name']}}</div>
<div class="show" style="display: none;width: 158px;">
<input type="hidden" name="country_name" value="">
<select name="country" lay-ignore="" style="height: 30px;border: 1px solid #eee;background: transparent;width: 100%;">
<select data="1" name="country" style="height: 30px;border: 1px solid #eee;background: transparent;width: 100%;">
<option value="">请选择国家</option>
@foreach(\App\Models\Country::getCountryMap() as $cid=>$cname)
<option data=">{{$cname}}" value="{{$cid}}">{{$cname}}</option>
<option data="{{$cname}}" value="{{$cid}}">{{$cname}}</option>
@endforeach
</select>
</div>
</div>
......@@ -287,7 +261,7 @@
<label class="layui-form-label">地址:</label>
<div class="layui-input-block">
<div class="layui-form-mid">{{$info['receiveInfo']['detail_address']}}</div>
<input type="text" class="layui-input show" name="detail_address" placeholder="请输入地址" value="{{$info['receiveInfo']['detail_address']}}" style="display: none;">
<input type="text" class="layui-input show" name="detail_address" placeholder="请输入地址" value="{{$info['receiveInfo']['detail_address']}}" style="display: none;width: 427px;">
</div>
</div>
</div>
......@@ -299,21 +273,24 @@
<div class="layui-card-header">账单邮寄信息</div>
<div class="layui-card-body layui-form" lay-filter="billingInfo">
<input type="hidden" name="order_id" value="{{$info['receiveInfo']['order_id']}}">
<input type="hidden" name="order_address_type" value="2">
<div class="btn-box">
<button class="layui-btn layui-btn-sm" lay-event="add">修改</button>
<a class="layui-btn layui-btn-sm layui-btn-primary canel" style="margin-left: 0;margin-top: 10px;">取消</a>
<button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="billingInfoSubmit">修改</button>
<button class="layui-btn layui-btn-sm layui-btn-primary canel" lay-submit="" lay-filter="canelSubmit" style="margin-left: 0;margin-top: 10px;">取消</button>
</div>
<div class="layui-form-item mb0">
<div class="layui-inline">
<label class="layui-form-label">快递公司:</label>
<div class="layui-input-block">
<div class="layui-form-mid mid-width">{{$info['billingInfo']['shipping_name']}}</div>
<input type="text" class="layui-input show" name="shipping_name" placeholder="请输入快递公司" value="{{$info['billingInfo']['shipping_name']}}" style="display: none;">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">快递单号:</label>
<div class="layui-input-block">
<div class="layui-form-mid mid-width">{{$info['billingInfo']['shipping_sn']}}</div>
<input type="text" class="layui-input show" name="shipping_sn" placeholder="请输入快递单号" value="{{$info['billingInfo']['shipping_sn']}}" style="display: none;">
</div>
</div>
</div>
......@@ -322,12 +299,14 @@
<label class="layui-form-label">联系人:</label>
<div class="layui-input-block">
<div class="layui-form-mid mid-width">{{$info['billingInfo']['consignee']}}</div>
<input type="text" class="layui-input show" name="consignee" placeholder="请输入联系人" value="{{$info['billingInfo']['consignee']}}" style="display: none;">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">公司名称:</label>
<div class="layui-input-block">
<div class="layui-form-mid mid-width">{{$info['billingInfo']['company_name']}}</div>
<input type="text" class="layui-input show" name="company_name" placeholder="请输入公司名称" value="{{$info['billingInfo']['company_name']}}" style="display: none;">
</div>
</div>
</div>
......@@ -336,12 +315,14 @@
<label class="layui-form-label">邮箱:</label>
<div class="layui-input-block">
<div class="layui-form-mid mid-width">{{$info['billingInfo']['email']}}</div>
<input type="text" class="layui-input show" name="email" placeholder="请输入邮箱" value="{{$info['billingInfo']['email']}}" style="display: none;">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">电话:</label>
<div class="layui-input-block">
<div class="layui-form-mid mid-width">{{$info['billingInfo']['phone']}}</div>
<input type="text" class="layui-input show" name="phone" placeholder="请输入电话" value="{{$info['billingInfo']['phone']}}" style="display: none;">
</div>
</div>
</div>
......@@ -350,12 +331,22 @@
<label class="layui-form-label">国家/地区:</label>
<div class="layui-input-block">
<div class="layui-form-mid mid-width">{{$info['billingInfo']['country_name']}}</div>
<div class="show" style="display: none;width: 158px;">
<input type="hidden" name="country_name" value="">
<select data="2" name="country" style="height: 30px;border: 1px solid #eee;background: transparent;width: 100%;">
<option value="">请选择国家</option>
@foreach(\App\Models\Country::getCountryMap() as $cid=>$cname)
<option data="{{$cname}}" value="{{$cid}}">{{$cname}}</option>
@endforeach
</select>
</div>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">省/州:</label>
<div class="layui-input-block">
<div class="layui-form-mid mid-width">{{$info['receiveInfo']['province']}}</div>
<div class="layui-form-mid mid-width">{{$info['billingInfo']['province']}}</div>
<input type="text" class="layui-input show" name="province" placeholder="请输入省/" value="{{$info['billingInfo']['province']}}" style="display: none;">
</div>
</div>
</div>
......@@ -364,19 +355,25 @@
<label class="layui-form-label">城市:</label>
<div class="layui-input-block">
<div class="layui-form-mid mid-width">{{$info['billingInfo']['city']}}</div>
<input type="text" class="layui-input show" name="city" placeholder="请输入城市" value="{{$info['billingInfo']['city']}}" style="display: none;">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">邮编:</label>
<div class="layui-input-block">
<div class="layui-form-mid mid-width">{{$info['billingInfo']['post_code']}}</div>
<input type="text" class="layui-input show" name="post_code" placeholder="请输入邮编" value="{{$info['billingInfo']['post_code']}}" style="display: none;">
</div>
</div>
</div>
<div class="layui-form-item mb0">
<label class="layui-form-label">地址:</label>
<div class="layui-input-block">
<div class="layui-input-block row verCenter">
<div class="layui-form-mid">{{$info['billingInfo']['detail_address']}}</div>
<input type="text" class="layui-input show" name="detail_address" placeholder="请输入地址" value="{{$info['billingInfo']['detail_address']}}" style="display: none;width: 427px;">
<div class="show row verCenter" style="display: none;margin-left: 15px;">
<input type="checkbox" name="open" lay-skin="switch" lay-filter="switchChange" lay-text="同收货地址|取消">
</div>
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment