|
@@ -1,25 +1,46 @@
|
|
|
const $ = require("jquery");
|
|
|
-const {post, config, getUrlArgObject, openNewWin, titleConfig} = require('./promise.js');
|
|
|
+const {get, post, config, getUrlArgObject, openNewWin, titleConfig} = require('./promise.js');
|
|
|
const targetUrl = 'http://114.55.109.16:81/lantone/index';
|
|
|
-
|
|
|
$(function () {
|
|
|
let mrId = getUrlArgObject('mrId')
|
|
|
$(".knowledge .a-link").click(function () {
|
|
|
const code = $(this).attr("code");
|
|
|
- openNewWin(targetUrl + '?page=' + code);
|
|
|
+ openNewWin(targetUrl + '?page=' + code, true);
|
|
|
})
|
|
|
$("#goPush").on("click", function () {
|
|
|
- openNewWin(targetUrl + '?page=bztd');
|
|
|
+ openNewWin(targetUrl + '?page=bztd', true);
|
|
|
});
|
|
|
-
|
|
|
});
|
|
|
|
|
|
-//获取参数
|
|
|
+function getTcmMr(mrId) {
|
|
|
+ post('/sys/mr/getTcmMr', {mrId: mrId}).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ let data = res.data.data || {}
|
|
|
+ const {tcmdisease, tcmsyndrome} = data;
|
|
|
+ if (!tcmdisease) {
|
|
|
+ $(".recipe").hide();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (res.data.code === '0') {
|
|
|
+ getTcmData({tcmDiag: tcmdisease.uniqueName, tcmSyndrome: tcmsyndrome.uniqueName})
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+//获取处方推荐
|
|
|
function getTcmData(param) {
|
|
|
- $("#jibing").text(param.tcmDiag + "-" + param.tcmSyndrome);
|
|
|
- $('#bingming').text(param.tcmDiag);
|
|
|
- $('#zhenghou').text(param.tcmSyndrome);
|
|
|
- post('/lantone/private/zycftj?jibing=' + param.tcmDiag + "&zhengxing=" + param.tcmSyndrome).then((res) => {
|
|
|
+ $(".recipe").show();
|
|
|
+ const {tcmDiag, tcmSyndrome} = param;
|
|
|
+ $("#jibing").text(tcmDiag + "-" + tcmSyndrome);
|
|
|
+ $('#bingming').text(tcmDiag);
|
|
|
+ $('#zhenghou').text(tcmSyndrome);
|
|
|
+ $("#goTreat").on("click", function () {
|
|
|
+ openNewWin(targetUrl + '?page=xftj&jibing=' + tcmDiag + "&zhengxing=" + tcmSyndrome, true);
|
|
|
+ });
|
|
|
+ //处方推荐
|
|
|
+ get('/lantone/private/zycftj?jibing=' + tcmDiag + "&zhengxing=" + tcmSyndrome).then((res) => {
|
|
|
console.log(res)
|
|
|
let data = res.data.data || {}
|
|
|
if (res.data.status) {
|
|
@@ -27,7 +48,16 @@ function getTcmData(param) {
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
+ })
|
|
|
+ //治法推荐
|
|
|
+ get('/lantone/private/zhongyizx?type=1&code=' + tcmDiag + '&value=' + tcmSyndrome).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ let data = res.data.data || {}
|
|
|
+ if (res.data.status) {
|
|
|
+ //renderTcm(data)
|
|
|
+ } else {
|
|
|
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -42,16 +72,15 @@ function renderTcm(data) {
|
|
|
|
|
|
})
|
|
|
if (data.length > 3) {
|
|
|
- str += `<a class="go go-push" id="goTreat" href="">更多 <img class="icon" src="./images/go.png" alt=""></a>`;
|
|
|
+ str += `<a class="go go-push" id="goTreat">更多 <img class="icon" src="./images/go.png" alt=""></a>`;
|
|
|
}
|
|
|
$('.detail ul').html(str);
|
|
|
-
|
|
|
+ //更多治法
|
|
|
$("#goTreat").on('click', function () {
|
|
|
- openNewWin(targetUrl + '?page=fjcx');
|
|
|
+ openNewWin(targetUrl, true);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
module.exports = {
|
|
|
- renderTcm,
|
|
|
- getTcmData
|
|
|
+ getTcmMr
|
|
|
}
|