录入订单
This commit is contained in:
parent
f4ffaabbfc
commit
e5ffa674b0
|
|
@ -261,6 +261,7 @@ class Order extends Backend
|
||||||
}
|
}
|
||||||
$params['status'] = 10;
|
$params['status'] = 10;
|
||||||
$params['total'] = $params['online_amount'] ?? 0;
|
$params['total'] = $params['online_amount'] ?? 0;
|
||||||
|
$params['dispatch_type'] = $params['dispatch_type'] ?? 2;
|
||||||
$params['order_no'] = $this->generateOrderNumber();
|
$params['order_no'] = $this->generateOrderNumber();
|
||||||
$params['create_time'] = date('Y-m-d H:i:s');
|
$params['create_time'] = date('Y-m-d H:i:s');
|
||||||
$params['update_time'] = date('Y-m-d H:i:s');
|
$params['update_time'] = date('Y-m-d H:i:s');
|
||||||
|
|
|
||||||
|
|
@ -654,7 +654,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
|
||||||
|
|
||||||
// 如果还没有选择地址,且列表中有内容,则默认选择第一个
|
// 如果还没有选择地址,且列表中有内容,则默认选择第一个
|
||||||
if (!addressSelected && $('#suggestionList li').length > 0) {
|
if (!addressSelected && $('#suggestionList li').length > 0) {
|
||||||
$('#suggestionList li').first().trigger('mousedown');
|
choseFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#suggestionList').hide();
|
$('#suggestionList').hide();
|
||||||
|
|
@ -727,7 +727,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
|
||||||
let html = '';
|
let html = '';
|
||||||
res.tips.forEach(tip => {
|
res.tips.forEach(tip => {
|
||||||
if (tip.location) {
|
if (tip.location) {
|
||||||
html += `<li data-name="${tip.district} ${tip.name}" data-location="${tip.location}">
|
html += `<li data-name="${tip.district} ${tip.name}" data-area_id="${tip.adcode}" data-location="${tip.location}">
|
||||||
${tip.district} ${tip.name}
|
${tip.district} ${tip.name}
|
||||||
</li>`;
|
</li>`;
|
||||||
}
|
}
|
||||||
|
|
@ -751,16 +751,33 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
|
||||||
$('#suggestionList').on('mousedown', 'li', function (e) {
|
$('#suggestionList').on('mousedown', 'li', function (e) {
|
||||||
const name = $(this).data('name');
|
const name = $(this).data('name');
|
||||||
const location = $(this).data('location'); // "经度,纬度"
|
const location = $(this).data('location'); // "经度,纬度"
|
||||||
|
const area_id = $(this).data('area_id'); // "经度,纬度"
|
||||||
const [lng, lat] = location.split(',');
|
const [lng, lat] = location.split(',');
|
||||||
console.log('click');
|
$('#c-address').val(name);
|
||||||
// $('#c-address').val(name);
|
|
||||||
$('#lng').val(lng);
|
$('#lng').val(lng);
|
||||||
$('#lat').val(lat);
|
$('#lat').val(lat);
|
||||||
|
$('#area_id').val(area_id);
|
||||||
// 隐藏提示列表
|
// 隐藏提示列表
|
||||||
$('#suggestionList').hide();
|
$('#suggestionList').hide();
|
||||||
selectedIndex = -1;
|
selectedIndex = -1;
|
||||||
addressSelected = true;
|
addressSelected = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function choseFirst(){
|
||||||
|
const first = $('#suggestionList li').first();
|
||||||
|
const name = first.data('name');
|
||||||
|
const location = first.data('location'); // "经度,纬度"
|
||||||
|
const area_id = first.data('area_id'); // "经度,纬度"
|
||||||
|
const [lng, lat] = location.split(',');
|
||||||
|
console.log('chose');
|
||||||
|
$('#lng').val(lng);
|
||||||
|
$('#lat').val(lat);
|
||||||
|
$('#area_id').val(area_id);
|
||||||
|
// 隐藏提示列表
|
||||||
|
$('#suggestionList').hide();
|
||||||
|
selectedIndex = -1;
|
||||||
|
addressSelected = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user