agreement.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <view class="content">
  3. <u-parse :content="content"></u-parse>
  4. <!-- <mp-html :content="content"></mp-html> -->
  5. </view>
  6. </template>
  7. <script>
  8. // import mpHtml from '@/uni_modules/mp-html/mp-html.vue'
  9. import {getConfigByKey} from '@/api/common'
  10. export default {
  11. // components: { // mpHtml // },
  12. data() {
  13. return {
  14. type:null,
  15. content:"",
  16. }
  17. },
  18. onLoad(options) {
  19. this.type=options.type;
  20. if(this.type=="doctorAgreement"){
  21. uni.setNavigationBarTitle({
  22. title:"入驻协议"
  23. })
  24. }
  25. if(this.type=="userRegister"){
  26. uni.setNavigationBarTitle({
  27. title:"用户协议"
  28. })
  29. }
  30. if(this.type=="userPrivacy"){
  31. uni.setNavigationBarTitle({
  32. title:"隐私协议"
  33. })
  34. }
  35. if(this.type=="userHealth"){
  36. uni.setNavigationBarTitle({
  37. title:"健康客服协议"
  38. })
  39. }
  40. if(this.type=="splitOrderAgreement"){
  41. uni.setNavigationBarTitle({
  42. title:"互联网药品委托保存协议"
  43. })
  44. }
  45. this.getConfig();
  46. },
  47. methods:{
  48. getConfig(){
  49. var that=this;
  50. var data={key:"his.agreementConfig"}
  51. getConfigByKey(data).then(
  52. res => {
  53. if(res.code==200){
  54. if(this.type=="doctorRegister"){
  55. this.content=JSON.parse(res.data).doctorRegister;
  56. }
  57. else if(this.type=="doctorFiling"){
  58. this.content=JSON.parse(res.data).doctorFiling;
  59. }
  60. else if(this.type=="userRegister"){
  61. this.content=JSON.parse(res.data).userRegister;
  62. }
  63. else if(this.type=="userPrivacy"){
  64. this.content=JSON.parse(res.data).userPrivacy;
  65. }
  66. else if(this.type=="userHealth"){
  67. this.content=JSON.parse(res.data).userHealth;
  68. }
  69. else if(this.type=="splitOrderAgreement"){
  70. this.content=JSON.parse(res.data).splitOrderAgreement;
  71. }
  72. }
  73. },
  74. rej => {}
  75. );
  76. },
  77. }
  78. }
  79. </script>
  80. <style scoped lang="scss">
  81. page{
  82. height: 100%;
  83. }
  84. .content{
  85. height: 100%;
  86. }
  87. </style>