This commit is contained in:
曹辉 2023-04-24 14:06:37 +08:00
parent fe7b1cb158
commit 247c010c92
7 changed files with 69 additions and 23 deletions

View File

@ -1,8 +1,9 @@
import request from "../request.js" import request from "../request.js"
export function selectTrainingCategory(pageNum, pageSize) {
export function selectTrainingCategory(pageNum, pageSize, nurseStationPersonId) {
return request({ return request({
url: `/nurseApplet/personLearn/selectTrainingCategory?pageNum=${pageNum}&pageSize=${pageSize}`, url: `/nurseApplet/personLearn/personTrainingItem?pageNum=${pageNum}&pageSize=${pageSize}&trainingItemType=${'LEARNING_ITEM_GROUP'}&nurseStationPersonId=${nurseStationPersonId}`,
method: 'GET' method: 'GET'
}) })
} }

9
api/Orderlist/index.js Normal file
View File

@ -0,0 +1,9 @@
import request from "../request.js"
//订单列表
export function selectTrainingOrderItemList(pageNum, pageSize, trainingItemType, nurseStationPersonId) {
return request({
url: `/nurseApplet/personLearn/selectTrainingOrderItemList?pageNum=${pageNum}&pageSize=${pageSize}&trainingItemType=${trainingItemType}&nurseStationPersonId=${nurseStationPersonId}`,
method: 'GET'
})
}

View File

@ -1,8 +1,8 @@
import request from "../request.js" import request from "../request.js"
export function personTrainingItem(pageNum, pageSize, trainingCategoryId, nurseStationPersonId) { export function personTrainingItem(pageNum, pageSize, trainingItemId, nurseStationPersonId) {
return request({ return request({
url: `/nurseApplet/personLearn/personTrainingItem?pageNum=${pageNum}&pageSize=${pageSize}&trainingCategoryId=${trainingCategoryId}&nurseStationPersonId=${nurseStationPersonId}`, url: `/nurseApplet/personLearn/personTrainingItem?pageNum=${pageNum}&pageSize=${pageSize}&trainingItemId=${trainingItemId}&nurseStationPersonId=${nurseStationPersonId}`,
method: 'GET' method: 'GET'
}) })
} }

View File

