Commit e7ab9789 authored by 罗超's avatar 罗超

2

parent 135fc38d
......@@ -7,7 +7,7 @@
首页
</view>
<view class="loginBox">
<indexassembly @success='againdata' v-if="userData.AccountId==0">
<indexassembly @success='againdata' v-if="!userData.AccountId||userData.AccountId==0">
<view class="flex_start_center">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/login2x.png"
......@@ -54,7 +54,8 @@
<view class="flex_around_center ">
<view class="wordItem">
<text class="wordItemTitle">今日新词</text>
<text class="wordItemText">{{pageData.Words.NextWord||0}}<text class="wordItemTextUnit"></text></text>
<text class="wordItemText">{{pageData.Words.NextWord||0}}<text
class="wordItemTextUnit"></text></text>
</view>
<view class="wordItem">
<text class="wordItemTitle">复习词语</text>
......@@ -108,6 +109,9 @@
<view v-for="(item,index) in pageData.LearningGardenList" :key="index" v-if="item.List.length>0">
<view class="learningGardenTitle">
<text>{{item.Name}}</text>
<text style="font-size: 24rpx;
font-weight: 500;
color: #4C50E7;" @click="jumpGarden(item.Id)">查看更多</text>
</view>
<view class="gardenCon" v-for="(item1,index1) in item.List" :key="index1" id="img">
<image :src="item1.Img" mode="aspectFill"
......@@ -115,7 +119,6 @@
<view class="gardenTextBox" :style="{background:'linear-gradient(0deg,'+getColor(item1.Img)}">
<view class="gardenTitle one_line">
{{item1.Title}}
{{getColor(item1.Img)}}
</view>
<view class="gardenDigest one_line">
{{item1.Digest}}
......@@ -171,7 +174,7 @@
},
ActivityList: [],
pageData: {},
userData:{}
userData: {}
});
let methods = {
......@@ -188,8 +191,8 @@
},
getIndexData() {
proxy.$request("/AppletIndex/GetIndexInfo_V2", {}).then(res => {
// console.log(222, res)
data.pageData = res.Data
uni.setStorageSync("indexData", res.Data);
})
},
async getColor(src) {
......@@ -202,13 +205,23 @@
data.pageData = uni.getStorageSync("userInfo");
methods.getIndexData();
methods.getActivityData();
},
jumpGarden(id){
if(id==1){
uni.navigateTo({
url:"/pages/learningGarden/learningGardenList"
})
}else if(id==2){
// uni.navigateTo({
// url:"/pages/learningGarden/learningGardenList"
// })
}
}
};
onMounted(() => {
methods.getIndexData();
data.userData=uni.getStorageSync('userInfo');
console.log(208,data.userData)
data.userData = uni.getStorageSync('userInfo');
});
return {
...toRefs(data),
......@@ -525,6 +538,8 @@
color: #111111;
margin-bottom: 35rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.gardenCon {
......
......@@ -42,7 +42,7 @@
},
StudyList: [],
ReviewList: [],
current: 0,
current: 25,
readMsg: {
Id: 0,
ClassId: 1,
......@@ -50,6 +50,14 @@
Stu_Account_Id: 1,
ChapterId: 1,
StudyNum: 1
},
reviewMsg: {
Id: 0,
ClassId: 1,
CourseId: 1,
Stu_Account_Id: 1,
ChapterId: 1,
ReviewNum: 1
}
})
let methods = {
......@@ -60,6 +68,12 @@
})
},
swiperChange(val) {
console.log(63, val.detail.current,'study', data.StudyList.length)
if (data.current <= data.StudyList.length) {
methods.completeRead(val.detail.current)
} else if (data.current > data.StudyList.length && data.current <= data.ReviewList.length) {
methods.completeReview(val.detail.current)
}
const total = data.StudyList.length + data.ReviewList.length + 1
if (val.detail.current + 1 == total && total > 1) {
......@@ -68,8 +82,19 @@
})
}
},
completeRead() {
proxy.$request('/AppletWords/SetStuWordsPrep', )
completeRead(n) {
console.log(74, n)
// data.readMsg.StudyNum = n
// proxy.$request('/AppletWords/SetStuWordsPrep', data.readMsg).then(res => {
// c
// })
},
completeReview(n) {
console.log(75, n-data.StudyList.length)
// data.readMsg.ReviewNum = n
// proxy.$request('/AppletWords/SetStuWordsReview', data.reviewMsg).then(res => {
// })
}
}
......@@ -86,14 +111,19 @@
uni.setNavigationBarTitle({
title: '新的标题'
});
this.msg.ChapterId = options.ChapterId
this.msg.CourseId = options.CourseId
this.msg.PrevChapterId = options.PrevChapterId
this.readMsg.CourseId=options.CourseId
this.readMsg.ChapterId=options.ChapterId
this.getData()
const userInfo=uni.getStorageSync('userinfo');
this.readMsg.Stu_Account_Id=userInfo.AccountId
this.msg.ChapterId = options.ChapterId??0
this.msg.CourseId = options.CourseId??0
this.msg.PrevChapterId = options.PrevChapterId??0
if(options.ChapterId&&options.CourseId&&options.PrevChapterId){
this.getData()
}
const userInfo = uni.getStorageSync('userinfo');
this.readMsg.Stu_Account_Id = userInfo.AccountId??0
this.readMsg.CourseId = options.CourseId??0
this.readMsg.ChapterId = options.ChapterId??0
this.reviewMsg.Stu_Account_Id = userInfo.AccountId??0
this.reviewMsg.CourseId = options.CourseId??0
this.reviewMsg.ChapterId = options.ChapterId??0
},
}
</script>
......
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