Commit 21e79a8e authored by wildfirecode's avatar wildfirecode

1

parent 761251ff
......@@ -169,6 +169,7 @@ export default class MainBase extends eui.UILayer {
RES.getResAsync(`nums2_fnt`);
if (!window['development']) {
RES.getResAsync(`common_json`);
RES.getResAsync(`friendshare_json`);
RES.getResAsync(`inviterulepanel_json`);
}
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 @@
{
"keys": "sharefriend_png",
"name": "share3"
},
{
"keys": "sharefriend_png",
"name": "friendshare"
}
],
"resources": [
......@@ -2250,6 +2254,11 @@
"url": "assets/sharefriend/sharefriend.png",
"type": "image",
"name": "sharefriend_png"
},
{
"url": "assets/sharefriendwx.jpg",
"type": "image",
"name": "sharefriendwx_jpg"
}
]
}
\ No newline at end of file
......@@ -19,6 +19,7 @@
"resource/skins/FailSkin.exml",
"resource/skins/FriendItem2Skin.exml",
"resource/skins/FriendItemSkin.exml",
"resource/skins/FriendShareSkin.exml",
"resource/skins/FriendSkin.exml",
"resource/skins/H5Skin.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 getHomeData, { BLOOD_NUMS_MAX } from "../getHomeData";
import { NetManager } from "../../libs/tw/manager/NetManager";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import { getlogItem } from "../Main";
import wait from "../../libs/new_tc/wait";
import { showShare } from "../shareCtrl";
import { updateMainTimer } from "../../libs/new_wx/MainBase";
import { NetManager } from "../../libs/tw/manager/NetManager";
import getHomeData, { BLOOD_NUMS_MAX } from "../getHomeData";
import { getShareUrl } from "../getSharePic";
import { iswx } from "../iswx";
import getShowOffPic from "../getShowOffPic";
import getSharePic, { getShareUrl } from "../getSharePic";
import { getlogItem } from "../Main";
import CountDown from "../mapScene/CountDown";
import { updateMainTimer } from "../../libs/new_wx/MainBase";
import { showShare } from "../shareCtrl";
export default class BloodPanel extends Panel {
start(data) {
......
import wait from "../../libs/new_tc/wait";
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 { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import { getlogItem } from "../Main";
import wait from "../../libs/new_tc/wait";
import { showShare } from "../shareCtrl";
import { updateMainTimer } from "../../libs/new_wx/MainBase";
import { NetManager } from "../../libs/tw/manager/NetManager";
import getHomeData, { BLOOD_NUMS_MAX } from "../getHomeData";
import { getShareUrl } from "../getSharePic";
import { iswx } from "../iswx";
import getShowOffPic from "../getShowOffPic";
import getSharePic, { getShareUrl } from "../getSharePic";
import { getlogItem } from "../Main";
import CountDown from "../mapScene/CountDown";
import { updateMainTimer } from "../../libs/new_wx/MainBase";
import { showShare } from "../shareCtrl";
export default class BloodPanel2 extends Panel {
start(data) {
......
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 { getNick } from "../mapScene/MapScene";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { iswx } from "../iswx";
import { getShareUrl } from "../getSharePic";
import { showShare } from "../shareCtrl";
import { getNick } from "../mapScene/MapScene";
import { showShare3 } from "../shareCtrl3";
import FriendItemRenderer from "./FriendItemRenderer";
import { getFriendShareUrl } from "../getFriendSharePic";
export default class FriendPanel extends Panel {
public list: eui.List;
......@@ -84,7 +83,7 @@ export default class FriendPanel extends Panel {
console.log('onTapInvite');
if (iswx()) {
getShareUrl(this.stage);
getFriendShareUrl(this.stage);
} else
showShare3();
}
......
......@@ -7,6 +7,7 @@ import { DataManager } from "../libs/tw/manager/DataManager";
import { getNick } from "./mapScene/MapScene";
import { getPrintScreenData } from "./getShowOffPic";
import { NetManager } from "../libs/tw/manager/NetManager";
import Loading from "../libs/new_wx/components/Loading";
const img: any = document.getElementById('pic');
img.style.display = 'none';
......@@ -50,12 +51,14 @@ class Share3 extends ComponentBase {
//channel 1 好友 2 朋友圈
shareFunc(channel: string) {
Loading.instace.show();
const base64 = getPrintScreenData(this['pic'], 0, 0, 579, 864);
NetManager.ins.imgUrl((success) => {
const data = DataManager.ins.getData('imgURL');
img.src = data.data;
// img.src = base64;
callShareApi(data.data, channel);
Loading.instace.hide();
}, 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