Commit 506666c1 authored by zhengzy's avatar zhengzy

no message

parent 7a4ee397
...@@ -189,12 +189,14 @@ ...@@ -189,12 +189,14 @@
courselist:null, courselist:null,
loadStatus: "loading", //加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式 loadStatus: "loading", //加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
isLoadMore: false, //是否加载中 isLoadMore: false, //是否加载中
course_id:"course_id_=173" course_id:"course_id_=173",
exam:null
}; };
}, },
onLoad() { onLoad() {
this.getList(); this.getList();
this.getCourseList(); this.getCourseList();
this.getUserExamInfo();
}, },
computed:{ computed:{
bannerImage() { bannerImage() {
...@@ -358,150 +360,83 @@ ...@@ -358,150 +360,83 @@
}, },
}); });
}, },
}, //考核认证,通用认证,考试通过or未通过查询接口请求
}; getUserExamInfo() {
=======
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: { uni.showLoading({
getList() { title: '请稍候'
this.$u.api })
.getTrainingNoticeList(this.params)
.then((res) => { let that = this
if (res.code == 200) { uni.request({
if (res.data) { url: 'http://192.168.1.22' +
this.list = this.list.concat(res.data); '/wxh-worker-rest/rest/exam' +
if (res.data.length < 5) { '/serviceRule/userExamInfo/' +
//判断接口返回数据量小于请求数据量,则表示此为最后一页 'RTOKENe83309bff5846d2ff0949d58a0c0f643d60d107d' +
this.isLoadMore = true; '?examId=' + 2,
this.loadStatus = "nomore"; method: 'POST',
} else { data: {
this.isLoadMore = false; //examId:this.examId,
} },
} else { header: {
this.isLoadMore = true; 'Content-Type': 'application/x-www-form-urlencoded'
this.loadStatus = "nomore"; },
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 { } else {
//接口请求失败的处理
uni.showToast({ title: res.message, icon: "none" });
this.isLoadMore = false;
if (this.params.start > 0) {
this.page -= 5;
}
}
})
.catch((err) => {
uni.showToast({ uni.showToast({
title: err, icon: 'none',
icon: "none", title: res.data.message
}); })
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到底部加载更多 fail: (e) => {
onreachBottom() { uni.hideLoading()
console.log("上拉触底函数"); uni.showToast({
//上拉触底函数 icon: 'none',
if (!this.isLoadMore) { title: '获取考试信息失败'
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> </script>
<style> <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