12 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/upload-face/upload-face"],{214:function(e,t,n){"use strict";(function(e,t){var o=n(4);n(26);o(n(25));var a=o(n(215));e.__webpack_require_UNI_MP_PLUGIN__=n,t(a.default)}).call(this,n(1)["default"],n(2)["createPage"])},215:function(e,t,n){"use strict";n.r(t);var o=n(216),a=n(218);for(var r in a)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(r);n(220);var c,u=n(36),s=Object(u["default"])(a["default"],o["render"],o["staticRenderFns"],!1,null,null,null,!1,o["components"],c);s.options.__file="pages/upload-face/upload-face.vue",t["default"]=s.exports},216:function(e,t,n){"use strict";n.r(t);var o=n(217);n.d(t,"render",(function(){return o["render"]})),n.d(t,"staticRenderFns",(function(){return o["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return o["recyclableRender"]})),n.d(t,"components",(function(){return o["components"]}))},217:function(e,t,n){"use strict";var o;n.r(t),n.d(t,"render",(function(){return a})),n.d(t,"staticRenderFns",(function(){return c})),n.d(t,"recyclableRender",(function(){return r})),n.d(t,"components",(function(){return o}));try{o={uIcon:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(n.bind(null,283))},uButton:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-button/u-button")]).then(n.bind(null,292))},uToast:function(){return n.e("uni_modules/uview-ui/components/u-toast/u-toast").then(n.bind(null,318))}}}catch(u){if(-1===u.message.indexOf("Cannot find module")||-1===u.message.indexOf(".vue"))throw u;console.error(u.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var a=function(){var e=this,t=e.$createElement;e._self._c},r=!1,c=[];a._withStripped=!0},218:function(e,t,n){"use strict";n.r(t);var o=n(219),a=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(r);t["default"]=a.a},219:function(e,t,n){"use strict";(function(e){var o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(n(30)),r=o(n(32)),c={data:function(){return{bgColor:"#3c9cff",pic:"",msg:{userId:e.getStorageSync("userId"),facePic:""}}},methods:{takePhoto:function(){var t=this;e.chooseImage({count:1,sizeType:["compressed"],sourceType:["album","camera"],success:function(e){var n=e.tempFilePaths;console.log(n[0]),t.urlTobase64(n[0])}})},urlTobase64:function(t){var n=this;console.log("url",t);var o=this;e.getFileSystemManager().readFile({filePath:t,encoding:"base64",success:function(){var t=(0,r.default)(a.default.mark((function t(r){var c,u,s;return a.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return c="data:image/jpg;base64,"+r.data,c=c.split(",")[1],o.msg.facePic=c,e.showLoading({mask:!0,title:"图片上传中"}),t.next=6,e.$http.post("/api/v1/test/user/face",o.msg);case 6:u=t.sent,s=u.data,e.hideLoading(),console.log(11,s),200==s.code?(n.$u.toast("人脸上传成功"),o.pic="data:image/jpeg;base64,"+c):n.$refs.uToast.show({type:"error",icon:!1,title:"失败主题",message:s.msg});case 11:case"end":return t.stop()}}),t)})));function c(e){return t.apply(this,arguments)}return c}(),fail:function(e){return reject(e.errMsg)}})},getFacePic:function(){var t=this;return(0,r.default)(a.default.mark((function n(){var o,r;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.showLoading({mask:!0,title:"正在加载",icon:"none"}),n.next=3,e.$http.get("/api/v1/test/user/facePic/".concat(t.msg.userId));case 3:o=n.sent,r=o.data,console.log(r),e.hideLoading(),200==r.code?(t.pic="data:image/jpg;base64,"+r.data,console.log(t.pic)):t.$u.toast("人脸未上传,请上传照片");case 8:case"end":return n.stop()}}),n)})))()},deleteFace:function(){var t=this;return(0,r.default)(a.default.mark((function n(){var o,r;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.$http.delete("/api/v1/test/user/face/".concat(t.msg.userId));case 2:o=n.sent,r=o.data,console.log(t.msg.userId),200===r.code?(e.showToast({duration:1500,title:r.data,icon:"none"}),t.pic=""):e.$showMsg("删除失败");case 6:case"end":return n.stop()}}),n)})))()}},onLoad:function(){this.getFacePic()}};t.default=c}).call(this,n(2)["default"])},220:function(e,t,n){"use strict";n.r(t);var o=n(221),a=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(r);t["default"]=a.a},221:function(e,t,n){}},[[214,"common/runtime","common/vendor"]]]);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/upload-face/upload-face.js.map
|