agreement.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. }
  57. },
  58. rej => {}
  59. );
  60. },
  61. }
  62. }
  63. </script>
  64. <style scoped lang="scss">
  65. page{
  66. height: 100%;
  67. }
  68. .content{
  69. height: 100%;
  70. }
  71. </style>