Commit 8d67920c by 杨树贤

添加隐藏逻辑

parent a53605fa
...@@ -154,6 +154,10 @@ ...@@ -154,6 +154,10 @@
}); });
$(document).on('click', '.viewAccount', function () { $(document).on('click', '.viewAccount', function () {
if ($(this).text() === '隐藏') {
$(this).prev().text($(this).attr('prev_text'));
$(this).text('查看');
} else {
let id = $(this).attr('id'); let id = $(this).attr('id');
let type = $(this).attr('type'); let type = $(this).attr('type');
let resp = ajax('/api/supplier_account/GetSupplierAccount', {id: id, type: type}); let resp = ajax('/api/supplier_account/GetSupplierAccount', {id: id, type: type});
...@@ -161,6 +165,8 @@ ...@@ -161,6 +165,8 @@
layer.msg('网络连接失败', {'icon': 5}); layer.msg('网络连接失败', {'icon': 5});
return false; return false;
} }
let prevText = $(this).prev().text();
$(this).attr('prev_text', prevText);
if (resp.err_code === 0) { if (resp.err_code === 0) {
switch (type) { switch (type) {
case 'mobile': case 'mobile':
...@@ -171,10 +177,13 @@ ...@@ -171,10 +177,13 @@
break; break;
} }
console.log(resp); console.log(resp);
$(this).text('隐藏');
} else { } else {
layer.msg(resp.err_msg, {'icon': 5}); layer.msg(resp.err_msg, {'icon': 5});
return false; return false;
} }
}
}); });
}); });
......
...@@ -150,6 +150,10 @@ ...@@ -150,6 +150,10 @@
} }
$(document).on('click', '.viewContact', function () { $(document).on('click', '.viewContact', function () {
if ($(this).text() === '隐藏') {
$(this).prev().text($(this).attr('prev_text'));
$(this).text('查看');
} else {
let contactId = $(this).attr('contact_id'); let contactId = $(this).attr('contact_id');
let type = $(this).attr('type'); let type = $(this).attr('type');
let resp = ajax('/api/supplier_contact/GetSupplierContact', {contact_id: contactId, type: type}); let resp = ajax('/api/supplier_contact/GetSupplierContact', {contact_id: contactId, type: type});
...@@ -157,6 +161,8 @@ ...@@ -157,6 +161,8 @@
layer.msg('网络连接失败', {'icon': 5}); layer.msg('网络连接失败', {'icon': 5});
return false; return false;
} }
let prevText = $(this).prev().text();
$(this).attr('prev_text', prevText);
if (resp.err_code === 0) { if (resp.err_code === 0) {
switch (type) { switch (type) {
case 'supplier_email': case 'supplier_email':
...@@ -172,11 +178,14 @@ ...@@ -172,11 +178,14 @@
$(this).prev().text(resp.data.supplier_telephone); $(this).prev().text(resp.data.supplier_telephone);
break; break;
} }
$(this).text('隐藏');
console.log(resp); console.log(resp);
} else { } else {
layer.msg(resp.err_msg, {'icon': 5}); layer.msg(resp.err_msg, {'icon': 5});
return false; return false;
} }
}
}); });
}); });
</script> </script>
\ No newline at end of file
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