protocol.vue 1.3 KB

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