Commit e409004615b6a7b7688b56b49aa44db2d8714bb4
1 parent
b84f011b
蒙层图片路径设置
Showing
1 changed file
with
63 additions
and
63 deletions
src/components/callAppBox/callAppBox.vue
| ... | ... | @@ -19,73 +19,73 @@ |
| 19 | 19 | |
| 20 | 20 | <script> |
| 21 | 21 | |
| 22 | - // 导入跳转方法组件 | |
| 23 | - import openAppOld from "@/common/openAppOld.js"; | |
| 24 | - import maskLayer from "@/components/maskLayer/maskLayer"; | |
| 22 | +// 导入跳转方法组件 | |
| 23 | +import openAppOld from "@/common/openAppOld.js"; | |
| 24 | +import maskLayer from "@/components/maskLayer/maskLayer"; | |
| 25 | 25 | |
| 26 | - export default { | |
| 27 | - data: function () { | |
| 28 | - return { | |
| 29 | - maskLayers: null, // 蒙层对象 | |
| 30 | - downLoadBtnData: { | |
| 31 | - data: "", | |
| 32 | - source: "", | |
| 33 | - channelName: this.$route.query.channelName, //频道名称 | |
| 34 | - title: "下载网家家,观看更多优质内容", | |
| 35 | - } | |
| 36 | - } | |
| 37 | - }, | |
| 38 | - props: ["callApps"], | |
| 39 | - components: { | |
| 40 | - maskLayer | |
| 41 | - }, | |
| 42 | - methods: { | |
| 43 | - | |
| 44 | - /** | |
| 45 | - * H5唤起App按钮事件 | |
| 46 | - */ | |
| 47 | - callApp() { | |
| 48 | - | |
| 49 | - /** | |
| 50 | - * 走openinstall拉起下载APP | |
| 51 | - * 通过分享页面下载完可以拉起到指定页面 | |
| 52 | - */ | |
| 53 | - if (typeof this.callApps.funcs === "object") { | |
| 54 | - | |
| 55 | - // 拼接参数字符串,根据分享参数拼接 | |
| 56 | - let shareString = "shop_shop_type=" + this.callApps.funcs.callAppParams.shop_shop_type + "&shop_to=" + this.callApps.funcs.callAppParams.shop_to + "&shop_type=" + this.callApps.funcs.callAppParams.shop_type + "&share_mold=" + this.callApps.funcs.callAppParams.share_mold; | |
| 57 | - | |
| 58 | - // Base64位编码加密 | |
| 59 | - const CryptoJS = require("crypto-js"); | |
| 60 | - const wordArray = CryptoJS.enc.Utf8.parse(shareString); | |
| 61 | - let shopData = encodeURIComponent(CryptoJS.enc.Base64.stringify(wordArray)); | |
| 62 | - | |
| 63 | - // 设置下载参数 | |
| 64 | - this.$set(this.downLoadBtnData, 'data', 'channel_id=' + (this.mode === 'prod' ? 'cnlive_mall' : 'cnlive_mall_test') + '&type=shop' + '&shopData=' + shopData); | |
| 65 | - | |
| 66 | - if (this.isiPhone.value) { | |
| 67 | - openAppOld.submitFn.call(this, this.downLoadBtnData); | |
| 68 | - } else if (this.isAndroid.value) { | |
| 69 | - if (this.isWeChat.value) { | |
| 70 | - | |
| 71 | - // 设置蒙层图片 | |
| 72 | - this.$set(this, "maskLayers", { | |
| 73 | - img: "/static/img/mask_layer_browser.png", | |
| 74 | - }); | |
| 75 | - | |
| 76 | - // 显示蒙层 | |
| 77 | - this.$refs.maskLayer.showLayer(); | |
| 78 | - } else { | |
| 79 | - openAppOld.submitFn.call(this, this.downLoadBtnData); | |
| 80 | - } | |
| 81 | - } | |
| 82 | - } | |
| 83 | - } | |
| 84 | - } | |
| 26 | +export default { | |
| 27 | + data: function () { | |
| 28 | + return { | |
| 29 | + maskLayers: null, // 蒙层对象 | |
| 30 | + downLoadBtnData: { | |
| 31 | + data: "", | |
| 32 | + source: "", | |
| 33 | + channelName: this.$route.query.channelName, //频道名称 | |
| 34 | + title: "下载网家家,观看更多优质内容", | |
| 35 | + } | |
| 85 | 36 | } |
| 37 | + }, | |
| 38 | + props: ["callApps"], | |
| 39 | + components: { | |
| 40 | + maskLayer | |
| 41 | + }, | |
| 42 | + methods: { | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * H5唤起App按钮事件 | |
| 46 | + */ | |
| 47 | + callApp () { | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 走openinstall拉起下载APP | |
| 51 | + * 通过分享页面下载完可以拉起到指定页面 | |
| 52 | + */ | |
| 53 | + if (typeof this.callApps.funcs === "object") { | |
| 54 | + | |
| 55 | + // 拼接参数字符串,根据分享参数拼接 | |
| 56 | + let shareString = "shop_shop_type=" + this.callApps.funcs.callAppParams.shop_shop_type + "&shop_to=" + this.callApps.funcs.callAppParams.shop_to + "&shop_type=" + this.callApps.funcs.callAppParams.shop_type + "&share_mold=" + this.callApps.funcs.callAppParams.share_mold; | |
| 57 | + | |
| 58 | + // Base64位编码加密 | |
| 59 | + const CryptoJS = require("crypto-js"); | |
| 60 | + const wordArray = CryptoJS.enc.Utf8.parse(shareString); | |
| 61 | + let shopData = encodeURIComponent(CryptoJS.enc.Base64.stringify(wordArray)); | |
| 62 | + | |
| 63 | + // 设置下载参数 | |
| 64 | + this.$set(this.downLoadBtnData, 'data', 'channel_id=' + (this.mode === 'prod' ? 'cnlive_mall' : 'cnlive_mall_test') + '&type=shop' + '&shopData=' + shopData); | |
| 65 | + | |
| 66 | + if (this.isiPhone.value) { | |
| 67 | + openAppOld.submitFn.call(this, this.downLoadBtnData); | |
| 68 | + } else if (this.isAndroid.value) { | |
| 69 | + if (this.isWeChat.value) { | |
| 70 | + | |
| 71 | + // 设置蒙层图片 | |
| 72 | + this.$set(this, "maskLayers", { | |
| 73 | + img: "static/img/mask_layer_browser.png", | |
| 74 | + }); | |
| 75 | + | |
| 76 | + // 显示蒙层 | |
| 77 | + this.$refs.maskLayer.showLayer(); | |
| 78 | + } else { | |
| 79 | + openAppOld.submitFn.call(this, this.downLoadBtnData); | |
| 80 | + } | |
| 81 | + } | |
| 82 | + } | |
| 83 | + } | |
| 84 | + } | |
| 85 | +} | |
| 86 | 86 | </script> |
| 87 | 87 | |
| 88 | 88 | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| 89 | 89 | <style rel="stylesheet/less" lang="less"> |
| 90 | - @import './callAppBox'; | |
| 90 | +@import './callAppBox'; | |
| 91 | 91 | </style> |
| 92 | 92 | \ No newline at end of file | ... | ... |