Commit 21e79a8e authored by wildfirecode's avatar wildfirecode

1

parent 761251ff
...@@ -169,6 +169,7 @@ export default class MainBase extends eui.UILayer { ...@@ -169,6 +169,7 @@ export default class MainBase extends eui.UILayer {
RES.getResAsync(`nums2_fnt`); RES.getResAsync(`nums2_fnt`);
if (!window['development']) { if (!window['development']) {
RES.getResAsync(`common_json`); RES.getResAsync(`common_json`);
RES.getResAsync(`friendshare_json`);
RES.getResAsync(`inviterulepanel_json`); RES.getResAsync(`inviterulepanel_json`);
} }
else { else {
......
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"friendshare","version":5,"files":["../assets/sharefriend/sharefriend.png"]}
\ No newline at end of file
...@@ -123,6 +123,10 @@ ...@@ -123,6 +123,10 @@
{ {
"keys": "sharefriend_png", "keys": "sharefriend_png",
"name": "share3" "name": "share3"
},
{
"keys": "sharefriend_png",
"name": "friendshare"
} }
], ],
"resources": [ "resources": [
...@@ -2250,6 +2254,11 @@ ...@@ -2250,6 +2254,11 @@
"url": "assets/sharefriend/sharefriend.png", "url": "assets/sharefriend/sharefriend.png",
"type": "image", "type": "image",
"name": "sharefriend_png" "name": "sharefriend_png"
},
{
"url": "assets/sharefriendwx.jpg",
"type": "image",
"name": "sharefriendwx_jpg"
} }
] ]
} }
\ No newline at end of file
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
"resource/skins/FailSkin.exml", "resource/skins/FailSkin.exml",
"resource/skins/FriendItem2Skin.exml", "resource/skins/FriendItem2Skin.exml",
"resource/skins/FriendItemSkin.exml", "resource/skins/FriendItemSkin.exml",
"resource/skins/FriendShareSkin.exml",
"resource/skins/FriendSkin.exml", "resource/skins/FriendSkin.exml",
"resource/skins/H5Skin.exml", "resource/skins/H5Skin.exml",
"resource/skins/IconButtonSkin.exml", "resource/skins/IconButtonSkin.exml",
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="FriendShareSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Rect width="750" height="1624" fillAlpha="0.7"/>
<e:Image source="sharefriendwx_jpg"/>
<e:Label id="lvTxt" text="70" y="377.58" anchorOffsetX="0" anchorOffsetY="0" bold="true" textAlign="center" verticalAlign="middle" size="106" textColor="0xB14D00" x="280" width="189"/>
<e:Group x="306" y="55">
<e:Image id="avatar" y="0" width="140" height="140" x="0" source=""/>
<e:Rect id="avatarMask" width="140" height="140" y="0" ellipseWidth="140" ellipseHeight="140" x="0"/>
</e:Group>
<e:Group y="174" horizontalCenter="-1">
<e:Image source="sharefriend_png" y="0" x="0"/>
<e:Label id="nameTxt" text="打发顺丰" width="149" verticalAlign="middle" textAlign="center" size="18" height="45" x="16"/>
</e:Group>
</e:Skin>
\ No newline at end of file
import ComponentBase from "../libs/new_wx/components/ComponentBase";
import getHomeData from "./getHomeData";
import { getPrintScreenData } from "./getShowOffPic";
import { DataManager } from "../libs/tw/manager/DataManager";
import { getNick } from "./mapScene/MapScene";
import Loading from "../libs/new_wx/components/Loading";
class FriendWxShare extends ComponentBase {
start() {
const data = getHomeData();
this['lvTxt'].text = data.levels.length ==0 ? 1 : data.levels.length;
this['avatar'].mask = this['avatarMask'];
const { data: user } = DataManager.ins.getData('hc_userInfo');
this['avatar'].source = user.avatar;
this['nameTxt'].text = getNick(user.nickname);
}
get skinKey() { return 'FriendShare' }
}
const img: any = document.getElementById('pic');
img.style.display = 'none';
export const getFriendShareUrl = async (parent?: egret.DisplayObjectContainer) => {
return new Promise(async (r) => {
const pic: egret.Texture = await RES.getResAsync('sharefriendwx_jpg');
const showoff = new FriendWxShare();
showoff.loadSkin();
showoff.start();
if (parent) parent.addChild(showoff);
showoff.visible = false;
img.style.display = 'block';
Loading.instace.show();
setTimeout(() => {
const base64 = getPrintScreenData(showoff, 0, 0, pic.textureWidth, parent.stage.stageHeight);
img.src = base64;
Loading.instace.hide();
}, 200);
})
}
\ No newline at end of file
import wait from "../../libs/new_tc/wait";
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import getHomeData, { BLOOD_NUMS_MAX } from "../getHomeData";
import { NetManager } from "../../libs/tw/manager/NetManager";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl"; import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import { getlogItem } from "../Main"; import { updateMainTimer } from "../../libs/new_wx/MainBase";
import wait from "../../libs/new_tc/wait"; import { NetManager } from "../../libs/tw/manager/NetManager";
import { showShare } from "../shareCtrl"; import getHomeData, { BLOOD_NUMS_MAX } from "../getHomeData";
import { getShareUrl } from "../getSharePic";
import { iswx } from "../iswx"; import { iswx } from "../iswx";
import getShowOffPic from "../getShowOffPic"; import { getlogItem } from "../Main";
import getSharePic, { getShareUrl } from "../getSharePic";
import CountDown from "../mapScene/CountDown"; import CountDown from "../mapScene/CountDown";
import { updateMainTimer } from "../../libs/new_wx/MainBase"; import { showShare } from "../shareCtrl";
export default class BloodPanel extends Panel { export default class BloodPanel extends Panel {
start(data) { start(data) {
......
import wait from "../../libs/new_tc/wait";
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import getHomeData, { BLOOD_NUMS_MAX } from "../getHomeData";
import { NetManager } from "../../libs/tw/manager/NetManager";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl"; import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import { getlogItem } from "../Main"; import { updateMainTimer } from "../../libs/new_wx/MainBase";
import wait from "../../libs/new_tc/wait"; import { NetManager } from "../../libs/tw/manager/NetManager";
import { showShare } from "../shareCtrl"; import getHomeData, { BLOOD_NUMS_MAX } from "../getHomeData";
import { getShareUrl } from "../getSharePic";
import { iswx } from "../iswx"; import { iswx } from "../iswx";
import getShowOffPic from "../getShowOffPic"; import { getlogItem } from "../Main";
import getSharePic, { getShareUrl } from "../getSharePic";
import CountDown from "../mapScene/CountDown"; import CountDown from "../mapScene/CountDown";
import { updateMainTimer } from "../../libs/new_wx/MainBase"; import { showShare } from "../shareCtrl";
export default class BloodPanel2 extends Panel { export default class BloodPanel2 extends Panel {
start(data) { start(data) {
......
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import FriendItemRenderer from "./FriendItemRenderer";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
import { getNick } from "../mapScene/MapScene"; import { NetManager } from "../../libs/tw/manager/NetManager";
import { iswx } from "../iswx"; import { iswx } from "../iswx";
import { getShareUrl } from "../getSharePic"; import { getNick } from "../mapScene/MapScene";
import { showShare } from "../shareCtrl";
import { showShare3 } from "../shareCtrl3"; import { showShare3 } from "../shareCtrl3";
import FriendItemRenderer from "./FriendItemRenderer";
import { getFriendShareUrl } from "../getFriendSharePic";
export default class FriendPanel extends Panel { export default class FriendPanel extends Panel {
public list: eui.List; public list: eui.List;
...@@ -84,7 +83,7 @@ export default class FriendPanel extends Panel { ...@@ -84,7 +83,7 @@ export default class FriendPanel extends Panel {
console.log('onTapInvite'); console.log('onTapInvite');
if (iswx()) { if (iswx()) {
getShareUrl(this.stage); getFriendShareUrl(this.stage);
} else } else
showShare3(); showShare3();
} }
......
...@@ -7,6 +7,7 @@ import { DataManager } from "../libs/tw/manager/DataManager"; ...@@ -7,6 +7,7 @@ import { DataManager } from "../libs/tw/manager/DataManager";
import { getNick } from "./mapScene/MapScene"; import { getNick } from "./mapScene/MapScene";
import { getPrintScreenData } from "./getShowOffPic"; import { getPrintScreenData } from "./getShowOffPic";
import { NetManager } from "../libs/tw/manager/NetManager"; import { NetManager } from "../libs/tw/manager/NetManager";
import Loading from "../libs/new_wx/components/Loading";
const img: any = document.getElementById('pic'); const img: any = document.getElementById('pic');
img.style.display = 'none'; img.style.display = 'none';
...@@ -50,12 +51,14 @@ class Share3 extends ComponentBase { ...@@ -50,12 +51,14 @@ class Share3 extends ComponentBase {
//channel 1 好友 2 朋友圈 //channel 1 好友 2 朋友圈
shareFunc(channel: string) { shareFunc(channel: string) {
Loading.instace.show();
const base64 = getPrintScreenData(this['pic'], 0, 0, 579, 864); const base64 = getPrintScreenData(this['pic'], 0, 0, 579, 864);
NetManager.ins.imgUrl((success) => { NetManager.ins.imgUrl((success) => {
const data = DataManager.ins.getData('imgURL'); const data = DataManager.ins.getData('imgURL');
img.src = data.data; img.src = data.data;
// img.src = base64; // img.src = base64;
callShareApi(data.data, channel); callShareApi(data.data, channel);
Loading.instace.hide();
}, base64); }, base64);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment