Xuewei.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <div class="xuewei flex flex-row-left">
  3. <div class="left">
  4. <!-- 顶部筛选 -->
  5. <div class="screening flex-vertical-center-l">
  6. <div class="screening-form flex-vertical-center-l flex-wrap">
  7. <div class="screening-item flex-vertical-center-l">
  8. <span>搜索经络:</span>
  9. <div class="input">
  10. <el-input size="mini" v-model="form.name" placeholder="请输入"></el-input>
  11. </div>
  12. </div>
  13. <el-button size="mini" type="primary" @click="search">搜索</el-button>
  14. <el-button size="mini" type="warning" @click="clearFilter">清空</el-button>
  15. </div>
  16. <div class="radio">
  17. <el-radio-group v-model="radio" @change="radioC">
  18. <el-radio label="1">十二经脉</el-radio>
  19. <el-radio label="2">奇经八脉</el-radio>
  20. <el-radio label="3">经外奇穴</el-radio>
  21. </el-radio-group>
  22. </div>
  23. </div>
  24. <!-- tab -->
  25. <div class="xue-tab flex-vertical-center-l flex-wrap">
  26. <div
  27. :class="index==current?'flex-center active':'flex-center'"
  28. v-for="(item,index) in tabs"
  29. :key="index"
  30. @click="changeCurrent(index)"
  31. >{{item.mername}}</div>
  32. </div>
  33. <div class="content" v-if="tabs.length>0">
  34. <div class="main-xuewei" v-if="radio!='3'">
  35. <div class="title">经脉巡行</div>
  36. <div v-html="tabs[current].merroute"></div>
  37. </div>
  38. <div class="main-xuewei" v-if="radio!='3'">
  39. <div class="title">主要病侯</div>
  40. <div v-html="tabs[current].mermaindisease"></div>
  41. </div>
  42. <div class="main-xuewei" v-if="radio!='3'">
  43. <div class="title">主治概要</div>
  44. <div v-html="tabs[current].mermaintreat"></div>
  45. <div class="flex-vertical-center-l flex-wrap xuewe-name">
  46. <div
  47. @click="$router.push({path: '/index/diseased?disid='+item.disid})"
  48. v-for="(item,index) in info.dislist"
  49. :key="index"
  50. >{{item.disname}}</div>
  51. </div>
  52. </div>
  53. <div class="main-xuewei" v-if="radio!='3'">
  54. <div class="title">经穴歌</div>
  55. <div v-html="info.mersong"></div>
  56. </div>
  57. <div class="main-xuewei">
  58. <div class="title">主要穴位</div>
  59. <div class="flex-vertical-center-l flex-wrap xuewe-name">
  60. <div
  61. @click="$router.push({path: '/index/xueweid?acuid='+item.acuid})"
  62. v-for="(item,index) in xueweiList"
  63. :key="index"
  64. >{{item.acuname}}</div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="right">
  70. <div class="title flex-vertical-center-l">
  71. <span></span>
  72. <div>经络图</div>
  73. </div>
  74. <div class="img" v-if="tabs.length>0">
  75. <img :src="tabs[current].merimg" alt />
  76. <!-- <img src="../../assets/jingluo1.jpg" alt=""> -->
  77. </div>
  78. <!-- <div class="img">
  79. <img src="../../assets/jingluo2.jpg" alt="">
  80. </div>-->
  81. </div>
  82. </div>
  83. </template>
  84. <script>
  85. import { getAcupoint, collateralChannels, getMerD } from "@/api/knowledge.js";
  86. export default {
  87. data() {
  88. return {
  89. form: {
  90. name: ""
  91. },
  92. ops: {
  93. vuescroll: {},
  94. scrollPanel: {},
  95. rail: {
  96. keepShow: true
  97. },
  98. bar: {
  99. hoverStyle: true,
  100. onlyShowBarOnScroll: false, //是否只有滚动的时候才显示滚动条
  101. background: "#C1C1C1", //滚动条颜色
  102. opacity: 0.5, //滚动条透明度
  103. "overflow-x": "hidden"
  104. }
  105. },
  106. radio: "1",
  107. tabs: [],
  108. current: 0,
  109. xueweiList: [],
  110. info: {}
  111. };
  112. },
  113. beforeCreate() {
  114. this.$nextTick(vm => {
  115. this.collateralChannels();
  116. });
  117. },
  118. created() {
  119. // this.collateralChannels()
  120. },
  121. methods: {
  122. clearFilter() {
  123. this.form.name = "";
  124. this.collateralChannels();
  125. },
  126. search() {
  127. this.page = 1;
  128. this.collateralChannels();
  129. },
  130. radioC() {
  131. this.current = 0;
  132. this.collateralChannels();
  133. },
  134. // 修改经络
  135. changeCurrent(index) {
  136. this.current = index;
  137. // this.collateralChannels()
  138. this.getAcupoint();
  139. this.getMerD();
  140. },
  141. // 获取穴位信息
  142. async getAcupoint() {
  143. let params = {
  144. merid: this.tabs[this.current].merid,
  145. pageid: 1,
  146. pagesize: 999
  147. };
  148. let res = await getAcupoint(params);
  149. if (res.code == 0) {
  150. this.xueweiList = res.data.acupoints;
  151. }
  152. },
  153. // 获取经络
  154. async collateralChannels() {
  155. let params = {
  156. mertype: this.radio,
  157. pageid: 1,
  158. pagesize: 999,
  159. keyword: this.form.name
  160. };
  161. let res = await collateralChannels(params);
  162. if (res.code == 0) {
  163. this.tabs = [];
  164. res.data.meridians.forEach(item => {
  165. item.merimg = process.env.VUE_APP_XUEWEI + item.merimg;
  166. });
  167. this.tabs = res.data.meridians;
  168. if (this.tabs.length > 0) {
  169. this.getAcupoint();
  170. this.getMerD();
  171. }
  172. }
  173. },
  174. // 获取经络详情
  175. async getMerD() {
  176. let res = await getMerD({
  177. merid: this.tabs[this.current].merid
  178. });
  179. if (res.code == 0) {
  180. this.info = res.data;
  181. }
  182. }
  183. }
  184. };
  185. </script>
  186. <style lang="scss" scoped>
  187. @import "../../style/base.scss";
  188. @import "../../style/common.scss";
  189. .xuewei {
  190. height: 100%;
  191. .left {
  192. flex: 1;
  193. overflow: hidden;
  194. height: 100%;
  195. margin-right: 10px;
  196. .xue-tab {
  197. margin-top: 10px;
  198. div {
  199. width: 90px;
  200. height: 32px;
  201. background: #ffffff;
  202. border-radius: 5px;
  203. font-size: 14px;
  204. font-family: PingFang SC;
  205. font-weight: 400;
  206. color: #333333;
  207. margin-right: 10px;
  208. margin-bottom: 10px;
  209. cursor: pointer;
  210. }
  211. .active {
  212. background: #9F643A;
  213. color: #fff;
  214. }
  215. }
  216. .content {
  217. background: #ffffff;
  218. border-radius: 5px;
  219. padding: 10px 10px;
  220. height: 60vh;
  221. overflow: auto;
  222. }
  223. .main-xuewei {
  224. margin-bottom: 30px;
  225. .title {
  226. font-size: 16px;
  227. color: #333;
  228. font-weight: 600;
  229. margin: 10px 0;
  230. }
  231. .xuewe-name {
  232. font-size: 14px;
  233. color: #333;
  234. font-weight: 600;
  235. // margin: 10px ;
  236. div {
  237. margin-top: 20px;
  238. margin-right: 50px;
  239. cursor: pointer;
  240. }
  241. div:hover {
  242. color: #9f643a;
  243. }
  244. }
  245. }
  246. }
  247. .right {
  248. // width: 230px;
  249. height: 100%;
  250. width: 200px;
  251. box-sizing: border-box;
  252. padding: 19px 12px;
  253. background: #ffffff;
  254. border-radius: 5px;
  255. .title {
  256. margin-bottom: 26px;
  257. span {
  258. width: 3px;
  259. height: 14px;
  260. background: #9F643A;
  261. border-radius: 1px;
  262. margin-right: 6px;
  263. }
  264. div {
  265. font-size: 18px;
  266. font-family: PingFang SC;
  267. font-weight: 400;
  268. color: #9F643A;
  269. }
  270. }
  271. .img {
  272. width: 194px;
  273. // height: 265px;
  274. img {
  275. width: 100%;
  276. background: red;
  277. }
  278. }
  279. }
  280. }
  281. // 滚动条位置
  282. .xuewei ::v-deep .__bar-is-vertical {
  283. right: -1px !important;
  284. }
  285. // 隐藏横向滚动条
  286. .xuewei ::v-deep .__bar-is-horizontal {
  287. display: none !important;
  288. }
  289. .radio {
  290. margin-left: 20px;
  291. }
  292. </style>
  293. <style lang="scss" scoped>
  294. @media screen and (min-width: 1681px) and (max-width: 1920px) {
  295. .xuewei {
  296. .left {
  297. .content {
  298. height: 78vh;
  299. }
  300. }
  301. }
  302. }
  303. @media screen and (min-width: 1601px) and (max-width: 1680px) {
  304. .xuewei {
  305. .left {
  306. .content {
  307. height: 77vh;
  308. }
  309. }
  310. }
  311. }
  312. @media screen and (min-width: 1361px) and (max-width: 1600px) {
  313. .xuewei {
  314. .left {
  315. .content {
  316. height: 62vh;
  317. }
  318. }
  319. }
  320. }
  321. @media screen and(min-width:1281px) and (max-width: 1360px) {
  322. .xuewei {
  323. .left {
  324. .content {
  325. height: 62vh;
  326. }
  327. }
  328. }
  329. }
  330. </style>