| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages_course-webview"],{"0bcd":function(e,n,t){"use strict";t.r(n);var i=t("b921"),o=t.n(i);for(var r in i)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(r);n["default"]=o.a},"17fb":function(e,n,t){var i=t("a164");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var o=t("967d").default;o("03642bdd",i,!0,{sourceMap:!1,shadowMode:!1})},"1e8e":function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"c",(function(){return o})),t.d(n,"a",(function(){}));var i=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("v-uni-view",{staticClass:"container"},[e.loading?t("v-uni-view",{staticClass:"loading2"},[t("v-uni-text",[e._v("加载中...")])],1):e._e(),t("v-uni-web-view",{attrs:{src:e.webviewUrl},on:{message:function(n){arguments[0]=n=e.$handleEvent(n),e.handleMessage.apply(void 0,arguments)},load:function(n){arguments[0]=n=e.$handleEvent(n),e.onLoads.apply(void 0,arguments)},error:function(n){arguments[0]=n=e.$handleEvent(n),e.onError.apply(void 0,arguments)}}})],1)},o=[]},"3ff8":function(e,n,t){"use strict";t.r(n);var i=t("1e8e"),o=t("0bcd");for(var r in o)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(r);t("eff4");var a=t("828b"),s=Object(a["a"])(o["default"],i["b"],i["c"],!1,null,"31e2c1f6",null,!1,i["a"],void 0);n["default"]=s.exports},a164:function(e,n,t){var i=t("c86c");n=i(!1),n.push([e.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.container[data-v-31e2c1f6]{width:100%;height:100%;position:relative}.loading2[data-v-31e2c1f6]{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:#fff;z-index:100}uni-web-view[data-v-31e2c1f6]{width:100%;height:100%}',""]),e.exports=n},b921:function(e,n,t){"use strict";t("6a54");var i=t("f5bd").default;Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,t("5ef2"),t("c223");i(t("abbc"));var o=t("e42c"),r=(t("adb8"),{data:function(){return{loading:!1,userinfos:{nickname:"",avatar:""},usercode:{},h5Appid:"",redirect_uri:""}},onLoad:function(e){e.code&&this.loginweixin(e.code),console.log(this.webviewUrl)},computed:{appid:function(){return this.$store.state.appid},isSpare:function(){return this.$store.state.isSpare},webviewUrl:function(){return this.$store.state.webviewUrl}},methods:{getUrlParam:function(){var e=this.webviewUrl,n=new Object;if(-1!=e.indexOf("?"))for(var t=e.substr(1),i=t.split("&"),o=0;o<i.length;o++)n[i[o].split("=")[0]]=i[o].split("=")[1];return n},loginweixin:function(e){var n=this,t=uni.getStorageSync("H5course"),i={code:e,appId:this.appid,companyId:t.companyId,companyUserId:t.companyUserId,projectId:t.projectId},r=1==this.isSpare&&1==t.type?1:0;(0,o.H5logoinApp)(i,r).then((function(t){n.res=t,uni.hideLoading(),200==t.code?(n.$store.commit("setCoureLogin",1),console.log(t),uni.hideLoading(),uni.showToast({icon:"none",title:"成功获取用户信息"}),n.userinfos.nickname=t.user.nickname,n.userinfos.avatar=t.user.avatar,uni.setStorageSync("userinfos",n.userinfos),uni.setStorageSync("userInfo",t.user),uni.setStorageSync("TOKEN_WEXIN",t.token),n.usercode.code=e,n.usercode.userId=t.user.userId,uni.$emit("usercode",n.usercode),uni.navigateBack({delta:1})):(uni.hideLoading(),uni.showToast({title:t.msg||"获取用户信息失败",icon:"none"}),setTimeout((function(){uni.$emit("vipMsg",t.msg),uni.navigateBack({delta:1})}),2e3))}),(function(e){})).catch((function(e){uni.hideLoading(),uni.showToast({icon:"none",title:"获取用户信息失败"})}))},generateAuthUrl:function(){var e=uni.getLaunchOptionsSync().scene;this.h5Appid=this.getUrlParam().appid,this.redirect_uri=this.webviewUrl;var n={scene:e,appid:this.h5Appid,redirect_uri:encodeURIComponent(this.redirect_uri),scope:"snsapi_userinfo",state:"wechat_redirect"};return"https://open.weixin.qq.com/connect/oauth2/authorize?appid=".concat(n.appid,"&redirect_uri=").concat(n.redirect_uri,"&response_type=code&scope=").concat(n.scope,"&state=").concat(n.state,"#wechat_redirect")},handleMessage:function(e){console.log("收到web-view消息:",e.detail),console.log("收到web-view消息:",e),e.detail&&"user_info"===e.detail.type&&(this.userInfo=e.detail.data,this.token=e.detail.token,uni.setStorageSync("userInfo",this.userInfo),uni.setStorageSync("TOKEN_WEXIN",this.userInfo),uni.showToast({title:"登录成功",icon:"success"}),setTimeout((function(){uni.navigateBack()}),1500))},onLoads:function(){this.loading=!1,console.log("web-view加载完成")},onError:function(e){this.loading=!1,console.error("web-view加载失败:",e),uni.showToast({title:"页面加载失败",icon:"none"})}}});n.default=r},e42c:function(e,n,t){"use strict";t("6a54");var i=t("f5bd").default;Object.defineProperty(n,"__esModule",{value:!0}),n.H5logoinApp=function(e,n){return r(n&&1==n?"/app/wx/h5/mp/courseLoginByMp":"/app/wx/h5/mp/loginByMp",e,"POST","application/json;charset=UTF-8")},n.checkUserInfo=function(e){return r("/course_uniapp/app/user/checkUserInfo",e,"GET","application/json;charset=UTF-8")},n.courseAnswer=function(e){return r("/course_uniapp/app/course/wx/h5/courseAnswer",e,"POST","application/json;charset=UTF-8","https://h5api.his.cdwjyyh.com")},n.editUser=function(e){return r("/course_uniapp/app/user/editUser",e,"POST","application/json;charset=UTF-8")},n.getErrMsg=function(e){return r("/course_uniapp/app/course/wx/h5/getErrMsg",e,"POST","application/x-www-form-urlencoded","https://h5api.his.cdwjyyh.com")},n.getFinishCourseVideo=function(e){return r("/course_uniapp/app/course/wx/h5/updateWatchDuration",e,"POST","application/json;charset=UTF-8","https://h5api.his.cdwjyyh.com")},n.getH5CourseByVideoId=function(e){return r("/course_uniapp/app/course/wx/h5/getH5CourseByVideoId",e,"GET","","https://h5api.his.cdwjyyh.com")},n.getH5CourseVideoDetails=function(e){return r("/course_uniapp/app/course/wx/h5/videoDetails",e,"GET","","https://h5api.his.cdwjyyh.com")},n.getIntegralByH5Video=function(e){return r("/app/course/getIntegralByH5Video",e,"POST","application/json;charset=UTF-8","https://h5api.his.cdwjyyh.com")},n.getInternetTraffic=function(e){return r("/course_uniapp/app/course/wx/h5/getInternetTraffic",e,"POST","application/json;charset=UTF-8","https://h5api.his.cdwjyyh.com")},n.getIsAddKf=function(e){return r("/course_uniapp/app/course/wx/h5/isAddKf",e,"POST","application/json;charset=UTF-8","https://h5api.his.cdwjyyh.com")},n.getRealLink=function(e){return r("/app/course/getRealLink",e,"GET","","https://h5api.his.cdwjyyh.com")},n.getusername=function(e){return r("/companyapp/app/wx/h5/mp/userInfo",e,"POST","application/json;charset=UTF-8")},n.handleFsUserWx=function(e){return r("/course_uniapp/app/wx/h5/mp/handleFsUserWx",e,"POST","application/json;charset=UTF-8")},n.loginByMiniApp=function(e){return r("/course_uniapp/app/wx/miniapp/loginByMa",e,"POST","application/json;charset=UTF-8")},n.registerCourses=function(e){return r("/course_uniapp/companyapp/app/fs/user/beMember",e,"POST","application/json;charset=UTF-8")},n.sendReward=function(e){return r("/course_uniapp/app/course/wx/h5/sendReward",e,"POST","application/json;charset=UTF-8","https://h5api.his.cdwjyyh.com")};var o=i(t("d4c0")),r=(new o.default).http},eff4:function(e,n,t){"use strict";var i=t("17fb"),o=t.n(i);o.a}}]);
|