| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <html lang="zh">
- <head>
- <title>百日题库-题目合集</title>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
- <script src="/static/vue.js"></script>
- <script src="/static/jquery.min.js"></script>
- <style>
- .click {
- font-size: 22px;
- /*text-decoration: underline;*/
- user-select: none;
- cursor: pointer;
- }
- </style>
- </head>
- <body>
- <div id="app">
- <p v-show="courseName!=''">{{courseName}}</p>
- <p v-show="msg!=''">{{msg}}</p>
- <p v-show="msg==''" class="click" @click="goAll()">所有</p>
- <p class="click" v-for="q, i in questions" @click="goQuestion(q.id, q.title, i+1)">{{((i+1
- <10)?( "0"+(i+1)):( ""+(i+1))) + '-' +q.title}}</p>
- </div>
- <script>
- var URL_PREFIX = "";
- var app = new Vue({
- el: '#app',
- data: {
- msg: "loading...",
- course: -1,
- questions: [],
- courseName: ""
- },
- methods: {
- getQuestionList() {
- var self = this;
- $.ajax({
- url: URL_PREFIX + "/get/question/list/" + this.course,
- success: function(data) {
- console.log(data);
- if (data["success"]) {
- self.msg = "";
- self.questions = data["data"]["results"];
- }
- else {
- self.msg = "获取失败";
- }
- }
- });
- },
- goQuestion(id, paperName, index) {
- location.href = URL_PREFIX + "/show_new/" + id + '?course_name=' + encodeURI(this.courseName) + '&paper_name=' + encodeURI(paperName) + "&index=" + ((index < 10) ? ("0" + index) : ("" + index));
- },
- goAll() {
- location.href = URL_PREFIX + "/show/all/" + this.course + "?course_name=" + encodeURI(this.courseName);
- }
- },
- mounted() {
- var search = location.search.substr(1).split('&');
- for (var i = 0, j = search.length; i < j; i++) {
- var s = search[i].split('=');
- if (s[0] === "course_name") {
- this.courseName = decodeURI(s[1]);
- }
- }
- if (this.courseName !== '') {
- document.title = "百日题库-" + this.courseName;
- }
- var url = location.href.split('?')[0].split('/');
- this.course = url[url.length - 1];
- this.getQuestionList();
- }
- });
- </script>
- </body>
- </html>
|