protocol.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view>
  3. <!-- <u-sticky bgColor="#fff"> -->
  4. <view class="sticky">
  5. <!-- #ifdef MP-WEIXIN -->
  6. <NavigateBar title="使用须知" control="back" bgcolor="#a09cc4"></NavigateBar>
  7. <!-- #endif -->
  8. <!-- #ifdef MP-ALIPAY -->
  9. <NavigateBar title="使用须知" bgcolor="#a09cc4"></NavigateBar>
  10. <!-- #endif -->
  11. <u-tabs :list="protocolList" @click="tabChange" lineWidth="40"></u-tabs>
  12. </view>
  13. <!-- </u-sticky> -->
  14. <view class="text-area">
  15. <u-text :text="text"></u-text>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import NavigateBar from "../../components/navigateBar/navigate-bar.vue";
  21. export default {
  22. components: {
  23. NavigateBar
  24. },
  25. data() {
  26. return {
  27. protocolList: [{
  28. name: '使用须知',
  29. },
  30. {
  31. name: '隐私政策',
  32. },
  33. {
  34. name: '个人信息授权',
  35. },
  36. {
  37. name: '反恐法',
  38. },
  39. {
  40. name: '旅游业治安管理办法',
  41. }
  42. ],
  43. text: '',
  44. baseUrl: 'https://test.cloud.boyuantech.net/protocol/'
  45. };
  46. },
  47. methods: {
  48. tabChange(protocol) {
  49. console.log(protocol)
  50. uni.pageScrollTo({
  51. scrollTop: 0,
  52. duration: 0
  53. })
  54. this.getProtocol(protocol.name)
  55. },
  56. async getProtocol(name) {
  57. uni.request({
  58. url: this.baseUrl + name + '.txt',
  59. success: (res) => {
  60. console.log(res)
  61. this.text = res.data
  62. }
  63. })
  64. }
  65. },
  66. onLoad() {
  67. this.getProtocol(this.protocolList[0].name)
  68. },
  69. // #ifdef MP-WEIXIN
  70. onShareAppMessage(info) {
  71. return {
  72. title: '源享住',
  73. path: 'pages/login/login',
  74. imageUrl: "/static/logo.png"
  75. }
  76. }
  77. // #endif
  78. }
  79. </script>
  80. <style lang="scss">
  81. page {
  82. height: 100%;
  83. .sticky {
  84. position: sticky;
  85. background-color: #fff;
  86. top: 0;
  87. }
  88. .text-area {
  89. margin: 20rpx;
  90. }
  91. }
  92. </style>