新增親友功能

This commit is contained in:
2026-04-13 17:44:13 +08:00
parent 1afb90f3ba
commit a81967ddbd
+31 -7
View File
@@ -139,6 +139,22 @@
</div>
</div>
</div>
<div class="position-fixed top-50 start-50 p-3" style="z-index: 10001" >
<div id="liveToast" class="toast hide " role="alert" aria-live="assertive"
data-bs-delay="3000" aria-atomic="true"
style="color:white;background-color:dimgray;opacity:1;font-size:24px;">
<div class="toast-header">
<!--<img src="..." class="rounded me-2" alt="...">
<strong class="me-auto">Bootstrap</strong>
<small>11 mins ago</small>-->
<strong class="me-auto">提示訊息</strong>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body" id="toast_body">
</div>
</div>
</div>
<script type="text/javascript">
const designer = {
code: {
@@ -199,9 +215,9 @@
.then(res => res.json())
.then(data => { this.phrases = data; })
.catch(err => console.error('載入 phrases.json 失敗:', err));
//this.toast = new bootstrap.Toast($('#familyModal'));
this.toast = new bootstrap.Toast($('#liveToast'));
this.modal = new bootstrap.Modal($('#familyModal'));
//this.toast.hide();
//this.toast.show();
},
async getActItem() {
axios
@@ -1347,13 +1363,20 @@
axios
.post('/api/tablet/saveFamily', pro_order_detail)
.then(response => {
console.log(response);
if (response.status == 200 && response.result == "Y") {
//console.log(response);
if (response.status == 200 && response.data.result == "Y") {
let data = response.data;
this.familyMembers.push(data);
alert("新增成功");
self.familyMembers.push(data.data);
//console.log(self.familyMembers);
//alert("新增成功");
self.modal.toggle();
if (self.selectedElement) {
let element = $(self.selectedElement).children().first();
self.renderItem(element);
}
$("#toast_body").html(`${"新增成功"}`)
self.toast.show();
} else {
}
@@ -1487,6 +1510,7 @@
}
$(() => $(window).on("message", function (event) {
//designer.toast.show();
//designer.reset();
let e = event.originalEvent;
if (e.origin === window.parent.location.origin) {