123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <template>
- <view class="content">
- <uni-card :title="repo.title">
- <view>{{repo.remark}}</view>
- <view>题目总数:{{repo.quCount}}</view>
- <view>创建时间:{{repo.createTime}}</view>
- </uni-card>
-
-
- <view>
-
- <uni-card title="练习模式">
- <uni-row :gutter="2">
- <uni-col :span="8">
- <view class="tr-item" @click="navtoTrain(11)">
- <image src="../../static/nav/pattern1.png"></image>
- <text>顺序训练</text>
- </view>
- </uni-col>
- <uni-col :span="8">
- <view class="tr-item" @click="navtoTrain(12)">
- <image src="../../static/nav/pattern2.png"></image>
- <text>随机训练</text>
- </view>
- </uni-col>
- <uni-col :span="8">
- <view class="tr-item" @click="navtoTrain(13)">
- <image src="../../static/nav/pattern3.png"></image>
- <text>背题模式</text>
- </view>
- </uni-col>
- </uni-row>
- </uni-card>
-
- <uni-card title="题型练习">
-
- <uni-row :gutter="2">
- <uni-col :span="8" v-for="item in repo.typeList">
- <view class="tr-item" @click="navtoTrain(`2${item.quType}`)">
- <image :src="`../../static/nav/qtype${item.quType}.png`"></image>
- <text>{{item.quType_dictText}}({{ item.count }})</text>
- </view>
- </uni-col>
- </uni-row>
-
- </uni-card>
-
- </view>
-
-
- </view>
- </template>
- <script>
- import { repoDetail } from '@/api/repo/repo'
-
- export default {
- components: {
-
- },
- data() {
- return {
- repoId: null,
- repo: {},
- }
- },
- onLoad(option) {
- this.repoId = option.id;
- this.fetchRepoDetail()
-
- // 支付成功刷新页面
- uni.$on('paySuccess', () => {
- this.fetchRepoDetail()
- });
- },
- methods: {
- // 加载考试列表
- fetchRepoDetail() {
- repoDetail(this.repoId).then(data => {
- //打印请求返回的数据
- this.repo = data
- }, error => {
- console.log(error);
- })
- },
- // 去训练
- navtoTrain(mode) {
- uni.redirectTo({
- url: '/pages/repo/train?repoId=' + this.repoId + '&mode=' + mode
- });
- }
-
- },
- onUnload() {
- uni.$off('paySuccess');
- }
- }
- </script>
- <style scoped>
-
- .tr-item {
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- align-content: center;
- flex-direction: column;
- padding: 10px 0px 10px 0px;
- border: #efefef 0.5px solid;
- margin: 10px;
- }
- .tr-item image {
- width: 18px;
- height: 18px;
- }
- .tr-item text {
- color: #666;
- }
-
-
-
- </style>
|