(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-rights-rights"],{"298c":function(t,e,a){"use strict";var i=a("885d"),n=a.n(i);n.a},"62dd":function(t,e,a){"use strict";a.r(e);var i=a("e985"),n=a("9cfd");for(var s in n)["default"].indexOf(s)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(s);a("298c");var o=a("828b"),r=Object(o["a"])(n["default"],i["b"],i["c"],!1,null,"e6473e9c",null,!1,i["a"],void 0);e["default"]=r.exports},"714d":function(t,e,a){"use strict";a("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a("bf0f"),a("18f7"),a("de6c"),a("dc89"),a("2425"),a("7a76"),a("c9b5"),a("d4b5"),a("c223");var i={data:function(){return{status:"auth",form:{realName:"",phone:"",idType:"居民身份证",idNumber:""},showIdTypePicker:!1,tabs:["待使用","已预约","已使用"],currentTab:0,keyword:"",rightsList:[],pageNo:1,pageSize:10,total:0,lng:"",lat:"",loading:!1}},onLoad:function(t){t.status&&(this.status=t.status),this.form.phone=uni.getStorageSync("phone")||"";var e=uni.getStorageSync("lng")&&uni.getStorageSync("lat")?{lng:uni.getStorageSync("lng"),lat:uni.getStorageSync("lat")}:null;e&&(this.lng=e.lng,this.lat=e.lat),this.checkAuthResult(),"info"===this.status&&this.loadRightsList()},methods:{checkAuthResult:function(){var t=this,e=new URL(window.location.href),a=e.searchParams.get("response");if(console.log("responseStr:",a),a){var i;try{var n=JSON.parse(decodeURIComponent(a));console.log("parms:",n),i="string"===typeof n?JSON.parse(n):n,console.log("response:",i)}catch(r){try{i=JSON.parse(a)}catch(c){return}}var s=i.code,o=i.extInfo?i.extInfo.certifyId:"";console.log("code:",s,"certifyId:",o),1e3==s&&o?this.$u.api.describeFaceVerify({certifyId:o}).then((function(e){if(console.log("describeFaceVerify res:",e),0===e.errcode&&e.data.body&&e.data.body.resultObject){var a=e.data.body.resultObject;if(console.log("verifyResult:",a),"T"===String(a.passed)||"T"===String(a.Passed)){var i=uni.getStorageSync("phone")||"",n=uni.getStorageSync("authName")||"",s=uni.getStorageSync("authIdNo")||"";t.$u.api.getEligibility({phone:i,identityNo:s,name:n}).then((function(e){console.log("eligibility res:",e),0===e.errcode&&(uni.setStorageSync("isAuth",e.data.isAuth),uni.setStorageSync("hasWin",e.data.hasWin),uni.setStorageSync("cardNumber",e.data.cardNumber),uni.setStorageSync("expiresTime",e.data.expiresTime),e.data.isAuth&&(t.status=e.data.hasWin?"info":"noWin","info"===t.status&&t.loadRightsList()))}))}else uni.showToast({title:"认证未通过",icon:"none"})}else uni.showToast({title:"认证结果查询失败",icon:"none"})})).catch((function(){uni.showToast({title:"认证结果查询失败",icon:"none"})})):uni.showToast({title:"认证未通过",icon:"none"})}},loadAliyunSDK:function(){return new Promise((function(t,e){if(window.getMetaInfo)t();else{var a=document.createElement("script");a.src="https://o.alicdn.com/yd-cloudauth/cloudauth-cdn/jsvm_all.js",a.onload=function(){return t()},a.onerror=function(){return e(new Error("加载阿里云SDK失败"))},document.head.appendChild(a)}}))},onAuth:function(){var t=this;this.form.realName?this.form.idNumber?(uni.setStorageSync("authName",this.form.realName),uni.setStorageSync("authIdNo",this.form.idNumber),this.loadAliyunSDK().then((function(){var e=JSON.stringify(window.getMetaInfo()),a=window.location.origin+window.location.pathname+"?response=%7B%7D#/pages/rights/rights?status=auth";t.$u.api.initFaceVerify({certName:t.form.realName,certNo:t.form.idNumber,metaInfo:e,returnUrl:a}).then((function(t){0===t.errcode&&t.data.body&&t.data.body.resultObject&&t.data.body.resultObject.certifyUrl?window.location.href=t.data.body.resultObject.certifyUrl:uni.showToast({title:t.errmsg||"认证初始化失败",icon:"none"})})).catch((function(){uni.showToast({title:"认证初始化失败",icon:"none"})}))})).catch((function(){uni.showToast({title:"加载认证组件失败",icon:"none"})}))):uni.showToast({title:"请输入证件号码",icon:"none"}):uni.showToast({title:"请输入真实姓名",icon:"none"})},loadRightsList:function(){var t=uni.getStorageSync("cardNumber")||"";this.fetchRightsList(t)},fetchRightsList:function(t){var e=this;this.loading||(this.loading=!0,this.$u.api.getRightsList({pageNo:this.pageNo,pageSize:this.pageSize,keyword:this.keyword,lng:this.lng,lat:this.lat,cardNumber:t}).then((function(t){if(0===t.errcode&&t.data){var a=t.data.list||[];1===e.pageNo?e.rightsList=a:e.rightsList=e.rightsList.concat(a),e.total=t.data.total||0}})).finally((function(){e.loading=!1})))},loadMore:function(){this.rightsList.length=t.total&&t.rightsList.length>0?a("v-uni-view",{staticClass:"no-more"},[a("v-uni-text",{staticClass:"no-more-text"},[t._v("没有更多了")])],1):t._e()],2)],1):t._e()],1)},s=[]}}]);