148 lines
3.1 KiB
JavaScript
148 lines
3.1 KiB
JavaScript
const baseUrl = getApp();
|
|
const api = require('../../config/api.js');
|
|
const util = require('../../config/util.js');
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
itemdata:[],
|
|
id:1,
|
|
typename:'国考',
|
|
ismdata:1 //是否材料型数据跳转
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
console.log(options);
|
|
let id=options.id;
|
|
this.setData({
|
|
id:id
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow: function () {
|
|
this.getpaper(this.data.id);
|
|
this.getpaperattrname(this.data.id);
|
|
this.isjumpurl(this.data.id,2);
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage: function () {
|
|
|
|
},
|
|
examingbtnclick:function(e){
|
|
console.log(e);
|
|
console.log(this.data.ismdata);
|
|
// console.log(this.data.itemdata);
|
|
|
|
let grouppaper_id=e.currentTarget.dataset.typeid;
|
|
// console.log(grouppaper_id);
|
|
// return;
|
|
if(this.data.ismdata==2){
|
|
wx.navigateTo({
|
|
url: '/pages/exammakings/exammakings?examid='+e.currentTarget.id+'&grouppaper_id='+grouppaper_id,
|
|
})
|
|
}else{
|
|
wx.navigateTo({
|
|
url: '/pages/examing/examing?examid='+e.currentTarget.id+'&grouppaper_id='+grouppaper_id,
|
|
})
|
|
}
|
|
|
|
},
|
|
isjumpurl:function(id,groupid) {
|
|
|
|
const that = this;
|
|
let url = baseUrl.globalData.baseUrl + '/exam/isarrdata';
|
|
var param = {
|
|
id:id,
|
|
groupid:groupid
|
|
};
|
|
//此处为使用封装的post请求
|
|
util.post(url, param).then((res) => {
|
|
console.log(res);
|
|
that.setData({
|
|
ismdata:res.data
|
|
});
|
|
}).catch((errMsg) => {
|
|
console.log(errMsg);
|
|
});
|
|
},
|
|
getpaper:function(params) {
|
|
const that = this;
|
|
let url = baseUrl.globalData.baseUrl + '/paperlist/getpaperlist';
|
|
var param = {
|
|
paperattr_id: params
|
|
};
|
|
//此处为使用封装的post请求
|
|
util.get(url, param).then((res) => {
|
|
console.log(res);
|
|
that.setData({
|
|
itemdata: res.data
|
|
});
|
|
|
|
}).catch((errMsg) => {
|
|
console.log(errMsg);
|
|
});
|
|
},
|
|
getpaperattrname:function(params) {
|
|
const that = this;
|
|
let url = baseUrl.globalData.baseUrl + '/paperlist/getpaperattrname';
|
|
var param = {
|
|
id: params
|
|
};
|
|
//此处为使用封装的post请求
|
|
util.get(url, param).then((res) => {
|
|
console.log(res);
|
|
that.setData({
|
|
typename: res.data.name
|
|
});
|
|
|
|
}).catch((errMsg) => {
|
|
console.log(errMsg);
|
|
});
|
|
}
|
|
}) |