item-detail.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. var ItemDetail = {
  2. template: '<div class="plr10 ptb10 c-position-r item-detail-wrap">\
  3. <div class="item-detail-innerwrap">\
  4. <div class="item-detail">\
  5. <div class="c-f14 c-999 plr10 item-detail-name">项目名称</div>\
  6. <div class="c-f14 c-666 ptb10 plr10">{{item.specialistServiceItemDO.title}}</div>\
  7. </div>\
  8. <div class="item-detail mt20">\
  9. <div class="c-f14 c-999 plr10 item-detail-name">项目内容</div>\
  10. <div class="c-f14 c-666 ptb10 plr10">{{item.specialistServiceItemDO.content}}</div>\
  11. </div>\
  12. <div class="item-detail mt20">\
  13. <div class="c-f14 c-999 plr10 item-detail-name">项目类型</div>\
  14. <div class="c-f14 c-666 ptb10 plr10">{{itemTypes[item.specialistServiceItemDO.itemType]}}</div>\
  15. </div>\
  16. <div class="item-detail mt20">\
  17. <div class="c-f14 c-999 plr10 item-detail-name">服务机构</div>\
  18. <div class="c-f14 c-666 ptb10 plr10">{{item.hospitalName}}</div>\
  19. </div>\
  20. <div class="item-detail mt20">\
  21. <div class="c-f14 c-999 plr10 item-detail-name">服务地点</div>\
  22. <div class="c-f14 c-666 ptb10 plr10">{{item.hospitalDo.address}}</div>\
  23. </div>\
  24. </div>\
  25. <a class="back-btn c-t-center mr15" @click="goBack">\
  26. 返回\
  27. </a>\
  28. </div>',
  29. props: [],
  30. data: function() {
  31. return {
  32. item: {
  33. specialistServiceItemDO: {},
  34. hospitalName: "",
  35. hospitalDo: {}
  36. },
  37. itemTypes: ["","诊疗服务","健康服务"],
  38. itemId: ""
  39. }
  40. },
  41. beforeRouteEnter: function(to, from, next) {
  42. next(function(vm) {
  43. var query = vm.$route.query
  44. vm.itemId = query.itemId
  45. rehaAPI.selectByIds({
  46. ids: JSON.stringify([vm.itemId])
  47. }).then(function(res) {
  48. if(res.status == 200) {
  49. var data = res.data[0]
  50. if(data) {
  51. vm.item = data
  52. }
  53. } else {
  54. }
  55. })
  56. })
  57. },
  58. created: function() {
  59. var vm = this
  60. },
  61. mounted: function() {
  62. var vm = this
  63. },
  64. methods: {
  65. goBack: function() {
  66. this.$router.back()
  67. }
  68. }
  69. }