活动接口

pull/36/head
zcx 10 months ago
parent 67b3e63de9
commit 9e24edad28
  1. 12
      src/jtools/api/activity.js
  2. 37
      src/pages/index/index.vue

@ -4,7 +4,7 @@ import request from '../request/index.js';
export function queryActivityList(data) { export function queryActivityList(data) {
return request({ return request({
url: 'activity/applet/activity/list', url: 'activity/applet/activity/list',
method: 'POST', method: 'get',
data, data,
noToken: true noToken: true
}); });
@ -13,16 +13,16 @@ export function queryActivityList(data) {
export function queryActivityDetail(data) { export function queryActivityDetail(data) {
return request({ return request({
url: 'activity/applet/activity/detail', url: 'activity/applet/activity/detail',
method: 'POST', method: 'get',
data, data,
noToken: true noToken: true
}); });
} }
//查询抽奖次数 //查询抽奖次数
export function queryLuckyNum(data) { export function queryLuckyNum(data) {
return request({ return request({
url: 'activity/applet/activity/lucky/num', url: 'activity/applet/activity/lucky/num',
method: 'POST', method: 'get',
data, data,
noToken: true noToken: true
}); });
@ -31,7 +31,7 @@ export function queryLuckyNum(data) {
export function queryLuckyResult(data) { export function queryLuckyResult(data) {
return request({ return request({
url: 'activity/applet/activity/lucky/result', url: 'activity/applet/activity/lucky/result',
method: 'POST', method: 'get',
data, data,
noToken: true noToken: true
}); });
@ -58,7 +58,7 @@ export function receiveWinner(data) {
export function getLuckyRecord(data) { export function getLuckyRecord(data) {
return request({ return request({
url: 'activity/applet/activity/lucky/record', url: 'activity/applet/activity/lucky/record',
method: 'POST', method: 'get',
data, data,
noToken: true noToken: true
}); });

@ -38,7 +38,6 @@
} from '@/jtools/api/question'; } from '@/jtools/api/question';
import Subject1 from "./components/Subject1"; import Subject1 from "./components/Subject1";
import Subject2 from "./components/Subject2"; import Subject2 from "./components/Subject2";
import { import {
queryActivityList, queryActivityList,
} from '@/jtools/api/activity'; } from '@/jtools/api/activity';
@ -129,25 +128,25 @@
queryActivityList(){ queryActivityList(){
// console.log(this.user) // console.log(this.user)
// console.log(useUserStore().userInfo) // console.log(useUserStore().userInfo)
this.activityList = null; // this.activityList = null;
uni.request({ // uni.request({
url: 'http://localhost:8089/applet/activity/list', // url: 'http://localhost:8089/applet/activity/list',
method: 'post', // method: 'get',
data: {'schoolId': useUserStore().userInfo.schoolId} // data: {'schoolId': useUserStore().userInfo.schoolId}
}).then(resp => { // }).then(resp => {
console.log(".....") // console.log(".....")
console.log(resp) // console.log(resp)
if(resp.data.code == 200) { // if(resp.data.code == 200) {
this.activityList = resp.data.data // this.activityList = resp.data.data
console.log("*****") // console.log("*****")
console.log(resp.data) // console.log(resp.data)
console.log(resp.data.data) // console.log(resp.data.data)
console.log(this.activityList) // console.log(this.activityList)
} // }
})
// queryActivityList({schoolId: this.user.schoolId}).then(resp => {
// this.activityList = resp.data;
// }) // })
queryActivityList({schoolId: this.user.schoolId}).then(resp => {
this.activityList = resp.data;
})
}, },
// //
handleToActivity(index) { handleToActivity(index) {

Loading…
Cancel
Save