1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/info/editCenter"],{"0f96":function(t,e,i){"use strict";i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){return n}));var n={uniPopup:function(){return i.e("node-modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup").then(i.bind(null,"8eb5"))}},s=function(){var t=this,e=t.$createElement;t._self._c},a=[]},"235a":function(t,e,i){"use strict";(function(t){i("39a3");n(i("66fd"));var e=n(i("25a0"));function n(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=i,t(e.default)}).call(this,i("543d")["createPage"])},"25a0":function(t,e,i){"use strict";i.r(e);var n=i("0f96"),s=i("5049");for(var a in s)"default"!==a&&function(t){i.d(e,t,(function(){return s[t]}))}(a);i("7b3d");var o,c=i("f0c5"),r=Object(c["a"])(s["default"],n["b"],n["c"],!1,null,"83a863f4",null,!1,n["a"],o);e["default"]=r.exports},5049:function(t,e,i){"use strict";i.r(e);var n=i("a61f"),s=i.n(n);for(var a in n)"default"!==a&&function(t){i.d(e,t,(function(){return n[t]}))}(a);e["default"]=s.a},"7b3d":function(t,e,i){"use strict";var n=i("cf5a"),s=i.n(n);s.a},a61f:function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(i("dbb0")),s=i("f8e9"),a=i("eb73");function o(t){return t&&t.__esModule?t:{default:t}}var c=function(){Promise.all([i.e("common/vendor"),i.e("components/TabBar/TabBar")]).then(function(){return resolve(i("a31d"))}.bind(null,i)).catch(i.oe)},r=function(){i.e("components/invinbg-image-cropper/invinbg-image-cropper").then(function(){return resolve(i("3d91"))}.bind(null,i)).catch(i.oe)},u=(new n.default({key:"E5SBZ-T2YC3-CBL3F-YGFQQ-26PP2-ERFII"}),{components:{TabBar:c,ImageCropper:r},data:function(){return{btnText:"完成",pageName:"个人资料",assetsUrl:this.$util.assetsUrl,scrollHeight:0,topNavHeight:0,scrollRefreshing:!1,scrollTriggered:!0,tempFilePath:"",cropFilePath:"",nickname:"",introduce:"",heights:[],height:"选择身高",weights:[],weight:"选择体重",age:"选择年龄",jobs:[],careersData:[],job:"选择职业",auths:[{key:"WxM2F5",value:"对VIP公开或使用颜豆、权益卡查看"},{key:"WaitAuth",value:"经过我授权才能查看微信"}],auth:"经过我授权才能查看微信",weiXinStatusEnum:"WaitAuth",wechat:"",myCitys:[],myLabels:[],myWants:[],saveOptions:{birthday:"",career:"",cities:[],completeUser:{},desc:"",education:{},height:0,icon:"",myLabelIds:[],nick:"",wantedLabelIds:[],weiXinStatus:{},weight:0,wxId:""}}},computed:{statusBarHeight:function(){return this.$store.state.statusBarHeight},topbarOffsetHeight:function(){return this.$store.state.topbarOffsetHeight}},onLoad:function(t){this.computedScollviewHeight(),this.getMineData()},mounted:function(){for(var t=[],e=150;e<210;e++)t.push("".concat(e,"cm"));this.heights=t,t=[];for(var i=30;i<150;i++)t.push("".concat(i,"kg"));this.weights=t,this.getCareersConfig()},onPageScroll:function(t){},methods:{back:function(){t.navigateBack({delta:1})},showHeadPopup:function(){this.btnText="从相册上传",this.$refs.popup.open()},hideHeadPopup:function(){this.btnText="完成",this.$refs.popup.close()},computedScollviewHeight:function(){var e=this,i=t.createSelectorQuery().in(this),n=0;i.select("#topnav").boundingClientRect((function(t){e.topNavHeight=t.height,n+=t.height})).exec((function(){var i=t.getSystemInfoSync();e.scrollHeight=i.windowHeight-n}))},scrollRefresh:function(){var t=this;this.scrollRefreshing||(this.scrollRefreshing=!0,setTimeout((function(){t.scrollTriggered=!1,t.scrollRefreshing=!1}),1e3),this.getMineDetail())},scrollPulling:function(t){},scrollRestore:function(){this.scrollTriggered=!0},scrollAbort:function(){},scrollToBottom:function(){},randNick:function(){var t=this;this.$api.login.randNick({}).then((function(e){t.nickname=e.data.nick})).catch((function(t){}))},confirm:function(e){var i=this;this.tempFilePath="",this.cropFilePath=e.detail.tempFilePath;var n=this,o=(0,s.getPolicy)(),c=(0,a.encode)(JSON.stringify(o)),r=(0,s.getKey)(0,this.cropFilePath.split(".")[1]);n.$api.public.aliossToken({}).then((function(e){var a={key:r,policy:c,OSSAccessKeyId:e.data.accessKeyId,signature:(0,s.computeSignature)(e.data.accessKeySecret,c),"x-oss-security-token":e.data.securityToken,success_action_status:"200"};t.uploadFile({url:"https://zhenyanapp-gen.oss-cn-qingdao.aliyuncs.com",filePath:i.cropFilePath,name:"file",header:{"Content-Type":"multipart/form-data"},formData:a,success:function(t){200===t.statusCode&&(n.icon="".concat(n.$store.state.imageCdn,"/").concat(r),n.saveOptions.icon="".concat(n.$store.state.imageCdn,"/").concat(r))},fail:function(t){console.log(t)}})}))},cancel:function(){console.log("canceled")},getCareersConfig:function(){var t=this;this.$api.public.config({tscsj:["Careers"]}).then((function(e){t.careersData=e.data.careers;var i=[],n=[];for(var s in e.data.careers)n.push(s);i.push(n),i.push(e.data.careers[n[0]]),t.jobs=i})).catch((function(t){console.log(t)}))},getMineDetail:function(){var e=this,i=JSON.parse(t.getStorageSync("user"));this.$api.public.mineDetail({getAlbum:!0,completeUser:i}).then((function(i){e.$store.commit("setUserInfo",i.data),t.setStorageSync("userInfo",JSON.stringify(i.data))}))},heightsChange:function(t){this.height=this.heights[t.detail.value]},weightsChange:function(t){this.weight=this.weights[t.detail.value]},agesChange:function(t){this.age=t.detail.value},jobsChange:function(t){var e=this.jobs[1][t.detail.value[1]];this.job=e},jobsColumnChange:function(t){var e=this.jobs[t.detail.column][t.detail.value];0===t.detail.column&&(this.jobs[1]=this.careersData[e],this.$forceUpdate())},authsChange:function(t){this.auth=this.auths[t.detail.value].value,this.weiXinStatusEnum=this.auths[t.detail.value].key},editCity:function(){t.navigateTo({url:"/pages/info/city?type=edit"})},editLabels:function(){t.navigateTo({url:"/pages/info/labels?type=labels"})},editWants:function(){t.navigateTo({url:"/pages/info/labels?type=wants"})},getMineData:function(){var e=this,i=this.$store.state.userInfo||JSON.parse(t.getStorageSync("userInfo"));console.log(i),this.saveOptions.icon=i.icon,this.cropFilePath=i.iconThumbnail,this.nickname=i.nick,this.introduce=i.desc,this.height=i.height,this.weight=i.weight,this.age=i.ageInfo.birthday,this.job=i.career,this.wechat=i.wxId,this.weiXinStatusEnum=i.weixinStatus,this.auths.forEach((function(t,i){t.key===e.weiXinStatusEnum&&(e.auth=t.value)})),this.myCitys=i.cities||[],this.myLabels=i.myLabels||[],this.myWants=i.userWantedLabels||[]},sure:function(){var e=this;if("完成"===this.btnText){var i=this.$store.state.userInfo||JSON.parse(t.getStorageSync("userInfo"));if(this.saveOptions.birthday=this.age,this.saveOptions.education=i.education,this.saveOptions.career=this.job,this.saveOptions.cities=this.myCitys,this.saveOptions.completeUser=JSON.parse(t.getStorageSync("user")),this.saveOptions.desc=this.introduce,this.saveOptions.weight=this.weight,this.saveOptions.height=this.height,this.saveOptions.nick=this.nickname,this.saveOptions.weiXinStatus=this.weiXinStatusEnum,this.saveOptions.wxId=this.wechat,!this.saveOptions.icon)return void t.showToast({mask:!0,title:"请上传头像",icon:"none"});if(!this.saveOptions.nick)return void t.showToast({mask:!0,title:"请填写昵称",icon:"none"});if(!this.saveOptions.desc)return void t.showToast({mask:!0,title:"请填写个人简介",icon:"none"});t.showLoading({mask:!0,title:"更新中···"}),this.$api.login.editPersonal(this.saveOptions).then((function(i){if("Succ"===i.status){var n=JSON.parse(t.getStorageSync("user"));e.$api.login.editHead({completeUser:n,icon:e.saveOptions.icon}).then((function(e){t.hideLoading(),t.showToast({mask:!0,title:"更新成功",icon:"success"})})),e.getMineDetail()}}))}else this.$refs.popup.close(),this.btnText="完成",t.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(t){e.tempFilePath=t.tempFiles[0].path}})}}});e.default=u}).call(this,i("543d")["default"])},cf5a:function(t,e,i){}},[["235a","common/runtime","common/vendor"]]]);
|