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