health_guide.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <link rel="stylesheet" href="../../../css/font-awesome.min.css">
  8. <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  9. <title>健康指导</title>
  10. </head>
  11. <style>
  12. * {
  13. box-sizing: border-box;
  14. outline: none;
  15. list-style: none;
  16. }
  17. html,
  18. body {
  19. height: 100%;
  20. }
  21. ul,
  22. li,
  23. body,
  24. h1 {
  25. margin: 0;
  26. padding: 0;
  27. }
  28. body{
  29. font-size: 14px;
  30. }
  31. /* 头 */
  32. .head {
  33. width: 100%;
  34. line-height: 45px;
  35. background-color: #ffffff;
  36. padding-left: 40px;
  37. }
  38. section {
  39. width: 100%;
  40. }
  41. /* 内容 */
  42. div.nr {
  43. display: flex;
  44. background-color: #ffffff;
  45. border: 1px solid #d7dce6;
  46. }
  47. /* 左 */
  48. .left {
  49. position: relative;
  50. width: 45%;
  51. margin: 0 13px;
  52. background-color: #f6f6f6;
  53. border: 1px solid #d7dce6;
  54. }
  55. .left .nav {
  56. list-style: none;
  57. display: flex;
  58. justify-content: center;
  59. width: 100%;
  60. border-bottom: 1px solid #d7dce6;
  61. }
  62. .left .nav li {
  63. width: 92px;
  64. border: 1px solid #d7dce6;
  65. border-top-left-radius: 10px;
  66. border-top-right-radius: 10px;
  67. margin:18px 3px -1px 3px;
  68. line-height: 30px;
  69. }
  70. .left .nav li a {
  71. text-decoration: none;
  72. display: inline-block;
  73. width: 100%;
  74. text-align: center;
  75. }
  76. .before {
  77. color: gray;
  78. }
  79. .avtive {
  80. color: #12b7f5;
  81. }
  82. .left button.new {
  83. width: 100%;
  84. background-color: #17b3ec;
  85. line-height: 50px;
  86. color: aliceblue;
  87. border: 0;
  88. outline: none;
  89. }
  90. .check {
  91. display: flex;
  92. align-items: center;
  93. background-color: #ffffff;
  94. height: 58px;
  95. width: 100%;
  96. margin-top: 12px;
  97. /* margin: 10px 10px; */
  98. }
  99. .check input {
  100. display: inline-block;
  101. height: 38px;
  102. width: calc(100% - 50px);
  103. background-color: #f2f2f2;
  104. border: 1px solid gainsboro;
  105. outline: none;
  106. margin-left: 15px;
  107. }
  108. .check i {
  109. padding: 8px 15px;
  110. color: gainsboro;
  111. border: 1px solid gainsboro;
  112. border-left: none;
  113. margin-right: 20px;
  114. }
  115. .model {
  116. background-color: #ffffff;
  117. border: 1px solid rebeccapurple;
  118. }
  119. /* 右 */
  120. .right {
  121. width: 55%;
  122. background-color: #f6f6f6;
  123. }
  124. .right .title {
  125. display: flex;
  126. justify-content: space-between;
  127. align-items: center;
  128. height: 55px;
  129. background-color: #ffffff;
  130. padding: 20px 25px;
  131. font-size: 16px;
  132. font-weight: 530;
  133. }
  134. .right .title button {
  135. width: 100px;
  136. height: 35px;
  137. color: white;
  138. background-color: #17b3ec;
  139. border: 1px solid white;
  140. outline: none;
  141. }
  142. .chenhu {
  143. height: 55px;
  144. background-color: white;
  145. line-height: 50px;
  146. }
  147. .chenhu label {
  148. margin: 10px;
  149. vertical-align: bottom;
  150. }
  151. .chenhu input {
  152. display: inline-block;
  153. border: 0;
  154. line-height: 50px;
  155. }
  156. .right textarea {
  157. width: 100%;
  158. border: 0;
  159. border-top: 1px solid #e1e1e1;
  160. height: 285px;
  161. height: auto;
  162. resize: none;
  163. padding: 10px 15px;
  164. }
  165. .rigbtn {
  166. width: 130px;
  167. height: 40px;
  168. margin-top: 30px;
  169. border: 0;
  170. background-color: #17b3ec;
  171. color: #ffffff;
  172. border-radius: 5px;
  173. }
  174. .di {
  175. width: 100%;
  176. text-align: center;
  177. }
  178. .c-t-right {
  179. width: 100%;
  180. text-align: right;
  181. margin: 0;
  182. padding: 0;
  183. }
  184. .bgc-fff {
  185. background-color: #ffffff;
  186. }
  187. textarea {
  188. border: none;
  189. margin: 0;
  190. padding: 0;
  191. }
  192. .addpic {
  193. margin-top: 10px;
  194. padding: 10px 15px;
  195. }
  196. .xuanranmuban {
  197. margin: 10px 0;
  198. height: 490px;
  199. background-color: #ffffff;
  200. }
  201. .xuanranmuban ul li {
  202. width: 100%;
  203. line-height: 50px;
  204. border: 1px solid #e4e4e4;
  205. padding-left: 15px;
  206. }
  207. </style>
  208. <body>
  209. <section>
  210. <!-- 头 -->
  211. <div class="head">
  212. 健康指导
  213. </div>
  214. <!-- 内容-->
  215. <div class="nr" id="dra" v-cloak>
  216. <div class="left">
  217. <div id="dra1">
  218. <!-- 导航栏 -->
  219. <ul class="nav">
  220. <li>
  221. <a class="avtive" href="javascript:void(0)" @click="layout='personal'">个人模板</a>
  222. </li>
  223. <li>
  224. <a class="before" href="javascript:void(0)" @click="layout='team'">团队模板</a>
  225. </li>
  226. <li>
  227. <a class="before" href="javascript:void(0)" @click="layout='sysm'">系统模板</a>
  228. </li>
  229. </ul>
  230. <div class="check">
  231. <input type="text" placeholder="查找模板" class="search-input">
  232. <i class="fa fa-search"></i>
  233. </div>
  234. <div class="xuanranmuban">
  235. <ul v-if="layout=='personal'">
  236. <li v-for="(list,index) in resultList">{{list.modelName}}</li>
  237. </ul>
  238. <ul v-if="layout=='team'">
  239. <li v-for="(list,index) in resultList">
  240. {{list.owner}}
  241. </li>
  242. </ul>
  243. <ul v-if="layout=='sysm'">
  244. <li v-for="(list,index) in resultList">
  245. {{list.sendTimes}}
  246. </li>
  247. </ul>
  248. </div>
  249. </div>
  250. <button class="new">
  251. 新建指导模板</button>
  252. </div>
  253. <div class="right">
  254. <div class="title">
  255. <p>指导模板</p>
  256. <button>保存到模板</button>
  257. </div>
  258. <div class="chenhu">
  259. <label for="">模板名称:</label>
  260. <input maxlength="10" placeholder="请输入模板名称(10字内)">
  261. </div>
  262. <div class="bgc-fff c-border-b me">
  263. <textarea class="c-f14 " placeholder="请输入指导内容 " rows="22 " maxlength="1000"></textarea>
  264. <div class="c-t-right c-f14 c-909090 pr10 pb10 me2">
  265. <span id="text_count ">0</span>/1000</div>
  266. </div>
  267. <div class="mt10 bgc-fff c-border-tb addpic" id="imgArea">
  268. <div class="c-f16 c-333">插入图片 (
  269. <span id="img_count">0</span>/9)</div>
  270. <div id="img_wrap" class="clearfix">
  271. <div id="add" class="fl mr15 mt20">
  272. <img src="../../../images/tianjiatupian_btn.png" width="65">
  273. </div>
  274. </div>
  275. </div>
  276. <div class="di">
  277. <button class="rigbtn ">发送</button>
  278. </div>
  279. </div>
  280. </div>
  281. </section>
  282. <!-- <script src="https://unpkg.com/vue/dist/vue.js "></script> -->
  283. <!-- <script type="text/javascript " src="../../../js/vue.js "></script> -->
  284. <script src="../js/vue2.js "></script>
  285. <script src="https://unpkg.com/element-ui/lib/index.js "></script>
  286. <script src="../../../js//vue-router.js "></script>
  287. <script type="text/javascript " src="../../../js/jquery-2.2.4.js "></script>
  288. <script src="../../../js/bootstrap.min.js "></script>
  289. <script src="../../../api/http-request.js "></script>
  290. <script src="../../../api//healthy-guide-api.js"></script>
  291. <script>
  292. new Vue({
  293. el: '#dra',
  294. data: {
  295. layout: 'personal',
  296. resultList: [],
  297. },
  298. mounted: function () {
  299. this.signList();
  300. },
  301. methods: {
  302. signList: function (isInit) {
  303. var vm = this
  304. var selectedTab = 0
  305. var page = [1,0,1]
  306. if (isInit) {
  307. page[selectedTab] = 1;
  308. }
  309. var params = {
  310. type: selectedTab == 0 ? 2 : 1, //模板类型 1:系统 2:自定义 为空:所有
  311. pageNo: page[selectedTab],
  312. pageSize: 20,
  313. }
  314. healthAPI.getlist(params).then(function (res) {
  315. if (res.status == 200) {
  316. loaded[selectedTab] = true;
  317. console.log(res.data)
  318. vm.resultList = res.data//>
  319. } else {
  320. showErrorMessage(res.msg);
  321. }
  322. })//>
  323. },
  324. }
  325. })
  326. var li = document.getElementsByTagName('a');
  327. var $text_count = $("#dra").find(".right").find(".me").find(".me2").find("span")
  328. var last = 0
  329. for (i = 0; i < li.length; i++) {
  330. li[i].onclick = function () {
  331. li[last].style.backgroundColor = 'white'
  332. li[last].style.color = 'gray'
  333. last = Array.from(li).indexOf(this)
  334. li[last].style.backgroundColor = '#17b3ec'
  335. li[last].style.color = 'white'
  336. }
  337. }
  338. $("textarea").on('keyup', function () {
  339. var count = $(this).val().length;
  340. $text_count.html(count);
  341. });
  342. $(".search-input").on('keydown', function (e) {
  343. if (e.which === 13) {
  344. if (selectedTab == 0 || selectedTab == 2) {
  345. getList(true);
  346. } else {
  347. getTeamInfoBySearch(searchIndex);
  348. }
  349. }
  350. });
  351. </script>
  352. </body>
  353. </html>