|
@@ -25,6 +25,9 @@ import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
|
|
|
import { inviteChannel } from '@/http/treasure'
|
|
|
import { inject, onMounted } from 'vue'
|
|
|
import Report from "@/log-center/log"
|
|
|
+import { getFrontConfig } from "@/http/account";
|
|
|
+import { faceShareRedirectUrl } from '@/http/configAPI'
|
|
|
+import { setChromeStorage } from '@/uilts/chromeExtension.js'
|
|
|
|
|
|
let ClipboardJS = require('clipboard');
|
|
|
|
|
@@ -61,8 +64,15 @@ state.log_invite_copy_btn_click = {
|
|
|
currentInvitedNum: state.detail.inviteCount,
|
|
|
postId: state.postId
|
|
|
}
|
|
|
+
|
|
|
+let facebookAppConfig = {
|
|
|
+ facebookAppId: "",
|
|
|
+ faceShareRedirectUrl
|
|
|
+};
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
state.btn_loading = false
|
|
|
+ setFrontConfig();
|
|
|
try {
|
|
|
chrome.management.get('ophjlpahpchlmihnnnihgmmeilfjmjjc', (res) => {
|
|
|
let linePluginInstalled = 0
|
|
@@ -106,11 +116,28 @@ const clickShare = (item) => {
|
|
|
}, 2000)
|
|
|
e.clearSelection();
|
|
|
})
|
|
|
- chrome.tabs.create({
|
|
|
+ if(item.name == 'facebook') {
|
|
|
+ setChromeStorage({
|
|
|
+ shareFacebookData: JSON.stringify({
|
|
|
+ contentStr: item.inviteContent
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let cbParams = {
|
|
|
+ bizType: 'TEASURE_INVITE'
|
|
|
+ }
|
|
|
+ let url = `https://www.facebook.com/dialog/share?app_id=${facebookAppConfig.facebookAppId}&display=popup&href=${item.treasureInviteUrl}&redirect_uri=${facebookAppConfig.faceShareRedirectUrl}?params=${JSON.stringify(cbParams)}`;
|
|
|
+
|
|
|
+ chrome.windows.create({
|
|
|
+ width: 800,
|
|
|
+ type: 'normal',
|
|
|
+ url
|
|
|
+ }, function (window) {
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ chrome.tabs.create({
|
|
|
url: item.redirectPath
|
|
|
- });
|
|
|
- let strArr = item.treasureInviteUrl.split('/');
|
|
|
- let channelName = window.atob(strArr[strArr.length-1]);
|
|
|
+ });
|
|
|
+ }
|
|
|
Report.reportLog({
|
|
|
businessType: Report.businessType.buttonClick,
|
|
|
pageSource: Report.pageSource.inviteFriendsPage,
|
|
@@ -119,10 +146,21 @@ const clickShare = (item) => {
|
|
|
myShareLinkId: state.detail.inviteCopyUrl,
|
|
|
currentInvitedNum: state.detail.inviteCount,
|
|
|
}, {
|
|
|
- 'channel-name': channelName
|
|
|
+ 'channel-name': item.name
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+const setFrontConfig = () => {
|
|
|
+ getFrontConfig({
|
|
|
+ params: {},
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ facebookAppConfig.facebookAppId = res.data.fbClientId;
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
|
|
|
const clickCopy = () => {
|
|
|
var clipboard = new ClipboardJS('.copy-btn');
|