index.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const stores_userDataManager = require("../../stores/userDataManager.js");
  4. const data_data = require("../../data/data.js");
  5. const framework_util = require("../../framework/util.js");
  6. const framework_log = require("../../framework/log.js");
  7. const framework_http = require("../../framework/http.js");
  8. const config_config = require("../../config/config.js");
  9. require("../../framework/tools.js");
  10. if (!Math) {
  11. (alertDialog + MessageVue)();
  12. }
  13. const MessageVue = () => "../../components/public/Message.js";
  14. const alertDialog = () => "../../components/public/alertDialog.js";
  15. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  16. __name: "index",
  17. setup(__props) {
  18. let udata = new data_data.user_data();
  19. udata.token = "123";
  20. udata.user_id = "1";
  21. udata.user_name = "大靓仔";
  22. let tip_message = common_vendor.ref("");
  23. stores_userDataManager.UserData().updateUserData(udata);
  24. const { data } = common_vendor.storeToRefs(stores_userDataManager.UserData());
  25. let title = common_vendor.ref("123");
  26. let obj = common_vendor.reactive({ a: "12", b: "123" });
  27. let cb = function() {
  28. framework_util.util.alert("你有点呆呆的!");
  29. title.value = "fuck!";
  30. obj.a = "world";
  31. };
  32. let isOpenDialog = common_vendor.ref(false);
  33. let titleName = common_vendor.ref("fuck u!");
  34. function onDialogClose() {
  35. framework_log.log.Debug("onDialogClose!");
  36. isOpenDialog.value = false;
  37. }
  38. function onDialogConfirm() {
  39. framework_log.log.Debug("onDialogConfirm!");
  40. isOpenDialog.value = false;
  41. framework_http.http.StaticRequest("https://static.hainanmlwl.com/test_books/book_list.json", (err, data2) => {
  42. if (err) {
  43. tip_message = err;
  44. isOpenMessage.value = true;
  45. return;
  46. }
  47. framework_log.log.Debug("data.code", typeof config_config.config.url_confg.StatesCode.SUCCESS);
  48. if (data2.code == config_config.config.url_confg.StatesCode.SUCCESS) {
  49. framework_log.log.Debug("book_list", data2);
  50. } else {
  51. tip_message = data2.message;
  52. isOpenMessage.value = true;
  53. }
  54. });
  55. }
  56. let isOpenMessage = common_vendor.ref(false);
  57. common_vendor.onMounted(() => {
  58. });
  59. common_vendor.onUnmounted(() => {
  60. });
  61. common_vendor.watch(obj, async (new_v, old_v) => {
  62. console.log(new_v, old_v);
  63. });
  64. return (_ctx, _cache) => {
  65. return common_vendor.e({
  66. a: common_vendor.t(common_vendor.unref(title)),
  67. b: common_vendor.t(common_vendor.unref(data).user_name),
  68. c: common_vendor.o(
  69. //@ts-ignore
  70. (...args) => common_vendor.unref(cb) && common_vendor.unref(cb)(...args)
  71. ),
  72. d: common_vendor.f(common_vendor.unref(obj), (v, k, i) => {
  73. return {
  74. a: common_vendor.t(v),
  75. b: common_vendor.t(i)
  76. };
  77. }),
  78. e: common_vendor.unref(isOpenDialog)
  79. }, common_vendor.unref(isOpenDialog) ? {
  80. f: common_vendor.o(onDialogConfirm),
  81. g: common_vendor.o(onDialogClose),
  82. h: common_vendor.p({
  83. titleName: common_vendor.unref(titleName),
  84. contentText: "你好呀!"
  85. })
  86. } : {}, {
  87. i: common_vendor.o(($event) => common_vendor.isRef(isOpenDialog) ? isOpenDialog.value = true : isOpenDialog = true),
  88. j: common_vendor.o(($event) => common_vendor.isRef(isOpenMessage) ? isOpenMessage.value = true : isOpenMessage = true),
  89. k: common_vendor.unref(isOpenMessage)
  90. }, common_vendor.unref(isOpenMessage) ? {
  91. l: common_vendor.o(($event) => common_vendor.isRef(isOpenMessage) ? isOpenMessage.value = false : isOpenMessage = false),
  92. m: common_vendor.p({
  93. messageText: common_vendor.unref(tip_message)
  94. })
  95. } : {});
  96. };
  97. }
  98. });
  99. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b11b71c1"], ["__file", "/Users/future/Desktop/项目/uni-xs/xs-app/pages/test/index.vue"]]);
  100. tt.createPage(MiniProgramPage);