index.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const utils_system = require("../../utils/system.js");
  4. require("../../utils/http.js");
  5. if (!Array) {
  6. const _easycom_wd_cell2 = common_vendor.resolveComponent("wd-cell");
  7. _easycom_wd_cell2();
  8. }
  9. const _easycom_wd_cell = () => "../../node-modules/wot-design-uni/components/wd-cell/wd-cell.js";
  10. if (!Math) {
  11. (_easycom_wd_cell + UserLoginPopup)();
  12. }
  13. const UserLoginPopup = () => "../../components/userLoginPopup.js";
  14. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  15. __name: "index",
  16. setup(__props) {
  17. const imgObj = {
  18. user: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/user.png",
  19. gift: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/gift.png",
  20. page: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/page.png",
  21. with: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/with.png",
  22. myBg: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/myBg.png"
  23. };
  24. const list = [
  25. {
  26. label: "可用积分",
  27. src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/int.png",
  28. num: 0
  29. },
  30. {
  31. label: "优惠券",
  32. src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/coupon.png",
  33. num: 0
  34. }
  35. ];
  36. const navTop = common_vendor.ref(0);
  37. const loginRef = common_vendor.ref(null);
  38. const path = common_vendor.ref("");
  39. const phone = common_vendor.index.getStorageSync("phone");
  40. const toWinner = () => {
  41. path.value = "/pagesOne/record/winnerList";
  42. if (!utils_system.isGetPhone()) {
  43. loginRef.value.show = true;
  44. } else {
  45. common_vendor.index.navigateTo({
  46. url: "/pagesOne/record/winnerList"
  47. });
  48. }
  49. };
  50. const toUpLoad = () => {
  51. path.value = "/pagesOne/record/uploadList";
  52. if (!utils_system.isGetPhone()) {
  53. loginRef.value.show = true;
  54. } else {
  55. common_vendor.index.navigateTo({
  56. url: "/pagesOne/record/uploadList"
  57. });
  58. }
  59. };
  60. const mobile = common_vendor.ref("");
  61. const onLogin = async (e) => {
  62. path.value = "";
  63. console.log("-------------------", utils_system.isGetPhone());
  64. if (!utils_system.isGetPhone()) {
  65. loginRef.value.show = true;
  66. }
  67. };
  68. const getPhone = (res) => {
  69. mobile.value = res;
  70. };
  71. common_vendor.onLoad(() => {
  72. navTop.value = utils_system.getNavTop();
  73. });
  74. common_vendor.onShow(() => {
  75. utils_system.getActivityData();
  76. });
  77. return (_ctx, _cache) => {
  78. return common_vendor.e({
  79. a: imgObj.myBg,
  80. b: navTop.value + "rpx",
  81. c: imgObj.user,
  82. d: common_vendor.t(common_vendor.unref(phone) || mobile.value || "用户昵称"),
  83. e: !common_vendor.unref(phone) && !mobile.value
  84. }, !common_vendor.unref(phone) && !mobile.value ? {
  85. f: common_vendor.o(onLogin)
  86. } : {}, {
  87. g: navTop.value + 125 + "rpx",
  88. h: common_vendor.f(list, (item, index, i0) => {
  89. return {
  90. a: item.src,
  91. b: index
  92. };
  93. }),
  94. i: navTop.value + 280 + "rpx",
  95. j: imgObj.gift,
  96. k: imgObj.with,
  97. l: common_vendor.o(toWinner),
  98. m: common_vendor.p({
  99. ["is-link"]: true,
  100. title: "奖励记录"
  101. }),
  102. n: imgObj.page,
  103. o: common_vendor.o(toUpLoad),
  104. p: common_vendor.p({
  105. border: true,
  106. ["is-link"]: true,
  107. title: "上传记录"
  108. }),
  109. q: common_vendor.sr(loginRef, "276ac604-2", {
  110. "k": "loginRef"
  111. }),
  112. r: common_vendor.o(getPhone),
  113. s: common_vendor.p({
  114. path: path.value
  115. })
  116. });
  117. };
  118. }
  119. });
  120. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-276ac604"]]);
  121. wx.createPage(MiniProgramPage);