|
@@ -571,43 +571,33 @@
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
- wordXuewan({
|
|
|
+ getWordList({
|
|
|
jieId: data.jieId
|
|
|
- }).then(res => {
|
|
|
- getZhangInfoNewYingyu()
|
|
|
- // const localZhangInfo = cacheManager.get('zhangInfo')
|
|
|
- // const result = updateStudyFlag(localZhangInfo, data.jieId, 1);
|
|
|
- // console.log('result',result);
|
|
|
-
|
|
|
- // if (result) {
|
|
|
- // cacheManager.set('zhangInfo', result)
|
|
|
- // }
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 0 && res.data.wordList.length > 0) {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/wordList/wordList?jieId=' + data.jieId
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ toast("该单元没有学习内容!");
|
|
|
+ console.log('data,jieId', data.jieId);
|
|
|
+ wordXuewan({
|
|
|
+ jieId: data.jieId
|
|
|
+ }).then(res => {
|
|
|
+ getZhangInfoNewYingyu()
|
|
|
+ // 更新缓存 备用 现在是 直接调用接口
|
|
|
+ // const result = updateStudyFlag(responseData, data.jieId, 1);
|
|
|
+ // if (result) {
|
|
|
+ // cacheManager.set('zhangInfo', result)
|
|
|
+ // }
|
|
|
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
})
|
|
|
- // getWordList({
|
|
|
- // jieId: data.jieId
|
|
|
- // }).then(res => {
|
|
|
- // if (res.code == 0 && res.data.wordList.length > 0) {
|
|
|
- // uni.redirectTo({
|
|
|
- // url: '/pages/wordList/wordList?jieId=' + data.jieId
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // toast("该单元没有学习内容!");
|
|
|
- // console.log('data,jieId', data.jieId);
|
|
|
- // wordXuewan({
|
|
|
- // jieId: data.jieId
|
|
|
- // }).then(res => {
|
|
|
- // const result = updateStudyFlag(responseData, data.jieId, 1);
|
|
|
- // if (result) {
|
|
|
- // cacheManager.set('zhangInfo', result)
|
|
|
- // }
|
|
|
-
|
|
|
- // })
|
|
|
- // return false
|
|
|
- // }
|
|
|
- // })
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
+ // 更新缓存 备用 现在是 直接调用接口
|
|
|
const updateStudyFlag = (data, jieIdToUpdate, newValue) => {
|
|
|
// 检查data和必要的数据结构是否存在
|
|
|
if (!data || !Array.isArray(data.zhangList)) {
|