"use strict"; const common_vendor = require("../../common/vendor.js"); const api_user = require("../../api/user.js"); const _sfc_main = { data() { return { agreementContent: "", loading: true, error: false, errorMsg: "加载失败,请重试" }; }, onLoad() { this.fetchAgreement(); }, methods: { goBack() { common_vendor.index.navigateBack(); }, fetchAgreement() { this.loading = true; this.error = false; api_user.getUserAgreement().then((res) => { console.log(res); this.loading = false; this.agreementContent = res.content || ""; console.log(this.agreementContent); }).catch((err) => { console.error("获取用户协议失败:", err); this.error = true; this.errorMsg = "网络异常,请稍后重试"; }).finally(() => { this.loading = false; }); } } }; 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)) } : { e: $data.agreementContent }, { b: $data.error }); } const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]); wx.createPage(MiniProgramPage);