Commit 506666c1 authored by zhengzy's avatar zhengzy

no message

parent 7a4ee397
......@@ -189,12 +189,14 @@
courselist:null,
loadStatus: "loading", //加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
isLoadMore: false, //是否加载中
course_id:"course_id_=173"
course_id:"course_id_=173",
exam:null
};
},
onLoad() {
this.getList();
this.getCourseList();
this.getUserExamInfo();
},
computed:{
bannerImage() {
......@@ -358,150 +360,83 @@
},
});
},
//考核认证,通用认证,考试通过or未通过查询接口请求
getUserExamInfo() {
uni.showLoading({
title: '请稍候'
})
let that = this
uni.request({
url: 'http://192.168.1.22' +
'/wxh-worker-rest/rest/exam' +
'/serviceRule/userExamInfo/' +
'RTOKENe83309bff5846d2ff0949d58a0c0f643d60d107d' +
'?examId=' + 2,
method: 'POST',
data: {
//examId:this.examId,
},
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
success: (res) => {
console.log(res.data)
uni.hideLoading()
if (!res.data) {
return
}
if (res.data.code == 401 || res.data.code == 403) {
// uni.navigateTo({
// url: '/pages/login/wxlogin'
// })
// return
console.log('洪塘张学友')
}
if (res.data.code == 200) {
//examStatus 用户考试状态 0考试中 1考试完成 2未参与
that.exam = res.data.data
console.log(that.exam)
if (res.data.data.examStatus == 2) {
that.applyExam()
return
}
if(res.data.data.examStatus == 1){
console.log('111111111111111111111111111')
that.isComplete = true
that.examScore = res.data.data.examScore
that.postResult()
return
}
if (res.data.data.examStatus == 0 ) {
that.userExamId = res.data.data.id
that.getNext()
}
} else {
uni.showToast({
icon: 'none',
title: res.data.message
})
}
},
fail: (e) => {
uni.hideLoading()
uni.showToast({
icon: 'none',
title: '获取考试信息失败'
})
}
})
},
},
};
=======
export default {
data() {
return {
banner: [
{
image: "https://cdn.uviewui.com/uview/swiper/1.jpg",
title: "昨夜星辰昨夜风,画楼西畔桂堂东",
},
{
image: "https://cdn.uviewui.com/uview/swiper/2.jpg",
title: "身无彩凤双飞翼,心有灵犀一点通",
},
{
image: "https://cdn.uviewui.com/uview/swiper/3.jpg",
title: "谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳",
},
],
tabs: [
{
name: "交付规范",
},
{
name: "培训通知",
},
{
name: "在线学习",
},
{
name: "考核认证",
},
],
current: 0,
swiperCurrent: 0,
params: {
start: 0,
},
list: [],
loadStatus: "loading", //加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
isLoadMore: false, //是否加载中
};
},
onLoad() {
this.getList();
this.$u.mpShare.path = ''
},
methods: {
getList() {
this.$u.api
.getTrainingNoticeList(this.params)
.then((res) => {
if (res.code == 200) {
if (res.data) {
this.list = this.list.concat(res.data);
if (res.data.length < 5) {
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this.isLoadMore = true;
this.loadStatus = "nomore";
} else {
this.isLoadMore = false;
}
} else {
this.isLoadMore = true;
this.loadStatus = "nomore";
}
} else {
//接口请求失败的处理
uni.showToast({ title: res.message, icon: "none" });
this.isLoadMore = false;
if (this.params.start > 0) {
this.page -= 5;
}
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none",
});
this.isLoadMore = false;
if (this.params.start > 0) {
this.page -= 5;
}
});
},
//tabs通知swiper切换
tabsChange(index) {
this.swiperCurrent = index;
},
//swiper-item左右移动,通知tabs的滑块跟随移动
transition(e) {
let dx = e.detail.dx;
this.$refs.uTabs.setDx(dx);
},
animationfinish(e) {
let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},
//跳转到assessment页面
aaa() {
wx.navigateTo({
url: "./assessment",
});
},
//跳转到
bbb() {
wx.navigateTo({
url: "./news-details",
});
},
//scroll-view到底部加载更多
onreachBottom() {
console.log("上拉触底函数");
//上拉触底函数
if (!this.isLoadMore) {
this.isLoadMore = true;
this.params.start += 5;
if (this.loadStatus !== "nomore") {
this.getList();
}
}
},
//跳转到拍照小程序首页
goToPrint() {
console.log("111111");
uni.navigateToMiniProgram({
appId: "wxd1d6eede324b0465",
success(res) {
//打开成功
console.log("success", res);
},
fail(err) {
console.log("err", err);
},
});
},
},
};
>>>>>>> .merge_file_a11812
</script>
<style>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment