Commit a945e2dc authored by wjf's avatar wjf

Merge branch 'dev' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into dev

parents 6c914c8b 1e1a1c03
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<e:Group id="progressGroup" x="8" verticalCenter="0"> <e:Group id="progressGroup" x="8" verticalCenter="0">
<e:Image id="progressBg" source="scratch_progress_bg_png" anchorOffsetX="0" anchorOffsetY="0" x="0" y="0" width="437" height="22"/> <e:Image id="progressBg" source="scratch_progress_bg_png" anchorOffsetX="0" anchorOffsetY="0" x="0" y="0" width="437" height="22"/>
<e:Rect id="progress" fillColor="0xeb1917" left="0" verticalCenter="0" width="0" top="0" bottom="0"/> <e:Rect id="progress" fillColor="0xeb1917" left="0" verticalCenter="0" width="0" top="0" bottom="0"/>
<e:Label id="progressLabel" text="仅剩90.7%" size="18" verticalCenter="0" horizontalCenter="0" bold="true"/> <e:Label id="progressLabel" text="仅剩90.7%" size="18" verticalCenter="2" horizontalCenter="0.5" bold="true" verticalAlign="middle" textAlign="center"/>
</e:Group> </e:Group>
<e:Image id="hongbao" source="scratch_hongbao_png" scaleX="1" scaleY="1" verticalCenter="0" horizontalCenter="219"/> <e:Image id="hongbao" source="scratch_hongbao_png" scaleX="1" scaleY="1" verticalCenter="0" horizontalCenter="219"/>
</e:Group> </e:Group>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<e:Group id="progressGroup" x="8" verticalCenter="0"> <e:Group id="progressGroup" x="8" verticalCenter="0">
<e:Image id="progressBg" source="scratch_progress_bg_png" anchorOffsetX="0" anchorOffsetY="0" x="0" y="0" width="437" height="22"/> <e:Image id="progressBg" source="scratch_progress_bg_png" anchorOffsetX="0" anchorOffsetY="0" x="0" y="0" width="437" height="22"/>
<e:Rect id="progress" fillColor="0xEB1917" left="0" verticalCenter="0" width="0" top="0" bottom="0"/> <e:Rect id="progress" fillColor="0xEB1917" left="0" verticalCenter="0" width="0" top="0" bottom="0"/>
<e:Label id="progressLabel" text="仅剩90.7%" size="18" verticalCenter="0" horizontalCenter="0" bold="true"/> <e:Label id="progressLabel" text="仅剩90.7%" size="18" bold="true" verticalAlign="middle" textAlign="center" horizontalCenter="0" verticalCenter="0"/>
</e:Group> </e:Group>
<e:Image id="hongbao" source="scratch_hongbao_png" scaleX="1" scaleY="1" verticalCenter="0" horizontalCenter="219"/> <e:Image id="hongbao" source="scratch_hongbao_png" scaleX="1" scaleY="1" verticalCenter="0" horizontalCenter="219"/>
</e:Group> </e:Group>
......
...@@ -60,6 +60,9 @@ export default class Utils { ...@@ -60,6 +60,9 @@ export default class Utils {
* @returns {Object} obj - 拷贝完成的对象 * @returns {Object} obj - 拷贝完成的对象
*/ */
public static deepClone(src, dst = undefined) { public static deepClone(src, dst = undefined) {
if(src){
return src;
}
let _obj = dst || (src instanceof Array ? [] : {}); let _obj = dst || (src instanceof Array ? [] : {});
for(let key in src) { for(let key in src) {
let prop = src[key]; let prop = src[key];
......
...@@ -116,7 +116,7 @@ export default class MapScene extends Scene { ...@@ -116,7 +116,7 @@ export default class MapScene extends Scene {
} }
const backData = DataManager.ins.getData('hc_getBackReward'); const backData = DataManager.ins.getData('hc_getBackReward');
if(backData.data) { if(backData.success && backData.data) {
panels.push('back'); panels.push('back');
} }
......
...@@ -81,7 +81,7 @@ export default class ScratchIcon extends IconBase { ...@@ -81,7 +81,7 @@ export default class ScratchIcon extends IconBase {
// PanelCtrl.instance.show('scratch', res.data); // PanelCtrl.instance.show('scratch', res.data);
break; break;
case (status == 2): // 当前任务完成待领奖 请求领奖接口 case (status == 2): // 当前任务完成待领奖 请求领奖接口
NetManager.ins.scratchTakePrize((success, res) => { NetManager.ins.scratchTakePrize((success) => {
if(!success) { if(!success) {
return; return;
} }
......
...@@ -8,7 +8,7 @@ import CutTimer from "../CutTimer"; ...@@ -8,7 +8,7 @@ import CutTimer from "../CutTimer";
import Utils from "../Utils"; import Utils from "../Utils";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
export default class iScratchPanel extends Panel { export default class ScratchPanel extends Panel {
private cutTimer: CutTimer; private cutTimer: CutTimer;
constructor(data) { constructor(data) {
...@@ -20,7 +20,7 @@ export default class iScratchPanel extends Panel { ...@@ -20,7 +20,7 @@ export default class iScratchPanel extends Panel {
super.start(); super.start();
this.showlog(); this.showlog();
const scratchData =DataManager.ins.getData('hc_turnableDojoin'); const scratchData = DataManager.ins.getData('hc_turnableDojoin');
this['light1'].visible = this['light2'].visible = false; this['light1'].visible = this['light2'].visible = false;
this['con'].addChild(this.data.mv); this['con'].addChild(this.data.mv);
...@@ -91,7 +91,11 @@ export default class iScratchPanel extends Panel { ...@@ -91,7 +91,11 @@ export default class iScratchPanel extends Panel {
} }
// 添加邀请图标 // 添加邀请图标
let dNum = this.data.helpedCount - this.data.avatarList.length; let noAvatarNum = this.data.helpedCount - this.data.avatarList.length; // 没有头像的人数
let dNum = this.data.totalNeedCount - this.data.avatarList.length - noAvatarNum; // 没邀请的人数
for(let i = 0; i < noAvatarNum; i++){
this.data.avatarList.push("");
}
for(let i = 0; i < dNum; i++) { for(let i = 0; i < dNum; i++) {
this.data.avatarList.push("scratch_invite_png"); this.data.avatarList.push("scratch_invite_png");
} }
...@@ -214,6 +218,7 @@ class ScratchItem extends eui.ItemRenderer { ...@@ -214,6 +218,7 @@ class ScratchItem extends eui.ItemRenderer {
dataChanged() { dataChanged() {
this.img.mask = this.mask; this.img.mask = this.mask;
let s = this.data.avatar || "http://yun.duiba.com.cn/db_games/default_avatar.png";
this.img.source = this.data.avatar || "http://yun.duiba.com.cn/db_games/default_avatar.png"; this.img.source = this.data.avatar || "http://yun.duiba.com.cn/db_games/default_avatar.png";
this.img.addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this.img.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.scratchGetShareCode((success, res) => { NetManager.ins.scratchGetShareCode((success, res) => {
......
...@@ -14,6 +14,7 @@ import wait from "../../../libs/new_tc/wait"; ...@@ -14,6 +14,7 @@ import wait from "../../../libs/new_tc/wait";
import { showToast } from "../../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../../libs/new_wx/ctrls/toastCtrl";
import getHomeData from "../../getHomeData"; import getHomeData from "../../getHomeData";
import { getlogItem } from "../../Main"; import { getlogItem } from "../../Main";
import SceneCtrl from "../../../libs/new_wx/ctrls/sceneCtrl";
// export const loadTurntableSvga = (callback) => { // export const loadTurntableSvga = (callback) => {
// loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => { // loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => {
// // await wait(100); // // await wait(100);
...@@ -117,6 +118,9 @@ export default class Turntable extends Panel { ...@@ -117,6 +118,9 @@ export default class Turntable extends Panel {
console.warn(error) console.warn(error)
} }
NetManager.ins.hc_turnableDojoin((success, res) => { NetManager.ins.hc_turnableDojoin((success, res) => {
NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
Loading.instace.hide(); Loading.instace.hide();
// if(!success) { // if(!success) {
// return; // return;
...@@ -166,9 +170,9 @@ export default class Turntable extends Panel { ...@@ -166,9 +170,9 @@ export default class Turntable extends Panel {
PanelCtrl.instance.show("TurntableNoPrizePanel", {type: 3}); PanelCtrl.instance.show("TurntableNoPrizePanel", {type: 3});
} else { } else {
loadSvga(getResPath() + 'resource/assets/svgas/turnprize.svga').then(async (mv: any) => { loadSvga(getResPath() + 'resource/assets/svgas/turnprize.svga').then(async (mv: any) => {
let _data = Utils.deepClone(data); // let _data = Utils.deepClone(data);
_data.mv = mv; data.mv = mv;
PanelCtrl.instance.show('TurnPrizePanel', _data); PanelCtrl.instance.show('TurnPrizePanel', data);
}); });
} }
}); });
...@@ -299,15 +303,14 @@ export default class Turntable extends Panel { ...@@ -299,15 +303,14 @@ export default class Turntable extends Panel {
} }
v.prizeImg = prizeImg; v.prizeImg = prizeImg;
RotaryData.key.push(v.categoryType); RotaryData.key.push(v.categoryType);
RotaryData.data[v.categoryType] = [{start: i * 60 - 20, end: i * 60 + 20}]; if(i >= 6) {
if(i>=6){ continue;
return;
} }
RotaryData.data[v.categoryType] = [{start: i * 60 - 20, end: i * 60 + 20}];
this[`img${i}`].source = v.prizeImg; this[`img${i}`].source = v.prizeImg;
}
if(this.data.onceAgain) { // 再抽一次 if(this.data.onceAgain) { // 再抽一次
this.onTapStart(); this.onTapStart();
}
} }
}); });
......
...@@ -37,7 +37,9 @@ export default class TurnPrizePanel extends Panel { ...@@ -37,7 +37,9 @@ export default class TurnPrizePanel extends Panel {
updateOption(option: any) { updateOption(option: any) {
const { categoryType, img, num, propType } = option;// 2次数 3道具 4元宝 5实物 6优惠券 7虚拟商品 const { categoryType, img, num, propType } = option;// 2次数 3道具 4元宝 5实物 6优惠券 7虚拟商品
this['propnums'].text = 'x' + num; this['propnums'].text = 'x1';
if(num)
this['propnums'].text = 'x' + num;
switch (categoryType) { switch (categoryType) {
case 2: case 2:
this['blood'].visible = true; this['blood'].visible = true;
......
{ {
"code":"0000000000", "code":"0000000000",
"data":{ "data":{
"appItemId":2322,
"completePercent":"99", "categoryType":1,
"prizeImage":"", "coinType":1,
"remainPercent":"剩余进度", "img":"1",
"scratchCardTaskId":1, "maxValue":2,
"categoryType":4, "minValue":1,
"title":"奖品信息", "name":"测试商品",
"coinType":1, "num":3,
"maxValue":10, "propType":2,
"minValue":10, "rate":"概率",
"appItemId":2099, "title":"商品信息",
"img":"http://yun.duiba.com.cn/db_games/1022/111.png", "value":"虚拟商品标识符"
"name":"虚拟商品名称",
"value":"虚拟商品编码",
"num":10,
"propType":1
}, },
"desc":"OK", "desc":"OK",
"success":true, "success":true,
......
{ {
"success": true, "success": true,
"code": null, "code": "0000000000",
"desc": null, "desc": "OK",
"timestamp": 1566199822308, "timestamp": 1572318933388,
"data": { "data": {
"scratchCardTaskId": 1222, "scratchCardTaskId": 1,
"taskStatus": 1, "taskStatus": 1,
"prizeImage": "http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg", "prizeImage": "//yun.dui88.com/images/201910/e6pmpk2pne.png",
"currentTime": 1570673808000, "currentTime": 1572318933366,
"endTime": 1570673810000, "endTime": 1572358710000,
"completePercent": "90.50", "completePercent": "91.0",
"remainPercent": "9.50", "remainPercent": "9.0",
"helpedCount": 4, "totalNeedCount": 3,
"helpedCount": 2,
"avatarList": [ "avatarList": [
"http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg", null
""
] ]
} }
} }
\ No newline at end of file
...@@ -2,10 +2,15 @@ ...@@ -2,10 +2,15 @@
"success": true, "success": true,
"code": "0000000000", "code": "0000000000",
"desc": "OK", "desc": "OK",
"timestamp": 1572262646931, "timestamp": 1572327888728,
"data": { "data": {
"isScratchCard": false, "isScratchCard": true,
"option": null, "option": {
"scratchCardTaskId": 7,
"prizeImage": "//yun.dui88.com/images/201910/e6pmpk2pne.png",
"completePercent": "8",
"remainPercent": null
},
"orderNum": null "orderNum": null
} }
} }
\ 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