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.

198 lines
11 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. "use strict";
  2. const common_vendor = require("../../../../common/vendor.js");
  3. const config_api = require("../../../../config/api.js");
  4. require("../../../../uni_modules/uview-plus/index.js");
  5. require("../../../../uni_modules/uview-plus/libs/mixin/mixin.js");
  6. require("../../../../uni_modules/uview-plus/libs/vue.js");
  7. require("../../../../uni_modules/uview-plus/libs/function/index.js");
  8. require("../../../../uni_modules/uview-plus/libs/function/test.js");
  9. require("../../../../uni_modules/uview-plus/libs/function/digit.js");
  10. require("../../../../uni_modules/uview-plus/libs/config/config.js");
  11. require("../../../../uni_modules/uview-plus/libs/util/route.js");
  12. require("../../../../uni_modules/uview-plus/libs/mixin/mpMixin.js");
  13. require("../../../../uni_modules/uview-plus/libs/luch-request/core/Request.js");
  14. require("../../../../uni_modules/uview-plus/libs/luch-request/core/dispatchRequest.js");
  15. require("../../../../uni_modules/uview-plus/libs/luch-request/adapters/index.js");
  16. require("../../../../uni_modules/uview-plus/libs/luch-request/helpers/buildURL.js");
  17. require("../../../../uni_modules/uview-plus/libs/luch-request/utils.js");
  18. require("../../../../uni_modules/uview-plus/libs/luch-request/core/buildFullPath.js");
  19. require("../../../../uni_modules/uview-plus/libs/luch-request/helpers/isAbsoluteURL.js");
  20. require("../../../../uni_modules/uview-plus/libs/luch-request/helpers/combineURLs.js");
  21. require("../../../../uni_modules/uview-plus/libs/luch-request/core/settle.js");
  22. require("../../../../uni_modules/uview-plus/libs/luch-request/core/InterceptorManager.js");
  23. require("../../../../uni_modules/uview-plus/libs/luch-request/core/mergeConfig.js");
  24. require("../../../../uni_modules/uview-plus/libs/luch-request/core/defaults.js");
  25. require("../../../../uni_modules/uview-plus/libs/luch-request/utils/clone.js");
  26. require("../../../../uni_modules/uview-plus/libs/function/colorGradient.js");
  27. require("../../../../uni_modules/uview-plus/libs/function/debounce.js");
  28. require("../../../../uni_modules/uview-plus/libs/function/throttle.js");
  29. require("../../../../uni_modules/uview-plus/libs/config/props.js");
  30. require("../../../../uni_modules/uview-plus/libs/config/props/actionSheet.js");
  31. require("../../../../uni_modules/uview-plus/libs/config/props/album.js");
  32. require("../../../../uni_modules/uview-plus/libs/config/props/alert.js");
  33. require("../../../../uni_modules/uview-plus/libs/config/props/avatar.js");
  34. require("../../../../uni_modules/uview-plus/libs/config/props/avatarGroup.js");
  35. require("../../../../uni_modules/uview-plus/libs/config/props/backtop.js");
  36. require("../../../../uni_modules/uview-plus/libs/config/props/badge.js");
  37. require("../../../../uni_modules/uview-plus/libs/config/props/button.js");
  38. require("../../../../uni_modules/uview-plus/libs/config/props/calendar.js");
  39. require("../../../../uni_modules/uview-plus/libs/config/props/carKeyboard.js");
  40. require("../../../../uni_modules/uview-plus/libs/config/props/cell.js");
  41. require("../../../../uni_modules/uview-plus/libs/config/props/cellGroup.js");
  42. require("../../../../uni_modules/uview-plus/libs/config/props/checkbox.js");
  43. require("../../../../uni_modules/uview-plus/libs/config/props/checkboxGroup.js");
  44. require("../../../../uni_modules/uview-plus/libs/config/props/circleProgress.js");
  45. require("../../../../uni_modules/uview-plus/libs/config/props/code.js");
  46. require("../../../../uni_modules/uview-plus/libs/config/props/codeInput.js");
  47. require("../../../../uni_modules/uview-plus/libs/config/props/col.js");
  48. require("../../../../uni_modules/uview-plus/libs/config/props/collapse.js");
  49. require("../../../../uni_modules/uview-plus/libs/config/props/collapseItem.js");
  50. require("../../../../uni_modules/uview-plus/libs/config/props/columnNotice.js");
  51. require("../../../../uni_modules/uview-plus/libs/config/props/countDown.js");
  52. require("../../../../uni_modules/uview-plus/libs/config/props/countTo.js");
  53. require("../../../../uni_modules/uview-plus/libs/config/props/datetimePicker.js");
  54. require("../../../../uni_modules/uview-plus/libs/config/props/divider.js");
  55. require("../../../../uni_modules/uview-plus/libs/config/props/empty.js");
  56. require("../../../../uni_modules/uview-plus/libs/config/props/form.js");
  57. require("../../../../uni_modules/uview-plus/libs/config/props/formItem.js");
  58. require("../../../../uni_modules/uview-plus/libs/config/props/gap.js");
  59. require("../../../../uni_modules/uview-plus/libs/config/props/grid.js");
  60. require("../../../../uni_modules/uview-plus/libs/config/props/gridItem.js");
  61. require("../../../../uni_modules/uview-plus/libs/config/props/icon.js");
  62. require("../../../../uni_modules/uview-plus/libs/config/props/image.js");
  63. require("../../../../uni_modules/uview-plus/libs/config/props/indexAnchor.js");
  64. require("../../../../uni_modules/uview-plus/libs/config/props/indexList.js");
  65. require("../../../../uni_modules/uview-plus/libs/config/props/input.js");
  66. require("../../../../uni_modules/uview-plus/libs/config/props/keyboard.js");
  67. require("../../../../uni_modules/uview-plus/libs/config/props/line.js");
  68. require("../../../../uni_modules/uview-plus/libs/config/props/lineProgress.js");
  69. require("../../../../uni_modules/uview-plus/libs/config/props/link.js");
  70. require("../../../../uni_modules/uview-plus/libs/config/props/list.js");
  71. require("../../../../uni_modules/uview-plus/libs/config/props/listItem.js");
  72. require("../../../../uni_modules/uview-plus/libs/config/props/loadingIcon.js");
  73. require("../../../../uni_modules/uview-plus/libs/config/props/loadingPage.js");
  74. require("../../../../uni_modules/uview-plus/libs/config/props/loadmore.js");
  75. require("../../../../uni_modules/uview-plus/libs/config/props/modal.js");
  76. require("../../../../uni_modules/uview-plus/libs/config/props/navbar.js");
  77. require("../../../../uni_modules/uview-plus/libs/config/color.js");
  78. require("../../../../uni_modules/uview-plus/libs/config/props/noNetwork.js");
  79. require("../../../../uni_modules/uview-plus/libs/config/props/noticeBar.js");
  80. require("../../../../uni_modules/uview-plus/libs/config/props/notify.js");
  81. require("../../../../uni_modules/uview-plus/libs/config/props/numberBox.js");
  82. require("../../../../uni_modules/uview-plus/libs/config/props/numberKeyboard.js");
  83. require("../../../../uni_modules/uview-plus/libs/config/props/overlay.js");
  84. require("../../../../uni_modules/uview-plus/libs/config/props/parse.js");
  85. require("../../../../uni_modules/uview-plus/libs/config/props/picker.js");
  86. require("../../../../uni_modules/uview-plus/libs/config/props/popup.js");
  87. require("../../../../uni_modules/uview-plus/libs/config/props/radio.js");
  88. require("../../../../uni_modules/uview-plus/libs/config/props/radioGroup.js");
  89. require("../../../../uni_modules/uview-plus/libs/config/props/rate.js");
  90. require("../../../../uni_modules/uview-plus/libs/config/props/readMore.js");
  91. require("../../../../uni_modules/uview-plus/libs/config/props/row.js");
  92. require("../../../../uni_modules/uview-plus/libs/config/props/rowNotice.js");
  93. require("../../../../uni_modules/uview-plus/libs/config/props/scrollList.js");
  94. require("../../../../uni_modules/uview-plus/libs/config/props/search.js");
  95. require("../../../../uni_modules/uview-plus/libs/config/props/section.js");
  96. require("../../../../uni_modules/uview-plus/libs/config/props/skeleton.js");
  97. require("../../../../uni_modules/uview-plus/libs/config/props/slider.js");
  98. require("../../../../uni_modules/uview-plus/libs/config/props/statusBar.js");
  99. require("../../../../uni_modules/uview-plus/libs/config/props/steps.js");
  100. require("../../../../uni_modules/uview-plus/libs/config/props/stepsItem.js");
  101. require("../../../../uni_modules/uview-plus/libs/config/props/sticky.js");
  102. require("../../../../uni_modules/uview-plus/libs/config/props/subsection.js");
  103. require("../../../../uni_modules/uview-plus/libs/config/props/swipeAction.js");
  104. require("../../../../uni_modules/uview-plus/libs/config/props/swipeActionItem.js");
  105. require("../../../../uni_modules/uview-plus/libs/config/props/swiper.js");
  106. require("../../../../uni_modules/uview-plus/libs/config/props/swipterIndicator.js");
  107. require("../../../../uni_modules/uview-plus/libs/config/props/switch.js");
  108. require("../../../../uni_modules/uview-plus/libs/config/props/tabbar.js");
  109. require("../../../../uni_modules/uview-plus/libs/config/props/tabbarItem.js");
  110. require("../../../../uni_modules/uview-plus/libs/config/props/tabs.js");
  111. require("../../../../uni_modules/uview-plus/libs/config/props/tag.js");
  112. require("../../../../uni_modules/uview-plus/libs/config/props/text.js");
  113. require("../../../../uni_modules/uview-plus/libs/config/props/textarea.js");
  114. require("../../../../uni_modules/uview-plus/libs/config/props/toast.js");
  115. require("../../../../uni_modules/uview-plus/libs/config/props/toolbar.js");
  116. require("../../../../uni_modules/uview-plus/libs/config/props/tooltip.js");
  117. require("../../../../uni_modules/uview-plus/libs/config/props/transition.js");
  118. require("../../../../uni_modules/uview-plus/libs/config/props/upload.js");
  119. require("../../../../uni_modules/uview-plus/libs/config/zIndex.js");
  120. require("../../../../uni_modules/uview-plus/libs/function/platform.js");
  121. if (!Array) {
  122. const _easycom_oneBtn2 = common_vendor.resolveComponent("oneBtn");
  123. _easycom_oneBtn2();
  124. }
  125. const _easycom_oneBtn = () => "../../../../components/oneBtn/oneBtn.js";
  126. if (!Math) {
  127. (topInfo + _easycom_oneBtn)();
  128. }
  129. const topInfo = () => "./comp/topInfo.js";
  130. const _sfc_main = {
  131. __name: "vote",
  132. setup(__props) {
  133. let voteId = "";
  134. common_vendor.ref(false);
  135. const detailInfo = common_vendor.ref({});
  136. async function voteDetailFn() {
  137. const { data: res } = await config_api.voteDetail({ voteId });
  138. console.log(res);
  139. detailInfo.value = res;
  140. }
  141. const voteItemId = common_vendor.ref([]);
  142. function chooseItem(item) {
  143. if (detailInfo.value.voteType == 1) {
  144. voteItemId.value = [{ voteItemId: item.itemId, voteId: voteId * 1 }];
  145. return;
  146. }
  147. let index = voteItemId.value.findIndex((val) => val.voteItemId == item.itemId);
  148. if (index == -1) {
  149. voteItemId.value.push({ voteItemId: item.itemId, voteId: voteId * 1 });
  150. } else {
  151. voteItemId.value.splice(index, 1);
  152. }
  153. console.log(voteItemId.value);
  154. }
  155. async function articleVoteFn() {
  156. if (!voteItemId.value.length)
  157. return;
  158. const { data: res } = await config_api.articleVote(voteItemId.value);
  159. if (res)
  160. common_vendor.index.$u.toast("投票成功");
  161. setTimeout(() => {
  162. common_vendor.index.navigateTo({
  163. url: "/pages/subPage/ballots/vote/voteReslut"
  164. });
  165. }, 1500);
  166. }
  167. common_vendor.onLoad((option) => {
  168. voteId = option.voteId;
  169. voteDetailFn();
  170. });
  171. common_vendor.onPullDownRefresh(async () => {
  172. await voteDetailFn();
  173. common_vendor.index.stopPullDownRefresh();
  174. });
  175. return (_ctx, _cache) => {
  176. return {
  177. a: common_vendor.p({
  178. detailInfo: detailInfo.value
  179. }),
  180. b: common_vendor.f(detailInfo.value.voteItems, (item, index, i0) => {
  181. return {
  182. a: common_vendor.t(item.itemName),
  183. b: voteItemId.value.find((val) => val.voteItemId == item.itemId) ? 1 : "",
  184. c: index,
  185. d: common_vendor.o(($event) => chooseItem(item), index)
  186. };
  187. }),
  188. c: common_vendor.o(articleVoteFn),
  189. d: common_vendor.p({
  190. text: "投 票",
  191. disabled: !voteItemId.value.length
  192. })
  193. };
  194. };
  195. }
  196. };
  197. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-49022e38"], ["__file", "D:/work/xinjiangMiniProgram/pages/subPage/ballots/vote/vote.vue"]]);
  198. wx.createPage(MiniProgramPage);