| | |
| | | data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 |
| | | success: function(response) { |
| | | Feng.success("上架成功!"); |
| | | window.parent.TQuestion.table.refresh(); |
| | | TQuestion.table.refresh(); |
| | | }, |
| | | error: function(xhr, status, error) { |
| | | var errorMessage = xhr.responseText ? xhr.responseText : "上架失败!"; |
| | |
| | | data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 |
| | | success: function(response) { |
| | | Feng.success("下架成功!"); |
| | | window.parent.TQuestion.table.refresh(); |
| | | TQuestion.table.refresh(); |
| | | |
| | | }, |
| | | error: function(xhr, status, error) { |
| | | var errorMessage = xhr.responseText ? xhr.responseText : "下架失败!"; |
| | |
| | | data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 |
| | | success: function(response) { |
| | | Feng.success("删除成功!"); |
| | | window.parent.TQuestion.table.refresh(); |
| | | TQuestion.table.refresh(); |
| | | }, |
| | | error: function(xhr, status, error) { |
| | |
| | | var addButton = document.getElementById('addButton'); |
| | | addButton.addEventListener('click', function () { |
| | | var phoneRegex = /^1[0-9]{10}$/; |
| | | var landlineRegex = /^\d{4}-\d{7}$/; |
| | | |
| | | var inputField = document.getElementById('addPhone'); |
| | | var dataContainer = document.getElementById('phone'); |
| | | var inputData = inputField.value.trim(); |
| | | if (TQuestion.dataCount>=2){ |
| | | Feng.info("最多添加两个客服电话!"); |
| | | // todo 添加正则表达式验证电话号码合法性 |
| | | }else if(!phoneRegex.test(inputData)){ |
| | | }else if(!phoneRegex.test(inputData)&&!landlineRegex.test(inputData)){ |
| | | Feng.info("客服电话不合法,请重新输入!"); |
| | | }else { |
| | | if (inputData !== '' || document.querySelectorAll('.data-item').length !==0) { |