protocol.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="flex-common-css bgc-f">
  3. <Nav :title="title" leftIconColor="#333" titleColor="#333"></Nav>
  4. <scroll-view :scroll-y="true" class="scroll-view-css p-24 box-border-box" @scrolltolower="scrolltolower">
  5. <view v-if="type === 1 && num === 1" class="align-items-center flex-wrap-wrap">
  6. <image class="image-c" :src="business_license" mode="widthFix"></image>
  7. </view>
  8. <view v-else-if="type === 1 && num === 2" class="align-items-center flex-wrap-wrap">
  9. <image class="image-c" :src="permit" mode="widthFix"></image>
  10. </view>
  11. <view v-else class="" v-html="text"></view>
  12. </scroll-view>
  13. </view>
  14. </template>
  15. <script>
  16. import {
  17. commonCredential,
  18. commonProtocolInfo
  19. } from "@/api/common.js"
  20. export default {
  21. components: {},
  22. data() {
  23. return {
  24. type: '',
  25. num: '',
  26. title: '',
  27. text: '',
  28. permit: '',
  29. business_license: ''
  30. };
  31. },
  32. onLoad(data) {
  33. console.log(data, '000000000000');
  34. if (data) {
  35. this.type = Number(data.type)
  36. this.num = Number(data.num)
  37. if (this.type === 1) {
  38. if (this.num === 1) {
  39. this.title = '平台资质'
  40. } else {
  41. this.title = '经营许可证'
  42. }
  43. this.commonCredential()
  44. } else {
  45. this.commonProtocolInfo(this.num)
  46. }
  47. }
  48. },
  49. mounted() {},
  50. methods: {
  51. commonCredential() {
  52. commonCredential().then((res) => {
  53. if (res.code === 1) {
  54. this.permit = res.data.permit
  55. this.business_license = res.data.business_license
  56. }
  57. })
  58. },
  59. commonProtocolInfo(num) {
  60. commonProtocolInfo({
  61. id: num
  62. }).then((res) => {
  63. if (res.code == 1) {
  64. this.title = res.data.title
  65. this.text = res.data.content
  66. }
  67. })
  68. }
  69. },
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .image-c {
  74. width: 100%;
  75. height: auto;
  76. }
  77. </style>