1 line
7.8 KiB
JavaScript
1 line
7.8 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-login-registerByTg"],{1010:function(e,t,a){var n=a("8ee9");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=a("967d").default;o("24f9dbed",n,!0,{sourceMap:!1,shadowMode:!1})},"67cf":function(e,t,a){"use strict";var n=a("1010"),o=a.n(n);o.a},"8ee9":function(e,t,a){var n=a("c86c");t=n(!1),t.push([e.i,".block__title[data-v-6eff5211]{margin:0;font-weight:400;font-size:14px;color:rgba(69,90,100,.6);padding:%?40?% %?30?% %?20?%}.read-me[data-v-6eff5211]{line-height:%?64?%}.user-read[data-v-6eff5211]{margin-left:%?10?%;color:#006400}.tg-user-card[data-v-6eff5211]{background-color:#fff;border-radius:12px;padding:16px;margin:12px;box-shadow:0 4px 12px rgba(0,0,0,.08)}.tg-note[data-v-6eff5211]{color:#666;font-size:14px;line-height:1.5;margin-bottom:12px;padding-left:8px;border-left:2px solid #e5e5e5}.tg-user-info[data-v-6eff5211]{display:flex;align-items:center}.tg-avatar[data-v-6eff5211]{width:80px;height:80px;border-radius:50%;margin-right:16px;border:2px solid #f0f0f0}.tg-user-details[data-v-6eff5211]{flex:1}.tg-name[data-v-6eff5211]{font-size:18px;font-weight:700;margin-bottom:6px}.tg-note[data-v-6eff5211]{margin-bottom:16px;padding:12px;background-color:#f9f9f9;border-radius:8px;border-left:3px solid #08c}.tg-note-title[data-v-6eff5211]{font-weight:700;margin-bottom:6px;color:#333}.tg-note-content[data-v-6eff5211]{color:#666;font-size:14px;line-height:1.6}.tg-language[data-v-6eff5211]{display:flex;align-items:center;color:#888;font-size:14px}.tg-language .icon[data-v-6eff5211]{margin-right:4px}",""]),e.exports=t},"973f":function(e,t,a){"use strict";a.d(t,"b",(function(){return n})),a.d(t,"c",(function(){return o})),a.d(t,"a",(function(){}));var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("v-uni-view",[a("v-uni-view",{staticClass:"block__title"},[e._v(e._s(e.$t("pages.login.register.注册信息")))]),a("v-uni-view",{staticClass:"tg-user-card"},[a("v-uni-view",{staticClass:"tg-note"},[a("v-uni-view",{staticClass:"tg-note-title"},[e._v("📱 手机号设置说明")]),a("v-uni-view",{staticClass:"tg-note-content"},[e._v("注册时如需设置或修改手机号,请通过 Telegram 完成。\n 当前暂不支持手动修改,如有疑问或需要协助,请联系物业处理。")])],1),a("v-uni-view",{staticClass:"tg-user-info"},[a("v-uni-image",{staticClass:"tg-avatar",attrs:{src:e.tgData.user.photo_url,mode:"aspectFill"}}),a("v-uni-view",{staticClass:"tg-user-details"},[a("v-uni-view",{staticClass:"tg-name"},[e._v(e._s(e.tgData.user.first_name)+" "+e._s(e.tgData.user.last_name))]),a("v-uni-view",{staticClass:"tg-language"},[a("v-uni-text",{staticClass:"icon"},[e._v("🌐")]),a("v-uni-text",[e._v(e._s(e.tgData.user.language_code))])],1)],1)],1)],1),a("v-uni-view",{staticClass:"padding flex justify-start"},[a("v-uni-checkbox-group",{on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e._changeReadme.apply(void 0,arguments)}}},[a("v-uni-checkbox",{staticStyle:{transform:"scale(0.7)"},attrs:{value:"readme"}})],1),a("v-uni-view",{staticClass:"read-me"},[a("v-uni-text",{staticClass:"margin-left-xs"},[e._v(e._s(e.$t("pages.login.register.我已阅读")))]),a("v-uni-text",{staticClass:"user-read",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e._readMe.apply(void 0,arguments)}}},[e._v(e._s(e.$t("pages.login.register.用户须知")))])],1)],1),a("v-uni-view",{staticClass:"padding flex flex-direction margin-top"},[a("v-uni-button",{staticClass:"cu-btn bg-blue lg",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e._doRegister()}}},[e._v(e._s(e.$t("pages.login.register.使用telegram一键注册")))])],1)],1)},o=[]},"9f1a":function(e,t,a){"use strict";a("6a54");var n=a("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("c9b5"),a("d5c6"),a("5a56"),a("f074"),a("fd3c"),a("c223"),a("aa77"),a("bf0f");var o=n(a("4303")),i=a("d691"),r=n(a("9508")),s=a("d709"),d=o.default.constant,c={data:function(){return{tgData:"",upData:"",password:"1",rePassword:"1",readme:!1,countryCodes:[],selectedCountryCode:"+86",selectedCountryCodeRaw:"86"}},onLoad:function(){var e,t=btoa(unescape(encodeURIComponent(window.Telegram.WebApp.initData)));if(this.tgData=window.Telegram.WebApp.initDataUnsafe||{},this.upData=t,this.getInternationalAreaCodeData(),null!==(e=window.Telegram)&&void 0!==e&&e.WebApp){var a,n=(null===(a=window.Telegram.WebApp.initDataUnsafe)||void 0===a?void 0:a.user)||{};this.tgData.user={photo_url:n.photo_url||"",first_name:n.first_name||"",last_name:n.last_name||"",language_code:n.language_code||""}}console.log(this.tgData)},methods:{getInternationalAreaCodeData:function(){var e=this;(0,i.queryInternationalAreaCodeDict)({name:"international_area_code_dictionary",type:"link_area_type"}).then((function(t){if(Array.isArray(t)&&t.length>0){e.countryCodes=t.map((function(e){return{name:"".concat(e.name," (+").concat(e.statusCd,")"),code:"+".concat(e.statusCd),rawCode:String(e.statusCd)}}));var a=e.countryCodes.find((function(e){return"86"===e.rawCode}));if(a)e.selectedCountryCode=a.code,e.selectedCountryCodeRaw=a.rawCode;else{var n=e.countryCodes[0];e.selectedCountryCode=n.code,e.selectedCountryCodeRaw=n.rawCode}}else e.countryCodes=[{name:"中国 (+86)",code:"+86",rawCode:"86"}]})).catch((function(t){console.error("[注册页-国区数据] 加载失败:",t),e.countryCodes=[{name:"中国 (+86)",code:"+86",rawCode:"86"}]}))},onCountryCodeChange:function(e){var t=this,a=this.countryCodes[e.detail.value];a&&(this.selectedCountryCode=a.code,this.selectedCountryCodeRaw=a.rawCode,this.$nextTick((function(){return t.$forceUpdate()})))},_changeReadme:function(e){this.readme=e.detail.value.length>0},_doRegister:function(){var e=this;if(this.readme)if(this.password&&this.password===this.rePassword)if(this.upData){var t=uni.getStorageSync("DEFAULT_COMMUNITY_ID")||r.default.DEFAULT_COMMUNITY_ID,a={areaId:this.selectedCountryCodeRaw,password:this.password,openId:uni.getStorageSync(d.mapping.CURRENT_OPEN_ID),defaultCommunityId:t,tg_data:this.upData};(0,s.ownerRegiter)(a).then((function(t){0!==t.code&&-111!==t.code||(-111===t.code&&wx.showToast({title:e.$t("pages.login.register.telegram账号已存在正在登陆"),icon:"none"}),wx.hideLoading(),wx.redirectTo({url:"/pages/login/loginByTg"}))}))}else wx.showToast({title:this.$t("pages.login.register.请确保你是在telegram环境中注册"),icon:"none"});else wx.showToast({title:this.$t("pages.login.register.密码和重置密码不一致"),icon:"none"});else wx.showToast({title:this.$t("pages.login.register.未选择我已阅读用户须知"),icon:"none"})},_readMe:function(){uni.navigateTo({url:"/pages/login/registerProtocol"})}}};t.default=c},adff:function(e,t,a){"use strict";a.r(t);var n=a("9f1a"),o=a.n(n);for(var i in n)["default"].indexOf(i)<0&&function(e){a.d(t,e,(function(){return n[e]}))}(i);t["default"]=o.a},d691:function(e,t,a){"use strict";a("6a54");var n=a("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.queryInternationalAreaCodeDict=function(){return new Promise((function(e,t){(0,i.requestNoAuth)({url:o.default.queryInternationalAreaCodeDict,method:"GET",data:{name:"international_area_code_dictionary",type:"link_area_type"},success:function(a){console.log("[国区接口] 成功返回:",a),200===a.statusCode?e(a.data):(uni.showToast({title:"国区数据加载失败",icon:"none"}),t(new Error("接口错误:".concat(a.statusCode))))},fail:function(e){console.error("[国区接口] 请求失败:",e),uni.showToast({title:"网络异常,国区数据加载失败",icon:"none"}),t(e)}})}))},a("bf0f"),a("7a76"),a("c9b5");var o=n(a("0cb3")),i=a("c2bd")},e751:function(e,t,a){"use strict";a.r(t);var n=a("973f"),o=a("adff");for(var i in o)["default"].indexOf(i)<0&&function(e){a.d(t,e,(function(){return o[e]}))}(i);a("67cf");var r=a("828b"),s=Object(r["a"])(o["default"],n["b"],n["c"],!1,null,"6eff5211",null,!1,n["a"],void 0);t["default"]=s.exports}}]); |