1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[3],{434:function(t,a,s){t.exports=s.p+"assets/img/webgame.1d6ec041.png"},435:function(t,a,s){t.exports=s.p+"assets/img/cms61.6d86a7fd.png"},436:function(t,a,s){t.exports=s.p+"assets/img/webgame1.6820a5c3.png"},445:function(t,a,s){"use strict";s.r(a);var n=s(55),e=Object(n.a)({},(function(){var t=this,a=t.$createElement,n=t._self._c||a;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"多玩游戏大厅(珠海页游)"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#多玩游戏大厅(珠海页游)"}},[t._v("#")]),t._v(" 多玩游戏大厅(珠海页游)")]),t._v(" "),n("blockquote",[n("p",[t._v("多玩游戏大厅是 fis3 构建和打包(Webpack 不支持 IE8),通过 avalon 配合 JQuery 实现视图的逻辑(Vue 和 React 都不支持)。页面跳转是通过多页面实现的(不是一个单页面应用)。")])]),t._v(" "),n("h2",{attrs:{id:"开发人员"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#开发人员"}},[t._v("#")]),t._v(" 开发人员")]),t._v(" "),n("ul",[n("li",[t._v("康志鸿 百醇 唐喜君 杜文华")])]),t._v(" "),n("h2",{attrs:{id:"项目地址"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#项目地址"}},[t._v("#")]),t._v(" 项目地址")]),t._v(" "),n("ul",[n("li",[t._v("svn://svn.webdev.ouj.com/biz/page_game/trunk/web")])]),t._v(" "),n("h2",{attrs:{id:"技术栈"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#技术栈"}},[t._v("#")]),t._v(" 技术栈")]),t._v(" "),n("ul",[n("li",[t._v("环境依赖 : node6+ , fis3 ,mod.js")]),t._v(" "),n("li",[t._v("开发技术 : JQuery , avalon, sass")])]),t._v(" "),n("h2",{attrs:{id:"项目域名"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#项目域名"}},[t._v("#")]),t._v(" 项目域名")]),t._v(" "),n("table",[n("thead",[n("tr",[n("th",[t._v("环境")]),t._v(" "),n("th",[t._v("域名")])])]),t._v(" "),n("tbody",[n("tr",[n("td",[t._v("正式环境")]),t._v(" "),n("td",[n("a",{attrs:{href:"http://wan.ouj.com",target:"_blank",rel:"noopener noreferrer"}},[t._v("http://wan.ouj.com"),n("OutboundLink")],1)])]),t._v(" "),n("tr",[n("td",[t._v("测试环境")]),t._v(" "),n("td",[n("a",{attrs:{href:"http://test-wan.ouj.com",target:"_blank",rel:"noopener noreferrer"}},[t._v("http://test-wan.ouj.com"),n("OutboundLink")],1)])]),t._v(" "),n("tr",[n("td",[t._v("预发环境")]),t._v(" "),n("td",[n("a",{attrs:{href:"http://new-wan.ouj.com",target:"_blank",rel:"noopener noreferrer"}},[t._v("http://new-wan.ouj.com"),n("OutboundLink")],1)])])])]),t._v(" "),n("h2",{attrs:{id:"项目结构"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#项目结构"}},[t._v("#")]),t._v(" 项目结构")]),t._v(" "),n("div",{staticClass:"language-Text extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[t._v("|- src\n |- api --- 通用的http请求api(封装http请求)\n |- modules --- 按模块分类的api\n |- assets --- 静态资源文件(图片)\n |- components --- 不同模块对应的小组件\n |- lib --- 项目引入的第三方库\n |- mixins --- 全局混合(按需引入)\n |- modules --- 封装的插件(lazhload,md5,qrcode...)\n |- page --- 页面代码\n |- bt --- bt页游\n |- fcm --- 防沉迷\n |- hezi --- 目前dnf旧版&新版盒子,lol盒子,坦克世界盒子左侧游戏tab入口(2个尺寸)\n |- lolbox --- lol盒子和旧版dnf\n |- box --- 坦克世界盒子和新版dnf\n |- index --- 首页\n |- popup --- 多玩游戏大厅盒子-内嵌webview弹窗页面\n |- propCenter --- 道具中心-主要入口为运营推广广告\n |- self --- 多玩游戏大厅盒子-左侧个人中心\n |- agreement.html --- 多玩游戏充值协议\n |- asset.html --- 各页面通用配置-若js没有\x3c!--ignore--\x3e标志会自动编译到下面的\n |- index.html --- 首页\n |- list.html --- 游戏列表-精品游戏\n |- sdk --- 全局对象DW_APP_SDK 用于调用SDK的API\n |- style --- 样式表(components,modules,page)\n |- tpl --- 模板\n|- typeing --- 类型检查\n|- eslintrc.js --- eslint配置文件\n|- fis-conf.js --- fis配置文件\n")])])]),n("h2",{attrs:{id:"sdk"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#sdk"}},[t._v("#")]),t._v(" sdk")]),t._v(" "),n("p",[n("code",[t._v("sdk/index")]),t._v("文件保存全局方法,分别给游戏大厅,游戏盒子交互的。")]),t._v(" "),n("h2",{attrs:{id:"混入方法"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#混入方法"}},[t._v("#")]),t._v(" 混入方法")]),t._v(" "),n("p",[n("code",[t._v("mixins/index")]),t._v("文件是全局混入的方法,在 avalon 定义 VM 的时候要通过 underscore 的 extend 方法扩展。")]),t._v(" "),n("div",{staticClass:"language-JS extra-class"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" _ "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"underscore"')]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" vm "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" avalon"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("define")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("extend")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),n("span",{pre:!0,attrs:{class:"token template-string"}},[n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("mixins(这里加mixins的内容)")]),n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),n("p",[t._v("提供公共方法")]),t._v(" "),n("div",{staticClass:"language-js extra-class"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[t._v("checkLogin "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" 检测页面登录态\nonEnterGame "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("进入游戏(要登录态)\nonEnterGameWithoutLogin "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("进入游戏(不检测登录)\nonChoiceServer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("选服\n")])])]),n("h2",{attrs:{id:"上报方式"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#上报方式"}},[t._v("#")]),t._v(" 上报方式")]),t._v(" "),n("p",[t._v("1.多玩通用统计-目前用于自定义页游广告点击")]),t._v(" "),n("p",[t._v("2.大厅统计 pv/uv 地方加上 date-gid,data-poskey,data-dwgameclick 标志,对应的方法")]),t._v(" "),n("p",[n("a",{attrs:{href:"../image/webgame.png"}},[n("img",{attrs:{src:s(434),alt:"avatar"}})])]),t._v(" "),n("p",[t._v("3.loginGame 接口里面第三个参数(userSource)标志用户的来源,做到上报的")]),t._v(" "),n("div",{staticClass:"language-JS extra-class"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("getLoginGame")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" gid"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" sid"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" userSource "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" ax"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'/loginGame.do'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n params"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" gid"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" sid"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" userSource "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),n("p",[t._v("4.游戏页")]),t._v(" "),n("ul",[n("li",[n("strong",[t._v("任务上报")]),t._v(" 判断是否有 channel 参数(道具中心来源),然后获取道具中心的对应任务,匹配则在结束时上报")]),t._v(" "),n("li",[n("strong",[t._v("时长上报")]),t._v(" 关闭浏览器 tab 页时上报游戏时长,暴露上报方法给大厅盒子检测用户关闭时调用上报")])]),t._v(" "),n("p",[t._v("5....")]),t._v(" "),n("h2",{attrs:{id:"充值"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#充值"}},[t._v("#")]),t._v(" 充值")]),t._v(" "),n("p",[t._v("1.充值页,大厅盒子充值弹框,游戏页充值弹框都为同一个组件")]),t._v(" "),n("p",[t._v("2.默认帮用户选择游戏和区服(通过链接的&game_code=DZ&server_code=s4 主动选择)")]),t._v(" "),n("p",[t._v("3.初始化方法暴露了一个 initPayPopup 方法,主要用于引入的页面主动调起初始化,避免多余请求")]),t._v(" "),n("p",[t._v("4.微信支付是后端返回一个支付链接前端生成二维码,支付宝支付则是后端返回支付宝的页面,前端通过 iframe 引入再用 css 调整显示二维码位置")]),t._v(" "),n("h2",{attrs:{id:"游戏页"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#游戏页"}},[t._v("#")]),t._v(" 游戏页")]),t._v(" "),n("p",[t._v("1.iframe 引入游戏页面,游戏链接都是有时效性&登录态的,故从接口拿")]),t._v(" "),n("p",[t._v("2.里面含上报,任务上报和时长上报(看上面上报那点)")]),t._v(" "),n("h2",{attrs:{id:"广告"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#广告"}},[t._v("#")]),t._v(" 广告")]),t._v(" "),n("p",[t._v("广告部分暂时有两个自定义的广告位置,一个是右上角的,有个是右边侧边栏,对应接口是一个静态的 JSON 文件。修改图片链接或者是其他都在 JSON 文件中直接修改")]),t._v(" "),n("p",[t._v("模板位置:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(435),alt:"avatar"}})]),t._v(" "),n("div",{staticClass:"language-js extra-class"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 多玩游戏大厅/模板管理/广告数据")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("jsonp_dwDa")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//web顶部导航-图文广告300*76")]),t._v("\n headerRight"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n title"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xx"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n clientLink"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://www.duowan.com/"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 客户端打开的链接")]),t._v("\n webLink"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://pgame.duowan.com/dwgame.html"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// web downLoad的链接")]),t._v("\n img"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://img.dwstatic.com/yxdt/adPic/1907topright.png"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n report"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"dwgame_nav_youshangjiao"')]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//上报id")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//主页-右侧广告-宽250")]),t._v("\n mainRight"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n title"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xx"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n clientLink"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"dwgame://yygame"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 客户端打开的链接")]),t._v("\n webLink"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://wan.yy.com/"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// web 打开的链接")]),t._v("\n img"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://img.dwstatic.com/yxdt/adPic/1906right.jpg"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n report"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"dwgame_main_youce"')]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//上报id")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),n("ul",[n("li",[t._v("在发布器中,对应项目中的模板中会可以看到对应的广告。增加广告或者是删除广告等。")])]),t._v(" "),n("p",[n("a",{attrs:{href:"../image/webgame1.png"}},[n("img",{attrs:{src:s(436),alt:"avatar"}})])]),t._v(" "),n("h2",{attrs:{id:"备注"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#备注"}},[t._v("#")]),t._v(" 备注")]),t._v(" "),n("h3",{attrs:{id:"项目启动"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#项目启动"}},[t._v("#")]),t._v(" 项目启动")]),t._v(" "),n("ul",[n("li",[t._v("安装选择的时候直接选 fis-parser-node-sass")]),t._v(" "),n("li",[t._v("配置 host,需要多玩域记录登录状态")])]),t._v(" "),n("div",{staticClass:"language-Text extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[t._v("// hosts文件在C:\\Windows\\System32\\drivers\\etc\n127.0.0.1 yournickname.duowan.com\n")])])]),n("h3",{attrs:{id:"fis-的语法"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#fis-的语法"}},[t._v("#")]),t._v(" fis 的语法")]),t._v(" "),n("ul",[n("li",[n("p",[n("code",[t._v("?__inline")]),t._v("可以实现对整个外部文件的引入,eg:html")])]),t._v(" "),n("li",[n("p",[n("code",[t._v("background(url?__sprite)")]),t._v("实现对图片进行整合成雪碧图")])])]),t._v(" "),n("h3",{attrs:{id:"暂时遇到的坑-或者你有更好的解决方法,欢迎提-issue"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#暂时遇到的坑-或者你有更好的解决方法,欢迎提-issue"}},[t._v("#")]),t._v(" 暂时遇到的坑(或者你有更好的解决方法,欢迎提 issue)")]),t._v(" "),n("p",[t._v("1.游戏是通过 iframe 承载的,元素分为窗口元素和无窗口元素,在 ie 下窗口元素在最高层级的,设置 z-index 都是无效的,假如需要在游戏上面添加覆盖元素,要将覆盖的元素最下方添加一个空的 iframe")]),t._v(" "),n("p",[n("strong",[n("em",[t._v("参考")])]),t._v(" web 端游戏页游戏助手")]),t._v(" "),n("p",[t._v("2.上报的时候,在点击关闭的时候触发 onbeforeunload 的方法。这个方法在 JQuery 引入的情况下,Chrome,Firefox 浏览器都不能直接使用要套在 JQuery 方法里面才能使用")]),t._v(" "),n("div",{staticClass:"language-JS extra-class"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token function"}},[t._v("$")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("window"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("load")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n window"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("onunload")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n _this"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("gameReport")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Are you sure"')]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),n("p",[t._v("3.window.open 打开异步获取的链接或被浏览器 adblock 拦截")]),t._v(" "),n("ul",[n("li",[n("strong",[t._v("失败尝试 1")]),t._v(" - 异步前先打开一个空窗口,然后在 window 赋值,在普通浏览器可以解决被 adblock 拦截的情况 "),n("strong",[n("em",[t._v("但是")])]),t._v(" 在盒子赋值打开的链接不是同一个浏览器了,window 的对象已经发生改变,导致用户访问了一个空白页面")]),t._v(" "),n("li",[n("strong",[t._v("失败尝试 2")]),t._v(" - 加个 a 标签动态赋值,然后 js 模拟点击,尝试打开 "),n("strong",[n("em",[t._v("结果")])]),t._v(" 依旧被 adblock 拦截")])])])}),[],!1,null,null,null);a.default=e.exports}}]);
|