录入订单

This commit is contained in:
hant 2025-06-14 15:00:27 +08:00
parent f4ffaabbfc
commit e5ffa674b0
2 changed files with 22 additions and 4 deletions

View File

@ -261,6 +261,7 @@ class Order extends Backend
}
$params['status'] = 10;
$params['total'] = $params['online_amount'] ?? 0;
$params['dispatch_type'] = $params['dispatch_type'] ?? 2;
$params['order_no'] = $this->generateOrderNumber();
$params['create_time'] = date('Y-m-d H:i:s');
$params['update_time'] = date('Y-m-d H:i:s');

View File

@ -654,7 +654,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
// 如果还没有选择地址,且列表中有内容,则默认选择第一个
if (!addressSelected && $('#suggestionList li').length > 0) {
$('#suggestionList li').first().trigger('mousedown');
choseFirst();
}
$('#suggestionList').hide();
@ -727,7 +727,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
let html = '';
res.tips.forEach(tip => {
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}
</li>`;
}
@ -751,16 +751,33 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
$('#suggestionList').on('mousedown', 'li', function (e) {
const name = $(this).data('name');
const location = $(this).data('location'); // "经度,纬度"
const area_id = $(this).data('area_id'); // "经度,纬度"
const [lng, lat] = location.split(',');
console.log('click');
// $('#c-address').val(name);
$('#c-address').val(name);
$('#lng').val(lng);
$('#lat').val(lat);
$('#area_id').val(area_id);
// 隐藏提示列表
$('#suggestionList').hide();
selectedIndex = -1;
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;
}
}
}
};