index.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. if (!Array) {
  4. const _easycom_u_avatar2 = common_vendor.resolveComponent("u-avatar");
  5. _easycom_u_avatar2();
  6. }
  7. const _easycom_u_avatar = () => "../../node-modules/uview-plus/components/u-avatar/u-avatar.js";
  8. if (!Math) {
  9. _easycom_u_avatar();
  10. }
  11. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  12. __name: "index",
  13. setup(__props) {
  14. var _a, _b, _c;
  15. (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  16. (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config;
  17. (_c = common_vendor.getCurrentInstance()) == null ? void 0 : _c.appContext.config.globalProperties.$apifile;
  18. common_vendor.computed(() => {
  19. return common_vendor.index.getStorageSync("openid");
  20. });
  21. const config = common_vendor.ref({ logoUrl: "" });
  22. const form = common_vendor.ref({ icon: "", city: "", sex: "", nickname: "", phone: "" });
  23. const sexList = common_vendor.ref([]);
  24. common_vendor.onLoad(async () => {
  25. await searchOther();
  26. await searchConfig();
  27. await search();
  28. common_vendor.index.$on("setCity", function(city) {
  29. form.value.city = city;
  30. });
  31. });
  32. const searchOther = async () => {
  33. };
  34. const searchConfig = async () => {
  35. config.value = common_vendor.index.getStorageSync("config");
  36. };
  37. const search = async () => {
  38. };
  39. const sexChange = (e) => {
  40. const data = sexList.value[e.detail.value];
  41. if (data)
  42. form.value.sex = data.dictLabel;
  43. };
  44. const formSubmit = async (e) => {
  45. let data = e.detail.value;
  46. data.icon = form.value.icon;
  47. data = delEmptyQueryNodes(data);
  48. console.log(data);
  49. };
  50. const delEmptyQueryNodes = (obj = {}) => {
  51. Object.keys(obj).forEach((key) => {
  52. let value = obj[key];
  53. value && typeof value === "object" && delEmptyQueryNodes(value);
  54. (value === "" || value === null || value === void 0 || value.length === 0 || Object.keys(value).length === 0) && delete obj[key];
  55. });
  56. return obj;
  57. };
  58. return (_ctx, _cache) => {
  59. return {
  60. a: form.value.id,
  61. b: common_vendor.p({
  62. text: form.value.name,
  63. shape: "square",
  64. fontSize: "40",
  65. randomBgColor: true
  66. }),
  67. c: form.value.name,
  68. d: form.value.nickname,
  69. e: common_vendor.t(form.value.sex || "请选择性别"),
  70. f: common_vendor.o(sexChange),
  71. g: _ctx.index,
  72. h: sexList.value,
  73. i: form.value.phone,
  74. j: common_vendor.o(formSubmit)
  75. };
  76. };
  77. }
  78. });
  79. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-bf1a7b85"], ["__file", "D:/project/赋强公证/notarization_applet/pagesMy/basic/index.vue"]]);
  80. wx.createPage(MiniProgramPage);