爱简收旧衣按件回收前端代码仓库
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.

211 lines
7.0 KiB

  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const pages_mixins_pullRefreshMixin = require("../mixins/pullRefreshMixin.js");
  4. const _sfc_main = {
  5. mixins: [pages_mixins_pullRefreshMixin.pullRefreshMixin],
  6. data() {
  7. return {
  8. statusBarHeight: 0,
  9. navBarHeight: 44,
  10. // px
  11. navBarTotalHeight: 44,
  12. // px
  13. featureTags: ["收益高", "品类全", "到账快", "城市多"],
  14. userInfo: {
  15. avatar: "",
  16. name: "",
  17. id: "",
  18. type: "",
  19. balance: "",
  20. totalWithdraw: ""
  21. },
  22. tabActive: 0,
  23. rankList: [],
  24. status: 0,
  25. showProgressModal: false
  26. };
  27. },
  28. computed: {
  29. qrcodeUrl() {
  30. common_vendor.index.__f__("log", "at pages/subcomponent/promotion.vue:147", getApp().globalData.configData, "getApp().globalData.configData");
  31. const item = getApp().globalData.configData.find((i) => i.keyName === "kefu_code");
  32. return item ? item.keyContent : "";
  33. },
  34. indexLvxingUrl() {
  35. common_vendor.index.__f__("log", "at pages/subcomponent/promotion.vue:152", getApp().globalData.configData, "getApp().globalData.configData");
  36. const item = getApp().globalData.configData.find((i) => i.keyName === "index_lvxing");
  37. return item ? item.keyContent : "";
  38. }
  39. },
  40. onLoad() {
  41. const sysInfo = common_vendor.index.getSystemInfoSync();
  42. this.statusBarHeight = sysInfo.statusBarHeight;
  43. this.navBarHeight = 44;
  44. this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight;
  45. this.getUserInfoByToken();
  46. this.getRankList();
  47. this.getMyPromotionInfo();
  48. },
  49. onShow() {
  50. this.getMyPromotionInfo();
  51. },
  52. onPullDownRefresh() {
  53. this.getUserInfoByToken();
  54. common_vendor.index.stopPullDownRefresh();
  55. },
  56. methods: {
  57. async onRefresh() {
  58. await new Promise((resolve) => setTimeout(resolve, 1e3));
  59. common_vendor.index.stopPullRefresh();
  60. },
  61. navigateBack() {
  62. common_vendor.index.navigateBack();
  63. },
  64. getRankIcon(idx) {
  65. return `/static/tui/${idx}.png`;
  66. },
  67. goQrcode() {
  68. common_vendor.index.navigateTo({ url: "/pages/subcomponent/promo-qrcode" });
  69. },
  70. goUpgrade() {
  71. common_vendor.index.navigateTo({ url: "/pages/subcomponent/upgrad" });
  72. },
  73. getUserInfoByToken() {
  74. this.$api("getUserByToken", {}, (res) => {
  75. if (res && res.success && res.result) {
  76. this.userInfo.avatar = res.result.headImage || "";
  77. this.userInfo.name = res.result.nickName || "";
  78. this.userInfo.id = res.result.id || "";
  79. this.userInfo.intentioCode = res.result.intentioCode || "";
  80. this.userInfo.money = res.result.money || "";
  81. this.userInfo.integerPrice = res.result.integerPrice || "";
  82. }
  83. });
  84. },
  85. goWithdrawRecord() {
  86. common_vendor.index.navigateTo({ url: "/pages/subcomponent/promotion-withdraw-record" });
  87. },
  88. goWithdraw() {
  89. common_vendor.index.navigateTo({ url: "/pages/subcomponent/withdraw?fromPromotion=true" });
  90. },
  91. goProfitDetail() {
  92. common_vendor.index.navigateTo({ url: "/pages/subcomponent/promotion-profit-detail" });
  93. },
  94. goTeam() {
  95. common_vendor.index.navigateTo({ url: "/pages/subcomponent/promotion-team" });
  96. },
  97. getRankList() {
  98. this.$api("getRankList", {}, (res) => {
  99. if (res && res.success && res.result) {
  100. this.rankList = res.result.records || [];
  101. }
  102. });
  103. },
  104. getMyPromotionInfo() {
  105. this.$api("getMyPromotionInfo", {}, (res) => {
  106. if (res && res.success && res.result) {
  107. this.status = res.result.status;
  108. common_vendor.index.__f__("log", "at pages/subcomponent/promotion.vue:228", this.status, "this.status");
  109. }
  110. });
  111. },
  112. goToFaq() {
  113. common_vendor.index.navigateTo({ url: "/pages/subcomponent/admin_faq" });
  114. }
  115. }
  116. };
  117. if (!Array) {
  118. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  119. _easycom_uni_icons2();
  120. }
  121. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  122. if (!Math) {
  123. _easycom_uni_icons();
  124. }
  125. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  126. return common_vendor.e({
  127. a: common_vendor.p({
  128. type: "left",
  129. size: "22",
  130. color: "#222"
  131. }),
  132. b: common_vendor.o((...args) => $options.navigateBack && $options.navigateBack(...args)),
  133. c: common_vendor.p({
  134. type: "more-filled",
  135. size: "22",
  136. color: "#222"
  137. }),
  138. d: $data.navBarTotalHeight + "px",
  139. e: $data.statusBarHeight + "px",
  140. f: common_vendor.f($data.featureTags, (t, i, i0) => {
  141. return {
  142. a: common_vendor.t(t),
  143. b: i
  144. };
  145. }),
  146. g: $data.navBarTotalHeight + $data.statusBarHeight + "px",
  147. h: $data.userInfo.avatar,
  148. i: common_vendor.t($data.userInfo.type),
  149. j: common_vendor.t($data.userInfo.name),
  150. k: common_vendor.t($data.userInfo.intentioCode),
  151. l: common_vendor.t($data.userInfo.money),
  152. m: common_vendor.o((...args) => $options.goWithdraw && $options.goWithdraw(...args)),
  153. n: common_vendor.t($data.userInfo.integerPrice),
  154. o: common_vendor.o((...args) => $options.goWithdrawRecord && $options.goWithdrawRecord(...args)),
  155. p: common_vendor.p({
  156. type: "wallet",
  157. size: "32",
  158. color: "#fff"
  159. }),
  160. q: common_vendor.o((...args) => $options.goProfitDetail && $options.goProfitDetail(...args)),
  161. r: common_vendor.p({
  162. type: "person",
  163. size: "32",
  164. color: "#fff"
  165. }),
  166. s: common_vendor.o((...args) => $options.goTeam && $options.goTeam(...args)),
  167. t: common_vendor.f($data.rankList.slice(0, 5), (item, idx, i0) => {
  168. return common_vendor.e({
  169. a: idx < 3
  170. }, idx < 3 ? {
  171. b: $options.getRankIcon(idx + 1)
  172. } : {
  173. c: $options.getRankIcon(idx + 1)
  174. }, {
  175. d: item.headImage,
  176. e: common_vendor.t(item.nickName),
  177. f: common_vendor.t(item.price),
  178. g: idx
  179. });
  180. }),
  181. v: $options.indexLvxingUrl,
  182. w: $options.qrcodeUrl,
  183. x: common_vendor.o((...args) => $options.goQrcode && $options.goQrcode(...args)),
  184. y: $data.status === ""
  185. }, $data.status === "" ? {
  186. z: common_vendor.o((...args) => $options.goUpgrade && $options.goUpgrade(...args))
  187. } : {}, {
  188. A: $data.status == 0
  189. }, $data.status == 0 ? {
  190. B: common_vendor.o(($event) => $data.showProgressModal = true)
  191. } : {}, {
  192. C: $data.showProgressModal
  193. }, $data.showProgressModal ? {
  194. D: common_vendor.p({
  195. type: "right",
  196. size: "22",
  197. color: "#bbb"
  198. }),
  199. E: common_vendor.o((...args) => $options.goToFaq && $options.goToFaq(...args)),
  200. F: common_vendor.p({
  201. type: "right",
  202. size: "22",
  203. color: "#bbb"
  204. }),
  205. G: common_vendor.o((...args) => $options.goToFaq && $options.goToFaq(...args)),
  206. H: common_vendor.o(($event) => $data.showProgressModal = false)
  207. } : {});
  208. }
  209. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-50cfba12"]]);
  210. wx.createPage(MiniProgramPage);
  211. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/subcomponent/promotion.js.map