agreement.vue 1.4 KB

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