index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. <template>
  2. <div class="mine">
  3. <div class="left">
  4. <div class="user-info">
  5. <div class="user-img"><img :src="userInfo.avatar_url"
  6. alt=""></div>
  7. <div class="user-span">
  8. <div class="name">昵称:<span>{{userInfo.nickname}}</span></div>
  9. <div class="sex">性别:<span>{{userInfo.sex}}</span></div>
  10. <div class="age">肤龄:<span>{{userInfo.age}}</span></div>
  11. <div class="skin-type">肤质:<span>{{userInfo.skin}}</span></div>
  12. </div>
  13. </div>
  14. <div class="user-record">
  15. <div class="fraction">
  16. <div class="title">肌肤得分</div>
  17. <div class="num">{{userInfo.score}}分</div>
  18. </div>
  19. <div class="status">
  20. <div class="title">皮肤状态</div>
  21. <div class="tips">{{userInfo.skin_status}}</div>
  22. </div>
  23. <div class="times">
  24. <div class="title">上传检测时间</div>
  25. <div class="ts">{{userInfo.check_time}}</div>
  26. </div>
  27. </div>
  28. <div class="summary">
  29. <div class="left-title">皮肤总结</div>
  30. <div class="summary-list">
  31. <div class="summary-info"
  32. v-for="item,index in detail_list"
  33. :key="index">
  34. <div class="result">
  35. <div class="result-left">
  36. <div class="title">{{item.name}}:</div>
  37. <div class="tips">{{item.main_item.name}}{{item.main_item.num}}</div>
  38. </div>
  39. <div class="right min-size">
  40. <div v-for="value,i in item.items"
  41. :key="i">{{value.name}}:{{value.num}}个</div>
  42. </div>
  43. </div>
  44. <div class="bottom-tips">
  45. <span>{{item.suggest}}</span>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="right">
  52. <div class="lable">
  53. <div class="lable-title">
  54. 面诊标签
  55. </div>
  56. <div class="lable-list">
  57. <div v-for="(item,index) in lableList"
  58. :key="index"
  59. :class="['lable-info', tags.indexOf(item)>-1?'active':'']">
  60. {{item}}
  61. </div>
  62. <div class="add-lable">
  63. +
  64. </div>
  65. </div>
  66. <div class="lable-title">
  67. 备注
  68. </div>
  69. <div class="remarks">
  70. <el-input type="textarea"
  71. autosize
  72. resize="none"
  73. placeholder="多行输入"
  74. v-model="remarks">
  75. </el-input>
  76. </div>
  77. </div>
  78. <div class="programme">
  79. <div class="tab">
  80. <div class="tab-title">执行方案</div>
  81. <div class="add"
  82. @click="isPupop=true">新增</div>
  83. </div>
  84. <div class="programme-list">
  85. <div :class="['programme-info',item.onSelect?'programme-active':'']"
  86. v-for="(item,index) in programmeList"
  87. :key="index"
  88. @click="onOperation(index)">
  89. <div class="programme-left">
  90. <div class="programme-img"><img :src="item.cover_url"
  91. alt=""></div>
  92. <div class="programme-tips">
  93. <div class="tips-title">{{item.name|ellipsis(9)}}</div>
  94. <div class="tips-title">{{item.desc|ellipsis(9)}}</div>
  95. <div class="tips-title">仪器:<span>{{item.device_name|ellipsis(9)}}</span></div>
  96. </div>
  97. </div>
  98. <div class="programme-right">
  99. <div class="frequency">执行频率:<span>{{item.frequency}}</span></div>
  100. <div class="duration">持续时长:<span>{{item.duration}}</span></div>
  101. </div>
  102. <div class="operation"
  103. v-if="item.onSelect">
  104. <div class="edit">编辑</div>
  105. <div class="delete">删除</div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <div class="submit"
  111. @click="onSubmit">保存</div>
  112. </div>
  113. <mine-pupop :show="isPupop">
  114. <div class="block">
  115. <div class="delete-pupop"
  116. @click="isPupop=false"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
  117. alt=""></div>
  118. <div class="pupop-title">
  119. 选择执行方案
  120. </div>
  121. <el-select v-model="projectInfo"
  122. placeholder="请选择项目"
  123. class="project-select"
  124. size="mini">
  125. <el-option v-for="item in projectList"
  126. :key="item.id"
  127. :label="item.name"
  128. :value="item.id">
  129. </el-option>
  130. </el-select>
  131. <div class="frequency">
  132. <div>执行频率:</div>
  133. <el-select v-model="weekInfo"
  134. class="week-select"
  135. size="mini">
  136. <el-option v-for="item in weekList"
  137. :key="item.value"
  138. :label="item.label"
  139. :value="item.value">
  140. </el-option>
  141. </el-select>
  142. <div>周</div>
  143. <el-select v-model="timesInfo"
  144. class="times-select"
  145. size="mini">
  146. <el-option v-for="item in timesList"
  147. :key="item.value"
  148. :label="item.label"
  149. :value="item.value">
  150. </el-option>
  151. </el-select>
  152. <div>次</div>
  153. </div>
  154. <div class="submit-frequency"
  155. @click="submitFrequency">确定</div>
  156. </div>
  157. </mine-pupop>
  158. </div>
  159. </template>
  160. <script>
  161. import minePupop from '../../../components/minePupop/index.vue'
  162. import api from '../../../server/home'
  163. export default {
  164. components: { minePupop },
  165. data () {
  166. return {
  167. userInfo: {
  168. },
  169. //皮肤总结
  170. detail_list: [],
  171. //面部标签
  172. lableList: [],
  173. //后台默认的标签
  174. tags: [],
  175. //执行方案
  176. programmeList: [
  177. {
  178. frequency: '1周1次',
  179. duration: '28天'
  180. }, {
  181. frequency: '1周1次',
  182. duration: '28天'
  183. }, {
  184. frequency: '1周1次',
  185. duration: '28天'
  186. },
  187. ],
  188. //项目列表
  189. projectList: [{
  190. value: '选项1',
  191. label: '黄金糕'
  192. }, {
  193. value: '选项2',
  194. label: '双皮奶'
  195. }, {
  196. value: '选项3',
  197. label: '蚵仔煎'
  198. }, {
  199. value: '选项4',
  200. label: '龙须面'
  201. }, {
  202. value: '选项5',
  203. label: '北京烤鸭'
  204. }],
  205. //周期
  206. weekList: [
  207. {
  208. value: '选项1',
  209. label: '1'
  210. },
  211. {
  212. value: '选项2',
  213. label: '2'
  214. },
  215. ],
  216. //次数
  217. timesList: [
  218. {
  219. value: '选项1',
  220. label: '1'
  221. },
  222. {
  223. value: '选项2',
  224. label: '2'
  225. },
  226. ],
  227. timesInfo: '',//次数
  228. projectInfo: '',//项目
  229. projectId: '',//项目id
  230. weekInfo: '',//周次
  231. programmeIndex: '',
  232. remarks: '',//备注
  233. isPupop: false,
  234. id: 0
  235. };
  236. },
  237. computed: {
  238. },
  239. watch: {},
  240. methods: {
  241. getSkinInfo () {
  242. api.getSkinInfo({ id: this.id }).then(res => {
  243. this.userInfo = res.data.user
  244. this.detail_list = res.data.detail_list
  245. this.lableList = res.data.tags
  246. this.programmeList = res.data.scheme_list
  247. this.remarks = res.data.remark
  248. })
  249. },
  250. getSkinTags () {
  251. api.getSkinTags().then(res => {
  252. this.tags = res.data.tags
  253. })
  254. },
  255. getProject () {
  256. api.getProject().then(res => {
  257. this.projectList = res.data.list
  258. })
  259. },
  260. getSkinUpdate () {
  261. let params = {
  262. remark: this.remarks,
  263. tags: this.lableList.toString()
  264. }
  265. api.getSkinUpdate().then(res => {
  266. })
  267. },
  268. onOperation (index) {
  269. if (this.programmeList[index].onSelect) {
  270. this.$set(this.programmeList[index], 'onSelect', !this.programmeList[index].onSelect)
  271. } else {
  272. this.$set(this.programmeList[index], 'onSelect', true)
  273. }
  274. },
  275. onSubmit () {
  276. this.getSkinUpdate()
  277. },
  278. submitFrequency () { },
  279. },
  280. created () {
  281. let id = this.$route.query.id
  282. this.id = id
  283. this.getSkinInfo()
  284. this.getProject()
  285. this.getSkinTags()
  286. },
  287. mounted () {
  288. },
  289. }
  290. </script>
  291. <style lang='less' scoped>
  292. .mine {
  293. height: 100%;
  294. display: flex;
  295. .left {
  296. width: 318px;
  297. padding: 12px 12px 0 12px;
  298. background: #ffffff;
  299. box-shadow: 0px 2px 4px 0px rgba(184, 191, 198, 0.2);
  300. border-radius: 8px;
  301. font-size: 13px;
  302. font-family: PingFangSC-Regular, PingFang SC;
  303. font-weight: 400;
  304. color: #999999;
  305. line-height: 18px;
  306. height: 100%;
  307. .user-info {
  308. display: flex;
  309. align-items: center;
  310. .user-img {
  311. width: 96px;
  312. img {
  313. width: 100%;
  314. border-radius: 5px;
  315. display: block;
  316. }
  317. }
  318. .user-span {
  319. margin-left: 12px;
  320. span {
  321. color: #333333;
  322. }
  323. }
  324. }
  325. .user-record {
  326. margin-top: 16px;
  327. display: flex;
  328. justify-content: space-between;
  329. .num {
  330. font-size: 18px;
  331. font-family: OPPOSans-B, OPPOSans;
  332. font-weight: normal;
  333. color: #333333;
  334. line-height: 29px;
  335. }
  336. .tips {
  337. font-size: 13px;
  338. font-family: PingFangSC-Regular, PingFang SC;
  339. font-weight: 400;
  340. color: #333333;
  341. line-height: 30px;
  342. }
  343. .ts {
  344. font-size: 13px;
  345. font-family: PingFangSC-Regular, PingFang SC;
  346. font-weight: 400;
  347. color: #333333;
  348. line-height: 30px;
  349. }
  350. }
  351. .summary {
  352. .left-title {
  353. margin-top: 10px;
  354. font-size: 14px;
  355. font-family: PingFangSC-Medium, PingFang SC;
  356. font-weight: 500;
  357. color: #333333;
  358. line-height: 20px;
  359. }
  360. .summary-list {
  361. margin-top: 10px;
  362. height: 280px;
  363. overflow: scroll;
  364. .summary-info {
  365. border-radius: 4px;
  366. margin-bottom: 20px;
  367. border: 1px solid #f5f5f5;
  368. .result {
  369. padding: 10px;
  370. display: flex;
  371. justify-content: space-between;
  372. align-content: center;
  373. .result-left {
  374. font-family: PingFangSC-Regular, PingFang SC;
  375. font-weight: 400;
  376. .title {
  377. font-size: 14px;
  378. color: #666666;
  379. line-height: 20px;
  380. }
  381. .tips {
  382. font-size: 18px;
  383. color: #fa7d22;
  384. line-height: 25px;
  385. }
  386. }
  387. .right {
  388. font-size: 12px;
  389. font-family: PingFangSC-Regular, PingFang SC;
  390. font-weight: 400;
  391. color: #666666;
  392. line-height: 20px;
  393. text-align: end;
  394. }
  395. }
  396. .bottom-tips {
  397. padding: 6px 10px;
  398. font-size: 10px;
  399. font-family: PingFang-SC-Regular, PingFang-SC;
  400. font-weight: 400;
  401. color: #333333;
  402. line-height: 14px;
  403. background: #f5f5f5;
  404. border-radius: 4px;
  405. span {
  406. display: block;
  407. zoom: 0.83;
  408. }
  409. }
  410. }
  411. }
  412. }
  413. }
  414. .right {
  415. margin-left: 18px;
  416. position: relative;
  417. flex: 1;
  418. .lable {
  419. width: 100%;
  420. height: 230px;
  421. overflow: scroll;
  422. padding: 12px;
  423. background: #ffffff;
  424. box-shadow: 0px 2px 4px 0px rgba(184, 191, 198, 0.2);
  425. border-radius: 8px;
  426. .lable-title {
  427. font-size: 14px;
  428. font-family: PingFangSC-Medium, PingFang SC;
  429. font-weight: 500;
  430. color: #333333;
  431. line-height: 20px;
  432. margin-bottom: 14px;
  433. }
  434. .lable-list {
  435. width: 100%;
  436. min-height: 105rpx;
  437. .lable-info {
  438. display: inline-block;
  439. padding: 0 12px;
  440. margin-left: 10px;
  441. height: 24px;
  442. line-height: 24px;
  443. border-radius: 2px;
  444. border: 1px solid #d6d6d6;
  445. margin-bottom: 10px;
  446. }
  447. .add-lable {
  448. display: inline-block;
  449. width: 27px;
  450. height: 24px;
  451. line-height: 24px;
  452. font-size: 12px;
  453. font-family: PingFang-SC-Regular, PingFang-SC;
  454. font-weight: 400;
  455. color: #333333;
  456. text-align: center;
  457. margin-left: 10px;
  458. border-radius: 2px;
  459. border: 1px solid #d6d6d6;
  460. }
  461. .active {
  462. background: url(https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/%E9%80%89%E4%B8%AD2%402x.png)
  463. no-repeat;
  464. background-size: 100% 100%;
  465. border: 0px solid #d6d6d6;
  466. }
  467. }
  468. .remarks {
  469. /deep/ .el-textarea__inner:focus {
  470. border-color: #fa852f;
  471. }
  472. }
  473. }
  474. .programme {
  475. margin-top: 18px;
  476. width: 100%;
  477. // height: 208px;
  478. background: #ffffff;
  479. box-shadow: 0px 2px 4px 0px rgba(184, 191, 198, 0.2);
  480. border-radius: 8px;
  481. padding: 14px 12px 0 12px;
  482. .tab {
  483. display: flex;
  484. align-items: center;
  485. justify-content: space-between;
  486. .tab-title {
  487. font-size: 14px;
  488. font-family: PingFangSC-Medium, PingFang SC;
  489. font-weight: 500;
  490. color: #333333;
  491. line-height: 20px;
  492. }
  493. .add {
  494. width: 60px;
  495. height: 28px;
  496. line-height: 28px;
  497. background: #fa7d22;
  498. border-radius: 8px;
  499. font-size: 14px;
  500. font-family: PingFangSC-Medium, PingFang SC;
  501. font-weight: 500;
  502. color: #ffffff;
  503. text-align: center;
  504. }
  505. }
  506. .programme-list {
  507. margin-top: 10px;
  508. height: 150px;
  509. overflow: scroll;
  510. position: relative;
  511. z-index: 1;
  512. .programme-info {
  513. position: relative;
  514. padding: 8px 10px;
  515. margin-bottom: 10px;
  516. display: flex;
  517. align-items: center;
  518. border-radius: 4px;
  519. border: 1px solid #f5f5f5;
  520. .programme-left {
  521. flex: 1;
  522. display: flex;
  523. .programme-img {
  524. width: 48px;
  525. img {
  526. width: 100%;
  527. display: block;
  528. }
  529. }
  530. .programme-tips {
  531. margin-left: 10px;
  532. font-size: 10px;
  533. font-family: PingFangSC-Regular, PingFang SC;
  534. font-weight: 400;
  535. color: #999999;
  536. line-height: 14px;
  537. }
  538. }
  539. .programme-right {
  540. flex: 1;
  541. font-size: 12px;
  542. font-family: PingFangSC-Regular, PingFang SC;
  543. font-weight: 400;
  544. color: #333333;
  545. line-height: 17px;
  546. padding-left: 125px;
  547. .duration {
  548. margin-top: 14px;
  549. }
  550. }
  551. .operation {
  552. position: absolute;
  553. left: 50%;
  554. transform: translateX(-50%);
  555. top: 10px;
  556. z-index: 10;
  557. width: 44px;
  558. background: #ffffff;
  559. box-shadow: 0px 9px 28px 8px rgba(0, 0, 0, 0.05),
  560. 0px 6px 16px 0px rgba(0, 0, 0, 0.08),
  561. 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
  562. border-radius: 2px;
  563. padding: 10px;
  564. font-size: 12px;
  565. font-family: PingFangSC-Regular, PingFang SC;
  566. font-weight: 400;
  567. color: #333333;
  568. line-height: 17px;
  569. .delete {
  570. margin-top: 20px;
  571. }
  572. }
  573. }
  574. .programme-active {
  575. border: 1px solid #fa852f;
  576. }
  577. }
  578. }
  579. .submit {
  580. margin-top: 18px;
  581. position: relative;
  582. left: 50%;
  583. transform: translateX(-50%);
  584. width: 176px;
  585. height: 28px;
  586. line-height: 28px;
  587. background: #fa7d22;
  588. border-radius: 14px;
  589. text-align: center;
  590. font-size: 14px;
  591. font-family: PingFangSC-Medium, PingFang SC;
  592. font-weight: 500;
  593. color: #ffffff;
  594. }
  595. }
  596. .block {
  597. width: 540px;
  598. background: #ffffff;
  599. border-radius: 8px;
  600. position: relative;
  601. padding: 42px;
  602. .delete-pupop {
  603. position: absolute;
  604. width: 32px;
  605. height: 32px;
  606. top: 5px;
  607. right: 5px;
  608. img {
  609. width: 100%;
  610. height: 100%;
  611. display: block;
  612. }
  613. }
  614. .pupop-title {
  615. font-size: 14px;
  616. font-family: PingFangSC-Medium, PingFang SC;
  617. font-weight: 500;
  618. color: #333333;
  619. line-height: 20px;
  620. text-align: center;
  621. }
  622. .project-select {
  623. margin-top: 26px;
  624. position: relative;
  625. left: 50%;
  626. transform: translateX(-50%);
  627. width: 300px;
  628. }
  629. .frequency {
  630. margin-top: 20px;
  631. display: flex;
  632. justify-content: center;
  633. align-items: center;
  634. font-size: 14px;
  635. font-family: PingFangSC-Regular, PingFang SC;
  636. font-weight: 400;
  637. color: #333333;
  638. line-height: 20px;
  639. .week-select {
  640. width: 77px;
  641. margin-right: 8px;
  642. }
  643. .times-select {
  644. width: 77px;
  645. margin: 0 8px 0 20px;
  646. }
  647. }
  648. .submit-frequency {
  649. position: relative;
  650. left: 50%;
  651. transform: translateX(-50%);
  652. margin-top: 158px;
  653. width: 176px;
  654. height: 28px;
  655. text-align: center;
  656. background: #fa7d22;
  657. border-radius: 14px;
  658. font-size: 14px;
  659. font-family: PingFangSC-Medium, PingFang SC;
  660. font-weight: 500;
  661. color: #ffffff;
  662. line-height: 28px;
  663. }
  664. }
  665. }
  666. </style>