@ -5,9 +5,9 @@
</view> </view>
<view class="items" v-for="(item,index) in list" :key="index" @tap='gographicvideo(item)'> <view class="items" v-for="(item,index) in list" :key="index" @tap='gographicvideo(item)'>
<view class="item"> <view class="item">
<image :src="baseurl+item.trainingCategoryPictureUrl" mode=""></image> <image :src="baseurl+item.trainingItemCoverUrl" mode=""></image>
<view class="title"> <view class="title">
{{item.trainingCategoryName}} {{item.trainingItemTitle}}
</view> </view>
</view> </view>
</view> </view>
@ -21,6 +21,7 @@
export default { export default {
data() { data() {
return { return {
nursePersonId: null, //id
baseurl: undefined, baseurl: undefined,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
@ -28,27 +29,34 @@
total: 0, total: 0,
}; };
}, },
onShow() {},
onLoad() { onLoad() {
const that = this
this.baseurl = baseurl this.baseurl = baseurl
this.pageNum = 1 this.pageNum = 1
this.info(); const nursePersonId = uni.getStorageSync('nursePersonId');
if (nursePersonId) {
// that.nursePersonId = nursePersonId
that.nursePersonId = 61
that.info();
} else {}
}, },
methods: { methods: {
info() { info() {
selectTrainingCategory(this.pageNum, this.pageSize).then(res => { selectTrainingCategory(this.pageNum, this.pageSize, this.nursePersonId).then(res => {
this.list = res.rows this.list = res.rows
this.total = res.total this.total = res.total
}) })
}, },
// //
gographicvideo(item) { gographicvideo(item) {
if (item.trainingCategoryName == '图文学习') { if (item.trainingItemTitle == '图文学习') {
uni.navigateTo({ uni.navigateTo({
url: `/pages/Graphiclearning/Graphiclearning?trainingCategoryId=${item.id}` url: `/pages/Graphiclearning/Graphiclearning?trainingItemId=${item.id}`
}) })
} else if (item.trainingCategoryName == '视频学习') { } else if (item.trainingItemTitle == '视频学习') {
uni.navigateTo({ uni.navigateTo({
url: `/pages/Videolearning/Videolearning?trainingCategoryId=${item.id}` url: `/pages/Videolearning/Videolearning?trainingItemId=${item.id}`
}) })
} }
} }
@ -56,7 +64,7 @@
onReachBottom() { // onReachBottom() { //
if (this.list.length >= this.total) {} else { if (this.list.length >= this.total) {} else {
this.pageNum++ this.pageNum++
selectTrainingCategory(this.pageNum, this.pageSize).then(res => { selectTrainingCategory(this.pageNum, this.pageSize, this.nursePersonId).then(res => {
res.rows.forEach(e => { res.rows.forEach(e => {
this.list.push(e) this.list.push(e)
}) })

View File

@ -5,11 +5,39 @@
</template> </template>
<script> <script>
import {
selectTrainingOrderItemList
} from '@/api/Orderlist/index.js'
export default { export default {
data() { data() {
return { return {
trainingItemType: 'VIDEO_LEARNING',
nurseStationPersonId: undefined,
pageNum: 1,
pageSize: 10,
}; };
},
onShow() {
const that = this
const value = uni.getStorageSync('nursePersonId');
if (value) {
// that.nurseStationPersonId = value
that.nurseStationPersonId = 61
that.info();
} else {}
},
methods: {
goMyLearning() {
uni.navigateTo({
url: "/pages/MyLearning/MyLearning"
})
},
info() {
selectTrainingOrderItemList(this.pageNum, this.pageSize, this.trainingItemType, this.nurseStationPersonId)
.then(res => {
console.log(res)
})
},
} }
} }
</script> </script>

View File

@ -49,7 +49,7 @@
baseurl: undefined, baseurl: undefined,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
trainingCategoryId: undefined, trainingItemId: undefined,
nurseStationPersonId: undefined, nurseStationPersonId: undefined,
list: [], list: [],
total: 0, total: 0,
@ -58,8 +58,8 @@
}, },
onLoad(options) { onLoad(options) {
const that = this const that = this
// this.trainingCategoryId = options.trainingCategoryId // this.trainingItemId = options.trainingItemId
this.trainingCategoryId = 2 this.trainingItemId = 2
this.baseurl = baseurl this.baseurl = baseurl
const value = uni.getStorageSync('nursePersonId'); const value = uni.getStorageSync('nursePersonId');
if (value) { if (value) {
@ -106,7 +106,7 @@
}) })
}, },
info() { info() {
personTrainingItem(this.pageNum, this.pageSize, this.trainingCategoryId, this.nurseStationPersonId).then( personTrainingItem(this.pageNum, this.pageSize, this.trainingItemId, this.nurseStationPersonId).then(
res => { res => {
this.list = res.rows this.list = res.rows
this.total = res.total this.total = res.total
@ -116,7 +116,7 @@
onReachBottom() { // onReachBottom() { //
if (this.list.length >= this.total) {} else { if (this.list.length >= this.total) {} else {
this.pageNum++ this.pageNum++
personTrainingItem(this.pageNum, this.pageSize, this.trainingCategoryId, this.nurseStationPersonId).then( personTrainingItem(this.pageNum, this.pageSize, this.trainingItemId, this.nurseStationPersonId).then(
res => { res => {
res.rows.forEach(e => { res.rows.forEach(e => {
this.list.push(e) this.list.push(e)

View File

@ -61,7 +61,7 @@
我的收益 我的收益
</view> </view>
</view> </view>
<view class="bottomitem" @tap='goMyLearning'> <view class="bottomitem" @tap='goOrderlist'>
<image src="../../static/xuexi.png" mode=""></image> <image src="../../static/xuexi.png" mode=""></image>
<view class=""> <view class="">
我的学习 我的学习
@ -159,9 +159,9 @@
}) })
}, },
// //
goMyLearning() { goOrderlist() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/MyLearning/MyLearning" url: '/pages/Orderlist/Orderlist'
}) })
}, },
// //