Commit 8d67920c by 杨树贤

添加隐藏逻辑

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