protocol.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <view class="protocol_page">
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <service-widget @btnClick="btn_click"></service-widget>
  5. <public-module></public-module>
  6. <view class="title">{{title}}</view>
  7. <jyf-parser ref="article"></jyf-parser>
  8. </view>
  9. </template>
  10. <script>
  11. import jyfParser from '@/components/common/jyf-parser/jyf-parser.vue';
  12. export default {
  13. components: {
  14. jyfParser
  15. },
  16. data() {
  17. return {
  18. type: 1000,
  19. title: "用户协议"
  20. };
  21. },
  22. //第一次加载
  23. onLoad(e) {
  24. if (e.type) {
  25. this.type = parseInt(e.type);
  26. let title;
  27. switch (this.type) {
  28. case 1000:
  29. title = "登录注册用户协议";
  30. break;
  31. }
  32. this.title = title;
  33. }
  34. this.pageData();
  35. },
  36. //页面显示
  37. onShow() {},
  38. //方法
  39. methods: {
  40. btn_click() {
  41. uni.navigateTo({
  42. url: '/pages/chat/chat'
  43. })
  44. },
  45. pageData() {
  46. this.$http
  47. .get('api/common/v1/protocol', {
  48. type: this.type
  49. })
  50. .then(res => {
  51. this.$refs.article.setContent(res);
  52. });
  53. }
  54. },
  55. //页面隐藏
  56. onHide() {},
  57. //页面卸载
  58. onUnload() {},
  59. //页面下来刷新
  60. onPullDownRefresh() {},
  61. //页面上拉触底
  62. onReachBottom() {},
  63. //用户点击分享
  64. onShareAppMessage(e) {
  65. return this.wxShare();
  66. }
  67. };
  68. </script>
  69. <style scoped>
  70. .protocol_page {
  71. background-color: #fff;
  72. padding: 30upx;
  73. font-size: 30upx;
  74. line-height: 180%;
  75. }
  76. .protocol_page .title {
  77. font-size: 50upx;
  78. padding-bottom: 30upx;
  79. }
  80. </style>