index.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. };
  23. const list = [
  24. {
  25. label: "可用积分",
  26. src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/int.png",
  27. num: 0
  28. },
  29. {
  30. label: "优惠券",
  31. src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/coupon.png",
  32. num: 0
  33. }
  34. ];
  35. const list2 = [
  36. {
  37. title: "连先生便利店",
  38. label: "距离您88m",
  39. content: "麓枫和苑6栋一单元",
  40. src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/address1.png"
  41. },
  42. {
  43. title: "转角手作町",
  44. label: "距离您126m",
  45. content: "后湖创业园内",
  46. src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/address2.png"
  47. }
  48. ];
  49. const navTop = common_vendor.ref(0);
  50. const loginRef = common_vendor.ref(null);
  51. const path = common_vendor.ref("");
  52. const phone = common_vendor.index.getStorageSync("phone");
  53. const toWinner = () => {
  54. path.value = "/pagesOne/record/winnerList";
  55. if (!utils_system.isGetPhone()) {
  56. loginRef.value.show = true;
  57. } else {
  58. common_vendor.index.navigateTo({
  59. url: "/pagesOne/record/winnerList"
  60. });
  61. }
  62. };
  63. const toUpLoad = () => {
  64. path.value = "/pagesOne/record/uploadList";
  65. if (!utils_system.isGetPhone()) {
  66. loginRef.value.show = true;
  67. } else {
  68. common_vendor.index.navigateTo({
  69. url: "/pagesOne/record/uploadList"
  70. });
  71. }
  72. };
  73. const mobile = common_vendor.ref("");
  74. const onLogin = async (e) => {
  75. path.value = "";
  76. if (!utils_system.isGetPhone()) {
  77. loginRef.value.show = true;
  78. }
  79. };
  80. const getPhone = (res) => {
  81. mobile.value = res;
  82. };
  83. const toLink = (data) => {
  84. common_vendor.index.navigateTo({
  85. url: `/pages/my/location?title=${data.title}&label=${data.label}&content=${data.content}&src=${data.src}`
  86. });
  87. };
  88. common_vendor.onLoad(() => {
  89. navTop.value = utils_system.getNavTop();
  90. });
  91. common_vendor.onShow(() => {
  92. utils_system.getActivityData();
  93. });
  94. return (_ctx, _cache) => {
  95. return common_vendor.e({
  96. a: navTop.value + "rpx",
  97. b: imgObj.user,
  98. c: common_vendor.t(common_vendor.unref(phone) || mobile.value || "用户昵称"),
  99. d: !common_vendor.unref(phone) && !mobile.value
  100. }, !common_vendor.unref(phone) && !mobile.value ? {
  101. e: common_vendor.o(onLogin)
  102. } : {}, {
  103. f: navTop.value + 125 + "rpx",
  104. g: common_vendor.f(list, (item, index, i0) => {
  105. return {
  106. a: common_vendor.t(item.label),
  107. b: item.src,
  108. c: index
  109. };
  110. }),
  111. h: navTop.value + 290 + "rpx",
  112. i: imgObj.gift,
  113. j: imgObj.with,
  114. k: common_vendor.o(toWinner),
  115. l: common_vendor.p({
  116. ["is-link"]: true,
  117. title: "奖励记录"
  118. }),
  119. m: imgObj.page,
  120. n: common_vendor.o(toUpLoad),
  121. o: common_vendor.p({
  122. border: true,
  123. ["is-link"]: true,
  124. title: "上传记录"
  125. }),
  126. p: common_vendor.f(list2, (item, index, i0) => {
  127. return {
  128. a: common_vendor.t(item.title),
  129. b: common_vendor.t(item.label),
  130. c: common_vendor.t(item.content),
  131. d: common_vendor.o(($event) => toLink(item), index),
  132. e: index
  133. };
  134. }),
  135. q: common_vendor.sr(loginRef, "276ac604-2", {
  136. "k": "loginRef"
  137. }),
  138. r: common_vendor.o(getPhone),
  139. s: common_vendor.p({
  140. path: path.value
  141. })
  142. });
  143. };
  144. }
  145. });
  146. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-276ac604"]]);
  147. wx.createPage(MiniProgramPage);