Commit 699af0ba authored by wangzhujun's avatar wangzhujun

1232

parent 1afcbca2
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"name": "Preload" "name": "Preload"
}, },
{ {
"keys": "certificate_btn_png,certificate_cover_png,joinshare_btn_png,sharestarter_bg_jpg,sharestarter_btn_png,sharestarter_sharebtn_png,share2mask_png,share2btn_png,share2bg_jpg,confirm_btn_png,confirm_bg_png,transfer _toast3_png,transfer _toast2_png,transfer _toast1_png,transfer _title_png,transfer _btn_png,trans_bg_jpg,teamshare_btn_png,transferrecord_bg_png,transferrecord_item_bg_png,关闭按钮 _png,teamshare_bg_jpg,certificate_jpg,certificate_bg_png,joinshare_bg_jpg,xsbg_png,xuanshiBtn_png,backstartBtn_png", "keys": "certificate_btn_png,joinshare_btn_png,sharestarter_bg_jpg,sharestarter_btn_png,sharestarter_sharebtn_png,share2mask_png,share2btn_png,share2bg_jpg,confirm_btn_png,confirm_bg_png,transfer _toast3_png,transfer _toast2_png,transfer _toast1_png,transfer _title_png,transfer _btn_png,trans_bg_jpg,teamshare_btn_png,transferrecord_bg_png,transferrecord_item_bg_png,关闭按钮 _png,teamshare_bg_jpg,certificate_jpg,certificate_bg_png,joinshare_bg_jpg,xsbg_png,xuanshiBtn_png,backstartBtn_png,certificate_cover_png",
"name": "Normal" "name": "Normal"
}, },
{ {
...@@ -641,11 +641,6 @@ ...@@ -641,11 +641,6 @@
"type": "image", "type": "image",
"name": "mapxg_png" "name": "mapxg_png"
}, },
{
"url": "assets/certificate/certificate_cover.png",
"type": "image",
"name": "certificate_cover_png"
},
{ {
"url": "assets/pk/pkBG.jpg", "url": "assets/pk/pkBG.jpg",
"type": "image", "type": "image",
...@@ -680,6 +675,11 @@ ...@@ -680,6 +675,11 @@
"url": "assets/joinshare/joinshare_bg.jpg", "url": "assets/joinshare/joinshare_bg.jpg",
"type": "image", "type": "image",
"name": "joinshare_bg_jpg" "name": "joinshare_bg_jpg"
},
{
"url": "assets/certificate/certificate_cover.png",
"type": "image",
"name": "certificate_cover_png"
} }
] ]
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="RecordSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="RecordSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image width="750" height="1624" x="1" y="-1" source="mrbg_jpg"/> <e:Image width="750" height="1624" x="0" y="0" source="mrbg_jpg"/>
<e:Group id="recordGroup" width="750" height="899" horizontalCenter="0" verticalCenter="-137.5"> <e:Group id="recordGroup" width="750" height="899" horizontalCenter="0" verticalCenter="-137.5">
<e:Image width="367" height="75" source="mrtitle_png" scaleX="1" scaleY="1" horizontalCenter="1.5" y="31"/> <e:Image width="367" height="75" source="mrtitle_png" scaleX="1" scaleY="1" horizontalCenter="1.5" y="31"/>
<e:Image id="hz" width="180" height="202" source="mrhz_png" scaleX="1" scaleY="1" horizontalCenter="-222" y="184"/> <e:Image id="hz" width="180" height="202" source="mrhz_png" scaleX="1" scaleY="1" horizontalCenter="-222" y="184"/>
......
...@@ -318,6 +318,28 @@ export class yzwNet{ ...@@ -318,6 +318,28 @@ export class yzwNet{
}; };
NetManager.ins.send(net); NetManager.ins.send(net);
} }
/**
* 1.16 base64上传图片
* @param callback 回调
*/
public static imgUrl(callback, img64){
let param: any = {
img64:img64
}
const net: INetData = {
name: 'imgUrl',
uri: `/customActivity/duiba/imgUrl`,
type: 'post',
dataType: 'json',
hideMsg: true,
param: param,
callback: callback
};
NetManager.ins.send(net);
}
} }
......
...@@ -3,6 +3,10 @@ import PanelCtrl from "../ctrls/panelCtrl"; ...@@ -3,6 +3,10 @@ import PanelCtrl from "../ctrls/panelCtrl";
import { ModuleTypes } from "../types/sceneTypes"; import { ModuleTypes } from "../types/sceneTypes";
import SceneCtrl from "../ctrls/sceneCtrl"; import SceneCtrl from "../ctrls/sceneCtrl";
import GameConst from "../GameConst"; import GameConst from "../GameConst";
import { yzwNet } from "../NetConst";
import ToastCtrl from "../ctrls/toastCtrl";
import { DataManager } from "../../libs/tw/manager/DataManager";
import { GCache } from "../../libs/tc/util/GCache";
export default class CertificateScene extends Scene{ export default class CertificateScene extends Scene{
protected get skinKey(){return 'Certificate'} protected get skinKey(){return 'Certificate'}
...@@ -22,19 +26,19 @@ export default class CertificateScene extends Scene{ ...@@ -22,19 +26,19 @@ export default class CertificateScene extends Scene{
this._from=data.from; this._from=data.from;
this['from'].text = data.inviterPhone; this['from'].text = data.inviterPhone;
this['to'].text = data.inviteePhone; this['to'].text = data.inviteePhone;
document.getElementById('creImg').style.display = "block"; // document.getElementById('creImg').style.display = "block";
setTimeout(()=>{ // setTimeout(()=>{
this.getScreen(); // this.getScreen();
},500) // },500)
} }
onTap_btn(){ onTap_btn(){
console.log('onTap_btn') console.log('onTap_btn')
document.getElementById('creImg').style.display = "none"; // document.getElementById('creImg').style.display = "none";
if(this._from == 'ShareStarterScene') { if(this._from == 'ShareStarterScene') {
SceneCtrl.instance.change(ModuleTypes.ShareStarterScene); SceneCtrl.instance.change(ModuleTypes.ShareStarterScene);
}else { }else {
location.href = `${window['indexUrl']}?wayId=2`; window.location.replace(`${window['indexUrl']}?wayId=2`);
} }
} }
...@@ -45,11 +49,11 @@ export default class CertificateScene extends Scene{ ...@@ -45,11 +49,11 @@ export default class CertificateScene extends Scene{
//长按识别二维码 //长按识别二维码
getScreen(){ getScreen(){
setTimeout(() => { // setTimeout(() => {
let img = this.getPrintScreenData(this.cerGroup,0,0,558,697); let img = this.getPrintScreenData(this.cerGroup,0,0,558,697);
console.log(img); console.log(img);
this.showImgByImgData(document.getElementById('creImg'),img,100,(GameConst.stage.stageHeight-697)/2-21.5,558,697,false); this.showImgByImgData(document.getElementById('creImg'),img,100,(GameConst.stage.stageHeight-697)/2-21.5,558,697,false);
}, 500); // }, 500);
} }
/** /**
* 白鹭截canvas为img * 白鹭截canvas为img
...@@ -94,7 +98,25 @@ export default class CertificateScene extends Scene{ ...@@ -94,7 +98,25 @@ export default class CertificateScene extends Scene{
} else { } else {
img.style.opacity = 0; img.style.opacity = 0;
} }
img['src'] = imageData; let imgurl:string = imageData;
if(GCache.readCache(imageData)){
img['src'] = GCache.readCache(imageData);
img.onload = imgLoadCallBack ? imgLoadCallBack : () => { }; img.onload = imgLoadCallBack ? imgLoadCallBack : () => { };
}else{
yzwNet.imgUrl((s)=>{
if(!s){
// this.getScreen();
ToastCtrl.instance.show("保存失败")
return
}
let data = DataManager.ins.getData("imgUrl").data;
GCache.writeCache(imageData,data);
img['src'] = data;
img.onload = imgLoadCallBack ? imgLoadCallBack : () => { };
},imgurl)
}
// img['src'] = imageData;
// img.onload = imgLoadCallBack ? imgLoadCallBack : () => { };
} }
} }
\ No newline at end of file
...@@ -14,11 +14,13 @@ export default class PlacePanel extends Panel{ ...@@ -14,11 +14,13 @@ export default class PlacePanel extends Panel{
public mapBG:eui.Image; public mapBG:eui.Image;
public closeBtn:eui.Button; public closeBtn:eui.Button;
public knowBtn:eui.Button; public knowBtn:eui.Button;
public level;
constructor(data){ constructor(data){
super(); super();
this.once(egret.Event.ADDED_TO_STAGE, () => { this.once(egret.Event.ADDED_TO_STAGE, () => {
this.height = this.stage.stageHeight; this.height = this.stage.stageHeight;
}, this); }, this);
this.level =data;
this.initUI(data) this.initUI(data)
} }
...@@ -41,10 +43,10 @@ export default class PlacePanel extends Panel{ ...@@ -41,10 +43,10 @@ export default class PlacePanel extends Panel{
}else if(data == 8){ }else if(data == 8){
this.mapBG.source = "mapmg_png" this.mapBG.source = "mapmg_png"
} }
document.getElementById('placeImg').style.display = "block"; // document.getElementById('placeImg').style.display = "block";
setTimeout(()=>{ // setTimeout(()=>{
this.getScreen(); // this.getScreen();
},500) // },500)
} }
initEvents(){ initEvents(){
...@@ -55,7 +57,7 @@ export default class PlacePanel extends Panel{ ...@@ -55,7 +57,7 @@ export default class PlacePanel extends Panel{
} }
backStart(){ backStart(){
Waiting.instance.show(); Waiting.instance.show();
document.getElementById('placeImg').style.display = "none"; // document.getElementById('placeImg').style.display = "none";
yzwNet.homeBaseInfo((s)=>{ yzwNet.homeBaseInfo((s)=>{
Waiting.instance.hide(); Waiting.instance.hide();
if(!s){ if(!s){
...@@ -102,11 +104,11 @@ export default class PlacePanel extends Panel{ ...@@ -102,11 +104,11 @@ export default class PlacePanel extends Panel{
//长按识别二维码 //长按识别二维码
getScreen(){ getScreen(){
setTimeout(() => { // setTimeout(() => {
let img = this.getPrintScreenData(this.mapBG,0,0,683,801); let img = this.getPrintScreenData(this.mapBG,0,0,683,801);
console.log(img); // console.log(img);
this.showImgByImgData(document.getElementById('placeImg'),img,33,GameConst.stage.stageHeight/2-460,683,801,false); this.showImgByImgData(document.getElementById('placeImg'),img,33,GameConst.stage.stageHeight/2-460,683,801,false);
}, 500); // }, 500);
} }
/** /**
* 白鹭截canvas为img * 白鹭截canvas为img
...@@ -151,7 +153,25 @@ export default class PlacePanel extends Panel{ ...@@ -151,7 +153,25 @@ export default class PlacePanel extends Panel{
} else { } else {
img.style.opacity = 0; img.style.opacity = 0;
} }
img['src'] = imageData; let imgUrl;
if(this.level == 1){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/maphz.png"
}else if(this.level == 2){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/mapam.png"
}else if(this.level == 3){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/mapxg.png"
}else if(this.level == 4){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/maptb.png"
}else if(this.level == 5){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/maprb.png"
}else if(this.level == 6){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/maphg.png"
}else if(this.level == 7){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/mapcx.png"
}else if(this.level == 8){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/mapmg.png"
}
img['src'] = imgUrl;
img.onload = imgLoadCallBack ? imgLoadCallBack : () => { }; img.onload = imgLoadCallBack ? imgLoadCallBack : () => { };
} }
} }
\ No newline at end of file
...@@ -43,10 +43,10 @@ export default class RecordMapScene extends Scene{ ...@@ -43,10 +43,10 @@ export default class RecordMapScene extends Scene{
}else if(data.num == 8){ }else if(data.num == 8){
this.mapBG.source = "mapmg_png" this.mapBG.source = "mapmg_png"
} }
document.getElementById('mapImg').style.display = "block"; // document.getElementById('mapImg').style.display = "block";
setTimeout(()=>{ // setTimeout(()=>{
this.getScreen(); // this.getScreen();
},500) // },500)
const arr = ["HZ","AM","XG","TB","RB","HG","CX","MG"]; const arr = ["HZ","AM","XG","TB","RB","HG","CX","MG"];
if(data.data){ if(data.data){
for(let i =0;i<data.data.length;i++){ for(let i =0;i<data.data.length;i++){
...@@ -57,7 +57,7 @@ export default class RecordMapScene extends Scene{ ...@@ -57,7 +57,7 @@ export default class RecordMapScene extends Scene{
} }
if(data.type && data.type == 2){ if(data.type && data.type == 2){
this.onTap(this.backBtn,()=>{Waiting.instance.show(); this.onTap(this.backBtn,()=>{Waiting.instance.show();
document.getElementById('mapImg').style.display = "none"; // document.getElementById('mapImg').style.display = "none";
yzwNet.homeBaseInfo((s)=>{ yzwNet.homeBaseInfo((s)=>{
Waiting.instance.hide(); Waiting.instance.hide();
if(!s){ if(!s){
...@@ -113,11 +113,11 @@ export default class RecordMapScene extends Scene{ ...@@ -113,11 +113,11 @@ export default class RecordMapScene extends Scene{
//长按识别二维码 //长按识别二维码
getScreen(){ getScreen(){
setTimeout(() => { // setTimeout(() => {
let img = this.getPrintScreenData(this.mapBG,0,0,683,801); let img = this.getPrintScreenData(this.mapBG,0,0,683,801);
console.log(img); // console.log(img);
this.showImgByImgData(document.getElementById('mapImg'),img,33,GameConst.stage.stageHeight/2-460,683,801,false); this.showImgByImgData(document.getElementById('mapImg'),img,33,GameConst.stage.stageHeight/2-460,683,801,false);
}, 500); // }, 500);
} }
/** /**
* 白鹭截canvas为img * 白鹭截canvas为img
...@@ -162,7 +162,36 @@ export default class RecordMapScene extends Scene{ ...@@ -162,7 +162,36 @@ export default class RecordMapScene extends Scene{
} else { } else {
img.style.opacity = 0; img.style.opacity = 0;
} }
img['src'] = imageData; // let imgurl = "data:image/png;base64,"+imageData;
// yzwNet.imgUrl((s)=>{
// if(!s){
// ToastCtrl.instance.show("保存失败");
// return
// }
// let data = DataManager.ins.getData("imgUrl").data;
// img['src'] = data;
// img.onload = imgLoadCallBack ? imgLoadCallBack : () => { };
// },imgurl)
let imgUrl;
if(this.level == 1){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/maphz.png"
}else if(this.level == 2){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/mapam.png"
}else if(this.level == 3){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/mapxg.png"
}else if(this.level == 4){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/maptb.png"
}else if(this.level == 5){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/maprb.png"
}else if(this.level == 6){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/maphg.png"
}else if(this.level == 7){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/mapcx.png"
}else if(this.level == 8){
imgUrl = "http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/mapmg.png"
}
img['src'] = imgUrl;
img.onload = imgLoadCallBack ? imgLoadCallBack : () => { }; img.onload = imgLoadCallBack ? imgLoadCallBack : () => { };
} }
} }
\ No newline at end of file
...@@ -37,10 +37,10 @@ export default class TransScene extends Scene { ...@@ -37,10 +37,10 @@ export default class TransScene extends Scene {
this['btn'].visible = true; this['btn'].visible = true;
}, window['projectId']); }, window['projectId']);
} else { } else {
location.href = `${window['indexUrl']}?wayId=2`; window.location.replace(`${window['indexUrl']}?wayId=2`);
} }
} else { } else {
location.href = `${window['indexUrl']}?wayId=2`; window.location.replace(`${window['indexUrl']}?wayId=2`);
} }
}, window['projectId'], GameConst.getQueryString("shareCode")); }, window['projectId'], GameConst.getQueryString("shareCode"));
// if (iswx()) { // if (iswx()) {
...@@ -151,7 +151,10 @@ export default class TransScene extends Scene { ...@@ -151,7 +151,10 @@ export default class TransScene extends Scene {
const data = DataManager.ins.getData('accept').data; const data = DataManager.ins.getData('accept').data;
if (!data) if (!data)
console.log('accept 接口 data为空') console.log('accept 接口 data为空')
// let idata = {inviterPhone:123,inviteePhone:456,from:'TransScene'}
data.from = 'TransScene'; data.from = 'TransScene';
SceneCtrl.instance.change(ModuleTypes.CertificateScene, data); SceneCtrl.instance.change(ModuleTypes.CertificateScene, data);
}, this); }, this);
} }
......
...@@ -243,10 +243,12 @@ const config = { ...@@ -243,10 +243,12 @@ const config = {
}, },
'/projectx/1/invite_2/passRecord.do': { '/projectx/1/invite_2/passRecord.do': {
data: './yzw/passRecord.json' data: './yzw/passRecord.json'
},
'/customActivity/duiba/imgUrl': {
data: './yzw/imgUrl.json'
} }
} }
for (let item in config) { for (let item in config) {
......
{ {
"code":null, "code":null,
"data":{ "data":{
"currentLevel":5, "currentLevel":4,
"treasureBoxNum":0, "treasureBoxNum":0,
"currentScore":2000, "currentScore":2000,
"pkResult":{ "pkResult":{
......
{
"success":true,
"code":null,
"desc":null,
"timestamp":1536120702322,
"data":"http://yun.duiba.com.cn/db_games/activity/yzw_hjcd/mapth/maptb.png"
}
\ No newline at end of file
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