1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
- __name: "index",
- setup(__props) {
- var _a;
- (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
- const openid = common_vendor.computed(() => {
- return common_vendor.index.getStorageSync("openid");
- });
- const agree = common_vendor.ref(false);
- const otherLogin = () => {
- if (agree.value) {
- if (openid.value) {
- common_vendor.index.getUserProfile({
- desc: "用于展示",
- success: async function(res) {
- let parmas = {
- openid: openid.value,
- icon: res.userInfo.avatarUrl,
- nickname: res.userInfo.nickName + common_vendor.hooks().valueOf()
- };
- const arr = await that.$api(`matchUser`, "POST", parmas);
- if (arr.code === 200) {
- common_vendor.index.setStorage({
- key: "user",
- data: arr.data,
- success: function() {
- common_vendor.index.navigateBack({
- delta: 1
- });
- }
- });
- } else {
- common_vendor.index.showToast({
- title: arr.msg,
- icon: "error"
- });
- }
- },
- fail: function(err) {
- console.log(err);
- }
- });
- } else {
- common_vendor.index.showToast({
- title: "系统更新中,请稍后再试!",
- icon: "none"
- });
- }
- } else {
- common_vendor.index.showToast({
- title: "请阅读并同意用户协议和隐私政策",
- icon: "none"
- });
- }
- };
- const toAgree = () => {
- common_vendor.index.navigateTo({
- url: `/pagesHome/agree/index`
- });
- };
- return (_ctx, _cache) => {
- return {
- a: common_vendor.o(($event) => otherLogin()),
- b: agree.value,
- c: common_vendor.o(($event) => toAgree()),
- d: common_vendor.o(
- //@ts-ignore
- (...args) => _ctx.changeAgree && _ctx.changeAgree(...args)
- )
- };
- };
- }
- });
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-d08ef7d4"], ["__file", "D:/project/足球比赛/match_applet/pages/login/index.vue"]]);
- wx.createPage(MiniProgramPage);
|