|
@@ -148,19 +148,23 @@ export default {
|
|
|
})
|
|
|
setTimeout(() => {
|
|
|
gameDetail($record_id).then((res) => {
|
|
|
- console.log('get_game_detail', res)
|
|
|
- Toast.clear()
|
|
|
- let $res = res.data;
|
|
|
- $this.record = $res.data
|
|
|
- //5分钟阶段
|
|
|
- let $five_min = 5 * 60
|
|
|
- $this.is_cut = $this.record.play_time > $five_min
|
|
|
- if ($this.is_cut) {
|
|
|
- //截断得数量
|
|
|
- $this.data_section = Math.ceil($this.record.play_time / $five_min)
|
|
|
+ console.log('get_game_detail', res)
|
|
|
+ Toast.clear()
|
|
|
+ let $res = res.data;
|
|
|
+ $this.record = $res.data
|
|
|
+ //5分钟阶段
|
|
|
+ let $five_min = 5 * 60
|
|
|
+ $this.is_cut = $this.record.play_time > $five_min
|
|
|
+ if ($this.is_cut) {
|
|
|
+ //截断得数量
|
|
|
+ $this.data_section = Math.ceil($this.record.play_time / $five_min)
|
|
|
+ }
|
|
|
+ $this.record.play_time = formatSeconds($this.record.play_time)
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ Toast.fail('错误代码:' + res.code + ',联系客服')
|
|
|
}
|
|
|
- $this.record.play_time = formatSeconds($this.record.play_time)
|
|
|
- })
|
|
|
+ )
|
|
|
}, 800)
|
|
|
},
|
|
|
get_game_line($record_id) {
|
|
@@ -168,33 +172,36 @@ export default {
|
|
|
'game_record_id': $record_id,
|
|
|
}
|
|
|
gameLineChart($params).then((res) => {
|
|
|
- let $res = res.data;
|
|
|
- let $option = {}
|
|
|
- setTimeout(() => {
|
|
|
- let $line_data = $res.data.line
|
|
|
- if ($this.is_cut) {
|
|
|
- //需要截断数据
|
|
|
- let $more_than_count = $line_data.length % $this.data_section
|
|
|
- let i = 0
|
|
|
- //根据多出来的数 删除结尾得数量
|
|
|
- for (i = 0; i < $more_than_count; i++) {
|
|
|
- $line_data.pop()
|
|
|
- }
|
|
|
-
|
|
|
- $this.data_lines = []
|
|
|
- //获取每一组得数据长度
|
|
|
- let $item_len = $line_data.length / $this.data_section
|
|
|
- for (i = 0; i < $this.data_section; i++) {
|
|
|
- $this.data_lines.push($line_data.slice(i * $item_len, (i + 1) * $item_len))
|
|
|
+ let $res = res.data;
|
|
|
+ let $option = {}
|
|
|
+ setTimeout(() => {
|
|
|
+ let $line_data = $res.data.line
|
|
|
+ if ($this.is_cut) {
|
|
|
+ //需要截断数据
|
|
|
+ let $more_than_count = $line_data.length % $this.data_section
|
|
|
+ let i = 0
|
|
|
+ //根据多出来的数 删除结尾得数量
|
|
|
+ for (i = 0; i < $more_than_count; i++) {
|
|
|
+ $line_data.pop()
|
|
|
+ }
|
|
|
+
|
|
|
+ $this.data_lines = []
|
|
|
+ //获取每一组得数据长度
|
|
|
+ let $item_len = $line_data.length / $this.data_section
|
|
|
+ for (i = 0; i < $this.data_section; i++) {
|
|
|
+ $this.data_lines.push($line_data.slice(i * $item_len, (i + 1) * $item_len))
|
|
|
+ }
|
|
|
+
|
|
|
+ $option = util.getLineOption($this.data_lines[0], [0])
|
|
|
+ } else {
|
|
|
+ $option = util.getLineOption($line_data, [0])
|
|
|
}
|
|
|
-
|
|
|
- $option = util.getLineOption($this.data_lines[0], [0])
|
|
|
- } else {
|
|
|
- $option = util.getLineOption($line_data, [0])
|
|
|
- }
|
|
|
- att_charts.setOption($option)
|
|
|
- }, 1000)
|
|
|
- })
|
|
|
+ att_charts.setOption($option)
|
|
|
+ }, 1000)
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ Toast.fail('错误代码:' + res.code + ',联系客服')
|
|
|
+ })
|
|
|
},
|
|
|
to_game_records() {
|
|
|
mpvue.navigateTo({
|