Commit 506ac1eb authored by 罗超's avatar 罗超

2

parent 856d4c82
......@@ -64,7 +64,7 @@
预计用时10分钟
</view>
<view class="wordBtn"
@click="jumpPage(`/pages/word/word?CourseId=${pageData.Words.CourseId}&&ChapterId=${pageData.Words.NextCourseNo}&&ReviewChapterId=${pageData.Words.ReviewCourseNo}&&ClassId=${pageData.Words.ClassId}`)">
@click="jumpPage(`/pages/word/word?CourseId=${pageData.Words.CourseId||0}&&ChapterId=${pageData.Words.NextCourseNo||0}&&ReviewChapterId=${pageData.Words.ReviewCourseNo||0}&&ClassId=${pageData.Words.ClassId||0}`)">
开始学习
</view>
</view>
......
......@@ -70,8 +70,8 @@ export default {
let { proxy } = getCurrentInstance();
let Toast = inject("$toast");
let msg = reactive({
Account: "13551126755",
Password: "123456",
Account: "",
Password: "",
});
let data =reactive({
phoneNum: "",
......
......@@ -75,6 +75,9 @@
if (data.StudyList.length === 0 && data.ReviewList.length == 0) {
data.nodata = true
}
}).catch(err=>{
data.loading = false
data.nodata = true
})
},
swiperChange(val) {
......@@ -121,7 +124,6 @@
}
},
onLoad(options) {
console.log("options", options);
uni.setNavigationBarTitle({
title: '单词学习'
});
......
//请求教育接口
let host = ''
if (process.env.NODE_ENV === "development") {
// host = 'http://192.168.20.17:8017/api'
host = 'http://192.168.10.65:8085/api'
host = 'http://192.168.10.46:8300/api'
// host = 'http://192.168.10.65:8085/api'
// host = 'https://eduapi.oytour.com/api'
} else {
host = 'https://eduapi.oytour.com/api'
}
import Toast from '../wxcomponents/vant/toast/toast';
let request = (param) => {
return new Promise((resolve, reject) => {
let token = uni.getStorageSync('userInfo').Token;
uni.request({
......@@ -26,46 +25,29 @@ let request = (param) => {
if (res.data.Code === 1) {
resolve(res.data)
} else {
// Toast({
// type: 'fail',
// message: res.data.Message,
// onClose: () => {
// if (res.data.Code === 10001 || res.data.Code === 10000) {
// uni.reLaunch({
// url: '/pages/login/login'
// });
// } else {
// if (res.data.Message.indexOf('用户凭证为空') != -1 || res.data.Message.indexOf('用户凭证失效') != -1) {
// uni.reLaunch({
// url: '/pages/login/login'
// });
// }
// }
// },
// });
uni.showToast({
title: res.data.Message,
duration: 2000,
icon: "error",
success() {
// if (res.data.Code === 10001 || res.data.Code === 10000) {
// uni.reLaunch({
// url: '/pages/login/login'
// });
// } else {
// if (res.data.Message.indexOf('用户凭证为空') != -1 || res.data
// .Message.indexOf('用户凭证失效') != -1) {
// uni.reLaunch({
// url: '/pages/login/login'
// });
// }
// }
if(res.data.Code === 0 && res.data.Data.Error==-1){//如果电话号码没有
resolve(res.data)
if (res.data.Message.indexOf('用户凭证为空') != -1 || res.data
.Message.indexOf('用户凭证失效') != -1) {
uni.showToast({
title: "用户凭证失效,请重新授权",
duration: 2000,
icon: "none",
});
reject()
}else{
uni.showToast({
title: res.data.Message,
duration: 2000,
icon: "error",
success() {
if(res.data.Code === 0 && res.data.Data.Error==-1){//如果电话号码没有
resolve(res.data)
}else{
reject()
}
}
}
});
});
}
}
},
fail: (err) => {
......@@ -75,6 +57,7 @@ let request = (param) => {
duration: 2000,
icon: "error",
});
reject()
}
});
})
......
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