agreement.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. this.getConfig();
  36. },
  37. methods:{
  38. getConfig(){
  39. var that=this;
  40. var data={key:"his.agreementConfig"}
  41. getConfigByKey(data).then(
  42. res => {
  43. if(res.code==200){
  44. if(this.type=="doctorRegister"){
  45. this.content=JSON.parse(res.data).doctorRegister;
  46. }
  47. else if(this.type=="doctorFiling"){
  48. this.content=JSON.parse(res.data).doctorFiling;
  49. }
  50. else if(this.type=="userRegister"){
  51. this.content=JSON.parse(res.data).userRegister;
  52. }
  53. else if(this.type=="userPrivacy"){
  54. this.content=JSON.parse(res.data).userPrivacy;
  55. }
  56. else if(this.type=="pharmacistRegister"){
  57. this.content=JSON.parse(res.data).pharmacistRegister;
  58. }
  59. else if(this.type=="pharmacistFiling"){
  60. this.content=JSON.parse(res.data).pharmacistFiling;
  61. }
  62. else if(this.type=="storeRules"){
  63. this.content=JSON.parse(res.data).storeRules;
  64. }
  65. else if(this.type=="residencyAgreement"){
  66. this.content=JSON.parse(res.data).residencyAgreement;
  67. }
  68. }
  69. },
  70. rej => {}
  71. );
  72. },
  73. }
  74. }
  75. </script>
  76. <style scoped lang="scss">
  77. page{
  78. height: 100%;
  79. }
  80. .content{
  81. height: 100%;
  82. }
  83. </style>