|
@ -68,15 +68,6 @@ |
|
|
|
|
|
|
|
|
<div class="row"> </div> |
|
|
<div class="row"> </div> |
|
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
|
|
<label for="method">古方识别<font color='red'></font>:</label> |
|
|
|
|
|
<textarea rows="5" cols="70" id="shibie_text"></textarea> |
|
|
|
|
|
|
|
|
|
|
|
<button class="button info next" id="shibie_btn"><span class="tdesc_text" onclick="submitShibie(this)" style="color:white;">识别</span></button> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="row"> </div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="row" style="position:relative;"> |
|
|
<div class="row" style="position:relative;"> |
|
|
<label>药材<font color='red'>*</font>:</label> |
|
|
<label>药材<font color='red'>*</font>:</label> |
|
|
<button class="add-button" type="button" onclick="addIngredient()">+</button> |
|
|
<button class="add-button" type="button" onclick="addIngredient()">+</button> |
|
@ -123,7 +114,8 @@ |
|
|
<!-- 批量上传 <div id="onetickupload"></div> --> |
|
|
<!-- 批量上传 <div id="onetickupload"></div> --> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<textarea cols="200" rows="20" style="margin-top: 20px"></textarea> |
|
|
<textarea cols="100" rows="10" style="margin-top: 20px" id="shibie_text"></textarea> |
|
|
|
|
|
<button class="button info next" style="margin-top: 20px" id="shibie_btn" onclick="submitShibie(this)" >识别</button> |
|
|
<!--end of main section--> |
|
|
<!--end of main section--> |
|
|
</div><!--end of container--> |
|
|
</div><!--end of container--> |
|
|
</section><!--end of #page--> |
|
|
</section><!--end of #page--> |
|
@ -262,18 +254,21 @@ |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function submitShibie(obj) { |
|
|
function submitShibie() { |
|
|
obj.disabled = true; |
|
|
const text = document.getElementById('shibie_text').value; |
|
|
|
|
|
const lines = text.split('\n'); |
|
|
const original = document.getElementById('shibie_text').value; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let name = lines[0]; |
|
|
|
|
|
let original = lines[1]; |
|
|
|
|
|
let method = lines[2]; |
|
|
|
|
|
document.getElementById('name').value = name; |
|
|
|
|
|
document.getElementById('method').value = method; |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
url: '/admin/ajax_shibie_original', // 替换为你的服务器端处理文件 |
|
|
url: '/admin/ajax_shibie_original', // 替换为你的服务器端处理文件 |
|
|
type: 'POST', |
|
|
type: 'POST', |
|
|
data: {original:original}, |
|
|
data: {original:original}, |
|
|
dataType: 'json', |
|
|
dataType: 'json', |
|
|
success: function (response) { |
|
|
success: function (response) { |
|
|
obj.disabled = false; |
|
|
|
|
|
if (response.status == true) { |
|
|
if (response.status == true) { |
|
|
if (Array.isArray(response.data)) { |
|
|
if (Array.isArray(response.data)) { |
|
|
document.getElementById('ingredient-list').innerHTML = ''; |
|
|
document.getElementById('ingredient-list').innerHTML = ''; |
|
@ -281,7 +276,7 @@ |
|
|
addIngredient(row.herb_name,row.herb_desc,row.herb_num) |
|
|
addIngredient(row.herb_name,row.herb_desc,row.herb_num) |
|
|
}); |
|
|
}); |
|
|
}else{ |
|
|
}else{ |
|
|
console.log('识别失败') |
|
|
showAlert('识别失败') |
|
|
} |
|
|
} |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|