/**
 * Created by rockyl on 2019-04-10.
 *
 * 警告对话框内容
 */

import { Entity } from "scilla/src";
import { setText } from "../entityUtils";
import DialogContent from "../popup/DialogContent";

export default class ScoreDialogContent extends DialogContent {
	content: Entity;
	rankbtn: Entity;
	onAwake() {
		super.onAwake();
	}

	setup(data: any = {}) {
		setText(this.content, `恭喜你共摇出${data}个福`)
	}

	protected onTapCloseButton() {
		super.onTapCloseButton();
		this.bubbling('fuckNavigator', 'start');
	}

	onclick_ranbtn() {
		this.hide();
		// this.broadcast('callApi', 1, 'rankInfo', {
		// 	weddingId: window['CFG'].weddingId,
		// 	activityId: window['CFG'].activityId
		// })
		this.bubbling('fuckNavigator', 'start');
		window.location.href = getRankURL();
	}

	// onResponse_rank1() {
	// 	console.log('score dialog content,onResponse_rank')
	// 	this.bubbling('fuckNavigator', 'result');
	// }
}

export const getRankURL = () => {
	return `/customActivity/sjf/activity/recordIndex?weddingId=${window['CFG'].weddingId}&activityId=${window['CFG'].activityId}&brickType=7`
}
export const getURL = () => {
	     //`/customActivity/sjf/mainIndex?weddingId=2
	return `/customActivity/sjf/mainIndex?weddingId=${window['CFG'].weddingId}`;
}

export const getRecordURL = () => {
	return `/customActivity/sjf/activity/recordIndex?weddingId=${window['CFG'].weddingId}&activityId=${window['CFG'].activityId}&brickType=6`;
}
