agreement.vue 2.1 KB

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