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

2

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