You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
3.1 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
2 weeks ago
4 months ago
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const config_site_config = require("../../../config/site.config.js");
  4. const config_api = require("../../../config/api.js");
  5. const store_index = require("../../../store/index.js");
  6. if (!Array) {
  7. const _component_avabtnBox = common_vendor.resolveComponent("avabtnBox");
  8. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  9. (_component_avabtnBox + _easycom_u_icon2)();
  10. }
  11. const _easycom_u_icon = () => "../../../uni_modules/uview-plus/components/u-icon/u-icon.js";
  12. if (!Math) {
  13. _easycom_u_icon();
  14. }
  15. const _sfc_main = {
  16. __name: "mine",
  17. setup(__props) {
  18. const { imgUrl } = config_site_config.obj;
  19. const topBgUrl = imgUrl + "minebg.png";
  20. const counterStore = store_index.userStore();
  21. const configList = common_vendor.ref([
  22. { text: "用户协议", url: "/pages/subPage/privacyAgreement/privacyAgreement?type=2" },
  23. { text: "隐私政策", url: "/pages/subPage/privacyAgreement/privacyAgreement?type=1" }
  24. ]);
  25. function logOutFn() {
  26. common_vendor.index.showModal({
  27. content: "确定要退出登录吗?",
  28. success: async function(res) {
  29. if (res.confirm) {
  30. await config_api.logOut();
  31. counterStore.goLogin();
  32. } else if (res.cancel) {
  33. console.log("用户点击取消");
  34. }
  35. }
  36. });
  37. }
  38. async function getUserInfoFn() {
  39. const { data: res } = await config_api.getUserInfo();
  40. counterStore.upDateUseInfo("name", res.userName);
  41. counterStore.upDateUseInfo("userPhone", res.userPhone);
  42. console.log(res);
  43. }
  44. common_vendor.onShow(() => {
  45. counterStore.upDateUseInfo("name", "");
  46. if (counterStore.token && !counterStore.userInfo.name) {
  47. getUserInfoFn();
  48. }
  49. });
  50. return (_ctx, _cache) => {
  51. return common_vendor.e({
  52. a: _ctx.avaUrl
  53. }, _ctx.avaUrl ? {
  54. b: _ctx.avaUrl
  55. } : {}, {
  56. c: common_vendor.unref(counterStore).token
  57. }, common_vendor.unref(counterStore).token ? {
  58. d: common_vendor.t(common_vendor.unref(counterStore).userInfo.name),
  59. e: common_vendor.t(common_vendor.unref(counterStore).userInfo.userPhone)
  60. } : {
  61. f: common_vendor.o(($event) => _ctx.$goPage("/pages/subPage/login/login"))
  62. }, {
  63. g: common_vendor.f(configList.value, (item, index, i0) => {
  64. return {
  65. a: common_vendor.t(item.text),
  66. b: "23ed4277-1-" + i0,
  67. c: index,
  68. d: common_vendor.o(($event) => _ctx.$goPage(item.url), index)
  69. };
  70. }),
  71. h: common_vendor.p({
  72. name: "arrow-right"
  73. }),
  74. i: common_vendor.p({
  75. name: "arrow-right"
  76. }),
  77. j: common_vendor.unref(counterStore).token
  78. }, common_vendor.unref(counterStore).token ? {
  79. k: common_vendor.o(logOutFn)
  80. } : {}, {
  81. l: "url(" + topBgUrl + ") #F5F5F5 no-repeat"
  82. });
  83. };
  84. }
  85. };
  86. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-23ed4277"]]);
  87. wx.createPage(MiniProgramPage);