- 帮我看下下面源码是不是有编译过还是纯原生的呢?
代码如下图,看起来又像是原生的,但是可读性又很性,给模版的变量都是在["render", function(a, o, t, n, i, r) { return e.e({后定义的,老板拿来的代码,要在这上面二开的,看的头大。。 "use strict"; const e = require("../../common/vendor.js"); var a, o; const t = getApp(), n = { components: { popWarn: () => "../../components/popWarn/popWarn.js" }, data: () => ({ imgsrc: `${t.globalData.masterDomain}/static/images/miniprograme/task/`, imgVersion: t.globalData.imgVersion, canIUse: !0, canIUseGetUserProfile: !1, masterDomain: t.globalData.masterDomain, fromShare: 0, userData: {}, warningb: !1, info: "", miniProgramBindPhone: "", agreeb: !1, privateb: !1, reqUrl: "", platText: "", platcanIUse: !0 }), beforeCreate() {}, onLoad(e) { console.log("原生登录"), a = this, -1 == t.globalData.wxprivate ? t.watchG("wxprivate", (function(o) { a.wxprivate = o, o ? a.privateb = !0 : a.onload(e) })) : t.globalData.wxprivate ? a.privateb = !0 : a.onload(e) }, methods: { onload(o) { o.wxMiniProgramLogin && 1 == o.wxMiniProgramLogin && (a.wxMiniProgramLogin = 1), (o.path && "" != o .path || o.url && "" != o.url) && (a.path = o.path || o.url); let n = t.globalData.platForm; if ("mp-weixin" == n) { let e = a.path && "" != a.path ? "&path=" + a.path : ""; this.reqUrl = "include/ajax.php?service=member&action=wxMiniProgramConnect&fromShare=" + a .fromShare + e, this.platcanIUse = !1 } else if ("mp-toutiao" == n) { let e = a.path && "" != a.path ? "&path=" + a.path : "", o = a.wxMiniProgramLogin && "" != a.wxMiniProgramLogin ? "&wxMiniProgramLogin=" + a .wxMiniProgramLogin : ""; this.reqUrl = "include/ajax.php?service=member&action=byteMiniProgramConnect&fromShare=" + a .fromShare + e + o, this.platText = "抖音" }(o.back && 1 == o.back || o.path && "" != o.path) && (a.back = 1), o.authorize && (a.authorize = 1), o .fromShare && (a.fromShare = o.fromShare); let i = parseInt(t.globalData.dyConfig.bindphone); a.miniProgramBindPhone = i, o.authorize || 0 == i && e.index.getStorage({ key: "applyUserInfo" }), e.index.getUserProfile && (a.canIUseGetUserProfile = !0), e.index.login({ success: e => { a.code = e.code } }), a.redirect = o.url, a.agreeData() }, warnFn(e = 2e3) { this.warningb = !0, clearTimeout(o), o = setTimeout((e => { this.warningb = !1 }), e) }, backFn() { e.index.navigateBack({ delta: 1, fail: a => { e.index.redirectTo({ url: "/pages/index/index" }) } }) }, getUserProfile(o) { let t = parseInt(a.miniProgramBindPhone); e.index.login({ success: e => { e.code, a.code = e.code } }), e.index.getUserProfile({ desc: "用于完善会员资料", success: o => { let n = { code: a.code, iv: o.iv, encryptedData: o.encryptedData, redirect: a.redirect, nickname: o.userInfo.nickName, photo: o.userInfo.avatarUrl, city: o.userInfo.city, province: o.userInfo.province, gender: o.userInfo.gender }; a.userData = n, t ? a.request(1) : (a.canIUse = !1, e.index.setStorage({ key: "applyUserInfo", data: 1 })) }, fail: a => { console.log(a), e.index.showToast({ title: "已拒绝小程序获取信息", icon: "none", duration: 2e3 }) } }) }, getPhoneNumber(o) { let t; if (!o.detail.encryptedData && !o.detail.iv) return e.index.showToast({ title: "已拒绝小程序授权登录", icon: "none", duration: 2e3 }), !1; a.userData, e.index.login({ success: e => { t = { code: e.code, encryptedData: o.detail.encryptedData, iv: o.detail.iv }, a.phoneData = t, a.request() } }) }, wxLogin(o) { let t; if (!o.detail.encryptedData && !o.detail.iv) return e.index.showToast({ title: "已拒绝小程序授权登录", icon: "none", duration: 2e3 }), !1; e.index.login({ success: e => { console.log(e,12121) t = { code: o.detail.code, encryptedData: o.detail.encryptedData, iv: o.detail.iv }, a.phoneData = t, a.$set(a.userData, "code", e.code), a.request() } }) }, checkAgree() { e.index.showToast({ title: "请先同意并勾选《用户注册协议》和《隐私协议》", icon: "none", success: a => { setTimeout((a => { e.index.hideToast() }), 2e3) } }) }, agreeData() { let e = (new Date).valueOf(); a.$ajax.get({ url: "api/appConfig.json?v=" + e }).then((e => { a.protocol = e.data.protocol })) }, linkTo(o) { let t = o, n = ""; "1" == t ? n = a.protocol["用户注册协议"] : "2" == t && (n = a.protocol["隐私政策"]), e.index.navigateTo({ url: "/pages/redirect/index?url=" + encodeURIComponent(n) }) }, request(o) { e.index.showLoading({ title: "登录中..." }), a.$ajax.post({ url: `${a.reqUrl}&base64=1`, data: `phoneData=${t.base64("encode",unescape(encodeURIComponent(JSON.stringify(a.phoneData))))}&userData=${t.base64("encode",unescape(encodeURIComponent(a.userData?JSON.stringify(a.userData):"")))}` }).then((o => { if (o.data) { let n = o.data; if (100 == n.state) { e.index.removeStorageSync("logoutSelf"); let o = "", i = "", r = "", s = n.info.split("?")[1]; o = t.getUrlPara(s, "uid"), i = t.getUrlPara(s, "access_token"), r = t .getUrlPara(s, "refresh_token"), e.index.setStorageSync("userid", o), e .index.setStorageSync("access_token", i), e.index.setStorageSync( "refresh_token", r); let l = Date.parse(new Date) / 1e3 + 7200 - 20; if (e.index.setStorageSync("token_expired", l), t.globalData.userid = o, t .memberInfo(o), t.globalData.access_token = i, t.globalData.refresh_token = r, t.globalData.token_expired = l, decodeURIComponent(a.path).indexOf( "/pages/") > -1) e.index.navigateBack({ delta: 1, fail: function() { e.index.redirectTo({ url: "/pages/redirect/index?url=" + encodeURIComponent(n.info) }) } }); else { let o = a.path; o = o.indexOf("forcelogout&") > -1 ? o.replace("forcelogout&", "") : o .replace("&forcelogout", ""); let n = t.addUrlParam(o); e.index.redirectTo({ url: "/pages/redirect/index?url=" + encodeURIComponent(n) }) } } else e.index.hideLoading(), e.index.showToast({ title: n.info, icon: "none", duration: 2e3 }), a.userData = {}, a.canIUse = !0 } else e.index.hideLoading(), e.index.showToast({ title: "授权失败!", icon: "none", duration: 2e3 }), a.userData = {}, a.canIUse = !0 })).catch((o => { console.log(o), e.index.showToast({ title: "登录失败!", icon: "none", duration: 2e3 }), a.userData = {}, a.canIUse = !0 })) }, loginTo() { let o = a.path && "" != a.path ? "path=" + a.path : "", n = a.wxMiniProgramLogin && "" != a.wxMiniProgramLogin ? "&wxMiniProgramLogin=" + a .wxMiniProgramLogin : "", i = "/pages/redirect/index?url=" + encodeURIComponent(t.addUrlParam(t.globalData.masterDomain + "/login.html?from=wxmini&" + o + n, "forcelogout")); a.back && 1 == a.back ? e.index.navigateTo({ url: i }) : e.index.navigateBack() }, agree() { this.agreeb = !this.agreeb } }, watch: { info(e, a) { "" != e && (this.warnFn(), setTimeout((e => { this.info = "" }), 2200)) } }, onShareAppMessage(e) { let a = t.globalData.appConfig; return { title: a.share.title, desc: a.share.description, path: "/pages/index/index", imageUrl: t.globalData.masterDomain + "/include/json.php?action=getSystemLogo" } }, onShareTimeline: () => ({ title: config.share.title, imageUrl: t.globalData.masterDomain + "/include/json.php?action=getSystemLogo" }) }; if (!Array) { (e.resolveComponent("popWarn") + e.resolveComponent("private_tip"))() } Math || ((() => "../../components/popWarn/popWarn.js") + (() => "../../components/private_tip/private_tip.js"))(); const i = e._export_sfc(n, [ ["render", function(a, o, t, n, i, r) { return e.e({ a: i.canIUse && i.platcanIUse }, i.canIUse && i.platcanIUse ? e.e({ b: i.masterDomain + "/include/json.php?action=getSystemLogo", c: i.canIUseGetUserProfile }, i.canIUseGetUserProfile ? { d: e.t(i.platText), e: e.o((e => i.agreeb ? r.getUserProfile() : r.checkAgree())) } : {}, { f: i.canIUseGetUserProfile && !i.miniProgramBindPhone }, i.canIUseGetUserProfile && !i.miniProgramBindPhone ? { g: e.o(((...e) => r.backFn && r.backFn(...e))) } : {}, { h: i.miniProgramBindPhone }, i.miniProgramBindPhone ? { i: e.o(((...e) => r.loginTo && r.loginTo(...e))) } : {}) : e.e({ j: i.masterDomain + "/include/json.php?action=getSystemLogo", k: !i.agreeb }, i.agreeb ? { n: e.t(i.platText), o: e.o((e => i.platcanIUse ? r.getPhoneNumber(e) : r.wxLogin(e))) } : { l: e.t(i.platText), m: e.o(((...e) => r.checkAgree && r.checkAgree(...e))) }, { p: i.canIUseGetUserProfile }, i.canIUseGetUserProfile ? { q: e.o(((...e) => r.loginTo && r.loginTo(...e))) } : {}), { r: e.n("agreebtn " + (i.agreeb ? "checked" : "")), s: e.o(((...e) => r.agree && r.agree(...e))), t: e.o((e => r.linkTo(1))), v: e.o((e => r.linkTo(2))), w: e.p({ info: i.info, warningb: i.warningb }), x: e.p({ privateShow: i.privateb }) }) }] ]); n.__runtimeHooks = 6, wx.createPage(i);
05-27 - veduo标签 资质问题?
我的一个商城,然后想放一些学习视频,查了下好像现在小程序 视频都要需要添加"文娱-其他视频”类目,这里面又要办什么证,证是绝对不想花精力折腾了,想问下大家有没有折中的方案呀
05-19 - 企业微信如果没认证可以用微信客服功能吗?
小程序想使用微信客服功能,但企业微信这边还没有认证,这个没认证可以使用微信客服吗
05-04 - 公众号文章点击发表后没有群发出去发表记录也没有?
【公众号】: 加蓝树货车配件 【浏览器UA】: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 【页面链接】: https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit&action=edit×tamp=1714013140104&type=77&appmsgid=100000020&token=143250157&lang=zh_CN 【问题描述】: 公众号文章编辑好后,点击发表后,可是发表记录里也没有,粉丝也没有收到消息 [图片] [图片]
04-25 - 微信小程序发货信息超时问题?
这个发货开始时以通过 API生成发货订单或导入XLS发货订单来算的吗? 导入XLS模版中有一栏 为 是否完成发货,如果写的是“是”的话是不是就表示发货完成了等客户确认就可以?如果写的是否,就需要发货,然后时间发货开始时间就以后导入那个时间节点来算是吗?
02-19 - 地图接口被限制按照要求整改,还是过不了。又联系不上客服?
原始ID gh_09f116d3cba4 [图片] [图片] 上面这张强制授权的功能我早就已经处理过了,可是审核的时候还是说我这个违规,难道你们审核的时候没有清除缓存还是啥,客服又联系不上,点击那消息中的客服永远 都是机器人。
2023-12-13 - 我的API接口wx.getLocation 被限制了还能解封吗?
我的API接口wx.getLocation 因为之前没有注意过了时间没按要求整改 ,导致违规被暂停使用了,现在根据要求整改了,还能恢复使用吗。原始ID gh_09f116d3cba4
2023-12-07 - 微信开放平台 网站应用 微信支付问题
微信开放平台已认证了,也申请了网站应用,但现在想在网站内实现微信扫码支付,可是在商户平台绑定appid的时候,提示网站应用的appid不在自助绑定的范围之内。现在要怎么实现在网站的微信支付? 难道还要再花300个认证个服务号吗? [图片]
2019-11-20 - h5支付商家存在未配置的参数,请联系商家解决问题?
Referer与后台设置的顶级域名是一致的吗为什么还提示这个错误 呢,求解。。 [图片] [图片]
2019-08-30