GamePortrait/node_modules/.cache/babel-loader/9c12bc8468a91c4374dc9b25a578bd6cf4a963b35ff218910b40a44d9a5c0728.json

1 line
2.5 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"ast":null,"code":"import { mapState } from \"vuex\";\nimport { showToast } from \"vant\";\n// showSuccessToast, showFailToast\nexport default {\n data() {\n return {\n countDown: 0,\n rob_banker_username: \"\",\n successRob: false\n };\n },\n methods: {\n sendRob(state) {\n if (state == true) {\n var toRobData = {\n connect: \"client\",\n mode: \"toRob\",\n table_id: this.thisData.id,\n number_tab_id: this.thisData.number_tab_id\n };\n this.$store.dispatch(\"socket/sendMsg\", {\n ...toRobData\n });\n } else {\n if (this.$Type == \"cn\") {\n showToast(\"庄已被 \" + this.thisData.rob_banker_username + \" 抢了!\");\n } else if (this.$Type == \"tw\") {\n showToast(\"莊已被 \" + this.thisData.rob_banker_username + \" 搶了!\");\n } else if (this.$Type == \"en\") {\n showToast(\"Zhuang has been robbed by \" + this.thisData.rob_banker_username + \"\");\n }\n }\n }\n },\n computed: {\n ...mapState({\n $Type: state => state.config.$Type,\n $lang: state => state.config.$lang,\n userInfo: state => state.app.userInfo\n })\n },\n watch: {\n thisData: {\n handler: function (newData) {\n // console.log(newData)\n if (newData.game_id) {\n // 更新抢庄时间\n if (newData.sendMode == \"startRobCountDown\") {\n this.countDown = newData.rob_count_down;\n } else if (newData.sendMode != \"toRobResult\" && newData.sendMode != \"toRob\") {\n this.countDown = 0;\n }\n\n // 判断是否系统抢庄\n if (this.countDown == 0) {\n if (newData.rob_banker_username) {\n this.rob_banker_username = newData.rob_banker_username;\n } else {\n this.rob_banker_username = this.$lang[this.$Type].system;\n }\n }\n // 判断抢庄提示\n if (newData.rob_banker_id == this.userInfo.uid && newData.rob_status == 1) {\n this.successRob = true;\n setTimeout(() => {\n this.successRob = false;\n newData.rob_status = 2;\n }, 5000);\n } else {\n this.successRob = false;\n }\n }\n },\n deep: true,\n immediate: true\n }\n },\n props: {\n thisData: Object\n }\n};","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}