123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- require("../../utils/request.js");
- const common_config = require("../../common/config.js");
- const _sfc_main = {
- data() {
- return {
- agreementContent: "",
- loading: true,
- error: false,
- errorMsg: "加载失败,请重试"
- };
- },
- onLoad() {
- this.fetchAgreement();
- },
- methods: {
- goBack() {
- common_vendor.index.navigateBack();
- },
- async fetchAgreement() {
- this.loading = true;
- this.error = false;
- const res = await common_vendor.index.request({
- url: `${common_config.apiBaseUrl}/api/public/agreements/terms_of_service/`,
- method: "GET"
- });
- console.log(res);
- if (res.statusCode == 200) {
- this.loading = false;
- this.agreementContent = res.data.content || "";
- }
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: $data.loading
- }, $data.loading ? {} : $data.error ? {
- c: common_vendor.t($data.errorMsg),
- d: common_vendor.o((...args) => $options.fetchAgreement && $options.fetchAgreement(...args))
- } : {}, {
- b: $data.error,
- e: $data.agreementContent
- });
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
- wx.createPage(MiniProgramPage);
|