This commit is contained in:
nanguaboss
2026-08-06 00:50:23 +08:00
parent 595520822a
commit 2cb688ed46
29 changed files with 5227 additions and 186 deletions
+26 -2
View File
@@ -118,9 +118,14 @@ $(function () {
' <option value="company"' + (m.owner_type === 'company' ? ' selected' : '') + '>企业</option></select></div>' +
' <div class="form-item"><label>归属ID<span class="req">*</span></label><input type="number" name="owner_id" value="' + escHtml(m.owner_id) + '" ' + (isEdit ? 'disabled' : '') + '></div>' +
' <div class="form-item"><label>平台<span class="req">*</span></label>' +
' <select name="platform">' + platformOpts(m.platform) + '</select></div>' +
' <div class="form-item"><label>账号/号码<span class="req">*</span></label><input type="text" name="account_id" value="' + escHtml(m.account_id) + '"></div>' +
' <select name="platform" id="media-platform">' + platformOpts(m.platform) + '</select></div>' +
' <div class="form-item"><label>账号/号码<span class="req">*</span></label>' +
' <div><input type="text" name="account_id" id="media-account" value="' + escHtml(m.account_id) + '">' +
' <div class="geo-hint" id="media-account-geo" style="font-size:12px;color:#2f8f46;margin-top:4px;display:none;"></div></div></div>' +
' <div class="form-item"><label>主页链接</label><input type="text" name="profile_url" value="' + escHtml(m.profile_url) + '"></div>' +
' <div class="form-item"><label>是否常用</label><select name="is_defult">' +
' <option value="0"' + (!m.is_defult ? ' selected' : '') + '>备用</option>' +
' <option value="1"' + (m.is_defult ? ' selected' : '') + '>常用</option></select></div>' +
' <div class="form-item"><label>默认联系方式</label><select name="is_primary">' +
' <option value="0"' + (!m.is_primary ? ' selected' : '') + '>否</option>' +
' <option value="1"' + (m.is_primary ? ' selected' : '') + '>是</option></select></div>' +
@@ -144,6 +149,25 @@ $(function () {
$('#form-cancel').on('click', function () { Dialog.close(idx); });
// 手机号归属地自动识别(平台为 phone 时,录入号码自动识别归属地)
var $geo = $('#media-account-geo');
var bindGeo = function () {
if ($('#media-platform').val() !== 'phone') { $geo.text('').hide(); return; }
$('#media-account').off('blur.geo').on('blur.geo', function () {
var val = $.trim($(this).val());
if (!val) { $geo.text('').hide(); return; }
httpGet('common/phone_geo.php', { phone: val }).then(function (d) {
if (d && d.label && d.label !== '未知') {
$geo.text('归属地:' + d.label).show();
} else {
$geo.text('归属地:未能识别').show();
}
}).catch(function () { $geo.text('').hide(); });
});
};
$('#media-platform').on('change', bindGeo);
bindGeo();
$('#media-form').on('submit', function (e) {
e.preventDefault();
var data = {};