|
|
|
@ -102,9 +102,9 @@ const form = reactive({
|
|
|
|
|
})
|
|
|
|
|
const confirmOrder = () => {
|
|
|
|
|
try {
|
|
|
|
|
const currentExpressNo = parseInt(form.express_no.slice(2)); // 使用 slice 减少计算
|
|
|
|
|
const n = Math.floor(Math.random() * 10) + 1; // 生成 1 到 10 之间的随机数
|
|
|
|
|
form.express_no = `SF${currentExpressNo + n}`; // 将随机数加到当前快递单号上
|
|
|
|
|
const currentExpressNo = parseInt(form.express_no.slice(2));
|
|
|
|
|
const n = Math.floor(Math.random() * 10) + 1;
|
|
|
|
|
form.express_no = `SF${currentExpressNo + n}`;
|
|
|
|
|
store.add(form);
|
|
|
|
|
ElMessage({
|
|
|
|
|
message: '下单成功!',
|
|
|
|
@ -115,7 +115,7 @@ const confirmOrder = () => {
|
|
|
|
|
message: '下单失败,请检查信息!',
|
|
|
|
|
type: 'error'
|
|
|
|
|
});
|
|
|
|
|
console.error('下单错误:', error); // 打印错误信息
|
|
|
|
|
console.error('下单错误:', error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|