| 12 |
- require('./common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages_course/webview"],{934:function(e,n,t){"use strict";(function(e,n){var o=t(4);t(26);o(t(25));var i=o(t(935));e.__webpack_require_UNI_MP_PLUGIN__=t,n(i.default)}).call(this,t(1)["default"],t(2)["createPage"])},935:function(e,n,t){"use strict";t.r(n);var o=t(936),i=t(938);for(var r in i)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(r);t(940);var c,a=t(34),s=Object(a["default"])(i["default"],o["render"],o["staticRenderFns"],!1,null,null,null,!1,o["components"],c);s.options.__file="pages_course/webview.vue",n["default"]=s.exports},936:function(e,n,t){"use strict";t.r(n);var o=t(937);t.d(n,"render",(function(){return o["render"]})),t.d(n,"staticRenderFns",(function(){return o["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return o["recyclableRender"]})),t.d(n,"components",(function(){return o["components"]}))},937:function(e,n,t){"use strict";var o;t.r(n),t.d(n,"render",(function(){return i})),t.d(n,"staticRenderFns",(function(){return c})),t.d(n,"recyclableRender",(function(){return r})),t.d(n,"components",(function(){return o}));var i=function(){var e=this,n=e.$createElement;e._self._c},r=!1,c=[];i._withStripped=!0},938:function(e,n,t){"use strict";t.r(n);var o=t(939),i=t.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(r);n["default"]=i.a},939:function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var t={data:function(){return{loading:!0,webviewUrl:"https://h5.fbylive.com/weixinOauth",userInfo:null}},onLoad:function(n){console.log("webview",n),e.setStorageSync("webview","webview"),n.code&&this.loginweixin(n.code)},methods:{loginweixin:function(n){var t=this,o={code:n};loginByMp(o).then((function(n){t.res=n,e.hideLoading(),200==n.code?(console.log(n),e.hideLoading(),e.showToast({icon:"none",title:"成功获取用户信息"}),e.setStorageSync("userInfos",JSON.stringify(n.user)),t.userInfo=n.user,setTimeout((function(){e.navigateBack({delta:1})}),200)):(e.hideLoading(),e.showToast({title:n.msg||"获取用户信息失败",icon:"none"}))}),(function(e){})).catch((function(n){e.hideLoading(),e.showToast({icon:"none",title:"授权登录失败,请重新登录"})}))},generateAuthUrl:function(){var n=e.getLaunchOptionsSync().scene,t={scene:n,appid:"wx961fadab9bcb792b",redirect_uri:encodeURIComponent("https://h5.fbylive.com/weixinOauth"),scope:"snsapi_userinfo",state:"wechat_redirect"};return"https://open.weixin.qq.com/connect/oauth2/authorize?appid=".concat(t.appid,"&redirect_uri=").concat(t.redirect_uri,"&response_type=code&scope=").concat(t.scope,"&state=").concat(t.state,"#wechat_redirect")},handleMessage:function(n){console.log("收到web-view消息:",n.detail),console.log("收到web-view消息:",n),n.detail&&"user_info"===n.detail.type&&(this.userInfo=n.detail.data,this.token=n.detail.token,e.setStorageSync("userInfo",this.userInfo),e.setStorageSync("TOKEN_WEXIN",this.userInfo),e.showToast({title:"登录成功",icon:"success"}),setTimeout((function(){e.navigateBack()}),1500))},onLoads:function(){this.loading=!1,console.log("web-view加载完成")},onError:function(n){this.loading=!1,console.error("web-view加载失败:",n),e.showToast({title:"页面加载失败",icon:"none"})}}};n.default=t}).call(this,t(2)["default"])},940:function(e,n,t){"use strict";t.r(n);var o=t(941),i=t.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(r);n["default"]=i.a},941:function(e,n,t){}},[[934,"common/runtime","common/vendor"]]]);
- //# sourceMappingURL=../../.sourcemap/mp-weixin/pages_course/webview.js.map
|