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.

217 lines
12 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
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 common_assets = require("../../../common/assets.js");
  4. const config_api = require("../../../config/api.js");
  5. require("../../../uni_modules/uview-plus/index.js");
  6. const store_index = require("../../../store/index.js");
  7. const uni_modules_uviewPlus_libs_function_index = require("../../../uni_modules/uview-plus/libs/function/index.js");
  8. require("../../../uni_modules/uview-plus/libs/mixin/mixin.js");
  9. require("../../../uni_modules/uview-plus/libs/vue.js");
  10. require("../../../uni_modules/uview-plus/libs/function/test.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/config.js");
  30. require("../../../uni_modules/uview-plus/libs/config/props.js");
  31. require("../../../uni_modules/uview-plus/libs/config/props/actionSheet.js");
  32. require("../../../uni_modules/uview-plus/libs/config/props/album.js");
  33. require("../../../uni_modules/uview-plus/libs/config/props/alert.js");
  34. require("../../../uni_modules/uview-plus/libs/config/props/avatar.js");
  35. require("../../../uni_modules/uview-plus/libs/config/props/avatarGroup.js");
  36. require("../../../uni_modules/uview-plus/libs/config/props/backtop.js");
  37. require("../../../uni_modules/uview-plus/libs/config/props/badge.js");
  38. require("../../../uni_modules/uview-plus/libs/config/props/button.js");
  39. require("../../../uni_modules/uview-plus/libs/config/props/calendar.js");
  40. require("../../../uni_modules/uview-plus/libs/config/props/carKeyboard.js");
  41. require("../../../uni_modules/uview-plus/libs/config/props/cell.js");
  42. require("../../../uni_modules/uview-plus/libs/config/props/cellGroup.js");
  43. require("../../../uni_modules/uview-plus/libs/config/props/checkbox.js");
  44. require("../../../uni_modules/uview-plus/libs/config/props/checkboxGroup.js");
  45. require("../../../uni_modules/uview-plus/libs/config/props/circleProgress.js");
  46. require("../../../uni_modules/uview-plus/libs/config/props/code.js");
  47. require("../../../uni_modules/uview-plus/libs/config/props/codeInput.js");
  48. require("../../../uni_modules/uview-plus/libs/config/props/col.js");
  49. require("../../../uni_modules/uview-plus/libs/config/props/collapse.js");
  50. require("../../../uni_modules/uview-plus/libs/config/props/collapseItem.js");
  51. require("../../../uni_modules/uview-plus/libs/config/props/columnNotice.js");
  52. require("../../../uni_modules/uview-plus/libs/config/props/countDown.js");
  53. require("../../../uni_modules/uview-plus/libs/config/props/countTo.js");
  54. require("../../../uni_modules/uview-plus/libs/config/props/datetimePicker.js");
  55. require("../../../uni_modules/uview-plus/libs/config/props/divider.js");
  56. require("../../../uni_modules/uview-plus/libs/config/props/empty.js");
  57. require("../../../uni_modules/uview-plus/libs/config/props/form.js");
  58. require("../../../uni_modules/uview-plus/libs/config/props/formItem.js");
  59. require("../../../uni_modules/uview-plus/libs/config/props/gap.js");
  60. require("../../../uni_modules/uview-plus/libs/config/props/grid.js");
  61. require("../../../uni_modules/uview-plus/libs/config/props/gridItem.js");
  62. require("../../../uni_modules/uview-plus/libs/config/props/icon.js");
  63. require("../../../uni_modules/uview-plus/libs/config/props/image.js");
  64. require("../../../uni_modules/uview-plus/libs/config/props/indexAnchor.js");
  65. require("../../../uni_modules/uview-plus/libs/config/props/indexList.js");
  66. require("../../../uni_modules/uview-plus/libs/config/props/input.js");
  67. require("../../../uni_modules/uview-plus/libs/config/props/keyboard.js");
  68. require("../../../uni_modules/uview-plus/libs/config/props/line.js");
  69. require("../../../uni_modules/uview-plus/libs/config/props/lineProgress.js");
  70. require("../../../uni_modules/uview-plus/libs/config/props/link.js");
  71. require("../../../uni_modules/uview-plus/libs/config/props/list.js");
  72. require("../../../uni_modules/uview-plus/libs/config/props/listItem.js");
  73. require("../../../uni_modules/uview-plus/libs/config/props/loadingIcon.js");
  74. require("../../../uni_modules/uview-plus/libs/config/props/loadingPage.js");
  75. require("../../../uni_modules/uview-plus/libs/config/props/loadmore.js");
  76. require("../../../uni_modules/uview-plus/libs/config/props/modal.js");
  77. require("../../../uni_modules/uview-plus/libs/config/props/navbar.js");
  78. require("../../../uni_modules/uview-plus/libs/config/color.js");
  79. require("../../../uni_modules/uview-plus/libs/config/props/noNetwork.js");
  80. require("../../../uni_modules/uview-plus/libs/config/props/noticeBar.js");
  81. require("../../../uni_modules/uview-plus/libs/config/props/notify.js");
  82. require("../../../uni_modules/uview-plus/libs/config/props/numberBox.js");
  83. require("../../../uni_modules/uview-plus/libs/config/props/numberKeyboard.js");
  84. require("../../../uni_modules/uview-plus/libs/config/props/overlay.js");
  85. require("../../../uni_modules/uview-plus/libs/config/props/parse.js");
  86. require("../../../uni_modules/uview-plus/libs/config/props/picker.js");
  87. require("../../../uni_modules/uview-plus/libs/config/props/popup.js");
  88. require("../../../uni_modules/uview-plus/libs/config/props/radio.js");
  89. require("../../../uni_modules/uview-plus/libs/config/props/radioGroup.js");
  90. require("../../../uni_modules/uview-plus/libs/config/props/rate.js");
  91. require("../../../uni_modules/uview-plus/libs/config/props/readMore.js");
  92. require("../../../uni_modules/uview-plus/libs/config/props/row.js");
  93. require("../../../uni_modules/uview-plus/libs/config/props/rowNotice.js");
  94. require("../../../uni_modules/uview-plus/libs/config/props/scrollList.js");
  95. require("../../../uni_modules/uview-plus/libs/config/props/search.js");
  96. require("../../../uni_modules/uview-plus/libs/config/props/section.js");
  97. require("../../../uni_modules/uview-plus/libs/config/props/skeleton.js");
  98. require("../../../uni_modules/uview-plus/libs/config/props/slider.js");
  99. require("../../../uni_modules/uview-plus/libs/config/props/statusBar.js");
  100. require("../../../uni_modules/uview-plus/libs/config/props/steps.js");
  101. require("../../../uni_modules/uview-plus/libs/config/props/stepsItem.js");
  102. require("../../../uni_modules/uview-plus/libs/config/props/sticky.js");
  103. require("../../../uni_modules/uview-plus/libs/config/props/subsection.js");
  104. require("../../../uni_modules/uview-plus/libs/config/props/swipeAction.js");
  105. require("../../../uni_modules/uview-plus/libs/config/props/swipeActionItem.js");
  106. require("../../../uni_modules/uview-plus/libs/config/props/swiper.js");
  107. require("../../../uni_modules/uview-plus/libs/config/props/swipterIndicator.js");
  108. require("../../../uni_modules/uview-plus/libs/config/props/switch.js");
  109. require("../../../uni_modules/uview-plus/libs/config/props/tabbar.js");
  110. require("../../../uni_modules/uview-plus/libs/config/props/tabbarItem.js");
  111. require("../../../uni_modules/uview-plus/libs/config/props/tabs.js");
  112. require("../../../uni_modules/uview-plus/libs/config/props/tag.js");
  113. require("../../../uni_modules/uview-plus/libs/config/props/text.js");
  114. require("../../../uni_modules/uview-plus/libs/config/props/textarea.js");
  115. require("../../../uni_modules/uview-plus/libs/config/props/toast.js");
  116. require("../../../uni_modules/uview-plus/libs/config/props/toolbar.js");
  117. require("../../../uni_modules/uview-plus/libs/config/props/tooltip.js");
  118. require("../../../uni_modules/uview-plus/libs/config/props/transition.js");
  119. require("../../../uni_modules/uview-plus/libs/config/props/upload.js");
  120. require("../../../uni_modules/uview-plus/libs/config/zIndex.js");
  121. require("../../../uni_modules/uview-plus/libs/function/platform.js");
  122. require("../../../uni_modules/uview-plus/libs/function/digit.js");
  123. if (!Array) {
  124. const _easycom_oneBtn2 = common_vendor.resolveComponent("oneBtn");
  125. _easycom_oneBtn2();
  126. }
  127. const _easycom_oneBtn = () => "../../../components/oneBtn/oneBtn.js";
  128. if (!Math) {
  129. (_easycom_oneBtn + privacyRadion)();
  130. }
  131. const privacyRadion = () => "../../../components/privacyRadion/privacyRadion.js";
  132. const _sfc_main = {
  133. __name: "login",
  134. setup(__props) {
  135. common_vendor.ref({
  136. phone: "",
  137. code: ""
  138. });
  139. let isCheck = common_vendor.ref(false);
  140. function handleBtnClick() {
  141. uni_modules_uviewPlus_libs_function_index.toast("请先勾先勾选用户协议与隐私政策");
  142. }
  143. function changeRadio(val) {
  144. common_vendor.index.hideKeyboard();
  145. isCheck.value = val;
  146. }
  147. function loginFn() {
  148. return new Promise((resolve, reject) => {
  149. common_vendor.index.login({
  150. provider: "weixin",
  151. success: (loginRes) => {
  152. if (loginRes.code) {
  153. console.log("loginRes.code");
  154. console.log(loginRes.code);
  155. resolve(loginRes.code);
  156. } else {
  157. console.error("微信登录失败");
  158. }
  159. },
  160. fail: (err) => {
  161. reject(null);
  162. console.error("微信登录失败", err);
  163. }
  164. });
  165. });
  166. }
  167. async function getPhoneNumber(e) {
  168. if (!isCheck.value)
  169. return uni_modules_uviewPlus_libs_function_index.toast("请勾选产品协议与隐私政策");
  170. let phoneCode = e.detail.code;
  171. console.log(e.detail.errMsg);
  172. console.log(e.detail);
  173. const loginCode = await loginFn();
  174. if (!loginCode || !phoneCode)
  175. return;
  176. let obj = {
  177. phoneCode,
  178. socialCode: loginCode
  179. };
  180. const {
  181. data: res
  182. } = await config_api.weixinLogin(obj);
  183. const counterStore = store_index.userStore();
  184. await counterStore.upDateToken(res.accessToken);
  185. await counterStore.upDateLoginInfo(res);
  186. common_vendor.index.$u.toast("登录成功");
  187. setTimeout(() => {
  188. common_vendor.index.switchTab({
  189. url: "/pages/tabbar/index/index"
  190. });
  191. }, 2e3);
  192. }
  193. return (_ctx, _cache) => {
  194. return common_vendor.e({
  195. a: common_assets._imports_0$1,
  196. b: !common_vendor.unref(isCheck)
  197. }, !common_vendor.unref(isCheck) ? {
  198. c: common_vendor.o(handleBtnClick),
  199. d: common_vendor.p({
  200. text: "微信一键登录"
  201. })
  202. } : {
  203. e: common_vendor.o(getPhoneNumber),
  204. f: common_vendor.p({
  205. text: "微信一键登录"
  206. })
  207. }, {
  208. g: common_vendor.o(changeRadio),
  209. h: common_vendor.p({
  210. isCheck: common_vendor.unref(isCheck)
  211. })
  212. });
  213. };
  214. }
  215. };
  216. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f8b2b374"], ["__file", "D:/work/xinjiangMiniProgram/pages/subPage/login/login.vue"]]);
  217. wx.createPage(MiniProgramPage);