| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <template>
- <view>
- <!--mine/page/page.wxml-->
- <!-- <view class="title">{{ title }}</view> -->
- <view class="content"><rich-text :nodes="params"></rich-text></view>
- </view>
- </template>
- <script>
- // mine/page/page.js
- const app = getApp();
- const req = require('../../utils/request.js');
- export default {
- data() {
- return {
- title: '',
- isXieyi: false, //用户协议
- isYinsi: false, //隐私政策
- isOpen: false,
- isGroup: false,
- params: ''
- };
- },
- components: {},
- props: {},
- onLoad: function(options) {
- this.id = options.id;
- if (options.isXieyi) {
- this.isXieyi = true;
- }
- if (options.isYinsi) {
- this.isYinsi = true;
- }
- if (options.isOpen) {
- this.isOpen = true;
- }
- if (options.isGroup) {
- this.isGroup = true;
- }
- this.title = options.title;
- // if (this.title) {
- // uni.setNavigationBarTitle({
- // title: this.title
- // });
- // }
- this.getData();
- },
- methods: {
- getData() {
- var that = this;
- let url = false;
- let form = {};
- if (that.isXieyi) {
- url = '/api/protocol';
- } else if (that.isYinsi) {
- url = '/api/params/value';
- form.type = 'PRIVACY_AGREEMENT';
- } else {
- url = '/api/help/detail';
- form.id = that.id;
- }
- if (that.isOpen) {
- req.getRequest('/api/config', {}, function(res) {
- that.params = res.OPEN_GROUP;
- });
- } else if (that.isGroup) {
- req.getRequest('/api/config', {}, function(res) {
- that.params = res.Head_Agreement;
- });
- } else {
- req.getRequest(url, form, data => {
- that.setData({
- params: data
- });
- });
- }
- }
- }
- };
- </script>
- <style>
- @import './page.css';
- </style>
|