123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342 |
- <template>
- <div id="report_container">
- <view class="head"></view>
- <img class="boy" src="https://img.shuimuai.com/m_sign_chengji_boy%402x.png"/>
- <view class="user">
- <view class="up">
- <view class="left">
- <img :src="userinfo.portrait"/>
- <view>
- <text>{{ record.user_name }}</text>
- <text>{{ userinfo.level_name }}</text>
- </view>
- </view>
- <view class="right" @click="to_game_records">
- <img src="https://img.shuimuai.com/m_icon_chengji%402x.png"/>
- <text>成绩记录</text>
- </view>
- </view>
- <view class="down">
- <view>{{ record.att_average }}</view>
- <view>专注力得分</view>
- </view>
- </view>
- <view class="bar">
- <view>
- <view class="line"></view>
- <view class="title">数据详情</view>
- </view>
- </view>
- <view class="detail">
- <view>
- <view>{{ record.att_max }}</view>
- <view>专注力最高分</view>
- </view>
- <view>
- <view>{{ record.med_max }}</view>
- <view>放松度最高值</view>
- </view>
- <view>
- <view>{{ record.med_average }}</view>
- <view>放松度均值</view>
- </view>
- </view>
- <view class="bar">
- <view>
- <view class="line"></view>
- <view class="title">基本脑波</view>
- </view>
- </view>
- <view class="chart">
- <mpvue-echarts :echarts="echarts" :onInit="attCharts" canvasId="demo-canvas"/>
- </view>
- <view class="conclution">{{ record.content }}</view>
- <view class="bar">
- <view>
- <view class="line"></view>
- <view class="title">核销详情</view>
- </view>
- </view>
- <view class="sheet">
- <view class="left">
- <view>专注力训练设备: {{ record.name }}</view>
- <view>核销方式:
- <text v-if="record.consumption_type==1">次卡</text>
- <text v-if="record.consumption_type==2">时间卡</text>
- </view>
- <view>会员游玩时间: {{ record.play_time }}</view>
- </view>
- <view class="right">
- <view>专注力训练时长: {{ record.play_time }}</view>
- </view>
- </view>
- </div>
- </template>
- <script>
- import mpvueEcharts from 'mpvue-echarts'
- import echarts from '../../../static/echarts.min';
- import util, {formatSeconds} from '../../utils/index'
- import {gameDetail, gameLineChart} from "../../requests/game";
- import game_store from "../../store/game";
- var att_charts,
- $this
- // 大脑图表初始化
- function initAttChart(canvas, width, height) {
- att_charts = echarts.init(canvas, null, {
- width: width,
- height: height
- });
- canvas.setChart(att_charts);
- var option = util.getLineOption([0], [0]); // ECharts 配置项
- att_charts.setOption(option);
- return att_charts; // 返回 chart 后可以自动绑定触摸操作
- }
- export default {
- name: "index_container",
- components: {
- mpvueEcharts
- },
- data() {
- return {
- // 0:未选择 1:时间 2:次数
- // 折线图
- attCharts: initAttChart,
- echarts,
- record: {},
- userinfo: {},
- record_id: 0
- }
- },
- methods: {
- // 获取游戏报告
- get_report($record_id) {
- gameDetail($record_id).then((res) => {
- let $res = res.data;
- $this.record = $res.data
- $this.record.play_time = formatSeconds($this.record.play_time)
- })
- },
- get_game_line($record_id) {
- let $params = {
- 'game_record_id': $record_id,
- }
- gameLineChart($params).then((res) => {
- let $res = res.data;
- setTimeout(() => {
- let $option = util.getLineOption($res.data.line, [0])
- att_charts.setOption($option)
- }, 1000)
- })
- },
- to_game_records() {
- mpvue.navigateTo({
- url: "/pages/game_record/main"
- })
- }
- }
- ,
- mounted() {
- $this.userinfo = wx.getStorageSync('userinfo')
- $this.get_report($this.record_id)
- $this.get_game_line($this.record_id)
- },
- created() {
- $this = this;
- },
- onLoad(options) {
- $this.record_id = options.id ? options.id : game_store.getters.getGameRecordId
- console.log($this.record_id)
- }
- }
- </script>
- <style scoped>
- /* 头部椭圆 */
- .head {
- width: 442px;
- height: 385px;
- background-color:#4b3ab0;
- border-radius: 50%;
- position: absolute;
- left: -34px;
- top: -252px;
- z-index: -1;
- }
- /* 头部个人信息 */
- image.boy {
- width: 110px;
- height: 111px;
- position: absolute;
- left: 225px;
- top: 45px;
- }
- .user {
- width: 100%;
- }
- .user .up {
- width: 100%;
- height: 40px;
- margin-top: 9px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- color: #fff;
- }
- .user .up .left {
- height: 40px;
- display: flex;
- align-items: center;
- justify-content: start;
- }
- .user .up .left image {
- width: 40px;
- height: 40px;
- margin-left: 17px;
- margin-right: 8px;
- }
- .user .up .left view {
- height: 40px;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- justify-content: space-between;
- }
- .user .up .left view text:first-child{
- font-size: 15px;
- font-weight: bold;
- }
- .user .up .left view text:last-child{
- font-size: 13px;
- }
- .user .up .right {
- height: 40px;
- }
- .user .up .right image {
- width: 14px;
- height: 15px;
- vertical-align: middle;
- margin-right: 4px;
- }
- .user .up .right text {
- font-size: 12px;
- text-decoration: underline;
- margin-right: 10px;
- }
- .user .down {
- width: 100%;
- height: 82px;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: start;
- }
- .user .down view:first-child{
- font-size: 45px;
- color: #FFD800;
- font-weight: bold;
- }
- .user .down view:last-child{
- font-size: 10px;
- color: #C7C4D8;
- margin-top: -5px;
- }
- /* 详细数据 */
- .detail {
- width: 100%;
- height: 102px;
- display: flex;
- align-items: center;
- justify-content: space-around;
- }
- .detail view {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: space-around;
- color: #6C6C6C;
- font-size: 10px;
- }
- .detail view view:first-child {
- color: #000;
- font-size: 30px;
- }
- /* 小标题 */
- .bar {
- width: 100%;
- height: 10px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 7px;
- box-sizing: border-box;
- margin: 11px 0;
- }
- .bar view {
- display: flex;
- align-items: center;
- justify-content: start;
- }
- .conclution {
- width: 100%;
- padding: 5px 19px 20px;
- font-size: 12px;
- color: #6C6C6C;
- box-sizing: border-box;
- }
- .bar .line {
- width: 4px;
- height: 15px;
- background-color: #5D4DB8;
- margin-right: 7px;
- }
- .bar .title {
- color: #010101;
- font-size: 15px;
- }
- /* 图表 */
- #mychart-dom-multi-line {
- width: 360px;
- height: 193px;
- }
- .chart {
- margin: 0 auto;
- width: 360px;
- height: 193px;
- background: #f3f3f3;
- opacity: 0.6;
- border-radius: 10px;
- box-shadow: 0px 6px 11px #dadada;
- }
- /* 核销详情 */
- .sheet {
- color: #6D6D6D;
- font-size: 12px;
- display: flex;
- padding: 0 16px;
- box-sizing: border-box;
- }
- .sheet .left,
- .sheet .right {
- height: 95px;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- justify-content: space-between;
- }
- .sheet .left {
- width: 195px;
- }
- </style>
|