1 line
7.2 KiB
JSON
1 line
7.2 KiB
JSON
{"ast":null,"code":"import { mapState } from \"vuex\";\nimport { showToast, showLoadingToast, closeToast } from \"vant\";\nimport { getUserBets, getRobBet, tipRecord, rechargeRecord } from \"@/utils/api\";\nexport default {\n name: \"RecordView\",\n data() {\n return {\n frist: true,\n showGameType: false,\n showCapitalType: false,\n num: 0,\n pagenum: 0,\n page: 1,\n alldown: 0,\n allwin: 0,\n recharge_amount: 0,\n time_interval: 1,\n tableData: [],\n type: 1,\n // typetext:this.$lang[this.$Type].Baccarat||'',\n // capitaltext:this.$lang[this.$Type].Fundrecord||'',\n typetext: \"\",\n capitaltext: \"\",\n showRob: false,\n robTitle: \"\",\n robData: [],\n robnum: 0,\n robpagenum: 0,\n roballdown: 0,\n roballwin: 0,\n robpage: 1,\n rob_number_tab_id: 0,\n rob_title: \"\",\n rob_win_total: 0\n };\n },\n methods: {\n returnFloat(num) {\n let value = Math.round(parseFloat(num) * 100) / 100;\n let xsd = value.toString().split(\".\");\n if (xsd.length == 1) {\n value = value.toString() + \".00\";\n return value;\n }\n if (xsd.length > 1) {\n if (xsd[1].length < 2) {\n value = value.toString() + \"0\";\n }\n return value;\n }\n },\n gameType() {\n this.showGameType = !this.showGameType;\n this.showCapitalType = false;\n },\n capitalType() {\n this.showCapitalType = !this.showCapitalType;\n this.showGameType = false;\n },\n offSelect() {\n if (this.showGameType) {\n this.showGameType = false;\n }\n if (this.showCapitalType) {\n this.showCapitalType = false;\n }\n },\n choseTime(type) {\n this.time_interval = type;\n this.page = 1;\n this.getData(this.type);\n },\n choseType(type, text) {\n this.page = 1;\n if (type <= 7) {\n this.typetext = text;\n this.capitaltext = this.$lang[this.$Type].Betrecord;\n this.showGameType = false;\n this.getData(type);\n } else {\n if (this.userInfo.is_sw != 1) {\n this.capitaltext = text;\n this.typetext = this.$lang[this.$Type].Gamerecord;\n this.showCapitalType = false;\n this.getData(type);\n } else {\n showToast(this.$lang[this.$Type].Not_power);\n }\n }\n },\n getData(type) {\n this.type = type;\n if (this.type != 10 && this.type != 11 && this.type != 12) {\n // 游戏记录\n const params = {\n user_id: this.userInfo.id,\n api_token: this.userInfo.api_token,\n game_id: this.type,\n page: this.page,\n time_interval: this.time_interval\n };\n showLoadingToast({\n message: \"加载中...\",\n forbidClick: true\n });\n getUserBets(params).then(response => {\n if (response.Success == 1) {\n const data = response.Data;\n this.tableData = data.bet_info;\n this.num = data.bet_num;\n this.pagenum = data.page_num;\n this.alldown = data.bet_list_amount;\n this.allwin = data.bet_list_wintotal;\n } else {\n console.log(response);\n }\n }).catch(error => {\n console.log(error);\n }).finally(() => {\n closeToast();\n });\n } else if (this.type == 12) {\n // 打赏记录\n const params = {\n user_id: this.userInfo.id,\n api_token: this.userInfo.api_token,\n page: this.page,\n time_interval: this.time_interval\n };\n tipRecord(params).then(response => {\n if (response.Success == 1) {\n const data = response.Data;\n this.tableData = data.tip;\n this.num = data.tip_num;\n this.pagenum = data.page_num;\n this.recharge_amount = data.tip_amount;\n // console.log(data)\n } else {\n // console.log(data)\n }\n }).catch(error => {\n console.log(error);\n });\n } else {\n // 上下分记录\n let mode = 1;\n if (this.type == 10) {\n mode = 1;\n } else if (this.type == 11) {\n mode = 2;\n }\n const params = {\n user_id: this.userInfo.id,\n api_token: this.userInfo.api_token,\n page: this.page,\n mode: mode,\n time_interval: this.time_interval\n };\n rechargeRecord(params).then(response => {\n if (response.Success == 1) {\n const data = response.Data;\n this.tableData = data.recharge;\n this.num = data.recharge_num;\n this.pagenum = data.page_num;\n this.recharge_amount = data.recharge_amount;\n } else {\n // console.log(data)\n }\n }).catch(error => {\n console.log(error);\n });\n }\n },\n // 查看庄详情\n Details(number_tab_id, title, win_total) {\n this.rob_number_tab_id = number_tab_id;\n this.rob_title = title;\n this.rob_win_total = win_total;\n const params = {\n user_id: this.userInfo.id,\n api_token: this.userInfo.api_token,\n game_id: this.type,\n page: this.robpage,\n number_tab_id: number_tab_id\n };\n if (win_total != 0) {\n getRobBet(params).then(response => {\n if (response.Success == 1) {\n const data = response.Data;\n // console.log(data)\n this.showRob = true;\n this.robTitle = title;\n this.robData = data.bet_info;\n this.robnum = data.bet_num;\n this.robpagenum = data.page_num;\n this.roballdown = data.bet_list_amount;\n this.roballwin = data.bet_list_wintotal;\n } else {\n // console.log(data)\n }\n }).catch(error => {\n console.log(error);\n });\n } else {\n showToast(this.$lang[this.$Type].Not_bet);\n }\n },\n backRecord() {\n this.showRob = false;\n },\n prevPage() {\n this.page = this.page - 1;\n this.getData(this.type);\n },\n nextPage() {\n this.page = this.page + 1;\n this.getData(this.type);\n },\n robprevPage() {\n this.robpage = this.robpage - 1;\n this.Details(this.rob_number_tab_id, this.rob_title, this.rob_win_total);\n },\n robnextPage() {\n this.robpage = this.robpage + 1;\n this.Details(this.rob_number_tab_id, this.rob_title, this.rob_win_total);\n },\n goback() {\n this.$router.go(-1);\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 userInfo: {\n handler: function (newData) {\n if (newData.api_token) {\n this.getData(1);\n this.typetext = this.$lang[this.$Type].Baccarat;\n this.capitaltext = this.$lang[this.$Type].Fundrecord;\n }\n },\n deep: true,\n immediate: true\n }\n }\n};","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]} |